efficient-web-builder 50.0.0 → 52.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.
Files changed (154) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +1 -1
  3. package/dist/editor/components/BlogPostSource.js +1 -1
  4. package/dist/editor/components/HeroPartPanel.js +1 -1
  5. package/dist/editor/components/MediaUploadField.js +1 -1
  6. package/dist/editor/components/PartTextBox.js +1 -1
  7. package/dist/editor/components/PreviewPartStyleContext.d.ts +2 -2
  8. package/dist/editor/components/SectionEditor.js +1 -1
  9. package/dist/editor/components/SiteTextStylesField.d.ts +2 -1
  10. package/dist/editor/components/SiteTextStylesField.js +1 -1
  11. package/dist/editor/components/ThemeCard.js +1 -1
  12. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  13. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  14. package/dist/editor/components/storefront-editor.css +13 -45
  15. package/dist/editor/components/usePartMotion.d.ts +1 -1
  16. package/dist/editor/components/usePartTypingDeps.d.ts +2 -0
  17. package/dist/editor/components/usePartTypingDeps.js +1 -0
  18. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  19. package/dist/editor/lib/animation/fields.d.ts +1 -1
  20. package/dist/editor/lib/animation/fields.js +1 -1
  21. package/dist/editor/lib/animation/hover-fields.d.ts +7 -1
  22. package/dist/editor/lib/animation/hover-fields.js +1 -1
  23. package/dist/editor/lib/document/ColourControl.d.ts +11 -8
  24. package/dist/editor/lib/document/ColourControl.js +1 -1
  25. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  26. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  27. package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
  28. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  29. package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
  30. package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
  31. package/dist/editor/lib/document/blocks/general/Series/fields.js +1 -1
  32. package/dist/editor/lib/document/blocks/general/StatsParagraph/fields.js +1 -1
  33. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  34. package/dist/editor/lib/document/blocks/hero-shared-fields.d.ts +2 -0
  35. package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
  36. package/dist/editor/lib/document/canvas-typing.d.ts +1 -0
  37. package/dist/editor/lib/document/canvas-typing.js +1 -1
  38. package/dist/editor/lib/document/card-copy-rows.d.ts +12 -0
  39. package/dist/editor/lib/document/card-copy-rows.js +1 -0
  40. package/dist/editor/lib/document/controls.d.ts +15 -4
  41. package/dist/editor/lib/document/controls.js +1 -1
  42. package/dist/editor/lib/document/darken-fields.d.ts +4 -0
  43. package/dist/editor/lib/document/darken-fields.js +1 -0
  44. package/dist/editor/lib/document/overrides.js +1 -1
  45. package/dist/editor/lib/document/passes/inspector.js +1 -1
  46. package/dist/format/components/stored-pick-row.d.ts +8 -0
  47. package/dist/format/components/stored-pick-row.js +1 -0
  48. package/dist/format/lib/animation/hover.d.ts +32 -1
  49. package/dist/format/lib/animation/hover.js +1 -1
  50. package/dist/format/lib/content/borders.d.ts +4 -2
  51. package/dist/format/lib/content/borders.js +1 -1
  52. package/dist/format/lib/content/box-layout.d.ts +11 -0
  53. package/dist/format/lib/content/box-layout.js +1 -1
  54. package/dist/format/lib/content/box-shape.d.ts +2 -1
  55. package/dist/format/lib/content/box-shape.js +1 -1
  56. package/dist/format/lib/content/button-icon.d.ts +1 -1
  57. package/dist/format/lib/content/button-icon.js +1 -1
  58. package/dist/format/lib/content/card-state.d.ts +8 -0
  59. package/dist/format/lib/content/card-state.js +1 -0
  60. package/dist/format/lib/content/card-template.d.ts +6 -0
  61. package/dist/format/lib/content/card-template.js +1 -1
  62. package/dist/format/lib/content/image-treatment.d.ts +23 -4
  63. package/dist/format/lib/content/image-treatment.js +1 -1
  64. package/dist/format/lib/content/section-background.d.ts +10 -3
  65. package/dist/format/lib/content/section-background.js +1 -1
  66. package/dist/format/lib/content/section-min-height.d.ts +17 -1
  67. package/dist/format/lib/content/section-min-height.js +1 -1
  68. package/dist/format/lib/content/section-sticky.d.ts +9 -0
  69. package/dist/format/lib/content/section-sticky.js +1 -1
  70. package/dist/format/lib/document/blocks/general/Hero/meta.js +1 -1
  71. package/dist/format/lib/document/blocks/general/HeroSingle/meta.js +1 -1
  72. package/dist/format/lib/document/box-footer.js +1 -1
  73. package/dist/format/lib/document/card-template-layers.d.ts +1 -1
  74. package/dist/format/lib/document/card-template-layers.js +1 -1
  75. package/dist/format/lib/document/easel-row-words.d.ts +1 -0
  76. package/dist/format/lib/document/easel-row-words.js +1 -1
  77. package/dist/format/lib/document/part-inks.d.ts +5 -10
  78. package/dist/format/lib/document/part-inks.js +1 -1
  79. package/dist/format/lib/document/passes/card-template-on-insert.d.ts +2 -0
  80. package/dist/format/lib/document/passes/card-template-on-insert.js +1 -0
  81. package/dist/format/lib/document/passes/types.d.ts +7 -0
  82. package/dist/format/lib/document/section-catalog.js +2 -2
  83. package/dist/format/lib/document/show-when-attach.d.ts +2 -1
  84. package/dist/format/lib/document/show-when-attach.js +1 -1
  85. package/dist/format/lib/editor-words-catalogue.d.ts +9 -5
  86. package/dist/format/lib/editor-words-catalogue.js +4 -4
  87. package/dist/format/lib/sections/hero-overlay.js +1 -1
  88. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  89. package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.d.ts +4 -0
  90. package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.js +37 -20
  91. package/dist/format/lib/source-rules/support/part-slider-call-sites.d.ts +0 -1
  92. package/dist/format/lib/source-rules/support/part-slider-call-sites.js +6 -6
  93. package/dist/format/lib/text-styles/site-text-colours.d.ts +11 -0
  94. package/dist/format/lib/text-styles/site-text-colours.js +1 -0
  95. package/dist/format/lib/theme.d.ts +1 -0
  96. package/dist/format/lib/theme.js +3 -3
  97. package/dist/format/lib/word-styles.d.ts +0 -1
  98. package/dist/format/lib/word-styles.js +1 -1
  99. package/dist/render/components/ButtonBlock.d.ts +2 -1
  100. package/dist/render/components/ButtonBlock.js +1 -1
  101. package/dist/render/components/CardRowContext.d.ts +5 -2
  102. package/dist/render/components/CardRowContext.js +1 -1
  103. package/dist/render/components/ContactLocations.d.ts +3 -1
  104. package/dist/render/components/ContactLocations.js +2 -2
  105. package/dist/render/components/Flex.d.ts +6 -1
  106. package/dist/render/components/Flex.js +1 -1
  107. package/dist/render/components/HeroPictures.d.ts +10 -0
  108. package/dist/render/components/HeroPictures.js +1 -1
  109. package/dist/render/components/HeroSingle.js +1 -1
  110. package/dist/render/components/HeroSlide.js +1 -1
  111. package/dist/render/components/ImageBlock.d.ts +6 -1
  112. package/dist/render/components/ImageBlock.js +1 -1
  113. package/dist/render/components/Manifesto.d.ts +3 -1
  114. package/dist/render/components/Manifesto.js +1 -1
  115. package/dist/render/components/PhotoHoverSheet.d.ts +4 -0
  116. package/dist/render/components/PhotoHoverSheet.js +1 -0
  117. package/dist/render/components/PictureWash.d.ts +6 -0
  118. package/dist/render/components/PictureWash.js +1 -0
  119. package/dist/render/components/Placeholder.js +1 -1
  120. package/dist/render/components/PostCard.js +1 -1
  121. package/dist/render/components/Split.d.ts +3 -1
  122. package/dist/render/components/Split.js +1 -1
  123. package/dist/render/components/Text.d.ts +2 -2
  124. package/dist/render/components/Text.js +1 -1
  125. package/dist/render/components/goldPhrases.js +2 -2
  126. package/dist/render/lib/animation/part-motion.js +2 -2
  127. package/dist/render/lib/content/block-size.d.ts +1 -0
  128. package/dist/render/lib/content/block-size.js +1 -1
  129. package/dist/render/lib/content/box-shared-columns.js +1 -1
  130. package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
  131. package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
  132. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  133. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  134. package/dist/render/lib/document/blocks/general/Manifesto/render.js +1 -1
  135. package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
  136. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +2 -0
  137. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  138. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  139. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  140. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
  141. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
  142. package/dist/render/lib/document/part-styles.js +2 -2
  143. package/dist/render/lib/document/passes/block-size.js +1 -1
  144. package/dist/render/lib/document/passes/borders.js +1 -1
  145. package/dist/render/lib/document/passes/index.js +1 -1
  146. package/dist/render/lib/document/passes/section-animation.js +1 -1
  147. package/dist/render/lib/document/passes/section-height.js +1 -1
  148. package/dist/render/lib/document/passes/section-sticky.js +1 -1
  149. package/dist/render/lib/document/show-when.d.ts +1 -1
  150. package/dist/render/lib/document/show-when.js +1 -1
  151. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  152. package/package.json +4 -4
  153. package/dist/editor/components/PartInkControl.d.ts +0 -7
  154. package/dist/editor/components/PartInkControl.js +0 -1
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as N,Fragment as T}from"react/jsx-runtime";import{cloneElement as ye,createContext as yt,useContext as Ct,useEffect as _t,useId as Ce,useRef as z,useState as H}from"react";import{useEasel as oe,useSelectedHost as Y}from"efficient-easel/easel";import{toDateKey as wt,fromDateKey as It}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{mediaValueSrc as _e}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as we,loadingShowsOf as Et}from"../../../format/lib/hero-video.js";import{readHidable as Ie,hidableText as Ee}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as re,LINK_FIELD_MARKER as Re,MEDIA_FIELD_MARKER as Oe,SCAFFOLD_FIELD_MARKER as Te,TEXT_FIELD_MARKER as w,foldMetaOf as ie,textFieldIdentifier as Rt}from"efficient-easel/draw";import Ot from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Pe}from"../../../render/lib/document/show-when.js";import Tt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as Pt,CORNER_RADIUS_MAX as Ae,CORNER_RADIUS_MIN as v}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as At,IMAGE_CORNERS_LABEL as Ft}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as kt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Lt,GALLERY_LAYOUTS as V,GALLERY_LAYOUT_KEYS as Nt,galleryChoices as Fe,galleryPictureCells as vt}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Bt}from"./shell-glyph.js";import{anchorSiblingsOf as Dt,placementPoints as Gt}from"../../../format/lib/hero-group-placement.js";import Ht,{KEEP_HINT_CLASS as Mt}from"../../components/KeepHint.js";import Kt from"../../components/AnchorField.js";import{AdjustIcon as Wt,EyeIcon as Ut,AnimationIcon as $t,BackgroundIcon as Xt,BorderAllIcon as jt,BlockSectionIcon as zt,ColumnWidthsIcon as ke,ColumnsIcon as Le,CornerIcon as Yt,DirectionDownIcon as Vt,DirectionLeftIcon as qt,DirectionRightIcon as Zt,DirectionUpIcon as Jt,EditIcon as Qt,GapIcon as en,GridIcon as tn,GroundIcon as Ne,HashIcon as ve,HeightIcon as nn,ImageIcon as on,ListIcon as rn,LocationIcon as Be,PaddingBottomIcon as De,PaddingLeftIcon as Ge,PaddingRightIcon as He,PaddingTopIcon as Me,PageIcon as ln,StickyIcon as an,SearchIcon as sn,SquareIcon as cn,TypeIcon as dn,WidthIcon as un}from"efficient-easel/icons";import{FieldGlyph as Ke}from"../../components/FieldGlyph.js";import{resolvePageBackground as pn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as We,CORNER_SIDE_POINTS as fn,hasOwnSectionCorners as mn,normalizeCornerSides as Ue}from"../../../format/lib/content/section-corners.js";import{enclosingPath as hn,enclosingSection as gn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as bn,SettingsField as b,SettingsGroup as xn,SettingsGroupSub as Sn,SettingsSegmented as yn,SettingsBorder as Cn,SettingsSidesEach as _n,SettingsSwitch as le,borderSides as wn,borderStartEach as In}from"efficient-easel/panel";import{ListField as En}from"efficient-easel/fields";import{DisplayChips as Rn}from"efficient-shell/ui";import{desktopDisplayChanged as On,partShownOnDesktop as Tn,partShownOnPhone as Pn,phoneDisplayChanged as An,withDesktopPart as Fn,withPhonePart as kn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Ln,Checkbox as Nn,ColorSwatch as vn,CornersInput as Bn,DatePicker as Dn,DateTimePicker as Gn,FOCAL_DEFAULT as Hn,PictureTiles as Mn,IconPicker as Kn,IconButton as $e,InputNumber as Xe,Slider as Wn,Tooltip as q}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as Un}from"./geocode-resolve.js";import{ColourRow as je,InheritedColourRow as $n}from"./ColourControl.js";import{keptByRow as Xn}from"efficient-easel/screen/lib/document/style-fields";import ze from"./MarkupToolbar.js";import{deviceField as x}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as jn,NoControlMark as zn,noControlField as Ye}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Yn}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Vn,resolvePhoneValue as ae}from"../../../format/lib/document/phone-override.js";import{phoneKey as B,tabletKey as qn}from"efficient-easel/draw";import{SuppressibleText as Zn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Jn,CARD_OUTLINE_OPTIONS as Qn,DEFAULT_CARD_INDEX_FORMAT as eo,DEFAULT_CARD_OUTLINE as to}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as no,DEFAULT_COVER_INDEX as oo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as ro}from"efficient-easel/draw";import io from"../../components/MediaUploadField.js";import lo from"../../components/MultiSelectField.js";import ao from"../../components/SectionThemePicker.js";import so from"../../components/SearchSelectField.js";import co from"../../components/StorefrontLinkField.js";import{UiIcon as Ve}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as uo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as po}from"efficient-easel/draw/client";import{encodePartId as fo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as mo,useEaselStrings as ho}from"efficient-easel/strings";import{hasPhoneHeight as go,resolveSectionMinHeight as bo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Z,SECTION_STICK_LABEL as se,hasPhoneStick as xo,resolveSectionStick as So}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as yo,SECTION_MIN_HEIGHT_GROUP_LABEL as M,SECTION_SCREEN_PCT as Co}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as _o,resolveContainerDirection as qe}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as wo,BOX_BLOCK_SPACING_POINTS as Ze,BOX_PHONE_ROW_LABEL as Je,BOX_COLUMNS_MAX as Io,BOX_COLUMNS_MIN as Qe,BOX_PHONE_ROW_MAX as Eo,BOX_PHONE_ROW_MIN as ce,BOX_SHARE_LABEL as de,BOX_SHARE_PHONE_DEFAULT as Ro,BOX_SHARE_PHONE_POINTS as Oo,BOX_SHARE_POINTS as To}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as P}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Po}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as et,normalizeTheme as tt}from"../../../format/lib/theme.js";import{CONTAINER_GAP as nt,CONTAINER_GAP_BUILT_IN as Ao,CONTAINER_GAP_PHONE as ue,GAP_FIELD_CONTAINER as pe,followsSitePhoneGap as Fo,hasOwnContainerGap as ko,hasOwnPhoneGap as fe,resolveContainerGap as ot,resolvePhoneContainerGap as rt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Lo,CARD_IMAGE_BG_OFF as No,CARD_IMAGE_BG_SWATCH_NAMES as vo,CARD_IMAGE_BG_SWATCHES as Bo,isCardImageBackgroundInheriting as Do,cardImageBackgroundChoice as Go,THEME_CARD_IMAGE_BG as Ho}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Mo,SECTION_BG_SWATCHES as Ko,SECTION_BG_SWATCH_NAMES as Wo,THEME_SECTION_BG as Uo,isSectionBackgroundInheriting as $o}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Xo,nestedAccentValue as it,resolveSectionAccent as J}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as jo,TYPE_SIZE_INHERIT as zo,isTypeSizeInheriting as Yo}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Vo,WIDTH_CHOICE_LABEL as qo,WIDTH_INHERIT as Zo}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Jo}from"./panel-heading-scope.js";import{useEaselSession as Qo}from"efficient-easel/screen/lib/session-context";import{backendOf as er}from"../website-session.js";import{BOX_GAP as tr,describedAs as E,group as _,iconOf as K,sharedStyleKinds as W}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as nr,phoneTwinFields as lt}from"efficient-easel/screen/lib/document/box-fields";import{directionField as or,gapField as me,Segmented as he,segmented as rr,select as U,slider as D}from"./box-fields.js";function vl({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function A(e,t){return l("{value} from {from}",{value:e,from:t})}function ir(){const{blockGap:e}=P();return e===null?l("this container's own spacing"):A(`${e}px`,l("Styles"))}function lr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:ir(),onReset:t})}function ar(e){return me({...tr,builtIn:Ao[e],resolve:(t,n)=>ot(e,t,n?.siteGap),action:(t,n)=>i(lr,{inherited:!ko(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[pe]:e}})}function sr(e){return Pe(x("mobile",{[pe]:e,type:"custom",render:t=>i(ur,{container:e,...t})}),at)}function cr(e){return Pe(x("tablet",{[pe]:e,type:"custom",render:t=>i(dr,{container:e,...t})}),at)}const at={not:{field:"gap",in:Array.from({length:-nt.min},(e,t)=>nt.min+t)}};function Bl(e){return{gap:x("desktop",ar(e)),[qn("gap")]:cr(e),[B("gap")]:sr(e)}}function dr({container:e,...t}){const[n]=L("gap"),{siteGap:o}=t.field??{},r=Math.max(ue.min,ot(e,n,o));return me({...ue,builtIn:r,resolve:s=>fe(s)?s:r,action:(s,c)=>i(y,{words:S()?.panel,label:l("Gap"),changed:fe(s),detail:A(`${r}px`,l("Desktop")),onReset:()=>c(void 0)})}).render(t)}function ur({container:e,...t}){const[n]=L("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},a=rt(e,void 0,n,o,r);return me({...ue,builtIn:a,resolve:c=>rt(e,c,n,o,r),action:(c,u)=>i(y,{words:S()?.panel,label:l("Gap"),changed:fe(c),detail:A(`${a}px`,Fo(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>u(void 0)})}).render(t)}function Dl(e){return or({offered:_o(e),fallback:qe(e,void 0),resolve:t=>qe(e,t)})}function Gl(e,t){return Gt(t?Dt(e,t):[],t)}function pr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:A(l("Full"),l("the page")),onReset:t})}function F({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:a,hideable:s=!0,markup:c=!0}){const{text:u,hidden:f}=Ie(e),g=z(null),p=z(null),d=O=>t(s?{text:O,hidden:f}:O),m=()=>t({text:u,hidden:!f}),h=s&&f,R=Ce(),C=r?br(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(r)}):i(Ht,{children:l(r)}):void 0,j=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(b,{label:l(n),icon:i(dn,{}),htmlFor:R,className:h?"is-hidden":void 0,hint:C,action:s?i(q,{content:j,children:i($e,{"aria-pressed":f,"aria-label":j,onClick:m,children:f?i(Ve,{name:"eye-off",size:14}):i(Ve,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(ze,{target:a?p:g,value:u,onChange:d}),a?i("textarea",{id:R,ref:p,value:u,placeholder:o===void 0?void 0:l(o),onChange:O=>d(O.target.value)}):i("input",{id:R,ref:g,type:"text",value:u,placeholder:o===void 0?void 0:l(o),onChange:O=>d(O.target.value)})]})})}function Hl(e,t){return{...e,[Te]:t}}function Ml(e){const t=e[w];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[w]:{...t,offPage:!0}}}function Kl(e){return!e||typeof e!="object"?!1:e[w]?.offPage===!0}const st="sfPanelOnly";function Wl(e){if(!e[w])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[st]:!0}}function Ul(e){return!!e&&typeof e=="object"&&e[st]===!0}function $l(e){const t=e[w];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[w]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as ts,SCALAR_TEXT_CONTROLS as ns}from"efficient-easel/draw";function Xl(e,t){if(!e[w])throw new Error("inOwnBox: the field holds no authored text");const{[jn]:o,...r}=e;return{...r,[Yn]:!0,render:t}}const fr=new Set(ro),$={type:"radio",options:[{value:!0},{value:!1}]},ct={text:{type:"object",objectFields:{text:{type:"text"},hidden:$}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:$}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},k=(e,t)=>{const n=E({...t,[w]:e},{...ct[e.control],label:e.label});if(!fr.has(e.control))return n;const o=t.render;return{...Ye(n,"authored-copy"),render:r=>i(Zn,{name:r.name,children:o(r)})}},jl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",mr={field:"source.slug",set:!0},zl={not:mr},hr="Select a word, then press the highlighter.",gr=new Set([hr]),br=e=>gr.has(e);function Yl(e,t,n){return k({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(F,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Vl(e,t,n){return k({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(F,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function ql(e,t,n){return k({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(F,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Zl(e,t,n){return k({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(F,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Jl(e){return{type:"custom",[Re]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(co,{value:Ee(t),onChange:n,label:e})}}function Ql(e,t,n){return k({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(F,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const ea={Design:Wt,Animation:$t};function ta(e){return{type:"custom",render:()=>i(xr,{text:e})}}function xr({text:e}){return i("p",{className:"sf-note",children:l(e)})}function na(e){return ie(e)!==null&&e?.tabs!==void 0}const dt=new Map;function oa(e,t){const n=`${e}\0${t?t.join(""):""}`,o=dt.get(n)??{type:"custom",tabs:t,[re]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(T,{})};return dt.set(n,o),o}const ut=new Map;function ra(e){const t=ut.get(e)??{type:"custom",[re]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(T,{})};return ut.set(e,t),t}function Sr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ia(e,t){return Sr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(T,{})}}function la(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(T,{})}}function aa({title:e,children:t}){const[n,o]=H(()=>!ge.has(e));return i(xn,{title:e,open:n,onToggle:r=>{o(r),r?ge.delete(e):ge.add(e)},children:t})}const ge=new Set;function sa({label:e}){return i(Sn,{title:l(e),level:Jo(2)})}function pt({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),a=r?o?.[r]:void 0,s=a?l(a):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?l(o[c]):c;return i(q,{content:u,children:i(vn,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function ca(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=$o(n,t);return i(b,{label:l(e),icon:i(Xt,{}),changed:!r,action:i(y,{words:S()?.panel,label:l(e),changed:!r,detail:l("the theme's section background"),onReset:()=>o(Mo)}),children:pt({swatches:Ko,current:r?Uo:n??t??"",onPick:o,names:Wo})})}}}function yr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,a=Do(r,t);return i(b,{label:l(e),icon:i(Ne,{}),changed:!a,action:i(y,{words:S()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Lo)}),children:pt({swatches:Bo,current:a?Ho:Go(r,t),onPick:o,names:vo})})}}}function da(e=n=>n,t){return W({_gSectionTheme:_(Xo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(ao,{value:e(n),onChange:o,followLabel:t})}})}function X({min:e,max:t,step:n,value:o,onChange:r,suffix:a="",readout:s=!0,notch:c,ariaLabel:u,disabled:f=!1}){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(Wn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:s,label:u===void 0?void 0:l(u),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&r(p)}})})}function ft(e,t){const{min:n,max:o,step:r=1,unsetLabel:a,hint:s,restTrack:c,unsetMark:u,icon:f,unit:g="px"}=t;return{type:"custom",render:({value:p,onChange:d})=>{const m=typeof p=="number"?p:null,h=m===null;return i(b,{label:l(e),icon:f?K(f):void 0,value:h?u||a===void 0?void 0:l(a):`${m}${g}`,changed:!h,action:u?ye(u,{changed:!h,onReset:()=>d(null)}):i(y,{words:S()?.panel,label:l(e),changed:!h,onReset:()=>d(null)}),hint:typeof s=="string"?l(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:d}):X({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:d})})}}}const Q="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(b,{label:l(Q),icon:i(Yt,{}),changed:r,action:ye(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(_r,{tier:e,px:o,onRadius:n})})}}}function L(e){const t=Y();return[t?.values?.[e],n=>t?.onChange(e,n)]}function mt(){return Ye({type:"custom",render:()=>i(zn,{})},"always")}function Cr(){const e=Y();return t=>e?.onChangeMany(t)}function _r({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,a]=L(e.sidesKey),s=Ue(r)??[...We];return i(Bn,{label:l(Q),value:s,corners:fn,onChange:c=>{const u=Ue(c)??[];a(u.length===We.length?null:u)},radius:t,onRadiusChange:n,radiusMin:v,radiusMax:Ae,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function ht(){return mt()}function wr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=P(),r=typeof o=="number"?`${o}px`:l("not set");return i(y,{words:S()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):A(r,l("Styles")),onReset:n})}function Ir(){const{cornerRadiusPx:e}=P();return typeof e=="number"?e:v}function Er(){return be({sidesKey:"sectionCornerSides",useFollowed:Ir,mark:i(wr,{label:Q}),hint:Rr})}const Rr="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function ua(){return W({_gShape:_("Shape"),sectionCorners:Er(),sectionCornerSides:ht(),sectionBorder:gt("desktop"),sectionBorderPhone:gt("mobile")})}const Or=()=>({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 Tr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Pr(){let e;try{const t=tt(P().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||et.line}function Ar({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:a=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[u,f]=H(()=>r?In(c,s):!1),g=Or(),p=d=>Tr(r&&a?d:{width:d.width,color:d.color,...a?{style:d.style}:{}});return i(b,{label:l("Border"),icon:i(jt,{}),action:r?i(_n,{each:u,label:l("Each side"),onChange:f}):void 0,children:i(Cn,{label:l("Border"),value:c,each:u,onChange:d=>t(p(d)),placeholder:n,presets:o,words:g,styles:a,max:Po})})}function Fr({value:e,onChange:t,tier:n}){const[o]=L("sectionBorder"),r=Pr(),a=n==="mobile"?o&&typeof o=="object"?o:{}:{};return i(Ar,{value:e,onChange:t,placeholder:{sides:wn(a),style:a.style??"solid",color:a.color||r},presets:[r],above:a})}function gt(e){return x(e,{type:"custom",render:({value:t,onChange:n})=>i(Fr,{value:t,onChange:n,tier:e})})}function pa(e){return{type:"custom",render:()=>i(kr,{partKey:e})}}function kr({partKey:e}){const[t]=L("id"),[n]=L("_partStyles"),{textStyles:o}=P(),r=ho();let a=null;try{a=po().select}catch{a=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(bn,{name:l("Text"),preview:uo(s,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??mo.copy.panel).cases}),onOpen:()=>{a&&typeof t=="string"&&a(fo(t,e))}})}function bt(e){const{cornerRadiusPx:t}=P(),n=typeof t=="number"?t:e;let o=null;try{const{appState:a,selectedItem:s}=oe(u=>u),c=s?.props?.id?String(s.props.id):void 0;o=c?gn(a?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return mn(r)?r:n}function Lr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=bt(v);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:A(`${o}px`,l("the section")),onReset:n})}function Nr(){return i(T,{children:l("Follows the section's Corners until you set a number here.")})}function vr(){return be({sidesKey:"cardCornerSides",useFollowed:()=>bt(v),mark:i(Lr,{label:Q}),hint:i(Nr,{})})}function Br(){return{type:"custom",render:()=>i(Ot,{})}}function fa(e){return{...e,render:t=>i(Tt,{render:e.render,props:t})}}function ma(){return{_gShape:_("Shape"),cardCorners:vr(),cardCornerSides:ht(),cardCornersApplyAll:Br()}}function Dr(e=To,t=e[0].value){return E({type:"custom",render:({value:n,onChange:o})=>{const r=e.find(a=>a.value===n)??e.find(a=>a.value===t)??e[0];return i(b,{label:l(de),icon:i(ke,{}),value:l(r.label),children:i(Mn,{className:"sf-gallery-layouts",label:l(de),value:r.value,onChange:o,options:e.map(a=>({value:a.value,label:l(a.label),picture:i("span",{className:"sf-gallery-pic",children:Gr(a.weights).map((s,c)=>i("i",{style:{gridColumn:`span ${s}`}},c))})}))})})}},{type:"select",label:de,options:e.map(n=>({value:n.value,label:n.label}))})}function Gr(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 ha(){return U(wo,i(en,{}),Ze,Ze[0].value)}function ga(){return x("mobile",Dr(Oo,Ro))}function Hr(){return x("mobile",D(Je,i(Le,{}),ce,Eo,1,ce,"",{clear:{phoneFollows:!1,hint:ce}}))}const xt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function ba(){const e=D(Je,i(Le,{}),Qe,Io,1,Qe,"",{clear:{emptyLabel:"Auto"}}),t=lt("columns",e,{...xt,tablet:nr.tablet}),n=lt("columns",e,xt,{phoneRow:Hr()});return{...t,phoneRow:n.phoneRow}}function xa(e,t,n,o,r,a){return{type:"custom",render:({value:s,onChange:c})=>i(b,{label:l(e),icon:i(Ke,{noun:a}),action:i(y,{words:S()?.panel,label:l(e),changed:!Yo(s),detail:l("the Text style in Styles"),onReset:()=>c(zo),defaultAction:{onPress:()=>c(jo),title:l("Keep this section's own built-in size"),icon:i(zt,{})}}),children:X({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Sa(){return{_gCellWidth:_("Cell width"),gridSpan:U("Positions",i(ke,{}),[{label:"Auto",value:""},...Array.from({length:kt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function G(){let e=null,t=null;try{e=Ct(Mr),t=oe(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Mr=yt(null);function Kr({min:e,max:t,step:n,px:o,label:r,onChange:a,desktopKey:s,fallback:c}){const u=G()[s],f=ae(void 0,u,c);return i(T,{children:X({min:e,max:t,step:n,value:ae(o,u,c),readout:!1,ariaLabel:r,notch:f,onChange:a})})}function Wr({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:a=()=>{}}){const s=G()[t],c=ae(void 0,s,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:l("{value} on desktop",{value:`${c}${o}`}),onReset:a})}function Ur(e){return ft(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Wr,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Kr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const $r={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Xr={Top:Me,Bottom:De,Left:Ge,Right:He},jr=e=>{const t=Xr[e];return i(t,{})};function ya(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=C=>$r[C],a=C=>D(r("Top"),i(Me,{}),I.min,I.max,I.step,C,"px"),s=(C,j,O,ne=I)=>x("mobile",Ur({label:r(C),icon:jr(C),desktopKey:j,min:ne.min,max:ne.max,step:ne.step,fallback:O})),c=e.top??I.min,u=e.bottom??I.min,f="sectionPaddingLeft",g="sectionPaddingRight",p=e.sideBounds??I,d=e.side??p.min,m=e.sidePhone??d,h=e.phone===!0,R=C=>h?x("desktop",C):C;return W({...o?{_gSpacing:_("Padding")}:{},[t]:R(a(c)),...h?{[B(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:R(D(r("Bottom"),i(De,{}),I.min,I.max,I.step,u,"px")),...h?{[B(n)]:s("Bottom",n,u)}:{}},...e.sides?{[f]:R(D(r("Left"),i(Ge,{}),p.min,p.max,p.step,d,"px")),...h?{[B(f)]:s("Left",f,m,p)}:{},[g]:R(D(r("Right"),i(He,{}),p.min,p.max,p.step,d,"px")),...h?{[B(g)]:s("Right",g,m,p)}:{}}:{}})}function Ca(e,t){const n=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,a in e&&ie(s)?e[a]:s])),o={};let r=!1;for(const[a,s]of Object.entries(e)){if(a in t){r||Object.assign(o,n),r=!0;continue}o[a]=s}return r||Object.assign(o,n),o}const ee="Width";function _a(e,t=Vo,n=!0){const o=t.map(r=>({label:qo[r],value:r}));return W({...n?{_gWidth:_(ee)}:{},widthMode:{type:"custom",render:({onChange:r,field:a})=>i(b,{label:l(ee),icon:i(un,{}),action:n?i(pr,{inherited:a?.inherited??!1,onReset:()=>r(Zo),label:ee}):void 0,children:he({options:o,value:a?.currentValue||e,onChange:r,ariaLabel:ee})})}})}function wa(){const e=o=>({type:"custom",render:({value:r,onChange:a})=>i(b,{label:M,icon:K(i(nn,{})),action:o?o(a):void 0,children:he({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(r)?r:"auto",onChange:a,ariaLabel:M})})}),t=()=>({type:"custom",render:({value:o,onChange:r,field:a})=>{const s=a?.unit==="%"?"%":"px",c=s==="%"?Co:yo;return i("div",{className:"sf-field",children:X({min:c.min,max:c.max,step:c.step,value:typeof o=="number"?o:c.fallback,suffix:s,ariaLabel:M,onChange:r})})}}),n=()=>rr("Unit",i(ve,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return W({_gHeight:_(M),sectionHeightMode:x("desktop",e()),sectionHeightValue:x("desktop",t()),sectionHeightUnit:x("desktop",n()),sectionHeightModePhone:x("mobile",e(o=>i(zr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:x("mobile",t()),sectionHeightUnitPhone:x("mobile",n())})}function zr({onClear:e}){const t=G(),n=go(t),o=bo(t),r=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return i(y,{words:S()?.panel,label:l(M),changed:n,detail:r,onReset:e})}function Ia(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:a,name:s})=>i(Yr,{value:o,onChange:r,labelId:`${a??s??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>i("div",{className:"sf-field",children:X({min:Z.min,max:Z.max,step:Z.step,value:typeof n=="number"?n:Z.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:_(se),stickTop:x("desktop",e(!1)),stickTopDistance:x("desktop",t()),stickTopPhone:x("mobile",e(!0)),stickTopDistancePhone:x("mobile",t())}}function Yr({value:e,onChange:t,labelId:n,phone:o}){const r=G(),a=So(r),s=o?a.phone:e===!0;return i(b,{label:l(se),labelId:n,icon:K(i(an,{})),action:N(T,{children:[o?i(y,{words:S()?.panel,label:l(se),changed:xo(r),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,i(le,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const St="e.g. about";function Ea(){return{_gAnchor:_("Anchor"),anchor:k({control:"plainText",label:"Name",placeholder:St},{type:"custom",render:({value:e,onChange:t})=>i(Kt,{value:e,onChange:t,nameBox:(n,o)=>i(F,{value:n,onChange:o,label:"Name",placeholder:St,hideable:!1,markup:!1})})})}}function Ra(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return i(b,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(Gn,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Oa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-date`;return i(b,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(Dn,{id:c,value:It(typeof o=="string"?o:null),onChange:u=>r(u?wt(u):"")})})}}}function Vr(e,t,n,o){return{type:"custom",...E({},{...$,label:e}),render:({value:r,onChange:a,id:s,name:c})=>{const u=typeof r=="boolean"?r:t,f=`${s??c??e}-label`;return i(b,{label:l(e),labelId:f,icon:n,hint:o===void 0?void 0:l(o),action:i(le,{checked:u,onChange:a,ariaLabelledBy:f})})}}}function Ta(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(je,{label:l("Background"),icon:i(ln,{}),id:r,value:pn(e),onChange:t})}}}function Pa(e,t){return{type:"custom",...E({},{...$,label:e}),render:({value:n,onChange:o,id:r})=>{const a=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(b,{label:l(e),htmlFor:s,className:"sf-checkbox",action:i(Nn,{id:s,checked:a,onChange:o})})}}}function Aa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(je,{label:l(e),icon:n,value:o||t,onChange:r})}}function Fa(){return{type:"custom",render:({value:e,onChange:t})=>i(qr,{value:typeof e=="string"?e:"",onChange:t})}}function qr({value:e,onChange:t}){const{hex:n,n:o}=Jr();return i($n,{label:l("Fill"),icon:i(Ne,{}),value:e,inherited:n,resetTo:A(n.toUpperCase(),l("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function Zr(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return J(n);const r=hn(e,t);if(r.length===0)return null;const a=J(it(n));if(a!==null)return a;for(let s=r.length-1;s>0;s-=1){const c=J(it(r[s].sectionAccent));if(c!==null)return c}return J(r[0].sectionAccent)}function Jr(){const e=tt(P().theme),[t]=L("sectionAccent");let n=null;try{const{appState:r,selectedItem:a}=oe(c=>c),s=a?.props?.id?String(a.props.id):void 0;n=s?Zr(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{hex:e.themes[o].background??et.background,n:o+1}}const Qr=[{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 ei({label:e,value:t,onChange:n,points:o=Qr}){const r=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return i(Ln,{label:l(e),value:t,points:r,onChange:n})}function ka(){return mt()}const La={top:i(Jt,{}),right:i(Zt,{}),bottom:i(Vt,{}),left:i(qt,{})};function Na(e,t,n,o,r,a,s){const c=p=>t.find(d=>d.value===p),u=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const d=t.find(h=>h.cell===p);if(!d)return u(`missing-${p}`);const m=a?.[p];return m?{value:d.value,label:d.label,icon:m}:{value:d.value,label:d.label}},g=[u("corner-top-left"),f("top"),u("corner-top-right"),f("left"),u("centre"),f("right"),u("corner-bottom-left"),f("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:d})=>{const m=t.some(h=>h.value===p)?p:n;return i(b,{label:l(e),icon:r,value:c(m)?.label?l(c(m).label):s?l(s):"",children:ei({label:e,value:m,onChange:d,points:g})})}}}function va(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:a})=>i(lo,{label:e,options:(a.options??t).map(s=>({...s,label:l(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Ba(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:a,field:s})=>i(so,{label:e,options:(s.options??t).map(c=>({...c,label:l(c.label)})),fallback:s.fallback??n,value:r,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function Da(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ga=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ha(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(ti,{label:e,icon:t,options:o,onChange:r})}}function ti({label:e,icon:t,options:n,onChange:o}){const r=Y()?.values??{},a=Et(r),s=a==="frame"&&!!_e(r.mediaVideo)&&!_e(r.videoFrame);return i(b,{label:l(e),icon:K(t),hint:s?l("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:he({options:n,value:a,onChange:o,ariaLabel:e})})}function Ma(e,t,n,o={}){return{type:"custom",[Oe]:!0,render:({value:r,onChange:a,name:s})=>i(io,{value:r||"",onChange:a,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const Ka={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ni(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 Wa({value:e,onChange:t,label:n}){const o=e||{},r=Y(),a=r?r.values!==r.node.props:!0,s=!!o.pending&&a,c=!!o.pending&&!a,u=s?"var(--ink-faint)":o.ok&&!c?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",f=!!er(Qo()).geocode,g=Ce(),p=(d,m)=>t({...o,[d]:m??void 0});return N(T,{children:[i(b,{label:l(n),icon:i(Be,{}),action:f?i(q,{content:l("Find from the address (OpenStreetMap)"),children:i($e,{"aria-label":l("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(sn,{})})}):void 0,children:f&&o.status?i(q,{content:ni(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${Mt}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:u},children:s?l("Finding…"):c?l(Un):l(o.status)})}):null}),i(b,{label:l("Enter by hand"),labelId:g,icon:i(Qt,{}),action:i(le,{checked:!!o.manual,onChange:d=>t({...o,manual:d}),ariaLabelledBy:g})}),o.manual&&i(b,{label:l("Latitude, longitude"),icon:i(Be,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(Xe,{value:typeof o.lat=="number"?o.lat:null,onChange:d=>p("lat",d),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(Xe,{value:typeof o.lng=="number"?o.lng:null,onChange:d=>p("lng",d),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function oi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function ri(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,a)=>a===t?{text:n}:r)}function Ua(e,t){return e===null?null:t>e?e:null}function ii(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 $a={label:"Ticker items",icon:i(rn,{})};function Xa(e,t,n,o){return{type:"custom",[w]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...ct.textList,label:e}),render:({value:r,onChange:a})=>i(li,{label:e,icon:K(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:a,markup:o==="markup"})}}function li({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:a=!1}){const s=z(null),[c,u]=H(null),f=p=>p.map(d=>({text:d?.text??""})),g=p=>{const d=ii(n,p,c);d===null&&(s.current=null),u(d),r(f(p))};return i(En,{label:l(e),icon:t,noun:l("item"),items:n,onChange:g,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?i(ze,{target:s,value:oi(n,c),onChange:p=>r(ri(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,d,m)=>i("input",{type:"text",className:a&&c===d?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:d+1}),onChange:h=>m({text:h.target.value}),onFocus:h=>{s.current=h.currentTarget,u(d)}})})}function ja(e,t){const n=`${e.label} — row ${t+1}`;return k({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(F,{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 za(e){return{_gCards:_("Cards"),coverIndex:U("Cover image",i(on,{}),no,String(oo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:yr("Image background",No),cardImage:ci()}}function Ya(){return{outline:U("Card outline",i(cn,{}),Qn,to),indexBadge:U("Card number",i(ve,{}),Jn,eo),showBadge:Vr("Product badge",!0,i(Ke,{noun:"tag"}))}}function Va(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...$,label:te.find(a=>a.id===r).label}),o=r=>E(Xn(xe),n(r));return{_gShowOnCard:_("Show on a card"),[xe]:E({type:"custom",render:()=>i(ai,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(xe)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const xe="showCardPrice",te=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function ai({rest:e}){const t=G(),n=Cr(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],a=te.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(Se,{parts:te,changed:a,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(te.map(({id:s})=>[s,void 0])))})}function qa(e,t="display"){const n=B(t);return{[t]:x("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Se,{parts:e,changed:On(o),shown:a=>Tn(o,a),onPress:(a,s)=>r(Fn(o,a,s)),onReset:()=>r(void 0)})}),[n]:x("mobile",{type:"custom",render:({value:o,onChange:r})=>i(si,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Se({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:a,disabledReason:s}){const c=l("Display");return i(b,{label:c,icon:i(Ut,{}),changed:t,action:i(y,{words:S()?.panel,label:c,changed:t,detail:a,onReset:r}),children:i(Rn,{label:c,items:e.map(u=>({id:u.id,label:l(u.label),shown:n(u.id),...s?{disabled:!0,disabledReason:l(s)}:{}})),onChange:o})})}function si({parts:e,desktopKey:t,value:n,onChange:o}){const r=G()[t];return i(Se,{parts:e,changed:An(n),shown:a=>Pn(r,n,a),onPress:(a,s)=>o(kn(n,a,s)),onReset:()=>o(Vn),detail:l("the same as Desktop")})}function ci(){return ft("Card image",{min:v,max:Ae,step:Pt,hint:"Rounds the picture. The card's own corner is in Styles."})}function Za(){return be({sidesKey:"cornerSides",step:At,useFollowed:()=>v,mark:i(di,{label:Ft}),hint:l("Rounds the picture. Left alone it stays square.")})}function di({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function Ja(){return{type:"custom",render:({value:e,onChange:t})=>i(mi,{value:typeof e=="string"?e:"",onChange:t})}}function ui({layout:e,width:t}){return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:vt(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const pi={width:"3.5rem",height:"2.5rem"},fi=200;function mi({value:e,onChange:t}){const[n,o]=H(null),[r,a]=H(4),s=z(null);_t(()=>{const d=s.current;if(!d||typeof ResizeObserver!="function")return;const m=()=>a(d.getBoundingClientRect().width>=fi?4:3);m();const h=new ResizeObserver(m);return h.observe(d),()=>h.disconnect()},[]);const c=e&&e in V?e:"",u=Fe(n,c),f=Fe(n,"").length,g=Bt("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:g},...u.map(d=>({value:d,label:l(V[d].label),icon:i(ui,{layout:V[d],width:40})}))];return i(b,{label:l("Layout"),icon:i(tn,{}),value:c?l(V[c].label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(Kn,{label:l("Layout"),value:c,emptyValue:"",options:p,onChange:t,columns:r,cell:pi,header:N("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(yn,{options:[{id:"all",label:l("All")},...Lt.map(d=>({id:String(d),label:String(d)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:d=>o(d==="all"?null:Number(d))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:Nt.length})})]})})})})}export{mr as BOUND_TO_POST,jl as BOUND_TO_POST_NOTE,ea as BUCKET_ICONS,Ka as CUSTOM_FIELD_MEDIA,Wa as CoordsField,at as DESKTOP_GAP_NOT_OVERLAP,Se as DisplayRow,La as EDGE_ARROWS,Hn as FOCAL_DEFAULT,Qr as FOCAL_POINTS,re as FOLD_FIELD_MARKER,ei as FocalPicker,sa as GroupLabel,hr as HIGHLIGHT_HINT,F as HidableTextField,Re as LINK_FIELD_MARKER,vl as Label,Oe as MEDIA_FIELD_MARKER,Ga as MEDIA_TYPE_OPTIONS,zl as NOT_BOUND_TO_POST,aa as PanelBand,xr as PanelNoteLine,Mr as RowPropsContext,Te as SCAFFOLD_FIELD_MARKER,ns as SCALAR_TEXT_CONTROLS,lr as SiteGapDefaultReset,X as Slider,pt as Swatches,ts as TEXT_CONTROL_KINDS,w as TEXT_FIELD_MARKER,$a as TICKER_ITEMS_ROW,li as TextListField,ee as WIDTH_LABEL,pr as WidthDefaultReset,ii as aimAfterListChange,Ea as anchorFields,A as backTo,ca as backgroundField,ha as boxBlockSpacingField,ba as boxColumnsFields,Fa as boxFillField,Hr as boxPhoneRowField,Dr as boxShareField,ga as boxSharePhoneField,Zr as boxThemeIndexOf,oa as bucketHeader,pa as buttonWordsEntryField,vr as cardCornersField,yr as cardImageBackgroundField,ci as cardImageField,za as cardMediaFields,ma as cardShapeFields,Va as cardShowFields,Ya as cardStyleFields,Sa as cellWidthFields,Pa as checkbox,Aa as colorInput,Dl as containerDirectionField,ar as containerGapField,sr as containerGapPhoneField,Bl as containerGapRows,cr as containerGapTabletField,ni as coordsResultTip,Zl as copyText,ht as cornerSidesField,be as cornersRowField,Oa as date,Ra as dateTime,ra as designGroupHeader,qa as displayFields,Na as edgePad,Ua as focusAfterRemove,ka as focusKeptField,ia as foldMarker,ie as foldMetaOf,Sr as foldTitleOf,Ja as galleryLayoutField,wa as heightFields,Gl as heroGroupPlacementPoints,Ee as hidableText,br as hintIsWhileTyping,Za as imageCornersField,Xl as inOwnBox,na as isBucketHeader,mt as keptBy,Jl as linkField,Ha as loadingShowsField,va as multiSelect,Ta as pageBackgroundField,ta as panelNote,Ur as phoneOverrideField,ql as plainText,Ql as plainTextarea,ft as pxField,la as quietMarker,Ie as readHidable,oi as rowText,Ba as searchSelect,gt as sectionBorderField,Er as sectionCornersField,ua as sectionShapeFields,da as sectionThemeFields,ri as setRowText,xa as sizeField,Da as sourceField,ya as spacingFields,Ia as stickFields,Ca as swapPadding,fa as templateField,Yl as text,Rt as textFieldIdentifier,Kl as textFieldOffPage,Ul as textFieldPanelOnly,Xa as textList,ja as textListRowField,Vl as textarea,Vr as toggle,Ma as upload,Cr as useSelectedPatch,G as useSelectedProps,L as useSelectedSibling,ir as useSiteGapDetail,_a as widthField,$l as withIdentifier,Ml as withOffPage,Wl as withPanelOnly,Hl as withScaffold};
1
+ "use client";import{jsx as i,jsxs as v,Fragment as F}from"react/jsx-runtime";import{cloneElement as Fe,createContext as Dt,useContext as vt,useEffect as Ht,useId as Pe,useRef as J,useState as W}from"react";import{useEasel as de,useSelectedHost as H}from"efficient-easel/easel";import{toDateKey as Gt,fromDateKey as Mt}from"efficient-shell/format";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{mediaValueSrc as Ae}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as Le,loadingShowsOf as Kt}from"../../../format/lib/hero-video.js";import{readHidable as Ne,hidableText as Be}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as ue,LINK_FIELD_MARKER as De,MEDIA_FIELD_MARKER as ve,SCAFFOLD_FIELD_MARKER as He,TEXT_FIELD_MARKER as w,foldMetaOf as pe,textFieldIdentifier as Ut}from"efficient-easel/draw";import Wt from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Ge}from"../../../render/lib/document/show-when.js";import $t from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as Xt,CORNER_RADIUS_MAX as Me,CORNER_RADIUS_MIN as G}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as jt,IMAGE_CORNERS_LABEL as Vt}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as zt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Yt,GALLERY_LAYOUTS as Q,GALLERY_LAYOUT_KEYS as qt,galleryChoices as Ke,galleryPictureCells as Zt}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Jt}from"./shell-glyph.js";import{anchorSiblingsOf as Qt,placementPoints as en}from"../../../format/lib/hero-group-placement.js";import tn,{KEEP_HINT_CLASS as nn}from"../../components/KeepHint.js";import on from"../../components/AnchorField.js";import{AdjustIcon as rn,EyeIcon as ln,AnimationIcon as an,BackgroundIcon as sn,BorderAllIcon as cn,BlockSectionIcon as dn,ColumnWidthsIcon as Ue,ColumnsIcon as We,CornerIcon as un,DirectionDownIcon as pn,DirectionLeftIcon as fn,DirectionRightIcon as hn,DirectionUpIcon as mn,EditIcon as gn,GapIcon as bn,GridIcon as xn,GroundIcon as $e,HashIcon as Xe,HeightIcon as Sn,ImageIcon as yn,ListIcon as Cn,LocationIcon as je,PaddingBottomIcon as Ve,PaddingLeftIcon as ze,PaddingRightIcon as Ye,PaddingTopIcon as qe,PageIcon as wn,StickyIcon as _n,SearchIcon as Rn,SquareIcon as Tn,TypeIcon as In,WidthIcon as En}from"efficient-easel/icons";import{FieldGlyph as Ze}from"../../components/FieldGlyph.js";import{resolvePageBackground as On}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Je,CORNER_SIDE_POINTS as kn,hasOwnSectionCorners as Fn,normalizeCornerSides as Qe}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Pn,enclosingSection as An}from"./enclosing-section.js";import{SettingsDefaultReset as S,SettingsDrill as Ln,SettingsField as b,SettingsGroup as Nn,SettingsGroupSub as Bn,SettingsSegmented as Dn,SettingsBorder as vn,SettingsSidesEach as Hn,SettingsSwitch as fe,borderSides as Gn,borderStartEach as Mn}from"efficient-easel/panel";import{ListField as Kn}from"efficient-easel/fields";import{DisplayChips as Un}from"efficient-shell/ui";import{desktopDisplayChanged as Wn,partShownOnDesktop as $n,partShownOnPhone as Xn,phoneDisplayChanged as jn,withDesktopPart as Vn,withPhonePart as zn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Yn,Checkbox as qn,ColorSwatch as Zn,CornersInput as Jn,DatePicker as Qn,DateTimePicker as eo,FOCAL_DEFAULT as to,PictureTiles as no,IconPicker as oo,IconButton as et,InputNumber as tt,Slider as ro,Tooltip as ee}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as io}from"./geocode-resolve.js";import{ColourRow as nt,InheritedColourRow as ot}from"./ColourControl.js";import{keptByRow as lo}from"efficient-easel/screen/lib/document/style-fields";import rt from"./MarkupToolbar.js";import{deviceField as _}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as ao,NoControlMark as so,noControlField as it}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as co}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as uo,resolvePhoneValue as he}from"../../../format/lib/document/phone-override.js";import{phoneKey as I,tabletKey as M}from"efficient-easel/draw";import{SuppressibleText as po}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as fo,CARD_OUTLINE_OPTIONS as ho,DEFAULT_CARD_INDEX_FORMAT as mo,DEFAULT_CARD_OUTLINE as go}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as bo,DEFAULT_COVER_INDEX as xo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as So}from"efficient-easel/draw";import yo from"../../components/MediaUploadField.js";import Co from"../../components/MultiSelectField.js";import wo from"../../components/SectionThemePicker.js";import _o from"../../components/SearchSelectField.js";import Ro from"../../components/StorefrontLinkField.js";import{UiIcon as lt}from"efficient-easel/draw/client";import{SECTION_PADDING as R}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as To}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Io}from"efficient-easel/draw/client";import{encodePartId as Eo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Oo,useEaselStrings as ko}from"efficient-easel/strings";import{hasPhoneHeight as Fo,hasTabletHeight as me,resolveSectionMinHeight as Po,resolveTabletHeight as Ao}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as te,SECTION_STICK_LABEL as ge,hasPhoneStick as Lo,hasTabletStick as No,resolveSectionStick as at}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as Bo,SECTION_MIN_HEIGHT_GROUP_LABEL as $,SECTION_SCREEN_PCT as Do}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as vo,resolveContainerDirection as st}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Ho,BOX_BLOCK_SPACING_POINTS as ct,BOX_PHONE_ROW_LABEL as dt,BOX_COLUMNS_MAX as Go,BOX_COLUMNS_MIN as ut,BOX_PHONE_ROW_MAX as Mo,BOX_PHONE_ROW_MIN as be,BOX_SHARE_LABEL as ne,BOX_SHARE_PHONE_DEFAULT as Ko,BOX_SHARE_PHONE_POINTS as Uo,BOX_SHARE_POINTS as Wo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as L}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as $o,borderBySide as pt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Xo,normalizeTheme as ft,normalizeThemeColors as jo,sectionBandTone as Vo,surfaceTwoTone as zo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ht,CONTAINER_GAP_BUILT_IN as Yo,CONTAINER_GAP_PHONE as xe,GAP_FIELD_CONTAINER as Se,followsSitePhoneGap as qo,hasOwnContainerGap as Zo,hasOwnPhoneGap as ye,resolveContainerGap as mt,resolvePhoneContainerGap as gt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Jo,CARD_IMAGE_BG_OFF as Qo,CARD_IMAGE_BG_SWATCH_NAMES as er,CARD_IMAGE_BG_SWATCHES as tr,isCardImageBackgroundInheriting as nr,cardImageBackgroundChoice as or,THEME_CARD_IMAGE_BG as rr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as ir,SECTION_BG_NO_FILL as lr,sectionBackgroundChoice as ar,THEME_SECTION_BG as Ce,isSectionBackgroundEmpty as sr,sectionBackgroundHex as bt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as cr,nestedAccentValue as xt,resolveSectionAccent as oe}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as dr,TYPE_SIZE_INHERIT as ur,isTypeSizeInheriting as pr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as fr,WIDTH_CHOICE_LABEL as hr,WIDTH_INHERIT as mr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as gr}from"./panel-heading-scope.js";import{useEaselSession as br}from"efficient-easel/screen/lib/session-context";import{backendOf as xr}from"../website-session.js";import{BOX_GAP as Sr,describedAs as T,group as C,iconOf as X,sharedStyleKinds as j}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as we,onDesktopWords as V,phoneTwinFields as re}from"efficient-easel/screen/lib/document/box-fields";import{directionField as yr,gapField as _e,Segmented as Re,segmented as Cr,select as z,slider as K}from"./box-fields.js";function ia({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function wr(){const{blockGap:e}=L();return e===null?l("this container's own spacing"):N(`${e}px`,l("Styles"))}function _r({inherited:e,onReset:t,label:n}){return i(S,{words:x()?.panel,label:l(n),changed:!e,detail:wr(),onReset:t})}function Rr(e){return _e({...Sr,builtIn:Yo[e],resolve:(t,n)=>mt(e,t,n?.siteGap),action:(t,n)=>i(_r,{inherited:!Zo(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Se]:e}})}function Tr(e){return Ge(_("mobile",{[Se]:e,type:"custom",render:t=>i(Or,{container:e,...t})}),St)}function Ir(e){return Ge(_("tablet",{[Se]:e,type:"custom",render:t=>i(Er,{container:e,...t})}),St)}const St={not:{field:"gap",in:Array.from({length:-ht.min},(e,t)=>ht.min+t)}};function la(e){return{gap:_("desktop",Rr(e)),[M("gap")]:Ir(e),[I("gap")]:Tr(e)}}function Er({container:e,...t}){const[n]=P("gap"),{siteGap:o}=t.field??{},r=Math.max(xe.min,mt(e,n,o));return _e({...xe,builtIn:r,resolve:s=>ye(s)?s:r,action:(s,c)=>i(S,{words:x()?.panel,label:l("Gap"),changed:ye(s),detail:V(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Or({container:e,...t}){const[n]=P("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},a=gt(e,void 0,n,o,r);return _e({...xe,builtIn:a,resolve:c=>gt(e,c,n,o,r),action:(c,d)=>i(S,{words:x()?.panel,label:l("Gap"),changed:ye(c),detail:N(`${a}px`,qo(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function aa(e){return yr({offered:vo(e),fallback:st(e,void 0),resolve:t=>st(e,t)})}function sa(e,t){return en(t?Qt(e,t):[],t)}function kr({inherited:e,onReset:t,label:n}){return i(S,{words:x()?.panel,label:l(n),changed:!e,detail:N(l("Full"),l("the page")),onReset:t})}function B({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:a,hideable:s=!0,markup:c=!0}){const{text:d,hidden:f}=Ne(e),h=J(null),p=J(null),u=k=>t(s?{text:k,hidden:f}:k),m=()=>t({text:d,hidden:!f}),g=s&&f,O=Pe(),y=r?Nr(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(r)}):i(tn,{children:l(r)}):void 0,Z=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(b,{label:l(n),icon:i(In,{}),htmlFor:O,className:g?"is-hidden":void 0,hint:y,action:s?i(ee,{content:Z,children:i(et,{"aria-pressed":f,"aria-label":Z,onClick:m,children:f?i(lt,{name:"eye-off",size:14}):i(lt,{name:"eye",size:14})})}):void 0,children:v("div",{className:"sf-copybox",children:[c&&i(rt,{target:a?p:h,value:d,onChange:u}),a?i("textarea",{id:O,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:k=>u(k.target.value)}):i("input",{id:O,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:k=>u(k.target.value)})]})})}function ca(e,t){return{...e,[He]:t}}function da(e){const t=e[w];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[w]:{...t,offPage:!0}}}function ua(e){return!e||typeof e!="object"?!1:e[w]?.offPage===!0}const yt="sfPanelOnly";function pa(e){if(!e[w])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[yt]:!0}}function fa(e){return!!e&&typeof e=="object"&&e[yt]===!0}function ha(e){const t=e[w];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[w]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Es,SCALAR_TEXT_CONTROLS as Os}from"efficient-easel/draw";function ma(e,t){if(!e[w])throw new Error("inOwnBox: the field holds no authored text");const{[ao]:o,...r}=e;return{...r,[co]:!0,render:t}}const Fr=new Set(So),Y={type:"radio",options:[{value:!0},{value:!1}]},Ct={text:{type:"object",objectFields:{text:{type:"text"},hidden:Y}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Y}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},D=(e,t)=>{const n=T({...t,[w]:e},{...Ct[e.control],label:e.label});if(!Fr.has(e.control))return n;const o=t.render;return{...it(n,"authored-copy"),render:r=>i(po,{name:r.name,children:o(r)})}},ga="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Pr={field:"source.slug",set:!0},ba={not:Pr},Ar="Select a word, then press the highlighter.",Lr=new Set([Ar]),Nr=e=>Lr.has(e);function xa(e,t,n){return D({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Sa(e,t,n){return D({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function ya(e,t,n){return D({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Ca(e,t,n){return D({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function wa(e){return{type:"custom",[De]:{label:e},...T({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Ro,{value:Be(t),onChange:n,label:e})}}function _a(e,t,n){return D({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Ra={Design:rn,Animation:an};function Ta(e){return{type:"custom",render:()=>i(Br,{text:e})}}function Br({text:e}){return i("p",{className:"sf-note",children:l(e)})}function Ia(e){return pe(e)!==null&&e?.tabs!==void 0}const wt=new Map;function Ea(e,t){const n=`${e}\0${t?t.join(""):""}`,o=wt.get(n)??{type:"custom",tabs:t,[ue]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(F,{})};return wt.set(n,o),o}const _t=new Map;function Oa(e){const t=_t.get(e)??{type:"custom",[ue]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(F,{})};return _t.set(e,t),t}function Dr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ka(e,t){return Dr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(F,{})}}function Fa(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(F,{})}}function Pa({title:e,children:t}){const[n,o]=W(()=>!Te.has(e));return i(Nn,{title:e,open:n,onToggle:r=>{o(r),r?Te.delete(e):Te.add(e)},children:t})}const Te=new Set;function Aa({label:e}){return i(Bn,{title:l(e),level:gr(2)})}function vr({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),a=r?o?.[r]:void 0,s=a?l(a):t;return v("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(ee,{content:d,children:i(Zn,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function La(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(Hr,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Hr({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const a=typeof o=="string"?o:void 0,{colors:s,n:c}=Bt(),d={background:s.background,surface:s.surface,surface2:zo(s),band:Vo(s)},f=n?Ce:t,h=sr(a,t,f),p=bt(void 0,f,d),u=n?ir:void 0,m=ar(a,t),g=f===Ce?l("the theme's section background"):l("Theme {n} background",{n:c});return i(ot,{label:l(e),icon:i(sn,{}),value:h?"":bt(a,t,d),inherited:p,resetTo:N(p.toUpperCase(),g),onChange:r,onReset:()=>r(u),choices:[{label:l("No fill"),color:"",selected:m==="none",onPick:()=>r(lr)},{label:`${l("Section band")} · ${d.band.toUpperCase()}`,color:d.band,selected:m==="band",onPick:()=>r(Ce)}]})}function Gr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,a=nr(r,t);return i(b,{label:l(e),icon:i($e,{}),changed:!a,action:i(S,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Jo)}),children:vr({swatches:tr,current:a?rr:or(r,t),onPick:o,names:er})})}}}function Na(e=n=>n,t){return j({_gSectionTheme:C(cr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(wo,{value:e(n),onChange:o,followLabel:t})}})}function q({min:e,max:t,step:n,value:o,onChange:r,suffix:a="",readout:s=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:h}){const p=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:p?"sf-slider has-notch":"sf-slider",style:p?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(ro,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},suffix:a||void 0,showInput:s,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:u=>{u!==null&&u!==o&&r(u)}})})}function Rt(e,t){const{min:n,max:o,step:r=1,unsetLabel:a,hint:s,restTrack:c,unsetMark:d,icon:f,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const m=typeof p=="number"?p:null,g=m===null;return i(b,{label:l(e),icon:f?X(f):void 0,value:g?d||a===void 0?void 0:l(a):`${m}${h}`,changed:!g,action:d?Fe(d,{changed:!g,onReset:()=>u(null)}):i(S,{words:x()?.panel,label:l(e),changed:!g,onReset:()=>u(null)}),hint:typeof s=="string"?l(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:u}):q({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ie="Corners";function Ie(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(b,{label:l(ie),icon:i(un,{}),changed:r,action:Fe(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(Kr,{tier:e,px:o,onRadius:n})})}}}function P(e){const t=H();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Tt(){return it({type:"custom",render:()=>i(so,{})},"always")}function Mr(){const e=H();return t=>e?.onChangeMany(t)}function Kr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,a]=P(e.sidesKey),s=Qe(r)??[...Je];return i(Jn,{label:l(ie),value:s,corners:kn,onChange:c=>{const d=Qe(c)??[];a(d.length===Je.length?null:d)},radius:t,onRadiusChange:n,radiusMin:G,radiusMax:Me,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function It(){return Tt()}function Ur({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=L(),r=typeof o=="number"?`${o}px`:l("not set");return i(S,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):N(r,l("Styles")),onReset:n})}function Wr(){const{cornerRadiusPx:e}=L();return typeof e=="number"?e:G}function $r(){return Ie({sidesKey:"sectionCornerSides",useFollowed:Wr,mark:i(Ur,{label:ie}),hint:Xr})}const Xr="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Ba(){return j({_gShape:C("Shape"),sectionCorners:$r(),sectionCornerSides:It(),...U("sectionBorder",Et)})}const jr=()=>({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 Vr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function zr(){let e;try{const t=ft(L().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Xo.line}function Yr({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:a=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[d,f]=W(()=>r?Mn(c,s):!1),h=jr(),p=u=>Vr(r&&a?u:{width:u.width,color:u.color,...a?{style:u.style}:{}});return i(b,{label:l("Border"),icon:i(cn,{}),action:r?i(Hn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(vn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:h,styles:a,max:$o})})}function qr({value:e,onChange:t,view:n}){const[o]=P("sectionBorder"),[r]=P(M("sectionBorder")),a=zr(),s=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...pt(s(o)),...pt(s(r))}:n==="tablet"?s(o):{};return i(Yr,{value:e,onChange:t,placeholder:{sides:Gn(c),style:c.style??"solid",color:c.color||a},presets:[a],above:c})}function Da(e){return _(e,Et(e==="mobile"?"phone":e))}function Et(e){return{type:"custom",render:({value:t,onChange:n})=>i(qr,{value:t,onChange:n,view:e})}}function U(e,t){const n=(o,r)=>re(e,t(o),we)[r];return{[e]:n("desktop",e),[M(e)]:n("tablet",M(e)),[I(e)]:n("phone",I(e))}}function va(e){return{type:"custom",render:()=>i(Zr,{partKey:e})}}function Zr({partKey:e}){const[t]=P("id"),[n]=P("_partStyles"),{textStyles:o}=L(),r=ko();let a=null;try{a=Io().select}catch{a=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Ln,{name:l("Text"),preview:To(s,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Oo.copy.panel).cases}),onOpen:()=>{a&&typeof t=="string"&&a(Eo(t,e))}})}function Ot(e){const{cornerRadiusPx:t}=L(),n=typeof t=="number"?t:e;let o=null;try{const{appState:a,selectedItem:s}=de(d=>d),c=s?.props?.id?String(s.props.id):void 0;o=c?An(a?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Fn(r)?r:n}function Jr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Ot(G);return i(S,{words:x()?.panel,label:l(e),changed:t,detail:N(`${o}px`,l("the section")),onReset:n})}function Qr(){return i(F,{children:l("Follows the section's Corners until you set a number here.")})}function ei(){return Ie({sidesKey:"cardCornerSides",useFollowed:()=>Ot(G),mark:i(Jr,{label:ie}),hint:i(Qr,{})})}function ti(){return{type:"custom",render:()=>i(Wt,{})}}function Ha(e){return{...e,render:t=>i($t,{render:e.render,props:t})}}function Ga(){return{_gShape:C("Shape"),cardCorners:ei(),cardCornerSides:It(),cardCornersApplyAll:ti()}}function kt(e=Wo,t=e[0].value){return T({type:"custom",render:n=>{const{value:o,onChange:r}=n,a="follows"in n,s=n.follows,c=o!=null,d=c?o:a?s??t:o,f=e.find(p=>p.value===d)??e.find(p=>p.value===t)??e[0],h=e.find(p=>p.value===(s??t))??e[0];return i(b,{label:l(ne),icon:i(Ue,{}),value:l(f.label),action:a?i(S,{words:x()?.panel,label:l(ne),changed:c,detail:V(p=>l(p),l(h.label),n.followsView),onReset:()=>r(void 0)}):void 0,children:i(no,{className:"sf-gallery-layouts",label:l(ne),value:f.value,onChange:r,options:e.map(p=>({value:p.value,label:l(p.label),picture:i("span",{className:"sf-gallery-pic",children:ni(p.weights).map((u,m)=>i("i",{style:{gridColumn:`span ${u}`}},m))})}))})})}},{type:"select",label:ne,options:e.map(n=>({value:n.value,label:n.label}))})}function ni(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 Ma(){return z(Ho,i(bn,{}),ct,ct[0].value)}function Ka(){return _("mobile",kt(Uo,Ko))}function Ua(){return re("share",kt(),we)[M("share")]}function oi(){return _("mobile",K(dt,i(We,{}),be,Mo,1,be,"",{clear:{phoneFollows:!1,hint:be}}))}const Ft={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Wa(){const e=K(dt,i(We,{}),ut,Go,1,ut,"",{clear:{emptyLabel:"Auto"}}),t=re("columns",e,{...Ft,tablet:we.tablet}),n=re("columns",e,Ft,{phoneRow:oi()});return{...t,phoneRow:n.phoneRow}}function $a(e,t,n,o,r,a){return{type:"custom",render:({value:s,onChange:c})=>i(b,{label:l(e),icon:i(Ze,{noun:a}),action:i(S,{words:x()?.panel,label:l(e),changed:!pr(s),detail:l("the Text style in Styles"),onReset:()=>c(ur),defaultAction:{onPress:()=>c(dr),title:l("Keep this section's own built-in size"),icon:i(dn,{})}}),children:q({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Xa(){return{_gCellWidth:C("Cell width"),gridSpan:z("Positions",i(Ue,{}),[{label:"Auto",value:""},...Array.from({length:zt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function E(){let e=null,t=null;try{e=vt(ri),t=de(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const ri=Dt(null);function ii({min:e,max:t,step:n,px:o,label:r,onChange:a,desktopKey:s,fallback:c}){const d=E()[s],f=he(void 0,d,c);return i(F,{children:q({min:e,max:t,step:n,value:he(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:a})})}function li({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:a=()=>{}}){const s=E()[t],c=he(void 0,s,n);return i(S,{words:x()?.panel,label:l(e),changed:r,detail:V(d=>l(d),`${c}${o}`),onReset:a})}function ai(e){return Rt(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(ii,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const si={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},ci={Top:qe,Bottom:Ve,Left:ze,Right:Ye},di=e=>{const t=ci[e];return i(t,{})};function ja(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=y=>si[y],a=y=>K(r("Top"),i(qe,{}),R.min,R.max,R.step,y,"px"),s=(y,Z,k,ce=R)=>_("mobile",ai({label:r(y),icon:di(y),desktopKey:Z,min:ce.min,max:ce.max,step:ce.step,fallback:k})),c=e.top??R.min,d=e.bottom??R.min,f="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??R,u=e.side??p.min,m=e.sidePhone??u,g=e.phone===!0,O=y=>g?_("desktop",y):y;return j({...o?{_gSpacing:C("Padding")}:{},[t]:O(a(c)),...g?{[I(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:O(K(r("Bottom"),i(Ve,{}),R.min,R.max,R.step,d,"px")),...g?{[I(n)]:s("Bottom",n,d)}:{}},...e.sides?{[f]:O(K(r("Left"),i(ze,{}),p.min,p.max,p.step,u,"px")),...g?{[I(f)]:s("Left",f,m,p)}:{},[h]:O(K(r("Right"),i(Ye,{}),p.min,p.max,p.step,u,"px")),...g?{[I(h)]:s("Right",h,m,p)}:{}}:{}})}function Va(e,t){const n=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,a in e&&pe(s)?e[a]:s])),o={};let r=!1;for(const[a,s]of Object.entries(e)){if(a in t){r||Object.assign(o,n),r=!0;continue}o[a]=s}return r||Object.assign(o,n),o}const le="Width";function za(e,t=fr,n=!0){const o=t.map(r=>({label:hr[r],value:r}));return j({...n?{_gWidth:C(le)}:{},widthMode:{type:"custom",render:({onChange:r,field:a})=>i(b,{label:l(le),icon:i(En,{}),action:n?i(kr,{inherited:a?.inherited??!1,onReset:()=>r(mr),label:le}):void 0,children:Re({options:o,value:a?.currentValue||e,onChange:r,ariaLabel:le})})}})}function Ya(){const e=(o,r)=>({type:"custom",render:({value:a,onChange:s})=>i(ui,{value:a,onChange:s,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:a,field:s})=>i(fi,{value:r,onChange:a,unit:s?.unit,view:o})}),n=o=>{const r=Cr("Unit",i(Xe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const a=r.render;return{...r,render:s=>i(hi,{props:s,draw:a,view:o})}};return j({_gHeight:C($),...U("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(mi,{view:o,onClear:()=>r(void 0)}))),...U("sectionHeightValue",t),...U("sectionHeightUnit",n)})}function ui({value:e,onChange:t,view:n,badge:o}){const r=E(),a=c=>["auto","fixed","screen"].includes(c),s=ae(n,r)?.mode??"auto";return i(b,{label:$,icon:X(i(Sn,{})),action:o?o(t):void 0,children:Re({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:a(e)?e:s,onChange:t,ariaLabel:$})})}function Pt(e,t){return e==="phone"&&me(t)?Ao(t):Po(t)}function ae(e,t){return e==="desktop"||(e==="tablet"?me(t):Fo(t))?null:Pt(e,t)}const A=(e,t)=>e==="tablet"?M(t):I(t);function pi(e,t,n,o){const r=ae(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[A(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[A(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[A(e,"sectionHeightValue")]:r.value}:{},[A(e,n)]:o}}function At(e,t,n){const o=H(),r=ae(e,E());return!o||!r?{followed:null,write:n}:{followed:r,write:s=>o.onChangeMany(c=>{const d=pi(e,c,t,s);return d===null?{[e==="desktop"?t:A(e,t)]:s}:Object.keys(d).length?d:null})}}function fi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:a}=At(o,"sectionHeightValue",t),s=(r?r.unit:n)==="%"?"%":"px",c=s==="%"?Do:Bo;return i("div",{className:"sf-field",children:q({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:s,ariaLabel:$,onChange:a})})}function hi({props:e,draw:t,view:n}){const{followed:o,write:r}=At(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=E(),o=ae(e,n)===null,r=e==="phone"&&me(n),a=Pt(e,n),s=V(c=>l(c),a.mode==="auto"?l("Auto"):`${a.value}${a.unit}`,r?"tablet":"desktop");return i(S,{words:x()?.panel,label:l($),changed:o,detail:s,onReset:t})}function qa(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:a,name:s})=>i(xi,{value:o,onChange:r,labelId:`${a??s??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(gi,{value:o,onChange:r,view:n})});return{_gStick:C(ge),...U("stickTop",e),...U("stickTopDistance",t)}}function gi({value:e,onChange:t,view:n}){const o=H(),r=E(),a=n==="desktop"||Ee(n,r)?null:Lt(n,at(r)),s=a&&o?c=>o.onChangeMany(d=>{const f=bi(n,d,c);return f===null?{[A(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:q({min:te.min,max:te.max,step:te.step,value:a?null:typeof e=="number"?e:te.fallback,...a?{placeholder:a.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:s})})}function Ee(e,t){return e==="tablet"?No(t):Lo(t)}function Lt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function bi(e,t,n){return e==="desktop"||Ee(e,t)?null:n===void 0?{}:{[A(e,"stickTop")]:!0,[A(e,"stickTopDistance")]:n}}function xi({value:e,onChange:t,labelId:n,view:o}){const r=E(),a=at(r),s=o==="phone"?a.phone:o==="tablet"?a.tablet:e===!0,c=o==="phone"&&a.ownTablet,d=o==="desktop"?null:Lt(o,a),f=d?.on?`${d.distance}px`:l("Off");return i(b,{label:l(ge),labelId:n,icon:X(i(_n,{})),action:v(F,{children:[o!=="desktop"?i(S,{words:x()?.panel,label:l(ge),changed:Ee(o,r),detail:V(h=>l(h),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(fe,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const Nt="e.g. about";function Za(){return{_gAnchor:C("Anchor"),anchor:D({control:"plainText",label:"Name",placeholder:Nt},{type:"custom",render:({value:e,onChange:t})=>i(on,{value:e,onChange:t,nameBox:(n,o)=>i(B,{value:n,onChange:o,label:"Name",placeholder:Nt,hideable:!1,markup:!1})})})}}function Ja(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(b,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(eo,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Qa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-date`;return i(b,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(Qn,{id:c,value:Mt(typeof o=="string"?o:null),onChange:d=>r(d?Gt(d):"")})})}}}function Si(e,t,n,o){return{type:"custom",...T({},{...Y,label:e}),render:({value:r,onChange:a,id:s,name:c})=>{const d=typeof r=="boolean"?r:t,f=`${s??c??e}-label`;return i(b,{label:l(e),labelId:f,icon:n,hint:o===void 0?void 0:l(o),action:i(fe,{checked:d,onChange:a,ariaLabelledBy:f})})}}}function es(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(nt,{label:l("Background"),icon:i(wn,{}),id:r,value:On(e),onChange:t})}}}function ts(e,t){return{type:"custom",...T({},{...Y,label:e}),render:({value:n,onChange:o,id:r})=>{const a=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(b,{label:l(e),htmlFor:s,className:"sf-checkbox",action:i(qn,{id:s,checked:a,onChange:o})})}}}function ns(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(nt,{label:l(e),icon:n,value:o||t,onChange:r})}}function os(){return{type:"custom",render:({value:e,onChange:t})=>i(yi,{value:typeof e=="string"?e:"",onChange:t})}}function yi({value:e,onChange:t}){const{hex:n,n:o}=wi();return i(ot,{label:l("Fill"),icon:i($e,{}),value:e,inherited:n,resetTo:N(n.toUpperCase(),l("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function Ci(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return oe(n);const r=Pn(e,t);if(r.length===0)return null;const a=oe(xt(n));if(a!==null)return a;for(let s=r.length-1;s>0;s-=1){const c=oe(xt(r[s].sectionAccent));if(c!==null)return c}return oe(r[0].sectionAccent)}function wi(){const{colors:e,n:t}=Bt();return{hex:e.background,n:t}}function Bt(){const e=ft(L().theme),[t]=P("sectionAccent");let n=null;try{const{appState:r,selectedItem:a}=de(c=>c),s=a?.props?.id?String(a.props.id):void 0;n=s?Ci(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:jo(e.themes[o]),n:o+1}}const _i=[{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 Ri({label:e,value:t,onChange:n,points:o=_i}){const r=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return i(Yn,{label:l(e),value:t,points:r,onChange:n})}function rs(){return Tt()}const is={top:i(mn,{}),right:i(hn,{}),bottom:i(pn,{}),left:i(fn,{})};function ls(e,t,n,o,r,a,s){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(g=>g.cell===p);if(!u)return d(`missing-${p}`);const m=a?.[p];return m?{value:u.value,label:u.label,icon:m}:{value:u.value,label:u.label}},h=[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 m=t.some(g=>g.value===p)?p:n;return i(b,{label:l(e),icon:r,value:c(m)?.label?l(c(m).label):s?l(s):"",children:Ri({label:e,value:m,onChange:u,points:h})})}}}function as(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:a})=>i(Co,{label:e,options:(a.options??t).map(s=>({...s,label:l(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function ss(e,t,n,o){return{type:"custom",options:t,fallback:n,...T({},{type:"select",label:e}),render:({value:r,onChange:a,field:s})=>i(_o,{label:e,options:(s.options??t).map(c=>({...c,label:l(c.label)})),fallback:s.fallback??n,value:r,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function cs(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const ds=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function us(e,t,n){const o=Object.keys(Le).map(r=>({label:Le[r],value:r,picture:n[r]}));return{type:"custom",...T({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Ti,{label:e,icon:t,options:o,onChange:r})}}function Ti({label:e,icon:t,options:n,onChange:o}){const r=H()?.values??{},a=Kt(r),s=a==="frame"&&!!Ae(r.mediaVideo)&&!Ae(r.videoFrame);return i(b,{label:l(e),icon:X(t),hint:s?l("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:Re({options:n,value:a,onChange:o,ariaLabel:e})})}function ps(e,t,n,o={}){return{type:"custom",[ve]:!0,render:({value:r,onChange:a,name:s})=>i(yo,{value:r||"",onChange:a,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const fs={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ii(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 hs({value:e,onChange:t,label:n}){const o=e||{},r=H(),a=r?r.values!==r.node.props:!0,s=!!o.pending&&a,c=!!o.pending&&!a,d=s?"var(--ink-faint)":o.ok&&!c?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",f=!!xr(br()).geocode,h=Pe(),p=(u,m)=>t({...o,[u]:m??void 0});return v(F,{children:[i(b,{label:l(n),icon:i(je,{}),action:f?i(ee,{content:l("Find from the address (OpenStreetMap)"),children:i(et,{"aria-label":l("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Rn,{})})}):void 0,children:f&&o.status?i(ee,{content:Ii(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${nn}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:d},children:s?l("Finding…"):c?l(io):l(o.status)})}):null}),i(b,{label:l("Enter by hand"),labelId:h,icon:i(gn,{}),action:i(fe,{checked:!!o.manual,onChange:u=>t({...o,manual:u}),ariaLabelledBy:h})}),o.manual&&i(b,{label:l("Latitude, longitude"),icon:i(je,{}),children:v("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(tt,{value:typeof o.lat=="number"?o.lat:null,onChange:u=>p("lat",u),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(tt,{value:typeof o.lng=="number"?o.lng:null,onChange:u=>p("lng",u),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Ei(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Oi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,a)=>a===t?{text:n}:r)}function ms(e,t){return e===null?null:t>e?e:null}function ki(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 gs={label:"Ticker items",icon:i(Cn,{})};function bs(e,t,n,o){return{type:"custom",[w]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...T({},{...Ct.textList,label:e}),render:({value:r,onChange:a})=>i(Fi,{label:e,icon:X(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Fi({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:a=!1}){const s=J(null),[c,d]=W(null),f=p=>p.map(u=>({text:u?.text??""})),h=p=>{const u=ki(n,p,c);u===null&&(s.current=null),d(u),r(f(p))};return i(Kn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?i(rt,{target:s,value:Ei(n,c),onChange:p=>r(Oi(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,m)=>i("input",{type:"text",className:a&&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:g=>m({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,d(u)}})})}function xs(e,t){const n=`${e.label} — row ${t+1}`;return D({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(B,{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 Ss(e){return{_gCards:C("Cards"),coverIndex:z("Cover image",i(yn,{}),bo,String(xo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Gr("Image background",Qo),cardImage:Li()}}function ys(){return{outline:z("Card outline",i(Tn,{}),ho,go),indexBadge:z("Card number",i(Xe,{}),fo,mo),showBadge:Si("Product badge",!0,i(Ze,{noun:"tag"}))}}function Cs(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Y,label:se.find(a=>a.id===r).label}),o=r=>T(lo(Oe),n(r));return{_gShowOnCard:C("Show on a card"),[Oe]:T({type:"custom",render:()=>i(Pi,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Oe)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Oe="showCardPrice",se=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Pi({rest:e}){const t=E(),n=Mr(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],a=se.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(ke,{parts:se,changed:a,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(se.map(({id:s})=>[s,void 0])))})}function ws(e,t="display"){const n=I(t);return{[t]:_("desktop",{type:"custom",render:({value:o,onChange:r})=>i(ke,{parts:e,changed:Wn(o),shown:a=>$n(o,a),onPress:(a,s)=>r(Vn(o,a,s)),onReset:()=>r(void 0)})}),[n]:_("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Ai,{parts:e,desktopKey:t,value:o,onChange:r})})}}function ke({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:a,disabledReason:s}){const c=l("Display");return i(b,{label:c,icon:i(ln,{}),changed:t,action:i(S,{words:x()?.panel,label:c,changed:t,detail:a,onReset:r}),children:i(Un,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...s?{disabled:!0,disabledReason:l(s)}:{}})),onChange:o})})}function Ai({parts:e,desktopKey:t,value:n,onChange:o}){const r=E()[t];return i(ke,{parts:e,changed:jn(n),shown:a=>Xn(r,n,a),onPress:(a,s)=>o(zn(n,a,s)),onReset:()=>o(uo),detail:l("the same as Desktop")})}function Li(){return Rt("Card image",{min:G,max:Me,step:Xt,hint:"Rounds the picture. The card's own corner is in Styles."})}function _s(){return Ie({sidesKey:"cornerSides",step:jt,useFollowed:()=>G,mark:i(Ni,{label:Vt}),hint:l("Rounds the picture. Left alone it stays square.")})}function Ni({label:e,changed:t=!1,onReset:n=()=>{}}){return i(S,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function Rs(){return{type:"custom",render:({value:e,onChange:t})=>i(Hi,{value:typeof e=="string"?e:"",onChange:t})}}function Bi({layout:e,width:t}){return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:Zt(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const Di={width:"3.5rem",height:"2.5rem"},vi=200;function Hi({value:e,onChange:t}){const[n,o]=W(null),[r,a]=W(4),s=J(null);Ht(()=>{const u=s.current;if(!u||typeof ResizeObserver!="function")return;const m=()=>a(u.getBoundingClientRect().width>=vi?4:3);m();const g=new ResizeObserver(m);return g.observe(u),()=>g.disconnect()},[]);const c=e&&e in Q?e:"",d=Ke(n,c),f=Ke(n,"").length,h=Jt("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:h},...d.map(u=>({value:u,label:l(Q[u].label),icon:i(Bi,{layout:Q[u],width:40})}))];return i(b,{label:l("Layout"),icon:i(xn,{}),value:c?l(Q[c].label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(oo,{label:l("Layout"),value:c,emptyValue:"",options:p,onChange:t,columns:r,cell:Di,header:v("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(Dn,{options:[{id:"all",label:l("All")},...Yt.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:qt.length})})]})})})})}export{Pr as BOUND_TO_POST,ga as BOUND_TO_POST_NOTE,Ra as BUCKET_ICONS,fs as CUSTOM_FIELD_MEDIA,hs as CoordsField,St as DESKTOP_GAP_NOT_OVERLAP,ke as DisplayRow,is as EDGE_ARROWS,to as FOCAL_DEFAULT,_i as FOCAL_POINTS,ue as FOLD_FIELD_MARKER,Ri as FocalPicker,Aa as GroupLabel,Ar as HIGHLIGHT_HINT,B as HidableTextField,De as LINK_FIELD_MARKER,ia as Label,ve as MEDIA_FIELD_MARKER,ds as MEDIA_TYPE_OPTIONS,ba as NOT_BOUND_TO_POST,Pa as PanelBand,Br as PanelNoteLine,ri as RowPropsContext,He as SCAFFOLD_FIELD_MARKER,Os as SCALAR_TEXT_CONTROLS,_r as SiteGapDefaultReset,q as Slider,vr as Swatches,Es as TEXT_CONTROL_KINDS,w as TEXT_FIELD_MARKER,gs as TICKER_ITEMS_ROW,Fi as TextListField,le as WIDTH_LABEL,kr as WidthDefaultReset,ki as aimAfterListChange,Za as anchorFields,N as backTo,La as backgroundField,Ma as boxBlockSpacingField,Wa as boxColumnsFields,os as boxFillField,oi as boxPhoneRowField,kt as boxShareField,Ka as boxSharePhoneField,Ua as boxShareTabletField,Ci as boxThemeIndexOf,Ea as bucketHeader,va as buttonWordsEntryField,ei as cardCornersField,Gr as cardImageBackgroundField,Li as cardImageField,Ss as cardMediaFields,Ga as cardShapeFields,Cs as cardShowFields,ys as cardStyleFields,Xa as cellWidthFields,ts as checkbox,ns as colorInput,aa as containerDirectionField,Rr as containerGapField,Tr as containerGapPhoneField,la as containerGapRows,Ir as containerGapTabletField,Ii as coordsResultTip,Ca as copyText,It as cornerSidesField,Ie as cornersRowField,Qa as date,Ja as dateTime,Oa as designGroupHeader,ws as displayFields,ls as edgePad,ms as focusAfterRemove,rs as focusKeptField,ka as foldMarker,pe as foldMetaOf,Dr as foldTitleOf,pi as followedHeightPatch,bi as followedStickPatch,Rs as galleryLayoutField,Ya as heightFields,ae as heightFollowedBy,sa as heroGroupPlacementPoints,Be as hidableText,Nr as hintIsWhileTyping,_s as imageCornersField,ma as inOwnBox,Ia as isBucketHeader,Tt as keptBy,wa as linkField,us as loadingShowsField,as as multiSelect,es as pageBackgroundField,Ta as panelNote,ai as phoneOverrideField,ya as plainText,_a as plainTextarea,Rt as pxField,Fa as quietMarker,Ne as readHidable,Ei as rowText,ss as searchSelect,Da as sectionBorderField,$r as sectionCornersField,Ba as sectionShapeFields,Na as sectionThemeFields,Oi as setRowText,$a as sizeField,cs as sourceField,ja as spacingFields,qa as stickFields,Va as swapPadding,Ha as templateField,xa as text,Ut as textFieldIdentifier,ua as textFieldOffPage,fa as textFieldPanelOnly,bs as textList,xs as textListRowField,Sa as textarea,Si as toggle,ps as upload,Mr as useSelectedPatch,E as useSelectedProps,P as useSelectedSibling,wr as useSiteGapDetail,za as widthField,ha as withIdentifier,da as withOffPage,pa as withPanelOnly,ca as withScaffold};
@@ -0,0 +1,4 @@
1
+ export declare function darkenFields(): {
2
+ darken: import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
3
+ darkenStyle: import("efficient-easel/screen/lib/document/box-fields").SelectField;
4
+ };
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{OpacityIcon as n,StylesIcon as o}from"efficient-easel/icons";import{BOX_DARKEN as r,BOX_DARKEN_STYLES as t}from"../../../format/lib/content/box-background.js";import{select as a,slider as i}from"./box-fields.js";function c(){return{darken:i("Darken",e(n,{}),r.min,r.max,r.step,r.fallback,r.unit),darkenStyle:a("Darken style",e(o,{}),t,t[0].value)}}export{c as darkenFields};
@@ -1 +1 @@
1
- "use client";import{jsx as d,Fragment as v,jsxs as y}from"react/jsx-runtime";import{useEffect as I,useMemo as g,useRef as h}from"react";import{EaselCanvas as P,useEaselApi as T}from"efficient-easel/easel";import w from"../../components/PreviewThemeFrame.js";import{OpenDocumentChromeLoadNotice as F}from"../../components/PinnedChromeLoadNotice.js";import{SiteRestoreNotice as D}from"../../components/SiteRestoreNotice.js";import{usePreviewParts as E}from"efficient-easel/draw/client";import{partElement as k,partTypingTarget as x,setCanvasTypingPart as S}from"./canvas-typing.js";import{partThemeColors as A,readInks as W}from"../../../format/lib/document/part-inks.js";import{PART_ATTR as p}from"../../../render/lib/document/text-parts.js";import{useSectionOps as j}from"efficient-easel/screen/lib/document/use-section-ops";import{useBlockMetadata as B}from"../editor-block-metadata.js";import{usePreviewHeader as M,useSiteContentWidth as R}from"../../../render/components/PreviewHeaderContext.js";import{setEditorSiteContentWidth as C}from"../../../format/lib/document/editor-site-widths.js";import{siteWidthsMetadata as _}from"../../../format/lib/content/section-width.js";import{useEditorCanvasStyles as b}from"../editor-canvas-styles.js";function et(n){const{mirrorHostStyles:s}=b(),m=B(),{sectionBackgroundWidth:c,themeFromDocument:o}=M(),a=R(),u=g(()=>({...n.metadata??m??{},..._(o?null:c,a)}),[n.metadata,m,c,a,o]);I(()=>(C(a),()=>C(null)),[a]);const t=h(null),r=N(t),{onDocument:e}=n,i=l=>{t.current=l,e?.(l)};return y(v,{children:[d(D,{}),d(F,{}),d(P,{...n,onDocument:i,typing:r,metadata:u,height:"fill",mirrorStyles:s,frameWrapper:w})]})}function N(n){const s=T(),m=j(),c=E(),o=h({ops:m,parts:c});return o.current={ops:m,parts:c},g(()=>{const a={getItemById:t=>s.getState().getItemById(t),getSelectorForId:t=>s.getState().getSelectorForId(t),get components(){return s.getState().config.components},replace:(t,r,e)=>o.current.ops.replaceComponent(t,r,e)},u=(t,r)=>{const e=x(t,a);if(!e)return null;let i=r;const l=()=>(i=k(i,i?.ownerDocument??n.current,t),i),f=l();return f?{element:l,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,write:e.write,toolbar:{offered:e.offered,colors:e.offered.length>0?A(W(f)):void 0}}:null};return{at:t=>{const r=t.closest(`[${p}]`),e=r?.getAttribute(p);return r&&e?u(e,r):null},atSelection:()=>{const t=o.current.parts.selectedPartId;return t?u(t,null):null},onChange:t=>{if(!t.typing){S(null);return}const r=t.element.closest(`[${p}]`)?.getAttribute(p)??null;S(r),r&&o.current.parts.selectedPartId!==r&&o.current.parts.select(r)}}},[s,n])}export{et as SiteCanvas};
1
+ "use client";import{jsx as y,Fragment as $,jsxs as k}from"react/jsx-runtime";import{useEffect as x,useMemo as w,useRef as E}from"react";import{EaselCanvas as D,repeatCopyAt as _}from"efficient-easel/easel";import N from"../../components/PreviewThemeFrame.js";import{OpenDocumentChromeLoadNotice as W}from"../../components/PinnedChromeLoadNotice.js";import{SiteRestoreNotice as b}from"../../components/SiteRestoreNotice.js";import{decodePartId as F,REPEAT_ATTRIBUTE as g,REPEAT_INDEX_ATTRIBUTE as T}from"efficient-easel/draw";import{usePreviewParts as j}from"efficient-easel/draw/client";import{cssString as v,partElement as A,partTypingTarget as B,setCanvasTypingPart as S}from"./canvas-typing.js";import{usePartTypingDeps as M}from"../../components/usePartTypingDeps.js";import{copyRowTarget as K,copyRowValue as H,writeCopyText as L}from"./card-copy-rows.js";import{partColourName as O,partThemeColors as U,readInks as V}from"../../../format/lib/document/part-inks.js";import{PART_ATTR as f}from"../../../render/lib/document/text-parts.js";import{useBlockMetadata as q}from"../editor-block-metadata.js";import{usePreviewHeader as X,useSiteContentWidth as z}from"../../../render/components/PreviewHeaderContext.js";import{setEditorSiteContentWidth as R}from"../../../format/lib/document/editor-site-widths.js";import{siteWidthsMetadata as G}from"../../../format/lib/content/section-width.js";import{useEditorCanvasStyles as J}from"../editor-canvas-styles.js";function gt(o){const{mirrorHostStyles:s}=J(),l=q(),{sectionBackgroundWidth:i,themeFromDocument:u}=X(),t=z(),r=w(()=>({...o.metadata??l??{},...G(u?null:i,t)}),[o.metadata,l,i,t,u]);x(()=>(R(t),()=>R(null)),[t]);const e=E(null),c=Q(e),{onDocument:m}=o,n=a=>{e.current=a,m?.(a)};return k($,{children:[y(b,{}),y(W,{}),y(D,{...o,onDocument:n,typing:c,metadata:r,height:"fill",mirrorStyles:s,frameWrapper:N})]})}function Q(o){const s=M(),l=j(),i=E({parts:l});return i.current={parts:l},w(()=>{const u=(t,r)=>{let e=B(t,s),c,m=null;const n=r??(e?null:A(null,o.current,t)),a=!e&&n?_(n):null,p=a?F(t):null;if(a&&n&&p?.propKey){e=K({...a,nodeId:p.nodeId,key:p.propKey},s),c=p.propKey;const P=n.closest(`[${g}][${T}]`),I=`[${g}="${v(P?.getAttribute(g)??"")}"][${T}="${v(P?.getAttribute(T)??"")}"]`;m=()=>(n.ownerDocument??o.current)?.querySelector(I)??null}if(!e)return null;let d=n;const C=()=>(d=A(d,m?m():d?.ownerDocument??o.current,t),d),h=C();return h?{element:C,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,write:e.write,key:c,toolbar:{offered:e.offered,colors:e.offered.length>0?U(V(h)):void 0,colorNameOf:O}}:null};return{at:t=>{const r=t.closest(`[${f}]`),e=r?.getAttribute(f);return r&&e?u(e,r):null},atSelection:()=>{const t=i.current.parts.selectedPartId;return t?u(t,null):null},onCopyText:t=>L(t,s),copyValue:t=>H(t,s),onChange:t=>{if(!t.typing){S(null);return}const r=t.element.closest(`[${f}]`)?.getAttribute(f)??null;S(r),r&&i.current.parts.selectedPartId!==r&&i.current.parts.select(r)}}},[s,o])}export{gt as SiteCanvas};
@@ -1 +1 @@
1
- import o from"../../../components/PreviewPartAnchors.js";import{animationTabFields as r}from"../../animation/fields.js";import{BLOCK_THEME_FOLLOW_LABEL as e,SECTION_THEME_FOLLOW_LABEL as s}from"../../../components/SectionThemePicker.js";import{anchorFields as t,cardShapeFields as d,cellWidthFields as m,heightFields as l,sectionShapeFields as p,sectionThemeFields as F,spacingFields as a,stickFields as n,widthField as c}from"../controls.js";import{blockSizeFieldSet as S}from"efficient-easel/screen/lib/document/block-size-fields";import{rowSay as h,sidesPaddingFields as f}from"../box-fields.js";import{assignSectionGroups as E}from"../field-groups.js";import{boxGutterFields as L}from"../box-gutter-field.js";import{dropEmptyHeadings as O}from"../panel-drop-empty-headings.js";import{rowsShownForNode as _}from"../show-when-resolve.js";const H={spacingFields:a,sidesPaddingFields:f,sectionShapeFields:p,cardShapeFields:d,cellWidthFields:m,widthField:c,boxGutterFields:L,heightFields:l,anchorFields:t,stickFields:n,sectionThemeFields:F,animationTabFields:r,blockSizeFields:i=>S({...i,say:h}),assignSectionGroups:E,dropEmptyHeadings:O,rowsShownForNode:_,SECTION_THEME_FOLLOW_LABEL:s,BLOCK_THEME_FOLLOW_LABEL:e,PartAnchors:o};export{H as PASS_INSPECTOR};
1
+ import r from"../../../components/PreviewPartAnchors.js";import{animationTabFields as e}from"../../animation/fields.js";import{BLOCK_THEME_FOLLOW_LABEL as s,SECTION_THEME_FOLLOW_LABEL as t}from"../../../components/SectionThemePicker.js";import{anchorFields as m,cardShapeFields as d,cellWidthFields as p,heightFields as l,sectionShapeFields as F,sectionThemeFields as a,spacingFields as n,stickFields as S,widthField as c}from"../controls.js";import{blockSizeFieldSet as h}from"efficient-easel/screen/lib/document/block-size-fields";import{VIEW_KEY_ACCESS as E}from"efficient-easel/screen/lib/document/box-fields";import{rowSay as f,sidesPaddingFields as L}from"../box-fields.js";import{assignSectionGroups as _}from"../field-groups.js";import{boxGutterFields as O}from"../box-gutter-field.js";import{dropEmptyHeadings as A}from"../panel-drop-empty-headings.js";import{rowsShownForNode as P}from"../show-when-resolve.js";const N={spacingFields:n,sidesPaddingFields:L,sectionShapeFields:F,cardShapeFields:d,cellWidthFields:p,widthField:c,boxGutterFields:O,heightFields:l,anchorFields:m,stickFields:S,sectionThemeFields:a,animationTabFields:e,blockSizeFields:({tablet:i,...o}={})=>h({...o,say:f,...i?{phone:E}:{}}),assignSectionGroups:_,dropEmptyHeadings:A,rowsShownForNode:P,SECTION_THEME_FOLLOW_LABEL:t,BLOCK_THEME_FOLLOW_LABEL:s,PartAnchors:r};export{N as PASS_INSPECTOR};
@@ -0,0 +1,8 @@
1
+ export interface StoredPick {
2
+ name: string;
3
+ value: string;
4
+ }
5
+ export declare function storedPickRow(pick: StoredPick, gone: boolean): {
6
+ label: string;
7
+ value: string;
8
+ };
@@ -0,0 +1 @@
1
+ import{say as n}from"../lib/editor-words.js";function m(a,e){return{label:e?n("{name} (unavailable)",{name:a.name}):a.name,value:a.value}}export{m as storedPickRow};
@@ -1,6 +1,7 @@
1
1
  import { type ShowWhenRule } from "efficient-shell/format";
2
2
  export declare const HOVER_KEY = "hover";
3
- export declare const HOVER_KINDS: readonly ["none", "nextImage", "rotate", "zoom", "lift"];
3
+ export declare const HOVER_GROUP_KEY = "_gHover";
4
+ export declare const HOVER_KINDS: readonly ["none", "nextImage", "rotate", "zoom", "lift", "mono"];
4
5
  export type HoverKind = (typeof HOVER_KINDS)[number];
5
6
  export declare const HOVER_KIND_LABELS: Readonly<Record<HoverKind, string>>;
6
7
  export type PartHover = Extract<HoverKind, "none" | "lift">;
@@ -26,10 +27,40 @@ export declare const CARD_HOVER_TURN: number;
26
27
  export type CardHoverDrawn = {
27
28
  kind: CardHover;
28
29
  angle: number | null;
30
+ angleSet?: boolean;
29
31
  duration: number;
30
32
  delay: number;
31
33
  };
32
34
  export declare function cardHoverKindOf(record: Readonly<Record<string, unknown>>, resting: CardHover): CardHover;
33
35
  export declare function cardHoverAngleOf(stored: unknown): number;
34
36
  export declare function cardHoverOf(record: Readonly<Record<string, unknown>>, blockKey: string): CardHoverDrawn;
37
+ export declare function cardTurnFor(hover: CardHoverDrawn, spokes: unknown): CardHoverDrawn;
35
38
  export declare function cardRotatesRule(resting: CardHover): ShowWhenRule;
39
+ export type PictureHover = Extract<HoverKind, "none" | "nextImage" | "mono">;
40
+ export declare const PICTURE_HOVER_KINDS: readonly PictureHover[];
41
+ export declare const NEXT_PICTURE_HOVER_KINDS: readonly PictureHover[];
42
+ export declare const PICTURE_HOVER_BLOCKS: readonly string[];
43
+ export declare function pictureHoverResting(blockKey: string): PictureHover;
44
+ export type PictureHoverDrawn = {
45
+ kind: PictureHover;
46
+ duration: number;
47
+ delay: number;
48
+ zoom?: string | null;
49
+ darken?: number | null;
50
+ };
51
+ export declare const PICTURE_HOVER_KEYS: {
52
+ readonly zoom: "hoverZoom";
53
+ readonly darken: "hoverDarken";
54
+ };
55
+ export declare const PICTURE_HOVER_ZOOM: {
56
+ readonly min: 100;
57
+ readonly max: 150;
58
+ readonly step: 1;
59
+ readonly unit: "%";
60
+ };
61
+ export declare function pictureHoverZoomOf(record: Readonly<Record<string, unknown>>, kind: string): string | null;
62
+ export declare const NEXT_PICTURE_BLOCKS: readonly string[];
63
+ export declare function pictureHoverKindOf(record: Readonly<Record<string, unknown>>, resting: PictureHover, kinds?: readonly PictureHover[]): PictureHover;
64
+ export declare function pictureHoverOf(record: Readonly<Record<string, unknown>>, blockKey?: string): PictureHoverDrawn;
65
+ export declare function pictureHoverMovesRule(): ShowWhenRule;
66
+ export declare function pictureHoverRunsRule(resting: PictureHover): ShowWhenRule;
@@ -1 +1 @@
1
- import{HOVER_MOTION as f,motionSeconds as a}from"efficient-shell/format";import{finiteNumber as R}from"../finite-number.js";const l="hover",x=["none","nextImage","rotate","zoom","lift"],D={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift"};function s(t){return x.filter(n=>t.includes(n))}const O=s(["none","lift"]);function g(t){const n=t[l];return O.includes(n)?n:"none"}const d=s(["none","rotate"]),o={kind:l,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},i="spinOnHover",c={min:0,max:360,step:1},u={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},A=Object.keys(u);function p(t){return u[t]??"none"}const _=f.rotateFallbackDeg;function m(t,n){const r=t[o.kind];if(d.includes(r))return r;const e=t[i];return typeof e=="boolean"?e?"rotate":"none":n}function E(t){const n=R(t);return n===void 0?_:Math.min(c.max,Math.max(c.min,n))}function N(t,n){const r=p(n),e=m(t,r);return{kind:e,angle:e==="rotate"?E(t[o.angle]):null,duration:a("hover","duration",e==="rotate"?t[o.duration]:void 0),delay:a("hover","delay",e==="rotate"?t[o.delay]:void 0)}}function h(t){const n={field:o.kind,in:[...d]};return{any:[{field:o.kind,is:"rotate"},{all:[{not:n},t==="rotate"?{not:{field:i,is:!1}}:{field:i,is:!0}]}]}}export{c as CARD_HOVER_ANGLE,o as CARD_HOVER_KEYS,d as CARD_HOVER_KINDS,A as CARD_HOVER_SECTIONS,_ as CARD_HOVER_TURN,l as HOVER_KEY,x as HOVER_KINDS,D as HOVER_KIND_LABELS,i as OLD_SPIN_KEY,O as PART_HOVER_KINDS,E as cardHoverAngleOf,m as cardHoverKindOf,N as cardHoverOf,p as cardHoverResting,h as cardRotatesRule,g as hoverOf};
1
+ import{HOVER_MOTION as E,motionSeconds as a,rotateDegrees as H}from"efficient-shell/format";import{finiteNumber as u}from"../finite-number.js";const i="hover",P="_gHover",I=["none","nextImage","rotate","zoom","lift","mono"],L={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"};function c(n){return I.filter(e=>n.includes(e))}const g=c(["none","lift"]);function M(n){const e=n[i];return g.includes(e)?e:"none"}const p=c(["none","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},s="spinOnHover",R={min:0,max:360,step:1},x={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},U=Object.keys(x);function v(n){return x[n]??"none"}const S=E.rotateFallbackDeg;function k(n,e){const o=n[r.kind];if(p.includes(o))return o;const t=n[s];return typeof t=="boolean"?t?"rotate":"none":e}function D(n){const e=u(n);return e===void 0?S:Math.min(R.max,Math.max(R.min,e))}function B(n,e){const o=v(e),t=k(n,o);return{kind:t,angle:t==="rotate"?D(n[r.angle]):null,angleSet:t==="rotate"&&u(n[r.angle])!==void 0,duration:a("hover","duration",t==="rotate"?n[r.duration]:void 0),delay:a("hover","delay",t==="rotate"?n[r.delay]:void 0)}}function G(n,e){return n.kind!=="rotate"||n.angleSet?n:{...n,angle:H(u(e))}}function z(n){const e={field:r.kind,in:[...p]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:e},n==="rotate"?{not:{field:s,is:!1}}:{field:s,is:!0}]}]}}const m=c(["none","mono"]),N=c(["none","nextImage","mono"]),O={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},Y=Object.keys(O);function V(n){return O[n]??"none"}const _={zoom:"hoverZoom",darken:"hoverDarken"},d={min:100,max:150,step:1,unit:"%"},l=["nextImage"];function C(n,e){if(!l.includes(e))return null;const o=u(n[_.zoom]);if(o===void 0)return null;const t=Math.min(d.max,Math.max(d.min,o));return t===d.min?null:String(t/100)}function T(n,e){if(!l.includes(e))return null;const o=u(n[_.darken]);return o!==void 0&&o>0?o:null}const h=["ImageBlock"];function K(n,e,o=m){const t=n[i];return o.includes(t)?t:e}function b(n,e=""){const o=h.includes(e)?N:m,t=K(n,V(e),o),f=t!=="none";return{kind:t,duration:a("hover","duration",f?n[r.duration]:void 0),delay:a("hover","delay",f?n[r.delay]:void 0),...l.includes(t)?{zoom:C(n,t),darken:T(n,t)}:{}}}function Z(){return{field:i,in:[...l]}}function w(n){return n==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}export{R as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,p as CARD_HOVER_KINDS,U as CARD_HOVER_SECTIONS,S as CARD_HOVER_TURN,P as HOVER_GROUP_KEY,i as HOVER_KEY,I as HOVER_KINDS,L as HOVER_KIND_LABELS,h as NEXT_PICTURE_BLOCKS,N as NEXT_PICTURE_HOVER_KINDS,s as OLD_SPIN_KEY,g as PART_HOVER_KINDS,Y as PICTURE_HOVER_BLOCKS,_ as PICTURE_HOVER_KEYS,m as PICTURE_HOVER_KINDS,d as PICTURE_HOVER_ZOOM,D as cardHoverAngleOf,k as cardHoverKindOf,B as cardHoverOf,v as cardHoverResting,z as cardRotatesRule,G as cardTurnFor,M as hoverOf,K as pictureHoverKindOf,Z as pictureHoverMovesRule,b as pictureHoverOf,V as pictureHoverResting,w as pictureHoverRunsRule,C as pictureHoverZoomOf};
@@ -15,7 +15,9 @@ export type BorderValue = {
15
15
  };
16
16
  export declare const SECTION_BORDER_CLASS = "sf-section-border";
17
17
  export declare const SECTION_BORDER_SELF_CLASS = "sf-section-border-self";
18
- export declare function borderVars(value: BorderValue | null | undefined, { phone }?: {
18
+ export declare function borderVars(value: BorderValue | null | undefined, { phone, tablet }?: {
19
19
  phone?: boolean;
20
+ tablet?: boolean;
20
21
  }): Record<string, string> | undefined;
21
- export declare function sectionBorderStyle(desktop: BorderValue | null | undefined, phone: BorderValue | null | undefined): CSSProperties | undefined;
22
+ export declare function borderBySide(value: BorderValue): BorderValue;
23
+ export declare function sectionBorderStyle(desktop: BorderValue | null | undefined, phone: BorderValue | null | undefined, tablet?: BorderValue | null): CSSProperties | undefined;
@@ -1 +1 @@
1
- const E=20,i=["solid","dashed","dotted"],c=["top","right","bottom","left"],R="sf-section-border",S="sf-section-border-self",p=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,d=t=>typeof t=="number"&&Number.isFinite(t)?`${Math.min(20,Math.max(0,Math.round(t)))}px`:void 0;function f(t,{phone:n=!1}={}){if(!t||typeof t!="object")return;const e=n?"-phone":"",o={};for(const r of c){const s=d(t[r])??d(t.width);s!==void 0&&(o[`--sf-border-${r}-width${e}`]=s)}return typeof t.style=="string"&&i.includes(t.style)&&(o[`--sf-border-style${e}`]=t.style),typeof t.color=="string"&&p.test(t.color)&&(o[`--sf-border-color${e}`]=t.color.toLowerCase()),Object.keys(o).length?o:void 0}function b(t,n){const e=f(t),o=f(n,{phone:!0});return e||o?{...e,...o}:void 0}export{E as BORDER_MAX,c as BORDER_SIDES,i as BORDER_STYLES,R as SECTION_BORDER_CLASS,S as SECTION_BORDER_SELF_CLASS,f as borderVars,b as sectionBorderStyle};
1
+ const b=20,p=["solid","dashed","dotted"],i=["top","right","bottom","left"],h="sf-section-border",E="sf-section-border-self",u=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,c=t=>typeof t=="number"&&Number.isFinite(t)?`${Math.min(20,Math.max(0,Math.round(t)))}px`:void 0;function s(t,{phone:n=!1,tablet:o=!1}={}){if(!t||typeof t!="object")return;const e=n?"-phone":o?"-tablet":"",r={};for(const f of i){const d=c(t[f])??c(t.width);d!==void 0&&(r[`--sf-border-${f}-width${e}`]=d)}return typeof t.style=="string"&&p.includes(t.style)&&(r[`--sf-border-style${e}`]=t.style),typeof t.color=="string"&&u.test(t.color)&&(r[`--sf-border-color${e}`]=t.color.toLowerCase()),Object.keys(r).length?r:void 0}function S(t){const{width:n,...o}=t;return typeof n!="number"?t:{...o,...Object.fromEntries(i.map(e=>[e,o[e]??n]))}}function y(t,n,o){const e=s(t),r=s(o,{tablet:!0}),f=s(o,{phone:!0})||s(n,{phone:!0})?{...s(o,{phone:!0}),...s(n,{phone:!0})}:void 0;return e||r||f?{...e,...r,...f}:void 0}export{b as BORDER_MAX,i as BORDER_SIDES,p as BORDER_STYLES,h as SECTION_BORDER_CLASS,E as SECTION_BORDER_SELF_CLASS,S as borderBySide,s as borderVars,y as sectionBorderStyle};
@@ -38,6 +38,17 @@ export declare const BOX_SHARE_POINTS: readonly [{
38
38
  }];
39
39
  export type BoxShare = (typeof BOX_SHARE_POINTS)[number]["value"];
40
40
  export declare function boxShareClasses(share: unknown): string;
41
+ export declare function boxShareTabletOf(shareTablet: unknown): string | null;
42
+ export declare function boxRowTabletShareClass(box: {
43
+ direction?: unknown;
44
+ separator?: unknown;
45
+ loop?: unknown;
46
+ line?: unknown;
47
+ columns?: unknown;
48
+ columnsTablet?: unknown;
49
+ share?: unknown;
50
+ shareTablet?: unknown;
51
+ }): string;
41
52
  export declare function boxFitContentClass(share: unknown): string;
42
53
  export declare const BOX_PHONE_ROW_LABEL = "Columns";
43
54
  export declare const BOX_PHONE_ROW_MIN = 1;
@@ -1 +1 @@
1
- import{isStripBox as s}from"./box-separator.js";const k={sectionPaddingTop:0,sectionPaddingBottom:0},o={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},r={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function A(e,t){const w=typeof e=="string"&&e in o?o[e]:"",n=typeof t=="string"&&t in r?r[t]:"";return[w,n].filter(Boolean).join(" ")}function B(e){return e===!0||e==="wrap"?"flex-wrap":""}const N="Block widths",c=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Big left",value:"bigLeft",weights:[2,1]},{label:"Big right",value:"bigRight",weights:[1,2]},{label:"Bigger left",value:"biggerLeft",weights:[3,1]},{label:"Bigger right",value:"biggerRight",weights:[1,3]},{label:"2 : 3",value:"twoThree",weights:[2,3]}],i="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",p={equal:i,bigLeft:`${i} [&>*:first-child]:view-wide:grow-[2]`,bigRight:`${i} [&>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${i} [&>*:first-child]:view-wide:grow-[3]`,biggerRight:`${i} [&>*:last-child]:view-wide:grow-[3]`,twoThree:`${i} [&>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3]`};function x(e){return typeof e=="string"?p[e]??"":""}const _="[&>*]:view-wide:basis-[content]";function E(e){return x(e)===""?_:""}const P="Columns",R=1,T=3,v={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},X=c.filter(e=>e.value==="content"||e.value==="equal"),H="equal",I=1,$=6,a="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0!",d={1:`${a} [&>*]:view-wide:basis-[calc(100%/1)]!`,2:`${a} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${a} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${a} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${a} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${a} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function b(e){return typeof e=="number"?d[e]??"":""}const f={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function m(e){return typeof e=="number"?f[e]??"":""}function y(e){return e.direction!=="row"||s(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":m(e.columnsTablet)}function W(e){return e.direction!=="row"||s(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":b(e.columns)}const g="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]",h={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},u="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]";function O(e){return e===!1||e==="nowrap"}function M(e,t,w){const n=v[Number(e)];if(!n)return"max-view-wide:flex-col";const l=O(w);return S(e,t)?l?u:g:l?h[Number(e)]:n}function S(e,t){return Number(e)in v&&t==="content"}const F="Block spacing",U=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],C="sf-box-gap-only";function G(e){return e==="gap"?C:""}export{r as BOX_ALIGN_CLASS,F as BOX_BLOCK_SPACING_LABEL,U as BOX_BLOCK_SPACING_POINTS,$ as BOX_COLUMNS_MAX,I as BOX_COLUMNS_MIN,C as BOX_GAP_ONLY_CLASS,P as BOX_PHONE_ROW_LABEL,T as BOX_PHONE_ROW_MAX,R as BOX_PHONE_ROW_MIN,N as BOX_SHARE_LABEL,H as BOX_SHARE_PHONE_DEFAULT,X as BOX_SHARE_PHONE_POINTS,c as BOX_SHARE_POINTS,k as NESTED_BOX_PADDING,G as boxBlockSpacingClass,b as boxColumnsClass,E as boxFitContentClass,A as boxLayoutClasses,M as boxPhoneRowClasses,S as boxPhoneRowFits,O as boxPhoneRowOneLine,W as boxRowColumnsClass,y as boxRowTabletColumnsClass,x as boxShareClasses,m as boxTabletColumnsClass,B as boxWrapClass};
1
+ import{isStripBox as o}from"./box-separator.js";const N={sectionPaddingTop:0,sectionPaddingBottom:0},r={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function T(e,t){const w=typeof e=="string"&&e in r?r[e]:"",l=typeof t=="string"&&t in c?c[t]:"";return[w,l].filter(Boolean).join(" ")}function R(e){return e===!0||e==="wrap"?"flex-wrap":""}const P="Block widths",b=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Big left",value:"bigLeft",weights:[2,1]},{label:"Big right",value:"bigRight",weights:[1,2]},{label:"Bigger left",value:"biggerLeft",weights:[3,1]},{label:"Bigger right",value:"biggerRight",weights:[1,3]},{label:"2 : 3",value:"twoThree",weights:[2,3]}],i="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",h={equal:i,bigLeft:`${i} [&>*:first-child]:view-wide:grow-[2]`,bigRight:`${i} [&>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${i} [&>*:first-child]:view-wide:grow-[3]`,biggerRight:`${i} [&>*:last-child]:view-wide:grow-[3]`,twoThree:`${i} [&>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3]`};function m(e){return typeof e=="string"?h[e]??"":""}const v="view-tablet:max-view-desktop:flex-row!",a=`${v} [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-0!`,p={content:`${v} [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[content]!`,equal:a,bigLeft:`${a} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,bigRight:`${a} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,biggerLeft:`${a} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,biggerRight:`${a} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,twoThree:`${a} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`};function f(e){return typeof e=="string"&&e in p?e:null}function X(e){if(e.direction!=="row"||o(e.direction,e.separator)||e.loop==="scroll"||e.line===!0||x(e.columns)!==""||_(e.columnsTablet)!=="")return"";const t=f(e.shareTablet);return t===null?"":p[t]}const g="[&>*]:view-wide:basis-[content]";function $(e){return m(e)===""?g:""}const H="Columns",I=1,y=3,d={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},W=b.filter(e=>e.value==="content"||e.value==="equal"),M="equal",U=1,F=6,n="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0!",u={1:`${n} [&>*]:view-wide:basis-[calc(100%/1)]!`,2:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function x(e){return typeof e=="number"?u[e]??"":""}const S={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function _(e){return typeof e=="number"?S[e]??"":""}function q(e){return e.direction!=="row"||o(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":_(e.columnsTablet)}function G(e){return e.direction!=="row"||o(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":x(e.columns)}const O="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]",k={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},L="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]";function C(e){return e===!1||e==="nowrap"}function j(e,t,w){const l=d[Number(e)];if(!l)return"max-view-wide:flex-col";const s=C(w);return A(e,t)?s?L:O:s?k[Number(e)]:l}function A(e,t){return Number(e)in d&&t==="content"}const D="Block spacing",K=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],B="sf-box-gap-only";function Q(e){return e==="gap"?B:""}export{c as BOX_ALIGN_CLASS,D as BOX_BLOCK_SPACING_LABEL,K as BOX_BLOCK_SPACING_POINTS,F as BOX_COLUMNS_MAX,U as BOX_COLUMNS_MIN,B as BOX_GAP_ONLY_CLASS,H as BOX_PHONE_ROW_LABEL,y as BOX_PHONE_ROW_MAX,I as BOX_PHONE_ROW_MIN,P as BOX_SHARE_LABEL,M as BOX_SHARE_PHONE_DEFAULT,W as BOX_SHARE_PHONE_POINTS,b as BOX_SHARE_POINTS,N as NESTED_BOX_PADDING,Q as boxBlockSpacingClass,x as boxColumnsClass,$ as boxFitContentClass,T as boxLayoutClasses,j as boxPhoneRowClasses,A as boxPhoneRowFits,C as boxPhoneRowOneLine,G as boxRowColumnsClass,q as boxRowTabletColumnsClass,X as boxRowTabletShareClass,m as boxShareClasses,f as boxShareTabletOf,_ as boxTabletColumnsClass,R as boxWrapClass};
@@ -7,4 +7,5 @@ export declare const BOX_SHAPE_OPTIONS: readonly {
7
7
  export declare function boxShapeOf(value: unknown): BoxShape;
8
8
  export declare function boxShapeClass(value: unknown): string;
9
9
  export declare function boxShapePhoneOf(desktop: unknown, phone: unknown): BoxShape | null;
10
- export declare function boxShapeClasses(desktop: unknown, phone: unknown): string;
10
+ export declare function boxShapeTabletOf(tablet: unknown): BoxShape | null;
11
+ export declare function boxShapeClasses(desktop: unknown, phone: unknown, tablet?: unknown): string;
@@ -1 +1 @@
1
- import{galleryCardRatioClass as o}from"./gallery-card-layout.js";const u=["auto","tall","square","landscape","wide"],d=[{label:"Auto",value:"auto"},{label:"Tall (3:4)",value:"tall"},{label:"Square (1:1)",value:"square"},{label:"Landscape (4:3)",value:"landscape"},{label:"Wide (2:1)",value:"wide"}];function t(e){return u.includes(String(e??""))?e:"auto"}function n(e){const a=t(e);return a==="auto"?"":o(a)}const s={tall:"view-wide:aspect-[3/4]",square:"view-wide:aspect-square",landscape:"view-wide:aspect-[4/3]",wide:"view-wide:aspect-[2/1]"},r={auto:"max-view-wide:aspect-auto",tall:"max-view-wide:h-auto max-view-wide:aspect-[3/4]",square:"max-view-wide:h-auto max-view-wide:aspect-square",landscape:"max-view-wide:h-auto max-view-wide:aspect-[4/3]",wide:"max-view-wide:h-auto max-view-wide:aspect-[2/1]"};function w(e,a){return u.includes(String(a??""))?a===t(e)?null:a:null}function p(e,a){const i=w(e,a);if(i===null)return n(e);const l=t(e);return[l==="auto"?"":s[l],r[i]].filter(Boolean).join(" ")}export{u as BOX_SHAPES,d as BOX_SHAPE_OPTIONS,n as boxShapeClass,p as boxShapeClasses,t as boxShapeOf,w as boxShapePhoneOf};
1
+ import{galleryCardRatioClass as n}from"./gallery-card-layout.js";const l=["auto","tall","square","landscape","wide"],b=[{label:"Auto",value:"auto"},{label:"Tall (3:4)",value:"tall"},{label:"Square (1:1)",value:"square"},{label:"Landscape (4:3)",value:"landscape"},{label:"Wide (2:1)",value:"wide"}];function o(e){return l.includes(String(e??""))?e:"auto"}function u(e){const a=o(e);return a==="auto"?"":n(a)}const r={tall:"view-wide:aspect-[3/4]",square:"view-wide:aspect-square",landscape:"view-wide:aspect-[4/3]",wide:"view-wide:aspect-[2/1]"},c={auto:"max-view-wide:aspect-auto",tall:"max-view-wide:h-auto max-view-wide:aspect-[3/4]",square:"max-view-wide:h-auto max-view-wide:aspect-square",landscape:"max-view-wide:h-auto max-view-wide:aspect-[4/3]",wide:"max-view-wide:h-auto max-view-wide:aspect-[2/1]"};function d(e,a){return l.includes(String(a??""))?a===o(e)?null:a:null}const p={auto:"view-tablet:max-view-desktop:aspect-auto!",tall:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[3/4]!",square:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-square!",landscape:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[4/3]!",wide:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[2/1]!"};function v(e){return l.includes(String(e??""))?e:null}function m(e,a,w){const t=v(w),i=d(e,l.includes(String(a??""))?a:t);if(i===null&&t===null)return u(e);const s=o(e);return[i===null?u(e):s==="auto"?"":r[s],i===null?"":c[i],t===null?"":p[t]].filter(Boolean).join(" ")}export{l as BOX_SHAPES,b as BOX_SHAPE_OPTIONS,u as boxShapeClass,m as boxShapeClasses,o as boxShapeOf,d as boxShapePhoneOf,v as boxShapeTabletOf};
@@ -8,4 +8,4 @@ export declare function buttonIconChoice(icon: unknown, arrow: unknown): ButtonI
8
8
  export declare function buttonIconSide(value: unknown): ButtonIconSide;
9
9
  export declare function buttonIconAtEnd(side: unknown, width: unknown): boolean;
10
10
  export declare function buttonWidth(value: unknown): ButtonWidth;
11
- export declare function buttonWidthClass(desktop: unknown, phone: unknown): string;
11
+ export declare function buttonWidthClass(desktop: unknown, phone: unknown, tablet?: unknown): string;
@@ -1 +1 @@
1
- import{buttonArrowShown as f}from"./button-arrow.js";import{nonEmptyString as u}from"../non-empty-string.js";const c=["none","arrow-right","arrow-long-right","arrow-up-right","chevron-right","external","cart","bag","tag","email","location","play","download","search","car"];function l(t){return typeof t=="string"&&c.includes(t)?t:void 0}function w(t,o){return l(t)??(f(o)?"arrow-right":"none")}function d(t){return t==="before"?"before":t==="end"?"end":"after"}function h(t,o){return d(t)==="end"&&n(o)==="fill"}function n(t){return t==="fill"||t==="fixed"?"fill":"fit"}function s(t,o){const r=n(t),e=r==="fill"?["w-full"]:[];if(u(o)){const i=n(o);i!==r&&e.push(i==="fill"?"max-view-wide:w-full":"max-view-wide:w-auto")}return e.join(" ")}export{c as BUTTON_ICONS,h as buttonIconAtEnd,w as buttonIconChoice,d as buttonIconSide,n as buttonWidth,s as buttonWidthClass,l as storedButtonIcon};
1
+ import{buttonArrowShown as w}from"./button-arrow.js";import{nonEmptyString as i}from"../non-empty-string.js";const a=["none","arrow-right","arrow-long-right","arrow-up-right","chevron-right","external","cart","bag","tag","email","location","play","download","search","car"];function c(t){return typeof t=="string"&&a.includes(t)?t:void 0}function x(t,o){return c(t)??(w(o)?"arrow-right":"none")}function d(t){return t==="before"?"before":t==="end"?"end":"after"}function b(t,o){return d(t)==="end"&&e(o)==="fill"}function e(t){return t==="fill"||t==="fixed"?"fill":"fit"}function m(t,o,l){const r=e(t);if(i(l)){const n=e(l),u=i(o)?e(o):n;return[r==="fill"?"view-desktop:w-full":"view-desktop:w-auto",n==="fill"?"view-tablet:max-view-desktop:w-full":"view-tablet:max-view-desktop:w-auto",u==="fill"?"max-view-tablet:w-full":"max-view-tablet:w-auto"].join(" ")}const f=r==="fill"?["w-full"]:[];if(i(o)){const n=e(o);n!==r&&f.push(n==="fill"?"max-view-wide:w-full":"max-view-wide:w-auto")}return f.join(" ")}export{a as BUTTON_ICONS,b as buttonIconAtEnd,x as buttonIconChoice,d as buttonIconSide,e as buttonWidth,m as buttonWidthClass,c as storedButtonIcon};
@@ -0,0 +1,8 @@
1
+ declare const CARD_ROW_STATES: readonly ["selected", "highlighted"];
2
+ type CardRowStateName = (typeof CARD_ROW_STATES)[number];
3
+ export type CardRowState = Readonly<Partial<Record<CardRowStateName, boolean>>>;
4
+ export declare const CARD_STATE_ATTR = "data-sf-card-state";
5
+ export declare const CARD_STATE_LINE_CLASS = "pointer-events-none absolute inset-0 border border-accent";
6
+ export declare function cardStateValue(state: CardRowState | undefined | null): string;
7
+ export declare function cardStateAttrs(state: CardRowState | undefined | null): Record<string, string>;
8
+ export {};
@@ -0,0 +1 @@
1
+ const r=["selected","highlighted"],n="data-sf-card-state",a="pointer-events-none absolute inset-0 border border-accent";function o(t){return t?r.filter(e=>t[e]===!0).join(" "):""}function c(t){const e=o(t);return e?{[n]:e,className:"relative"}:{}}export{n as CARD_STATE_ATTR,a as CARD_STATE_LINE_CLASS,c as cardStateAttrs,o as cardStateValue};
@@ -16,12 +16,14 @@ export interface CardRowFieldSpec {
16
16
  kind?: CardRowFieldKind;
17
17
  multiline?: boolean;
18
18
  alt?: string;
19
+ next?: string;
19
20
  everySource?: boolean;
20
21
  }
21
22
  export interface CardTemplateSpec {
22
23
  block: string;
23
24
  fields: readonly CardRowFieldSpec[];
24
25
  blocks?: readonly CardTemplateBlock[];
26
+ typedRows?: string;
25
27
  seed?: (props: Record<string, unknown>) => Record<string, unknown>;
26
28
  }
27
29
  export interface CardTemplateBlock {
@@ -30,9 +32,11 @@ export interface CardTemplateBlock {
30
32
  }
31
33
  export declare function registerCardTemplates(specs: readonly CardTemplateSpec[]): void;
32
34
  export declare function templateOnRead(type: string | undefined, props: Record<string, unknown>): Record<string, unknown>;
35
+ export declare function templateOnInsert(type: string | undefined, props: Record<string, unknown>): Record<string, unknown>;
33
36
  export declare function cardTemplatesNameBlocks(): boolean;
34
37
  export declare function cardTemplateBlocks(type: string): readonly CardTemplateBlock[];
35
38
  export declare function isCardTemplateBlock(type: string): boolean;
39
+ export declare function cardTemplateTypedRows(type: unknown): string;
36
40
  export declare function hasCardTemplate(type: unknown): boolean;
37
41
  export declare function cardTemplateFields(type: string, kind?: CardRowFieldKind): readonly CardRowFieldSpec[];
38
42
  export declare function cardTemplateFieldsOf(owner: {
@@ -46,7 +50,9 @@ export declare function cardTemplateField(type: string | undefined, key: string,
46
50
  export declare function namedRowField(props: Record<string, unknown> | null | undefined, prop?: string): string;
47
51
  export declare function cardKeyOf(row: SourceRow, index: number): string;
48
52
  export declare function cardRow(value: unknown): SourceRow;
53
+ export declare function rowNextPicture(item: unknown, next: string | undefined, cover?: string): string;
49
54
  export declare function rowBound(type: string, props: Record<string, unknown> | null | undefined, key: string): boolean;
55
+ export declare function rowFieldOf(type: string, props: Record<string, unknown> | null | undefined, key: string): string;
50
56
  export declare function rowFieldText(row: SourceRow | null | undefined, key: string): string | null;
51
57
  export declare function rowFilledProps(type: string, props: Record<string, unknown>, row: SourceRow | null | undefined): Record<string, unknown>;
52
58
  type DocNode = {
@@ -1 +1 @@
1
- import{blockSourceSpec as k,declaredBlockSource as x}from"./block-sources.js";import{isNodeList as T}from"efficient-easel/data";import{BOX_TYPE as g}from"../document/container-blocks.js";import{globalRegistry as B}from"../global-registry.js";import{withCardsTemplate as C}from"../document/cards-template-on-read.js";const w="template",v="Card template",O=["Text","ImageBlock","ButtonBlock","Flex"],u="rowField",A="rowLinkField";function I(){return{type:"slot",allow:[...O]}}const L=[{block:"OrderSummary",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"Cards",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0}],seed:e=>C("Cards",e)}];function c(){return B("efficient.card-templates",()=>new Map(L.map(e=>[e.block,e])))}function M(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const n of t.blocks??[]){if(typeof n?.type!="string"||!n.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(l=>l.type===n.type)||r.push({type:n.type,label:n.label||n.type})}c().set(t.block,{block:t.block,fields:t.fields.map(n=>({...n})),blocks:r,...t.seed?{seed:t.seed}:{}})}}function N(e,t){const r=e?c().get(e)?.seed:void 0;return r?r(t):t}function j(){for(const e of c().values())if(e.blocks?.length)return!0;return!1}function K(e){return c().get(e)?.blocks??[]}function W(e){for(const t of c().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function R(e){return typeof e=="string"&&c().has(e)}function U(e,t){const r=c().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function _(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=c().get(r)?.fields??[],l=k(x(e?.props))?.fields,s=l?.length?[...l.map(o=>({...o})),...n.filter(o=>o.everySource&&!l.some(i=>i.key===o.key))]:n;return t?s.filter(o=>(o.kind??"text")===t):s}function H(e,t,r){return e?r?_(r).find(n=>n.key===t)??null:c().get(e)?.fields.find(n=>n.key===t)??null:null}function p(e,t=u){const r=e?.[t];return typeof r=="string"?r.trim():""}function V(e,t){return e.key||String(t+1)}function X(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}const y={Text:{text:u},ImageBlock:{src:u},ButtonBlock:{label:u,href:A}};function Y(e,t,r){const n=y[e]?.[r];return!!(n&&p(t,n))}function h(e,t){return!t||!e?null:e[t]??""}function $(e,t,r){if(!r)return t;let n=null;for(const[l,s]of Object.entries(y[e]??{})){const o=h(r,p(t,s));o!==null&&(n??={...t},n[l]=o)}return n??t}function f(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(s,o)=>{for(const i of s){if(i?.props?.id===t)return o;for(const[m,a]of Object.entries(i?.props??{})){if(!T(a))continue;const b=m===w&&R(i.type)?{owner:i,direct:!0,nested:o!==null,underBox:!1}:o&&{owner:o.owner,direct:!1,nested:o.nested,underBox:o.underBox||i.type===g},d=n(a,b);if(d!==void 0)return d}}},l=n(r,null);return l===void 0?null:l}function q(e,t){const r=f(e,t);return r&&r.owner}function z(e,t){const r=f(e,t);return r&&(r.direct?r.owner:null)}function G(e,t){const r=f(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}export{u as CARD_ROW_FIELD_PROP,A as CARD_ROW_LINK_PROP,O as CARD_TEMPLATE_BLOCKS,v as CARD_TEMPLATE_LABEL,w as CARD_TEMPLATE_SLOT,G as cardCopyPlace,V as cardKeyOf,X as cardRow,K as cardTemplateBlocks,z as cardTemplateCardOwner,H as cardTemplateField,U as cardTemplateFields,_ as cardTemplateFieldsOf,q as cardTemplateOwner,I as cardTemplateSlot,j as cardTemplatesNameBlocks,R as hasCardTemplate,W as isCardTemplateBlock,p as namedRowField,M as registerCardTemplates,Y as rowBound,h as rowFieldText,$ as rowFilledProps,N as templateOnRead};
1
+ import{blockSourceSpec as x,declaredBlockSource as g}from"./block-sources.js";import{isNodeList as T}from"efficient-easel/data";import{BOX_TYPE as w}from"../document/container-blocks.js";import{globalRegistry as C}from"../global-registry.js";import{nonEmptyString as p}from"../non-empty-string.js";import{withCardsTemplate as B}from"../document/cards-template-on-read.js";const R="template",j="Card template",A=["Text","ImageBlock","ButtonBlock","Flex"],u="rowField",O="rowLinkField";function K(){return{type:"slot",allow:[...A]}}const h=[{block:"OrderSummary",typedRows:"rows",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"Cards",typedRows:"items",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0}],seed:e=>B("Cards",e)}];function c(){return C("efficient.card-templates",()=>new Map(h.map(e=>[e.block,e])))}function W(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const o of t.blocks??[]){if(typeof o?.type!="string"||!o.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(i=>i.type===o.type)||r.push({type:o.type,label:o.label||o.type})}const n=p(t.typedRows);c().set(t.block,{block:t.block,fields:t.fields.map(o=>({...o})),blocks:r,typedRows:n,...t.seed?{seed:t.seed}:{}})}}function _(e,t){const r=e?c().get(e)?.seed:void 0;return r?r(t):t}function U(e,t){if(!(t.template===void 0||Array.isArray(t.template)&&t.template.length===0))return t;const{template:n,...o}=t,i=_(e,o);return i===o?t:i}function H(){for(const e of c().values())if(e.blocks?.length)return!0;return!1}function V(e){return c().get(e)?.blocks??[]}function X(e){for(const t of c().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function Y(e){return typeof e=="string"&&c().get(e)?.typedRows||""}function E(e){return typeof e=="string"&&c().has(e)}function $(e,t){const r=c().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function L(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=c().get(r)?.fields??[],o=x(g(e?.props))?.fields,i=o?.length?[...o.map(l=>({...l})),...n.filter(l=>l.everySource&&!o.some(s=>s.key===l.key))]:n;return t?i.filter(l=>(l.kind??"text")===t):i}function q(e,t,r){return e?r?L(r).find(n=>n.key===t)??null:c().get(e)?.fields.find(n=>n.key===t)??null:null}function y(e,t=u){const r=e?.[t];return typeof r=="string"?r.trim():""}function z(e,t){return e.key||String(t+1)}function G(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}function J(e,t,r=""){const n=t&&e&&typeof e=="object"?e[t]:void 0;if(!Array.isArray(n))return"";for(const o of n){const i=typeof o=="string"?o:o?.src,l=p(typeof i=="string"?i.trim():void 0);if(l&&l!==r.trim())return l}return""}const m={Text:{text:u},ImageBlock:{src:u},ButtonBlock:{label:u,href:O}};function Q(e,t,r){return P(e,t,r)!==""}function P(e,t,r){const n=m[e]?.[r];return n?y(t,n):""}function S(e,t){return!t||!e?null:e[t]??""}function Z(e,t,r){if(!r)return t;let n=null;for(const[o,i]of Object.entries(m[e]??{})){const l=S(r,y(t,i));l!==null&&(n??={...t},n[o]=l)}return n??t}function f(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(i,l)=>{for(const s of i){if(s?.props?.id===t)return l;for(const[b,d]of Object.entries(s?.props??{})){if(!T(d))continue;const k=b===R&&E(s.type)?{owner:s,direct:!0,nested:l!==null,underBox:!1}:l&&{owner:l.owner,direct:!1,nested:l.nested,underBox:l.underBox||s.type===w},a=n(d,k);if(a!==void 0)return a}}},o=n(r,null);return o===void 0?null:o}function ee(e,t){const r=f(e,t);return r&&r.owner}function te(e,t){const r=f(e,t);return r&&(r.direct?r.owner:null)}function re(e,t){const r=f(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}export{u as CARD_ROW_FIELD_PROP,O as CARD_ROW_LINK_PROP,A as CARD_TEMPLATE_BLOCKS,j as CARD_TEMPLATE_LABEL,R as CARD_TEMPLATE_SLOT,re as cardCopyPlace,z as cardKeyOf,G as cardRow,V as cardTemplateBlocks,te as cardTemplateCardOwner,q as cardTemplateField,$ as cardTemplateFields,L as cardTemplateFieldsOf,ee as cardTemplateOwner,K as cardTemplateSlot,Y as cardTemplateTypedRows,H as cardTemplatesNameBlocks,E as hasCardTemplate,X as isCardTemplateBlock,y as namedRowField,W as registerCardTemplates,Q as rowBound,P as rowFieldOf,S as rowFieldText,Z as rowFilledProps,J as rowNextPicture,U as templateOnInsert,_ as templateOnRead};