efficient-web-builder 74.0.0 → 74.2.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 (122) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/editor/components/PreviewFooterContext.d.ts +3 -1
  3. package/dist/editor/components/PreviewFooterContext.js +1 -1
  4. package/dist/editor/components/PreviewPartAnchors.d.ts +2 -1
  5. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  6. package/dist/editor/components/StorefrontEditor.js +1 -1
  7. package/dist/editor/components/storefront-editor.css +7 -0
  8. package/dist/editor/lib/document/blocks/general/ContactLocations/fields.js +1 -1
  9. package/dist/editor/lib/document/blocks/general/Footprint/fields.d.ts +3 -0
  10. package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
  11. package/dist/editor/lib/document/controls.d.ts +3 -0
  12. package/dist/editor/lib/document/controls.js +1 -1
  13. package/dist/editor/lib/document/own-pad-fields.d.ts +7 -1
  14. package/dist/editor/lib/document/own-pad-fields.js +1 -1
  15. package/dist/editor/lib/document/page-root-fields.d.ts +4 -0
  16. package/dist/editor/lib/document/page-root-fields.js +1 -1
  17. package/dist/editor/lib/document/page-root.d.ts +3 -2
  18. package/dist/editor/lib/document/page-root.js +2 -2
  19. package/dist/editor/lib/document/registry.js +1 -1
  20. package/dist/editor/lib/editor-document-adapter.d.ts +1 -0
  21. package/dist/editor/lib/editor-document-adapter.js +1 -1
  22. package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
  23. package/dist/editor/lib/pinned-chrome-doc.js +1 -1
  24. package/dist/format/lib/build/module-specifiers.d.ts +8 -0
  25. package/dist/format/lib/build/module-specifiers.js +1 -1
  26. package/dist/format/lib/content/block-sources.d.ts +1 -0
  27. package/dist/format/lib/content/block-sources.js +1 -1
  28. package/dist/format/lib/content/borders.d.ts +2 -1
  29. package/dist/format/lib/content/borders.js +1 -1
  30. package/dist/format/lib/content/page-width.d.ts +15 -0
  31. package/dist/format/lib/content/page-width.js +1 -1
  32. package/dist/format/lib/content/section-css.d.ts +1 -1
  33. package/dist/format/lib/content/section-css.js +1 -1
  34. package/dist/format/lib/content/site-css.d.ts +5 -0
  35. package/dist/format/lib/content/site-css.js +1 -0
  36. package/dist/format/lib/content/site-offices.d.ts +7 -0
  37. package/dist/format/lib/content/site-offices.js +1 -0
  38. package/dist/format/lib/document/blocks/block-types.d.ts +1 -0
  39. package/dist/format/lib/document/passes/types.d.ts +4 -2
  40. package/dist/format/lib/editor-words-catalogue.d.ts +5 -0
  41. package/dist/format/lib/editor-words-catalogue.js +3 -3
  42. package/dist/format/lib/sections/strip-shape.d.ts +1 -0
  43. package/dist/format/lib/sections/strip-shape.js +1 -1
  44. package/dist/format/lib/source-rules/panel-colour-tokens.js +7 -7
  45. package/dist/format/lib/source-rules/site-gutter-once.d.ts +12 -0
  46. package/dist/format/lib/source-rules/site-gutter-once.js +23 -0
  47. package/dist/format/lib/theme.d.ts +2 -1
  48. package/dist/format/lib/theme.js +3 -3
  49. package/dist/render/components/Breadcrumb.d.ts +4 -1
  50. package/dist/render/components/Breadcrumb.js +1 -1
  51. package/dist/render/components/Cards.js +1 -1
  52. package/dist/render/components/ChartSection.js +1 -1
  53. package/dist/render/components/ContactLocations.js +2 -2
  54. package/dist/render/components/Countdown.js +1 -1
  55. package/dist/render/components/DocBody.js +5 -5
  56. package/dist/render/components/DocMasthead.js +1 -1
  57. package/dist/render/components/DocMetaCards.js +1 -1
  58. package/dist/render/components/FAQ.js +1 -1
  59. package/dist/render/components/FeaturedCover.js +1 -1
  60. package/dist/render/components/Flex.js +1 -1
  61. package/dist/render/components/Footprint.js +1 -1
  62. package/dist/render/components/HeroGroup.js +1 -1
  63. package/dist/render/components/HeroSingle.js +1 -1
  64. package/dist/render/components/HeroSlide.js +1 -1
  65. package/dist/render/components/ImageBlock.js +1 -1
  66. package/dist/render/components/KeyFeatures.js +1 -1
  67. package/dist/render/components/LongRead.js +1 -1
  68. package/dist/render/components/Manifesto.js +1 -1
  69. package/dist/render/components/Masthead.js +1 -1
  70. package/dist/render/components/MockupSection.js +1 -1
  71. package/dist/render/components/ParagraphsA.js +1 -1
  72. package/dist/render/components/PhoneMenuTools.d.ts +3 -1
  73. package/dist/render/components/PhoneMenuTools.js +1 -1
  74. package/dist/render/components/ProcessSteps.js +1 -1
  75. package/dist/render/components/Prose.js +1 -1
  76. package/dist/render/components/PublishedPartStylesContext.d.ts +2 -1
  77. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  78. package/dist/render/components/SectionHeader.js +1 -1
  79. package/dist/render/components/Series.js +1 -1
  80. package/dist/render/components/SideSpaceOnce.d.ts +6 -0
  81. package/dist/render/components/SideSpaceOnce.js +1 -0
  82. package/dist/render/components/SiteGutterFrame.js +1 -1
  83. package/dist/render/components/SiteOffices.d.ts +5 -0
  84. package/dist/render/components/SiteOffices.js +1 -0
  85. package/dist/render/components/SiteRootProps.d.ts +6 -0
  86. package/dist/render/components/SiteRootProps.js +1 -0
  87. package/dist/render/components/SpecStrip.d.ts +4 -1
  88. package/dist/render/components/SpecStrip.js +1 -1
  89. package/dist/render/components/Split.js +1 -1
  90. package/dist/render/components/StatsParagraph.js +1 -1
  91. package/dist/render/components/Testimonials.js +1 -1
  92. package/dist/render/components/Timeline.js +1 -1
  93. package/dist/render/components/TimelineTrack.js +1 -1
  94. package/dist/render/components/TitleWithButtons.js +1 -1
  95. package/dist/render/lib/content/section-edge.d.ts +1 -1
  96. package/dist/render/lib/content/section-edge.js +1 -1
  97. package/dist/render/lib/content/section-padding.d.ts +24 -14
  98. package/dist/render/lib/content/section-padding.js +1 -1
  99. package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
  100. package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
  101. package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
  102. package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
  103. package/dist/render/lib/document/blocks/general/SpecStrip/render.js +1 -1
  104. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -0
  105. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  106. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
  107. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  108. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  109. package/dist/render/lib/document/custom-css.d.ts +2 -1
  110. package/dist/render/lib/document/part-styles.d.ts +7 -4
  111. package/dist/render/lib/document/part-styles.js +2 -2
  112. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  113. package/dist/render/lib/document/passes/section-custom-css.d.ts +7 -0
  114. package/dist/render/lib/document/passes/section-custom-css.js +1 -1
  115. package/dist/render/lib/document/passes/section-padding.d.ts +2 -1
  116. package/dist/render/lib/document/passes/section-padding.js +1 -1
  117. package/dist/render/lib/document/passes/section-width.js +1 -1
  118. package/dist/render/lib/document/section-css-style.d.ts +3 -1
  119. package/dist/render/lib/document/section-css-style.js +1 -1
  120. package/dist/routine-index.json +1 -1
  121. package/dist/value-index.json +1 -1
  122. package/package.json +1 -1
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as A,Fragment as L}from"react/jsx-runtime";import{HERO_FOCUS as An,HERO_MEDIA_TYPES as Ln}from"../../../format/lib/hero-media-layout.js";import{cloneElement as xe,createContext as kn,useContext as st,useEffect as Fn,useId as lt,useRef as J,useState as Z}from"react";import{useEasel as re,useSelectedHost as G}from"efficient-easel/easel";import{PIN_LENGTH as ie,toDateKey as vn,fromDateKey as Dn,parseOption as Bn}from"efficient-shell/format";import{say as a,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{finiteNumber as Y}from"../../../format/lib/finite-number.js";import{LOADING_SHOWS_LABELS as at,firstFrameHint as Hn,loadingShowsOf as Gn,loadingStillHint as Mn}from"../../../format/lib/hero-video.js";import{pageFramesFor as Un,usePageVideoFrames as Wn}from"../page-video-frames.js";import{ScreenDocumentContext as Kn}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as ct,hidableText as ut}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Oe,LINK_FIELD_MARKER as dt,MEDIA_FIELD_MARKER as Ie,SCAFFOLD_FIELD_MARKER as pt,TEXT_FIELD_MARKER as N,foldMetaOf as Ee,textFieldIdentifier as Xn}from"efficient-easel/draw";import $n from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ft}from"../../../render/lib/document/show-when.js";import{CARD_IMAGE_PX_ROW as jn,CARD_IMAGE_RADIUS_ROW as ht,CARD_IMAGE_RADIUS_STEP as Vn,CORNER_RADIUS_MAX as Te,CORNER_RADIUS_MIN as k}from"../../../format/lib/content/card-image-shape.js";import{SECTION_CSS_KEY as Yn}from"../../../format/lib/content/section-css.js";import{IMAGE_CORNER_STEP as zn,IMAGE_CORNERS_LABEL as qn,IMAGE_CORNERS_ROW as Jn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Zn,GRID_MAX_ROW_SPAN as mt,GRID_MAX_TILE_AT as Qn,GRID_MOBILE_MAX_COLUMNS as eo,GRID_TILE_AT_KEY as to}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as no,GALLERY_LAYOUTS as Re,GALLERY_LAYOUT_KEYS as oo,GALLERY_PHONE_LAYOUTS as ro,galleryChoices as gt,galleryLayoutRatio as io,galleryPictureCells as so}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as lo}from"./shell-glyph.js";import{anchorSiblingsOf as ao,placementPoints as co}from"../../../format/lib/hero-group-placement.js";import uo from"../../components/AnchorField.js";import po from"../../components/SourceStatus.js";import{AdjustIcon as fo,EyeIcon as ho,AnimationIcon as mo,BackgroundIcon as bt,BorderAllIcon as go,BlockSectionIcon as bo,ColumnWidthsIcon as se,ColumnsIcon as wt,CornerIcon as St,DirectionDownIcon as wo,DirectionLeftIcon as So,DirectionRightIcon as _o,DirectionUpIcon as Co,EditIcon as yo,GapIcon as xo,GridIcon as _t,GroundIcon as Ne,HashIcon as Ct,HeightIcon as le,ImageIcon as Oo,ListIcon as Io,LocationIcon as yt,PaddingBottomIcon as xt,PaddingLeftIcon as Ot,PaddingRightIcon as It,PaddingTopIcon as Pe,PageIcon as Eo,StickyIcon as Et,SearchIcon as To,SquareIcon as Ro,TypeIcon as No,WidthIcon as Po}from"efficient-easel/icons";import{FieldGlyph as Tt}from"../../components/FieldGlyph.js";import{resolvePageBackground as Ao}from"../../../format/lib/content/page-background.js";import{BOX_FILL_FADE_PROP as Lo,BOX_FILL_FADES as ko,BOX_SWATCH_PROP as Fo,boxFillFadeOf as Rt,boxFillOf as vo,boxFillSlot as Ae,boxPaintOf as Do}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as Nt,CORNER_SIDE_POINTS as Bo,SECTION_CORNERS_ROW as Pt,hasOwnSectionCorners as Ho,normalizeCornerSides as At}from"../../../format/lib/content/section-corners.js";import{CARD_CORNERS_ROW as Lt}from"../../../format/lib/content/card-corners.js";import{enclosingPath as Go,enclosingSection as Mo}from"./enclosing-section.js";import{SettingsDefaultReset as O,SettingsDrill as Uo,SettingsField as _,SettingsGroup as Wo,SettingsSegmented as Ko,SettingsBorder as Xo,SettingsSidesEach as $o,SettingsSwitch as Le,borderSides as jo,borderStartEach as Vo}from"efficient-easel/panel";import{ListField as Yo}from"efficient-easel/fields";import{CodeIcon as zo}from"efficient-shell/icons/efficient";import{DisplayChips as qo}from"efficient-shell/ui";import{desktopDisplayChanged as Jo,partShownOnDesktop as Zo,partShownOnPhone as Qo,phoneDisplayChanged as er,withDesktopPart as tr,withPhonePart as nr}from"../../../format/lib/content/part-display.js";import{ColorSwatch as or,CornersInput as rr,DatePicker as ir,DateTimePicker as sr,FOCAL_DEFAULT as lr,IconPicker as kt,COLUMN_COUNT_MAX as Ft,COLUMN_SHARE_MIN as ar,COLUMN_SHARES_EQUAL as cr,resolveColumnShares as vt,WidthsBar as ur,useShellStrings as dr,IconButton as Dt,InputNumber as Bt,Slider as pr,Textarea as fr,Tooltip as ke}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as hr}from"./geocode-resolve.js";import{ColourRow as ae,InheritedColourRow as Ht}from"./ColourControl.js";import{fillThemeColors as mr,slotFill as ce}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as Fe}from"../../../format/lib/document/part-inks.js";import{keptByRow as ve}from"efficient-easel/screen/lib/document/style-fields";import Gt from"./MarkupToolbar.js";import{deviceField as y}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as gr,NoControlMark as br,noControlField as Mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as wr}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as Sr,PANEL_ONLY_FIELD as _r}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as Cr,resolvePhoneValue as De}from"../../../format/lib/document/phone-override.js";import{phoneKey as B,tabletKey as Be,viewKeyAt as He}from"efficient-easel/draw";import{viewKey as I}from"../../../format/lib/animation/views.js";import{viewRows as M}from"../animation/view-rows.js";import{SuppressibleText as yr}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as xr,CARD_OUTLINE_OPTIONS as Or,DEFAULT_CARD_INDEX_FORMAT as Ir,DEFAULT_CARD_OUTLINE as Er}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Tr,DEFAULT_COVER_INDEX as Rr}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Nr}from"efficient-easel/draw";import Pr from"../../components/MediaUploadField.js";import Ar from"../../components/MultiSelectField.js";import Lr from"../../components/SectionThemePicker.js";import kr from"../../components/SearchSelectField.js";import Fr from"../../components/StorefrontLinkField.js";import{UiIcon as Ut}from"efficient-easel/draw/client";import{SECTION_PADDING as P}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as vr}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Dr}from"efficient-easel/draw/client";import{encodePartId as Br}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Hr,useEaselStrings as Gr}from"efficient-easel/strings";import{hasPhoneHeight as Mr,hasTabletHeight as Ge,resolveSectionMinHeight as Ur,resolveTabletHeight as Wr}from"../../../format/lib/content/section-min-height.js";import{INTRO_OLD_STICKY_PINS as Kr,SECTION_PIN_ABOVE_HINT as Xr,SECTION_PIN_ABOVE_KEY as $r,SECTION_PIN_ABOVE_LABEL as jr,SECTION_PIN_GROUP as Vr,SECTION_PIN_LABEL as Wt,SECTION_PIN_SCREENS_KEY as Me,SECTION_PIN_SCREENS_LABEL as Kt,SECTION_PIN_STOP_DEFAULT as Yr,SECTION_PIN_STOP_HINT as zr,SECTION_PIN_STOP_KEY as qr,SECTION_PIN_STOP_LABEL as Jr,SECTION_PIN_STOP_OPTIONS as Zr,SECTION_STICK_DISTANCE as U,SECTION_STICK_DISTANCE_ROW as Ue,SOME_VIEW_PINS as Xt,hasPhoneStick as Qr,hasTabletStick as ei,resolveSectionStick as ue,sectionPinStopOf as ti,sectionPinStopWrite as ni}from"../../../format/lib/content/section-sticky.js";import{cssLengthOf as oi}from"../../../format/lib/content/css-length.js";import{SECTION_HEIGHT_MODES as ri,SECTION_MIN_HEIGHT as ii,SECTION_MIN_HEIGHT_GROUP_LABEL as Q,SECTION_SCREEN_PCT as si,SECTION_HEIGHT_UNITS as li}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as ai,resolveContainerDirection as $t}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as ci,BOX_BLOCK_SPACING_POINTS as jt,BOX_PHONE_ROW_LABEL as Vt,BOX_COLUMNS_MAX as ui,BOX_COLUMNS_MIN as Yt,BOX_PHONE_ROW_MAX as di,BOX_PHONE_ROW_MIN as We,BOX_SHARE_CHOICES as zt,BOX_SHARE_LABEL as z,boxShareChoiceOf as qt,boxShareWidthsOf as Ke,BOX_SHARE_PHONE_DEFAULT as pi,BOX_SHARE_PHONE_POINTS as fi}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as W}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Jt,BORDER_SIDES as hi,SECTION_BORDER_ROW as Zt,borderBySide as Qt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as mi,normalizeTheme as en,normalizeThemeColors as gi,sectionBandTone as bi,surfaceTwoTone as wi}from"../../../format/lib/theme.js";import{CONTAINER_GAP as tn,CONTAINER_GAP_BUILT_IN as Si,CONTAINER_GAP_PHONE as Xe,GAP_FIELD_CONTAINER as $e,followsSitePhoneGap as _i,hasOwnContainerGap as Ci,hasOwnPhoneGap as je,resolveContainerGap as nn,resolvePhoneContainerGap as on}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as yi,CARD_IMAGE_BG_OFF as xi,CARD_IMAGE_BG_SWATCH_NAMES as Oi,CARD_IMAGE_BG_SWATCHES as Ii,isCardImageBackgroundInheriting as Ei,cardImageBackgroundChoice as Ti,THEME_CARD_IMAGE_BG as Ri}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Ni,SECTION_BG_NO_FILL as Pi,sectionBackgroundChoice as Ai,THEME_SECTION_BG as Ve,isSectionBackgroundEmpty as Li,sectionBackgroundHex as rn}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as ki,nestedAccentValue as sn,resolveSectionAccent as de}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Fi,TYPE_SIZE_INHERIT as vi,isTypeSizeInheriting as Di}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Bi,WIDTH_CHOICE_LABEL as Hi,WIDTH_INHERIT as Gi}from"../../../format/lib/content/section-width.js";import{useEaselSession as Mi}from"efficient-easel/screen/lib/session-context";import{backendOf as Ui}from"../website-session.js";import{BOX_GAP as Wi,describedAs as F,group as T,iconOf as K,sharedStyleKinds as ee}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ln,onDesktopWords as X,phoneTwinFields as Ye,saidAlignmentGrid as Ki,useLengthUnit as Xi}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as $i,PICTURE_PICKER_ROW as ji,directionField as Vi,gapField as ze,iconPickerRow as an,lengthUnitFields as pe,pickerCellIcon as Yi,pickerNoneIcon as zi,Segmented as fe,select as v,slider as H}from"./box-fields.js";import{VIEW_ABOVE as qe}from"efficient-easel/screen/lib/content/length-units";import{tierOfView as cn,viewOfTier as qi}from"../../../format/lib/content/view-tier.js";import{ownEntry as Ji}from"../../../format/lib/own-entry.js";import{LAYOUT_CELL as Zi,galleryPhonePicture as un}from"./choice-pictures.js";function cc({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?a(e):e})}function $(e,t){return a("{value} from {from}",{value:e,from:t})}function Qi(){const{blockGap:e}=W();return e===null?a("this container's own spacing"):$(`${e}px`,a("Styles"))}function es({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:Qi(),onReset:t})}function ts(e){return ze({...Wi,builtIn:Si[e],resolve:(t,n)=>nn(e,t,n?.siteGap),action:(t,n)=>i(es,{inherited:!Ci(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[$e]:e}})}function ns(e){return ft(y("mobile",{[$e]:e,type:"custom",render:t=>i(is,{container:e,...t})}),dn)}function os(e){return ft(y("tablet",{[$e]:e,type:"custom",render:t=>i(rs,{container:e,...t})}),dn)}const dn={not:{field:"gap",in:Array.from({length:-tn.min},(e,t)=>tn.min+t)}};function uc(e){return{gap:y("desktop",ts(e)),[Be("gap")]:os(e),[B("gap")]:ns(e)}}function rs({container:e,...t}){const[n]=R("gap"),{siteGap:o}=t.field??{},r=Math.max(Xe.min,nn(e,n,o));return ze({...Xe,builtIn:r,resolve:s=>je(s)?s:r,action:(s,c)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(s),detail:X(u=>a(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function is({container:e,...t}){const[n]=R("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},l=on(e,void 0,n,o,r);return ze({...Xe,builtIn:l,resolve:c=>on(e,c,n,o,r),action:(c,u)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(c),detail:$(`${l}px`,_i(e,n,r)?a("Styles"):a("Desktop")),onReset:()=>u(void 0)})}).render(t)}function dc(e){return Vi({offered:ai(e),fallback:$t(e,void 0),resolve:t=>$t(e,t)})}function pc(e,t){return co(t?ao(e,t):[],t)}function ss({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:$(a("Full"),a("the page")),onReset:t})}function j({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:s=!0,markup:c=!0}){const{text:u,hidden:d}=ct(e),h=J(null),p=J(null),f=C=>t(s?{text:C,hidden:d}:C),m=()=>t({text:u,hidden:!d}),g=s&&d,b=lt(),S=r?ds(r)?i("span",{className:"sf-hint-while-typing",children:a(r)}):a(r):void 0,w=d?a("Show {label} on the slide",{label:a(n)}):a("Hide {label} on the slide",{label:a(n)});return i(_,{label:a(n),icon:i(No,{}),htmlFor:b,className:g?"is-hidden":void 0,hint:S,action:s?i(ke,{content:w,children:i(Dt,{"aria-pressed":d,"aria-label":w,onClick:m,children:d?i(Ut,{name:"eye-off",size:14}):i(Ut,{name:"eye",size:14})})}):void 0,children:A("div",{className:"sf-copybox",children:[c&&i(Gt,{target:l?p:h,value:u,onChange:f}),l?i("textarea",{id:b,ref:p,value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)}):i("input",{id:b,ref:h,type:"text",value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)})]})})}function fc(e,t){return{...e,[pt]:t}}function hc(e){const t=e[N];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[N]:{...t,offPage:!0}}}function mc(e){return!e||typeof e!="object"?!1:e[N]?.offPage===!0}function gc(e){if(!e[N])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[_r]:!0}}function bc(e){return Sr(e)}function wc(e){const t=e[N];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[N]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Au,SCALAR_TEXT_CONTROLS as Lu}from"efficient-easel/draw";function Sc(e,t){if(!e[N])throw new Error("inOwnBox: the field holds no authored text");const{[gr]:o,...r}=e;return{...r,[wr]:!0,render:t}}const ls=new Set(Nr),he={type:"radio",options:[{value:!0},{value:!1}]},pn={text:{type:"object",objectFields:{text:{type:"text"},hidden:he}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:he}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},V=(e,t)=>{const n=F({...t,[N]:e},{...pn[e.control],label:e.label});if(!ls.has(e.control))return n;const o=t.render;return{...Mt(n,"authored-copy"),render:r=>i(yr,{name:r.name,children:o(r)})}},_c="Everything else on this block comes from the linked post. Unlink it to edit by hand.",as={field:"source.slug",set:!0},Cc={not:as},cs="Select a word, then press the highlighter.",us=new Set([cs]),ds=e=>us.has(e);function yc(e,t,n){return V({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function xc(e,t,n){return V({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Oc(e,t,n){return V({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Ic(e,t,n){return V({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Ec(e){return{type:"custom",[dt]:{label:e},...F({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Fr,{value:ut(t),onChange:n,label:e})}}function Tc(e,t,n){return V({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Rc={Design:fo,Animation:mo};function Nc(e,t){return{type:"custom",render:()=>i(ps,{text:e,values:t})}}function ps({text:e,values:t}){return i("p",{className:"sf-note",children:a(e,t)})}function Pc(e){return Ee(e)!==null&&e?.tabs!==void 0}const fn=new Map;function Ac(e,t){const n=`${e}\0${t?t.join(""):""}`,o=fn.get(n)??{type:"custom",tabs:t,[Oe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(L,{})};return fn.set(n,o),o}const hn=new Map;function Lc(e){const t=hn.get(e)??{type:"custom",[Oe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(L,{})};return hn.set(e,t),t}function fs(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function kc(e,t){return fs(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(L,{})}}function Fc(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(L,{})}}function vc({title:e,children:t}){const[n,o]=Z(()=>!Je.has(e));return i(Wo,{title:e,open:n,onToggle:r=>{o(r),r?Je.delete(e):Je.add(e)},children:t})}const Je=new Set;function hs({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,s=l?a(l):t;return A("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?a(o[c]):c;return i(ke,{content:u,children:i(or,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function Dc(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(ms,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function ms({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const l=typeof o=="string"?o:void 0,{colors:s,n:c}=nt(),u={background:s.background,surface:s.surface,surface2:wi(s),band:bi(s)},d=n?Ve:t,h=Li(l,t,d),p=rn(void 0,d,u),f=n?Ni:void 0,m=d===Ve?a("the theme's section background"):a("Theme {n} background",{n:c}),g=gs(l,t,s,c,u,r),b=$(p.toUpperCase(),m),S=Fe(l),w=S?ce(S,s,c):null;return w?i(ae,{label:a(e),icon:i(bt,{}),value:w.hex,caption:w.words,onChange:r,changed:!0,onReset:()=>r(f),resetTo:b,choices:g}):i(Ht,{label:a(e),icon:i(bt,{}),value:h?"":rn(l,t,u),inherited:p,resetTo:b,onChange:r,onReset:()=>r(f),choices:g})}function gs(e,t,n,o,r,l){const s=Ai(e,t);return[{label:a("No fill"),color:"",selected:s==="none",onPick:()=>l(Pi)},{label:`${a("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:s==="band",onPick:()=>l(Ve)},...tt(Fe(e)??"",n,o,l)]}function bs(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=Ei(r,t);return i(_,{label:a(e),icon:i(Ne,{}),changed:!l,action:i(O,{words:x()?.panel,label:a(e),changed:!l,detail:a("the theme's image stage"),onReset:()=>o(yi)}),children:hs({swatches:Ii,current:l?Ri:Ti(r,t),onPick:o,names:Oi})})}}}function Bc(e=n=>n,t){return ee({_gSectionTheme:T(ki),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Lr,{value:e(n),onChange:o,followLabel:t})}})}function me(e){const t=E(),n=cn(e?.view),o=s=>He(e.valueKey,s),r=e.numbersIn??(s=>Y(t[o(s)])!==void 0),l=e.followsView??Ls(n,r);return Xi({props:{value:void 0,onChange:()=>{},field:{}},row:e.valueKey?e.row:void 0,table:$i,label:a(e.label),grid:e.grid,hasOwn:r(n),view:{tier:n,numbersIn:r,followsView:l},convertTo:e.convertTo??(s=>{const c=Y(t[o(n)]);return c===void 0?{}:{[o(n)]:s(c)}})})}function q({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:s=!0,notch:c,ariaLabel:u,disabled:d=!1,placeholder:h,placeholderWord:p,onClear:f,units:m,inputMax:g}){const b=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:b?"sf-slider has-notch":"sf-slider",style:b?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(pr,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:a(p)}:{},suffix:l||void 0,...m?{units:m}:{},...g!==void 0?{inputMax:g}:{},showInput:s,label:u===void 0?void 0:a(u),disabled:d,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:S=>{S===null?f?.():S!==o&&r(S)}})})}function ws(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:s,restTrack:c,unsetMark:u,icon:d,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:f})=>{const m=typeof p=="number"?p:null,g=m===null;return i(_,{label:a(e),icon:d?K(d):void 0,value:g?u||l===void 0?void 0:a(l):`${m}${h}`,changed:!g,action:u?xe(u,{changed:!g,onReset:()=>f(null)}):i(O,{words:x()?.panel,label:a(e),changed:!g,onReset:()=>f(null)}),hint:typeof s=="string"?a(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:f}):q({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:f})})}}}const te="Corners",Ss={kind:"radius"};function Ze(e){return{type:"custom",render:t=>{const{value:n,onChange:o}=t,r=typeof n=="number"&&Number.isFinite(n)?n:null,l=r!==null;return i(_,{label:a(te),icon:i(St,{}),changed:l,action:xe(e.mark,{changed:l,onReset:()=>o(null)}),hint:e.hint,children:i(_s,{tier:e,px:r,name:t.name,onRadius:o})})}}}function R(e){const t=G();return[t?.values?.[e],n=>t?.onChange(e,n)]}function mn(){return Mt({type:"custom",render:()=>i(br,{})},"always")}function ge(){const e=G();return t=>e?.onChangeMany(t)}function _s({tier:e,px:t,name:n,onRadius:o}){const r=e.useFollowed(),[l,s]=R(e.sidesKey),c=ge(),u=me({row:e.row??Ss,label:te,grid:{min:k,max:Te,step:e.step??1},valueKey:n??"",view:"desktop"}),d=At(l)??[...Nt];return i(rr,{label:a(te),value:d,corners:Bo,onChange:h=>{const p=At(h)??[];s(p.length===Nt.length?null:p)},radius:t,onRadiusChange:u&&n?h=>c({[n]:h,...u.unitPatch(h===null)}):o,radiusMin:u?.grid.min??k,radiusMax:u?.grid.max??Te,radiusStep:u?.grid.step??e.step??1,radiusPlaceholder:u&&u.unit!=="px"?"–":String(r),...u?{radiusUnit:u.unit,units:u.units}:{}})}function gn(e,t){return pe(e,t)}function bn(){return mn()}function Cs({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=W(),r=typeof o=="number"?`${o}px`:a("not set");return i(O,{words:x()?.panel,label:a(e),changed:t,detail:o==null?a("the built-in corners"):$(r,a("Styles")),onReset:n})}function ys(){const{cornerRadiusPx:e}=W();return typeof e=="number"?e:k}function xs(){return Ze({sidesKey:"sectionCornerSides",row:Pt,useFollowed:ys,mark:i(Cs,{label:te}),hint:Os})}const Os="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Hc(){return ee({_gShape:T("Shape"),sectionCorners:xs(),...gn(Pt,"sectionCorners"),sectionCornerSides:bn(),...M("sectionBorder",As),...pe(Zt,"sectionBorder",{tablet:!0,phone:!0})})}const Is=()=>({width:a("Border width"),sides:{top:a("Border top"),right:a("Border right"),bottom:a("Border bottom"),left:a("Border left")},style:a("Border style"),styles:{solid:a("Solid"),dashed:a("Dashed"),dotted:a("Dotted")},color:a("Border color"),unit:"px"});function Es(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Ts(){let e;try{const t=en(W().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||mi.line}function Rs({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:s={},length:c}){const u=e&&typeof e=="object"?e:{},[d,h]=Z(()=>r?Vo(u,s):!1),p=Is(),f=m=>Es(r&&l?m:{width:m.width,color:m.color,...l?{style:m.style}:{}});return i(_,{label:a("Border"),icon:i(go,{}),action:r?i($o,{each:d,label:a("Each side"),onChange:h}):void 0,children:i(Xo,{label:a("Border"),value:u,each:d,onChange:m=>t(f(m)),placeholder:n,presets:o,words:c?{...p,unit:c.unit}:p,styles:l,max:c?.grid.max??Jt,...c?{step:c.grid.step,units:c.units}:{}})})}function Ns({value:e,onChange:t,view:n}){const[o]=R("sectionBorder"),[r]=R(Be("sectionBorder")),l=Ts(),s=f=>f&&typeof f=="object"?f:{},c=n==="phone"?{...Qt(s(o)),...Qt(s(r))}:n==="tablet"?s(o):{},u=E(),d=ge(),h=I("sectionBorder",n),p=me({row:Zt,label:"Border",grid:{min:0,max:Jt,step:1},valueKey:"sectionBorder",view:n,numbersIn:f=>Qe(u[He("sectionBorder",f)]),convertTo:f=>{const m=s(u[h]);return Qe(m)?{[h]:Ps(m,f)}:{}}});return i(Rs,{value:e,length:p,onChange:p?f=>d({[h]:f,...p.unitPatch(!Qe(f))}):t,placeholder:{sides:jo(c),style:c.style??"solid",color:c.color||l},presets:[l],above:c})}const wn=["width",...hi];function Qe(e){if(!e||typeof e!="object")return!1;const t=e;return wn.some(n=>Y(t[n])!==void 0)}function Ps(e,t){const n={...e};for(const o of wn){const r=Y(n[o]);r!==void 0&&(n[o]=t(r))}return n}function As(e){return{type:"custom",render:({value:t,onChange:n})=>i(Ns,{value:t,onChange:n,view:e})}}function Ls(e,t){let n=qe[e];for(;n&&qe[n]!==null&&!t(n);)n=qe[n];return n??e}function Gc(e){return{type:"custom",render:()=>i(ks,{partKey:e})}}function ks({partKey:e}){const[t]=R("id"),[n]=R("_partStyles"),{textStyles:o}=W(),r=Gr();let l=null;try{l=Dr().select}catch{l=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Uo,{name:a("Text"),preview:vr(s,c,{noStyle:a("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Hr.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(Br(t,e))}})}function Sn(e){const{cornerRadiusPx:t}=W(),n=typeof t=="number"?t:e;let o=null;try{const{appState:l,selectedItem:s}=re(u=>u),c=s?.props?.id?String(s.props.id):void 0;o=c?Mo(l?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Ho(r)?r:n}function Fs({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Sn(k);return i(O,{words:x()?.panel,label:a(e),changed:t,detail:$(`${o}px`,a("the section")),onReset:n})}function vs(){return i(L,{children:a("Follows the section's Corners until you set a number here.")})}function Ds(){return Ze({sidesKey:"cardCornerSides",row:Lt,useFollowed:()=>Sn(k),mark:i(Fs,{label:te}),hint:i(vs,{})})}function Bs(){return{type:"custom",render:()=>i($n,{})}}function Mc(){return{_gShape:T("Shape"),cardCorners:Ds(),...gn(Lt,"cardCorners"),cardCornerSides:bn(),cardCornersApplyAll:Bs()}}function Hs(){return F({type:"custom",[ji]:!0,render:e=>i(Ms,{...e})},{type:"select",label:z,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Gs(e,t){const n=qt(e);if(n!=="custom")return a(zt.find(r=>r.value===n)?.label??"");const o=vt(Ke(e,t),t);return o?[...o,100-o.reduce((r,l)=>r+l,0)].join(" / "):a("Custom")}function Ms(e){const{value:t,onChange:n}=e,[o]=R("content"),r=Array.isArray(o)?o.length:0,l="follows"in e,s=t!=null,c=s?t:l?e.follows:void 0,u=qt(c),d=r>=2&&r<=Ft,h=()=>[...cr[r]??[]],p=J(null),f=w=>{const C=p.current;C&&JSON.stringify(w)===JSON.stringify(C.shares)?n(C.value):w&&n(w)},m=w=>{w===u||w==="custom"&&!d||n(w==="custom"?h():w)},g=a("The width bar works for 2 to {count} blocks.",{count:Ft}),b=s&&(l||t!=="content"),S=dr().widths.hint(r,ar);return i(_,{label:a(z),icon:i(se,{}),changed:b,hint:u!=="custom"?void 0:d?S:g,action:i(O,{words:x()?.panel,label:a(z),changed:b,disabled:e.readOnly===!0,detail:l?X(w=>a(w),Gs(e.follows,r),e.followsView):a("Fit content"),onReset:()=>n(void 0)}),children:A("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(kt,{label:a(z),value:u,options:zt.map(w=>({value:w.value,label:w.value==="custom"&&!d?g:a(w.label),icon:Yi(i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(w.weights).map((C,D)=>i("i",{style:{gridColumn:`span ${C}`}},D))}),a(w.label),w.value==="custom"&&!d?g:a(w.label))})),onChange:m,columns:3,cell:Cn,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&d?i("div",{onFocus:()=>{p.current={value:t,shares:vt(Ke(c,r),r)}},onBlur:()=>{p.current=null},children:i(ur,{label:a(z),count:r,value:Ke(c,r),onChange:f,readOnly:e.readOnly===!0})}):null]})})}function _n(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 Uc(){return v(ci,i(xo,{}),jt,jt[0].value)}function Wc(){return y("mobile",an(z,i(se,{}),fi.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),pi,{columns:2,cell:Cn}))}const Cn={width:"5.75rem",height:"3.25rem",words:!0};function Kc(){return Ye("share",Hs(),ln)[Be("share")]}function Us(){return y("mobile",H(Vt,i(wt,{}),We,di,1,We,"",{clear:{phoneFollows:!1,hint:We}}))}const yn={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Xc(){const e=H(Vt,i(wt,{}),Yt,ui,1,Yt,"",{clear:{emptyLabel:"Auto"}}),t=Ye("columns",e,{...yn,tablet:ln.tablet}),n=Ye("columns",e,yn,{phoneRow:Us()});return{...t,phoneRow:n.phoneRow}}function $c(e,t,n,o,r,l,s){return{type:"custom",render:({value:c,onChange:u,name:d})=>i(Ws,{label:e,min:t,max:n,step:o,fallback:r,role:l,value:c,onChange:u,name:d??"",length:s})}}function Ws({label:e,min:t,max:n,step:o,fallback:r,role:l,value:s,onChange:c,name:u,length:d}){const h=E(),p=ge(),f=cn(d?.view),m=me({row:d?.row??{kind:"fontSize"},label:e,grid:{min:t,max:n,step:o},valueKey:d?u:"",view:d?.view??"desktop",numbersIn:b=>b===f&&typeof h[u]=="number",followsView:f,convertTo:b=>typeof h[u]=="number"?{[u]:b(h[u])}:{}}),g=b=>m?p({[u]:b,...m.unitPatch(typeof b!="number")}):c(b);return i(_,{label:a(e),icon:i(Tt,{noun:l}),action:i(O,{words:x()?.panel,label:a(e),changed:!Di(s),detail:a("the Text style in Styles"),onReset:()=>g(vi),defaultAction:{onPress:()=>g(Fi),title:a("Keep this section's own built-in size"),icon:i(bo,{})}}),children:q({min:m?.grid.min??t,max:m?.grid.max??n,step:m?.grid.step??o,value:typeof s=="number"?s:r,...m?{suffix:m.unit,units:m.units}:{suffix:"px"},ariaLabel:e,onChange:g})})}function be(e,t,n){return[{label:"Auto",value:""},...Array.from({length:e},(o,r)=>({label:r===0?`1 ${t}`:`${r+1} ${n}`,value:String(r+1)}))]}function jc(){return{_gCellWidth:T("Cell size"),gridSpan:y("desktop",v("Positions",i(se,{}),be(Zn,"position","positions"),"")),gridRowSpan:y("desktop",v("Rows tall",i(le,{}),be(mt,"row","rows"),"")),[to]:H("At card",i(Ct,{}),1,Qn,1,1,""),[B("gridSpan")]:y("mobile",v("Positions",i(se,{}),[{label:"Full row",value:""},...be(eo,"position","positions").slice(1)],"")),[B("gridRowSpan")]:y("mobile",v("Rows tall",i(le,{}),be(mt,"row","rows"),""))}}function E(){let e=null,t=null;try{e=st(Ks),t=re(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Ks=kn(null);function Xs({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:s,fallback:c}){const u=E()[s],d=De(void 0,u,c);return i(L,{children:q({min:e,max:t,step:n,value:De(o,u,c),readout:!1,ariaLabel:r,notch:d,onChange:l})})}function $s({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:l=()=>{}}){const s=E()[t],c=De(void 0,s,n);return i(O,{words:x()?.panel,label:a(e),changed:r,detail:X(u=>a(u),`${c}${o}`),onReset:l})}function js(e){return ws(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i($s,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Xs,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Vs={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ys={Top:Pe,Bottom:xt,Left:Ot,Right:It},zs=e=>{const t=Ys[e];return i(t,{})};function Vc(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=S=>Vs[S],l=S=>H(r("Top"),i(Pe,{}),P.min,P.max,P.step,S,"px"),s=(S,w,C,D=P)=>y("mobile",js({label:r(S),icon:zs(S),desktopKey:w,min:D.min,max:D.max,step:D.step,fallback:C})),c=e.top??P.min,u=e.bottom??P.min,d="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??P,f=e.side??p.min,m=e.sidePhone??f,g=e.phone===!0,b=S=>g?y("desktop",S):S;return ee({...o?{_gSpacing:T("Padding")}:{},[t]:b(l(c)),...g?{[B(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:b(H(r("Bottom"),i(xt,{}),P.min,P.max,P.step,u,"px")),...g?{[B(n)]:s("Bottom",n,u)}:{}},...e.sides?{[d]:b(H(r("Left"),i(Ot,{}),p.min,p.max,p.step,f,"px")),...g?{[B(d)]:s("Left",d,m,p)}:{},[h]:b(H(r("Right"),i(It,{}),p.min,p.max,p.step,f,"px")),...g?{[B(h)]:s("Right",h,m,p)}:{}}:{}})}function Yc(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,s])=>[l,l in e&&Ee(s)?e[l]:s])),o={};let r=!1;for(const[l,s]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=s}return r||Object.assign(o,n),o}const we="Width";function zc(e,t=Bi,n=!0){const o=t.map(r=>({label:Hi[r],value:r}));return ee({...n?{_gWidth:T(we)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(_,{label:a(we),icon:i(Po,{}),action:n?i(ss,{inherited:l?.inherited??!1,onReset:()=>r(Gi),label:we}):void 0,children:fe({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:we})})}})}function qc({fill:e=!1}={}){const t=(r,l)=>({type:"custom",render:({value:s,onChange:c})=>i(qs,{value:s,onChange:c,view:r,badge:l,fill:e})}),n=()=>ve("sectionHeightMode"),o=()=>ve("sectionHeightMode");return ee({_gHeight:T(Q),...M("sectionHeightMode",r=>r==="desktop"?t(r):t(r,l=>i(el,{view:r,onClear:()=>l(void 0)}))),...M("sectionHeightValue",n),...M("sectionHeightUnit",o)})}function qs({value:e,onChange:t,view:n,badge:o,fill:r=!1}){const l=E(),{mode:s,number:c,unit:u}=Js(n,l,e);return i(_,{label:Q,icon:K(i(le,{})),action:o?o(t):void 0,children:A("div",{className:"es-width-stack",children:[fe({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"},...r?[{label:"Fill",value:"fill"}]:[]],value:s,onChange:t,ariaLabel:Q}),c?i(Qs,{view:n,mode:s,menu:u}):null]})})}function xn(e,t){return e==="phone"&&Ge(t)?Wr(t):Ur(t)}function Se(e,t){return e==="desktop"||(e==="tablet"?Ge(t):Mr(t))?null:xn(e,t)}function Js(e,t,n){const r=(l=>ri.includes(l))(n)?n:Se(e,t)?.mode??"auto";return{mode:r,number:r!=="auto"&&r!=="fill",unit:r==="fixed"}}function Zs(e,t,n,o){const r=Se(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[I("sectionHeightMode",e)]:r.mode,...r.mode==="fixed"?{[I("sectionHeightUnit",e)]:r.unit}:{},...n==="sectionHeightUnit"?{[I("sectionHeightValue",e)]:r.value}:{},[I(n,e)]:o}}function On(e,t,n){const o=G(),r=Se(e,E());return!o||!r?{followed:null,write:n}:{followed:r,write:s=>o.onChangeMany(c=>{const u=Zs(e,c,t,s);return u===null?{[I(t,e)]:s}:Object.keys(u).length?u:null})}}function Qs({view:e,mode:t,menu:n}){const o=G(),r=E(),l=I("sectionHeightValue",e),s=I("sectionHeightUnit",e),c=S=>w=>o?.onChangeMany(()=>({[S]:w})),{followed:u,write:d}=On(e,"sectionHeightValue",c(l)),{write:h}=On(e,"sectionHeightUnit",c(s)),p=t==="screen"?"%":r[s],f=Bn(li,"px",u?u.unit:p),m=f==="%"?si:ii,g=r[l],b=n?{options:["px","%"],label:a("Unit"),onChange:S=>h(S)}:void 0;return q({min:m.min,max:m.max,step:m.step,value:u?null:typeof g=="number"?g:m.fallback,...u?{placeholder:u.value}:{},suffix:f,...b?{units:b}:{},ariaLabel:Q,onChange:d})}function el({view:e,onClear:t}){const n=E(),o=Se(e,n)===null,r=e==="phone"&&Ge(n),l=xn(e,n),s=X(c=>a(c),l.mode==="auto"?a("Auto"):`${l.value}${l.unit}`,r?"tablet":"desktop");return i(O,{words:x()?.panel,label:a(Q),changed:o,detail:s,onReset:t})}function Jc(e={}){const t=e.intro===!0,n=l=>({type:"custom",render:({value:s,onChange:c,id:u,name:d})=>i(ll,{value:s,onChange:c,labelId:`${u??d??"stickTop"}-label`,view:l,intro:t})}),o=l=>({type:"custom",render:({value:s,onChange:c})=>i(rl,{value:s,onChange:c,view:l,intro:t})}),r=l=>({type:"custom",render:({value:s,onChange:c})=>i(il,{value:s,onChange:c,view:l,intro:t})});return{_gStick:T(Vr,{dot:t?ol:Xt}),...M("stickTop",n),...M("stickTopDistance",o),...pe(Ue,"stickTopDistance",{tablet:!0,phone:!0}),...e.screens?M(Me,r):{},...t?{}:{[qr]:tl()},...t||e.above===!1?{}:{[$r]:nl()}}}function tl(){const e=v(Jr,i(Pe,{}),Zr,Yr);return y("desktop",{...e,render:t=>{const n=e.render({...t,value:ti(t.value),onChange:o=>t.onChange(ni(o))});return xe(n,{hint:a(zr)})}})}function nl(){const e=Tn(jr,!1,i(Et,{}),Xr);return y("desktop",{...e,render:t=>e.render({...t,onChange:n=>t.onChange(n===!0?!0:void 0)})})}const ol={any:[Xt,Kr]};function In(e,t,n,o,r){const l=G(),s=E(),c=e==="desktop"||ne(e,s)?null:et(e,ue(s,{intro:o}));return{followed:c,write:(c||r)&&l?d=>l.onChangeMany(h=>{const p=sl(e,h,d,t,o),f=p===null?{[I(t,e)]:d}:p;return Object.keys(f).length?{...f,...r?.(d)??{}}:null}):n}}function rl({value:e,onChange:t,view:n,intro:o}){const r=E(),l=ue(r,{intro:o}),s=h=>{const p=qi(h);return p==="desktop"||ne(p,r)},c=me({row:Ue,label:"Distance from top",grid:{min:U.min,max:U.max,step:U.step},valueKey:"stickTopDistance",view:n,numbersIn:h=>s(h)&&Y(r[He("stickTopDistance",h)])!==void 0,followsView:n==="phone"&&l.ownTablet?"tablet":"desktop"}),{followed:u,write:d}=In(n,"stickTopDistance",t,o,c?h=>c.unitPatch(h===void 0):void 0);return i("div",{className:"sf-field",children:q({min:c?.grid.min??U.min,max:c?.grid.max??U.max,step:c?.grid.step??U.step,value:u?null:typeof e=="number"?e:U.fallback,...u?{placeholder:u.distance}:{},...c?{suffix:c.unit,units:c.units}:{suffix:"px"},ariaLabel:a("Distance from top"),onChange:d})})}function il({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=In(n,Me,t,o);return i(_,{label:a(Kt),icon:K(i(le,{})),children:q({min:ie.min,max:ie.max,step:ie.step,value:r?null:Y(e)??ie.default,...r?{placeholder:r.screens}:{},ariaLabel:a(Kt),onChange:l})})}function ne(e,t){return e==="tablet"?ei(t):Qr(t)}function et(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance,unit:t.tabletUnit,screens:t.tabletScreens}:{on:t.desktop,distance:t.desktopDistance,unit:t.desktopUnit,screens:t.desktopScreens}}function sl(e,t,n,o="stickTopDistance",r=!1){if(e==="desktop"||ne(e,t))return null;if(n===void 0)return{};const l=et(e,ue(t,{intro:r})),s=e==="phone"&&ne("tablet",t)?h=>I(h,"tablet"):h=>h,c=(h,p)=>t[s(h)]==null?{}:{[I(h,e)]:p},u=Ue.unitKey,d=t[s(u)]==null?{}:{[I(u,e)]:l.unit};return{[I("stickTop",e)]:!0,...c("stickTopDistance",l.distance),...d,...c(Me,l.screens),[I(o,e)]:n}}function ll({value:e,onChange:t,labelId:n,view:o,intro:r}){const l=E(),s=ue(l,{intro:r}),c=o==="phone"?s.phone:o==="tablet"?s.tablet:r?s.desktop:e===!0,u=o==="phone"&&s.ownTablet,d=o==="desktop"?null:et(o,s),h=d?.on?oi(d.distance,d.unit):a("Off");return i(_,{label:a(Wt),labelId:n,icon:K(i(Et,{})),action:A(L,{children:[o!=="desktop"?i(O,{words:x()?.panel,label:a(Wt),changed:ne(o,l),detail:X(p=>a(p),h,u?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(Le,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const En="e.g. about";function Zc(){return{_gAnchor:T("Anchor"),anchor:V({control:"plainText",label:"Name",placeholder:En},{type:"custom",render:({value:e,onChange:t})=>i(uo,{value:e,onChange:t,nameBox:(n,o)=>i(j,{value:n,onChange:o,label:"Name",placeholder:En,hideable:!1,markup:!1})})})}}function Qc(){return{_gAdvanced:T("Advanced"),[Yn]:{type:"custom",render:({value:e,onChange:t})=>i(_,{label:a("Custom CSS"),icon:K(i(zo,{})),children:i(fr,{"aria-label":a("Custom CSS"),spellCheck:!1,autoGrow:!0,className:"font-mono",value:typeof e=="string"?e:"",onChange:n=>t(n.target.value)})})}}}function eu(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(sr,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:d=>r(d?d.toISOString():"")})})}}}function tu(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-date`;return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(ir,{id:c,value:Dn(typeof o=="string"?o:null),onChange:u=>r(u?vn(u):"")})})}}}function Tn(e,t,n,o){return{type:"custom",...F({},{...he,label:e}),render:r=>{const{value:l,onChange:s,id:c,name:u}=r,d="follows"in r,h=r,p=typeof l=="boolean",f=typeof h.follows=="boolean"?h.follows:t,m=p?l:d?f:t,g=`${c??u??e}-label`,b=h.readOnly===!0,S=i(Le,{checked:m,onChange:s,disabled:b,ariaLabelledBy:g});return i(_,{label:a(e),labelId:g,icon:n,hint:o===void 0?void 0:a(o),action:d?A(L,{children:[i(O,{words:x()?.panel,label:a(e),changed:p,detail:h.followsNoView?a(f?"On":"Off"):X(w=>a(w),a(f?"On":"Off"),h.followsView),disabled:b,onReset:()=>s(void 0)}),S]}):S})}}}function nu(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(al,{label:"Background",icon:i(Eo,{}),id:r,value:e,shown:Ao(e),onChange:t})}}}function ou(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(ae,{label:a(e),icon:n,value:o||t,onChange:r})}}function al({label:e,icon:t,id:n,value:o,shown:r,onChange:l}){const{colors:s,n:c}=nt(),u=Fe(o),d=u?ce(u,s,c):null;return i(ae,{label:a(e),icon:t,id:n,value:d?d.hex:r,caption:d?.words,onChange:l,choices:tt(u??"",s,c,l)})}function ru(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(cl,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function tt(e,t,n,o){const r=Ae(e);return mr(t,n).map(l=>({label:l.label,color:l.value,selected:r===l.name,onPick:()=>o(l.name)}))}function cl({value:e,onChange:t,twin:n}){const{colors:o,n:r}=nt(),l=o.background,s=$(l.toUpperCase(),a("Theme {n} background",{n:r})),[c,u]=R(Lo),[d]=R(Fo),h=typeof d=="string"&&d.trim()!=="",p=Rt(c),f=oe=>u(Rt(oe)||void 0),m=Ae(e),g=m?ce(m,o,r):null,b=tt(e,o,r,t),S=n?()=>t(void 0):()=>t("");let w=l,C=s;if(n){const oe=Ae(n.follows),Ce=vo(n.follows),ye=oe?ce(oe,o,r):Ce?{hex:Ce,words:Ce.toUpperCase()}:null;w=ye?.hex??l,C=X(Pn=>a(Pn),ye?ye.words:s,n.view)}const D=!n&&(Do(e)||h)?i(ul,{value:p,onChange:f}):null;return g?i(ae,{label:a("Fill"),icon:i(Ne,{}),value:g.hex,caption:g.words,onChange:t,changed:!0,onReset:S,resetTo:C,choices:b,children:D}):i(Ht,{label:a("Fill"),icon:i(Ne,{}),value:e,inherited:w,resetTo:C,onChange:t,onReset:S,choices:b,children:D})}function ul({value:e,onChange:t}){return fe({options:ko.map(n=>({label:n.label,value:n.value,hint:n.hint})),value:e,onChange:t,ariaLabel:a("Fill")})}function dl(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return de(n);const r=Go(e,t);if(r.length===0)return null;const l=de(sn(n));if(l!==null)return l;for(let s=r.length-1;s>0;s-=1){const c=de(sn(r[s].sectionAccent));if(c!==null)return c}return de(r[0].sectionAccent)}function nt(){const e=en(W().theme),[t]=R("sectionAccent");let n=null;try{const{appState:r,selectedItem:l}=re(c=>c),s=l?.props?.id?String(l.props.id):void 0;n=s?dl(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:gi(e.themes[o]),n:o+1}}function iu(){return mn()}const su={top:i(Co,{}),right:i(_o,{}),bottom:i(wo,{}),left:i(So,{})};function lu(e,t,n,o,r,l,s){const c=p=>t.find(f=>f.value===p),u=p=>({value:p,label:"",disabled:!0,title:o}),d=p=>{const f=t.find(g=>g.cell===p);if(!f)return u(`missing-${p}`);const m=l?.[p];return m?{value:f.value,label:f.label,icon:m}:{value:f.value,label:f.label}},h=[u("corner-top-left"),d("top"),u("corner-top-right"),d("left"),u("centre"),d("right"),u("corner-bottom-left"),d("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:f})=>{const m=t.some(g=>g.value===p)?p:n;return i(_,{label:a(e),icon:r,value:c(m)?.label?a(c(m).label):s?a(s):"",children:Ki(a,{label:e,value:m,onChange:f,points:h})})}}}function au(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(Ar,{label:e,options:(l.options??t).map(s=>({...s,label:a(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:a(n)}:{}})}}function cu(e,t,n,o){return{type:"custom",options:t,fallback:n,...F({},{type:"select",label:e}),render:({value:r,onChange:l,field:s})=>i(kr,{label:e,options:(s.options??t).map(c=>({...c,label:a(c.label)})),fallback:s.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:a(o)})}}function uu(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const pl={image:"Image",video:"Video"},du=Ln.map(e=>({label:pl[e],value:e}));function pu(e,t,n){const o=Object.keys(at).map(r=>({label:at[r],value:r,picture:n[r]}));return{type:"custom",...F({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(hl,{label:e,icon:t,options:o,onChange:r})}}function fl(e,t,n){const o=Hn(e,t,n);if(o!==void 0)return o==="save-makes-frame"?a("A frame is made from this video when you save the page."):o==="starts-dark"?a("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?a("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?a("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?a("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?a("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Mn(e);return r==="frame-missing-image"?a("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?a("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?a("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?a("No image yet. The slide shows its background colour until you choose one."):void 0}function hl({label:e,icon:t,options:n,onChange:o}){const r=G(),l=r?.values??{},s=Gn(l),c=st(Kn),u=Wn(c?.docId??null);let d=null;try{d=re(p=>p.appState.data)}catch{d=null}const h=Un(r?.id,d,u);return i(_,{label:a(e),icon:K(t),hint:fl(l,h,c?.hasUnsavedEdits??!1),children:fe({options:n,value:s,onChange:o,ariaLabel:e})})}function fu(e,t,n,o={}){const r={type:"custom",[Ie]:!0,render:({value:l,onChange:s,name:c})=>i(Pr,{value:l||"",onChange:s,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?y("each",r):r}function hu(e){return ot(e).map(t=>t.path)}function ot(e,t="",n=[]){const o=[];for(const[r,l]of Object.entries(e??{})){const s=t?`${t}.${r}`:r,c=l;if(c&&c[Ie]){o.push({path:s,field:c,along:n});continue}c?.arrayFields&&o.push(...ot(c.arrayFields,`${s}[]`,[...n,c])),c?.objectFields&&o.push(...ot(c.objectFields,s,[...n,c]))}return o}const mu={HeroSingle:[An.image],HeroSlide:["videoFrame","videoFramePhone"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ml(e){const t=a(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function gu({value:e,onChange:t,label:n}){const o=e||{},r=G(),l=r?r.values!==r.node.props:!0,s=!!o.pending&&l,c=!!o.pending&&!l,u=!!Ui(Mi()).geocode,d=lt(),h=(p,f)=>t({...o,[p]:f??void 0});return A(L,{children:[i(_,{label:a(n),icon:i(yt,{}),action:u?i(ke,{content:a("Find from the address (OpenStreetMap)"),children:i(Dt,{"aria-label":a("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(To,{})})}):void 0,children:u&&o.status?i(po,{compact:!0,oneLine:!0,spaced:!1,status:s?"busy":o.ok&&!c?"found":"notfound",statusText:s?a("Finding…"):c?a(hr):a(o.status),hint:ml(o)}):null}),i(_,{label:a("Enter by hand"),labelId:d,icon:i(yo,{}),action:i(Le,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:d})}),o.manual&&i(_,{label:a("Latitude, longitude"),icon:i(yt,{}),children:A("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(Bt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:a("Latitude")}),i(Bt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:a("Longitude")})]})})]})}function gl(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function bl(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function bu(e,t){return e===null?null:t>e?e:null}function wl(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 wu={label:"Ticker items",icon:i(Io,{})};function Su(e,t,n,o){return{type:"custom",[N]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...F({},{...pn.textList,label:e}),render:({value:r,onChange:l})=>i(Sl,{label:e,icon:K(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function Sl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const s=J(null),[c,u]=Z(null),d=p=>p.map(f=>({text:f?.text??""})),h=p=>{const f=wl(n,p,c);f===null&&(s.current=null),u(f),r(d(p))};return i(Yo,{label:a(e),icon:t,noun:a("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(Gt,{target:s,value:gl(n,c),onChange:p=>r(bl(n,c??-1,p)),disabled:c===null,label:c===null?a("Formatting — click a row first"):a("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,f,m)=>i("input",{type:"text",className:l&&c===f?"sf-list-marking":void 0,value:p?.text??"",placeholder:a(o),"aria-label":a("{label} {n}",{label:a(e),n:f+1}),onChange:g=>m({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,u(f)}})})}function _u(e,t){const n=`${e.label} — row ${t+1}`;return V({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:a("{label} — row {n}",{label:a(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Cu(e){return{_gCards:T("Cards"),coverIndex:v("Cover image",i(Oo,{}),Tr,String(Rr),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:bs("Image background",xi),cardImage:Rn()}}function yu(){return{outline:v("Card outline",i(Ro,{}),Or,Er),indexBadge:v("Card number",i(Ct,{}),xr,Ir),showBadge:Tn("Product badge",!0,i(Tt,{noun:"tag"}))}}function xu(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...he,label:_e.find(l=>l.id===r).label}),o=r=>F(ve(rt),n(r));return{_gShowOnCard:T("Show on a card"),[rt]:F({type:"custom",render:()=>i(_l,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(rt)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const rt="showCardPrice",_e=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function _l({rest:e}){const t=E(),n=ge(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],l=_e.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(it,{parts:_e,changed:l,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(_e.map(({id:s})=>[s,void 0])))})}function Ou(e,t="display"){const n=B(t);return{[t]:y("desktop",{type:"custom",render:({value:o,onChange:r})=>i(it,{parts:e,changed:Jo(o),shown:l=>Zo(o,l),onPress:(l,s)=>r(tr(o,l,s)),onReset:()=>r(void 0)})}),[n]:y("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Cl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function it({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l,disabledReason:s}){const c=a("Display");return i(_,{label:c,icon:i(ho,{}),changed:t,action:i(O,{words:x()?.panel,label:c,changed:t,detail:l,onReset:r}),children:i(qo,{label:c,items:e.map(u=>({id:u.id,label:a(u.label),shown:n(u.id),...s?{disabled:!0,disabledReason:a(s)}:{}})),onChange:o})})}function Cl({parts:e,desktopKey:t,value:n,onChange:o}){const r=E()[t];return i(it,{parts:e,changed:er(n),shown:l=>Qo(r,n,l),onPress:(l,s)=>o(nr(n,l,s)),onReset:()=>o(Cr),detail:a("the same as Desktop")})}function Rn(e=jn){return H("Card image",i(St,{}),k,Te,Vn,k,e,{clear:{hint:k},hint:"Rounds the picture. The card's own corner is in Styles."})}function yl(){return pe(ht,"cardImage")}function Iu(){return{cardImage:Rn(ht),...yl()}}function Eu(){return Ze({sidesKey:"cornerSides",row:Jn,step:zn,useFollowed:()=>k,mark:i(xl,{label:qn}),hint:a("Rounds the picture. Left alone it stays square.")})}function xl({label:e,changed:t=!1,onReset:n=()=>{}}){return i(O,{words:x()?.panel,label:a(e),changed:t,onReset:n})}function Tu(){return{type:"custom",render:({value:e,onChange:t})=>i(Tl,{value:typeof e=="string"?e:"",onChange:t})}}const Nn="own";function Ru(){const e=[{value:Nn,label:"Layout's own",picture:un(Array.from({length:8},()=>[3,1]))},...Object.entries(ro).map(([t,n])=>({value:t,label:n.label,picture:un([...n.phone,...n.phone])}))];return y("mobile",an("Layout",i(_t,{}),e,Nn,{columns:2,cell:Zi}))}function Ol({layout:e,width:t}){const n=io(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:so(e).map(([r,l],s)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${l}`,aspectRatio:o}},s))})}const Il={width:"3.5rem",height:"2.5rem",words:!1},El=200;function Tl({value:e,onChange:t}){const[n,o]=Z(null),[r,l]=Z(4),s=J(null);Fn(()=>{const m=s.current;if(!m||typeof ResizeObserver!="function")return;const g=()=>l(m.getBoundingClientRect().width>=El?4:3);g();const b=new ResizeObserver(g);return b.observe(m),()=>b.disconnect()},[]);const c=e?Ji(Re,e):void 0,u=c?e:"",d=gt(n,u),h=gt(n,"").length,p=lo("no-symbol"),f=[{value:"",label:a("Not chosen"),icon:zi(p,a("Not chosen"))},...d.map(m=>({value:m,label:a(Re[m].label),icon:i(Ol,{layout:Re[m],width:40})}))];return i(_,{label:a("Layout"),icon:i(_t,{}),value:c?a(c.label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(kt,{label:a("Layout"),value:u,options:f,onChange:t,columns:r,cell:Il,header:A("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:a("Photos in a row")}),i(Ko,{options:[{id:"all",label:a("All")},...no.map(m=>({id:String(m),label:String(m)}))],value:n===null?"all":String(n),ariaLabel:a("Photos in a row"),onChange:m=>o(m==="all"?null:Number(m))}),i("span",{className:"text-2xs text-ink-faint",children:a("{n} of {total} layouts",{n:h,total:oo.length})})]})})})})}export{as as BOUND_TO_POST,_c as BOUND_TO_POST_NOTE,Rc as BUCKET_ICONS,mu as CUSTOM_FIELD_MEDIA,gu as CoordsField,dn as DESKTOP_GAP_NOT_OVERLAP,it as DisplayRow,su as EDGE_ARROWS,lr as FOCAL_DEFAULT,Oe as FOLD_FIELD_MARKER,cs as HIGHLIGHT_HINT,j as HidableTextField,dt as LINK_FIELD_MARKER,cc as Label,Ie as MEDIA_FIELD_MARKER,du as MEDIA_TYPE_OPTIONS,Cc as NOT_BOUND_TO_POST,vc as PanelBand,ps as PanelNoteLine,Ks as RowPropsContext,pt as SCAFFOLD_FIELD_MARKER,Lu as SCALAR_TEXT_CONTROLS,es as SiteGapDefaultReset,q as Slider,hs as Swatches,Au as TEXT_CONTROL_KINDS,N as TEXT_FIELD_MARKER,wu as TICKER_ITEMS_ROW,Sl as TextListField,al as ThemeFillRow,we as WIDTH_LABEL,ss as WidthDefaultReset,wl as aimAfterListChange,Zc as anchorFields,$ as backTo,Dc as backgroundField,Uc as boxBlockSpacingField,Xc as boxColumnsFields,ru as boxFillField,Us as boxPhoneRowField,Hs as boxShareField,Wc as boxSharePhoneField,Kc as boxShareTabletField,dl as boxThemeIndexOf,Ac as bucketHeader,Gc as buttonWordsEntryField,Ds as cardCornersField,bs as cardImageBackgroundField,Rn as cardImageField,Iu as cardImageFields,Cu as cardMediaFields,Mc as cardShapeFields,xu as cardShowFields,yu as cardStyleFields,jc as cellWidthFields,ou as colorInput,dc as containerDirectionField,ts as containerGapField,ns as containerGapPhoneField,uc as containerGapRows,os as containerGapTabletField,ml as coordsResultTip,Ic as copyText,bn as cornerSidesField,Ze as cornersRowField,gn as cornersUnitFields,Qc as customCssFields,tu as date,eu as dateTime,Lc as designGroupHeader,Ou as displayFields,lu as edgePad,tt as fillSlotChoices,bu as focusAfterRemove,iu as focusKeptField,kc as foldMarker,Ee as foldMetaOf,fs as foldTitleOf,Zs as followedHeightPatch,sl as followedStickPatch,Tu as galleryLayoutField,Ru as galleryLayoutPhoneField,qc as heightFields,Se as heightFollowedBy,Js as heightLayersAt,pc as heroGroupPlacementPoints,ut as hidableText,ds as hintIsWhileTyping,Eu as imageCornersField,Sc as inOwnBox,Pc as isBucketHeader,mn as keptBy,Ec as linkField,fl as loadingRowHint,pu as loadingShowsField,hu as mediaFieldPaths,ot as mediaFields,au as multiSelect,nu as pageBackgroundField,Nc as panelNote,js as phoneOverrideField,Oc as plainText,Tc as plainTextarea,ws as pxField,Fc as quietMarker,ct as readHidable,gl as rowText,cu as searchSelect,gs as sectionBandChoices,xs as sectionCornersField,Hc as sectionShapeFields,Bc as sectionThemeFields,bl as setRowText,$c as sizeField,uu as sourceField,Vc as spacingFields,Jc as stickFields,Yc as swapPadding,yc as text,Xn as textFieldIdentifier,mc as textFieldOffPage,bc as textFieldPanelOnly,Su as textList,_u as textListRowField,xc as textarea,Tn as toggle,fu as upload,me as useLengthRow,ge as useSelectedPatch,E as useSelectedProps,R as useSelectedSibling,Qi as useSiteGapDetail,zc as widthField,wc as withIdentifier,hc as withOffPage,gc as withPanelOnly,fc as withScaffold};
1
+ "use client";import{jsx as i,jsxs as L,Fragment as k}from"react/jsx-runtime";import{HERO_FOCUS as An,HERO_MEDIA_TYPES as Ln}from"../../../format/lib/hero-media-layout.js";import{cloneElement as xe,createContext as kn,useContext as st,useEffect as Fn,useId as lt,useRef as J,useState as Z}from"react";import{useEasel as re,useSelectedHost as G}from"efficient-easel/easel";import{PIN_LENGTH as ie,toDateKey as vn,fromDateKey as Dn,parseOption as Bn}from"efficient-shell/format";import{say as a,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{finiteNumber as Y}from"../../../format/lib/finite-number.js";import{LOADING_SHOWS_LABELS as at,firstFrameHint as Hn,loadingShowsOf as Gn,loadingStillHint as Mn}from"../../../format/lib/hero-video.js";import{pageFramesFor as Un,usePageVideoFrames as Wn}from"../page-video-frames.js";import{ScreenDocumentContext as Kn}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as ct,hidableText as ut}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Oe,LINK_FIELD_MARKER as dt,MEDIA_FIELD_MARKER as Ie,SCAFFOLD_FIELD_MARKER as pt,TEXT_FIELD_MARKER as N,foldMetaOf as Ee,textFieldIdentifier as Xn}from"efficient-easel/draw";import $n from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ft}from"../../../render/lib/document/show-when.js";import{CARD_IMAGE_PX_ROW as jn,CARD_IMAGE_RADIUS_ROW as ht,CARD_IMAGE_RADIUS_STEP as Vn,CORNER_RADIUS_MAX as Te,CORNER_RADIUS_MIN as F}from"../../../format/lib/content/card-image-shape.js";import{SECTION_CSS_KEY as Yn}from"../../../format/lib/content/section-css.js";import{IMAGE_CORNER_STEP as zn,IMAGE_CORNERS_LABEL as qn,IMAGE_CORNERS_ROW as Jn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Zn,GRID_MAX_ROW_SPAN as mt,GRID_MAX_TILE_AT as Qn,GRID_MOBILE_MAX_COLUMNS as eo,GRID_TILE_AT_KEY as to}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as no,GALLERY_LAYOUTS as Re,GALLERY_LAYOUT_KEYS as oo,GALLERY_PHONE_LAYOUTS as ro,galleryChoices as gt,galleryLayoutRatio as io,galleryPictureCells as so}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as lo}from"./shell-glyph.js";import{anchorSiblingsOf as ao,placementPoints as co}from"../../../format/lib/hero-group-placement.js";import uo from"../../components/AnchorField.js";import po from"../../components/SourceStatus.js";import{AdjustIcon as fo,EyeIcon as ho,AnimationIcon as mo,BackgroundIcon as bt,BorderAllIcon as go,BlockSectionIcon as bo,ColumnWidthsIcon as se,ColumnsIcon as St,CornerIcon as wt,DirectionDownIcon as So,DirectionLeftIcon as wo,DirectionRightIcon as _o,DirectionUpIcon as Co,EditIcon as yo,GapIcon as xo,GridIcon as _t,GroundIcon as Ne,HashIcon as Ct,HeightIcon as le,ImageIcon as Oo,ListIcon as Io,LocationIcon as yt,PaddingBottomIcon as xt,PaddingLeftIcon as Ot,PaddingRightIcon as It,PaddingTopIcon as Pe,PageIcon as Eo,PhoneIcon as To,StickyIcon as Et,SearchIcon as Ro,SquareIcon as No,TypeIcon as Po,WidthIcon as Ao}from"efficient-easel/icons";import{FieldGlyph as Tt}from"../../components/FieldGlyph.js";import{resolvePageBackground as Lo}from"../../../format/lib/content/page-background.js";import{BOX_FILL_FADE_PROP as ko,BOX_FILL_FADES as Fo,BOX_SWATCH_PROP as vo,boxFillFadeOf as Rt,boxFillOf as Do,boxFillSlot as Ae,boxPaintOf as Bo}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as Nt,CORNER_SIDE_POINTS as Ho,SECTION_CORNERS_ROW as Pt,hasOwnSectionCorners as Go,normalizeCornerSides as At}from"../../../format/lib/content/section-corners.js";import{CARD_CORNERS_ROW as Lt}from"../../../format/lib/content/card-corners.js";import{enclosingPath as Mo,enclosingSection as Uo}from"./enclosing-section.js";import{SettingsDefaultReset as O,SettingsDrill as Wo,SettingsField as _,SettingsGroup as Ko,SettingsSegmented as Xo,SettingsBorder as $o,SettingsSidesEach as jo,SettingsSwitch as Le,borderSides as Vo,borderStartEach as Yo}from"efficient-easel/panel";import{ListField as zo}from"efficient-easel/fields";import{CodeIcon as qo}from"efficient-shell/icons/efficient";import{DisplayChips as Jo}from"efficient-shell/ui";import{desktopDisplayChanged as Zo,partShownOnDesktop as Qo,partShownOnPhone as er,phoneDisplayChanged as tr,withDesktopPart as nr,withPhonePart as or}from"../../../format/lib/content/part-display.js";import{ColorSwatch as rr,CornersInput as ir,DatePicker as sr,DateTimePicker as lr,FOCAL_DEFAULT as ar,IconPicker as kt,COLUMN_COUNT_MAX as Ft,COLUMN_SHARE_MIN as cr,COLUMN_SHARES_EQUAL as ur,resolveColumnShares as vt,WidthsBar as dr,useShellStrings as pr,IconButton as Dt,InputNumber as Bt,Slider as fr,Textarea as hr,Tooltip as ke}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as mr}from"./geocode-resolve.js";import{ColourRow as ae,InheritedColourRow as Ht}from"./ColourControl.js";import{fillThemeColors as gr,slotFill as ce}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as Fe}from"../../../format/lib/document/part-inks.js";import{keptByRow as ve}from"efficient-easel/screen/lib/document/style-fields";import Gt from"./MarkupToolbar.js";import{deviceField as y}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as br,NoControlMark as Sr,noControlField as Mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as wr}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as _r,PANEL_ONLY_FIELD as Cr}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as yr,resolvePhoneValue as De}from"../../../format/lib/document/phone-override.js";import{phoneKey as B,tabletKey as Be,viewKeyAt as He}from"efficient-easel/draw";import{viewKey as I}from"../../../format/lib/animation/views.js";import{viewRows as M}from"../animation/view-rows.js";import{SuppressibleText as xr}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Or,CARD_OUTLINE_OPTIONS as Ir,DEFAULT_CARD_INDEX_FORMAT as Er,DEFAULT_CARD_OUTLINE as Tr}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Rr,DEFAULT_COVER_INDEX as Nr}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Pr}from"efficient-easel/draw";import Ar from"../../components/MediaUploadField.js";import Lr from"../../components/MultiSelectField.js";import kr from"../../components/SectionThemePicker.js";import Fr from"../../components/SearchSelectField.js";import vr from"../../components/StorefrontLinkField.js";import{UiIcon as Ut}from"efficient-easel/draw/client";import{SECTION_PADDING as P}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Dr}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Br}from"efficient-easel/draw/client";import{encodePartId as Hr}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Gr,useEaselStrings as Mr}from"efficient-easel/strings";import{hasPhoneHeight as Ur,hasTabletHeight as Ge,resolveSectionMinHeight as Wr,resolveTabletHeight as Kr}from"../../../format/lib/content/section-min-height.js";import{INTRO_OLD_STICKY_PINS as Xr,SECTION_PIN_ABOVE_HINT as $r,SECTION_PIN_ABOVE_KEY as jr,SECTION_PIN_ABOVE_LABEL as Vr,SECTION_PIN_GROUP as Yr,SECTION_PIN_LABEL as Wt,SECTION_PIN_SCREENS_KEY as Me,SECTION_PIN_SCREENS_LABEL as Kt,SECTION_PIN_STOP_DEFAULT as zr,SECTION_PIN_STOP_HINT as qr,SECTION_PIN_STOP_KEY as Jr,SECTION_PIN_STOP_LABEL as Zr,SECTION_PIN_STOP_OPTIONS as Qr,SECTION_STICK_DISTANCE as U,SECTION_STICK_DISTANCE_ROW as Ue,SOME_VIEW_PINS as Xt,hasPhoneStick as ei,hasTabletStick as ti,resolveSectionStick as ue,sectionPinStopOf as ni,sectionPinStopWrite as oi}from"../../../format/lib/content/section-sticky.js";import{cssLengthOf as ri}from"../../../format/lib/content/css-length.js";import{SECTION_HEIGHT_MODES as ii,SECTION_MIN_HEIGHT as si,SECTION_MIN_HEIGHT_GROUP_LABEL as Q,SECTION_SCREEN_PCT as li,SECTION_HEIGHT_UNITS as ai}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as ci,resolveContainerDirection as $t}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as ui,BOX_BLOCK_SPACING_POINTS as jt,BOX_PHONE_ROW_LABEL as Vt,BOX_COLUMNS_MAX as di,BOX_COLUMNS_MIN as Yt,BOX_PHONE_ROW_MAX as pi,BOX_PHONE_ROW_MIN as We,BOX_SHARE_CHOICES as zt,BOX_SHARE_LABEL as z,boxShareChoiceOf as qt,boxShareWidthsOf as Ke,BOX_SHARE_PHONE_DEFAULT as fi,BOX_SHARE_PHONE_POINTS as hi}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as W}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Jt,BORDER_SIDES as mi,SECTION_BORDER_ROW as Zt,borderBySide as Qt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as gi,normalizeTheme as en,normalizeThemeColors as bi,sectionBandTone as Si,surfaceTwoTone as wi}from"../../../format/lib/theme.js";import{CONTAINER_GAP as tn,CONTAINER_GAP_BUILT_IN as _i,CONTAINER_GAP_PHONE as Xe,GAP_FIELD_CONTAINER as $e,followsSitePhoneGap as Ci,hasOwnContainerGap as yi,hasOwnPhoneGap as je,resolveContainerGap as nn,resolvePhoneContainerGap as on}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as xi,CARD_IMAGE_BG_OFF as Oi,CARD_IMAGE_BG_SWATCH_NAMES as Ii,CARD_IMAGE_BG_SWATCHES as Ei,isCardImageBackgroundInheriting as Ti,cardImageBackgroundChoice as Ri,THEME_CARD_IMAGE_BG as Ni}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Pi,SECTION_BG_NO_FILL as Ai,sectionBackgroundChoice as Li,THEME_SECTION_BG as Ve,isSectionBackgroundEmpty as ki,sectionBackgroundHex as rn}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Fi,nestedAccentValue as sn,resolveSectionAccent as de}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as vi,TYPE_SIZE_INHERIT as Di,isTypeSizeInheriting as Bi}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Hi,WIDTH_CHOICE_LABEL as Gi,WIDTH_INHERIT as Mi}from"../../../format/lib/content/section-width.js";import{useEaselSession as Ui}from"efficient-easel/screen/lib/session-context";import{backendOf as Wi}from"../website-session.js";import{BOX_GAP as Ki,describedAs as v,group as T,iconOf as K,sharedStyleKinds as ee}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ln,onDesktopWords as X,phoneTwinFields as Ye,saidAlignmentGrid as Xi,useLengthUnit as $i}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as ji,PICTURE_PICKER_ROW as Vi,directionField as Yi,gapField as ze,iconPickerRow as an,lengthUnitFields as pe,pickerCellIcon as zi,pickerNoneIcon as qi,Segmented as fe,select as A,slider as H}from"./box-fields.js";import{VIEW_ABOVE as qe}from"efficient-easel/screen/lib/content/length-units";import{tierOfView as cn,viewOfTier as Ji}from"../../../format/lib/content/view-tier.js";import{ownEntry as Zi}from"../../../format/lib/own-entry.js";import{LAYOUT_CELL as Qi,galleryPhonePicture as un}from"./choice-pictures.js";function dc({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?a(e):e})}function $(e,t){return a("{value} from {from}",{value:e,from:t})}function es(){const{blockGap:e}=W();return e===null?a("this container's own spacing"):$(`${e}px`,a("Styles"))}function ts({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:es(),onReset:t})}function ns(e){return ze({...Ki,builtIn:_i[e],resolve:(t,n)=>nn(e,t,n?.siteGap),action:(t,n)=>i(ts,{inherited:!yi(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[$e]:e}})}function os(e){return ft(y("mobile",{[$e]:e,type:"custom",render:t=>i(ss,{container:e,...t})}),dn)}function rs(e){return ft(y("tablet",{[$e]:e,type:"custom",render:t=>i(is,{container:e,...t})}),dn)}const dn={not:{field:"gap",in:Array.from({length:-tn.min},(e,t)=>tn.min+t)}};function pc(e){return{gap:y("desktop",ns(e)),[Be("gap")]:rs(e),[B("gap")]:os(e)}}function is({container:e,...t}){const[n]=R("gap"),{siteGap:o}=t.field??{},r=Math.max(Xe.min,nn(e,n,o));return ze({...Xe,builtIn:r,resolve:s=>je(s)?s:r,action:(s,c)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(s),detail:X(u=>a(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function ss({container:e,...t}){const[n]=R("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},l=on(e,void 0,n,o,r);return ze({...Xe,builtIn:l,resolve:c=>on(e,c,n,o,r),action:(c,u)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(c),detail:$(`${l}px`,Ci(e,n,r)?a("Styles"):a("Desktop")),onReset:()=>u(void 0)})}).render(t)}function fc(e){return Yi({offered:ci(e),fallback:$t(e,void 0),resolve:t=>$t(e,t)})}function hc(e,t){return co(t?ao(e,t):[],t)}function ls({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:$(a("Full"),a("the page")),onReset:t})}function j({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:s=!0,markup:c=!0}){const{text:u,hidden:d}=ct(e),h=J(null),p=J(null),f=C=>t(s?{text:C,hidden:d}:C),m=()=>t({text:u,hidden:!d}),g=s&&d,b=lt(),w=r?ps(r)?i("span",{className:"sf-hint-while-typing",children:a(r)}):a(r):void 0,S=d?a("Show {label} on the slide",{label:a(n)}):a("Hide {label} on the slide",{label:a(n)});return i(_,{label:a(n),icon:i(Po,{}),htmlFor:b,className:g?"is-hidden":void 0,hint:w,action:s?i(ke,{content:S,children:i(Dt,{"aria-pressed":d,"aria-label":S,onClick:m,children:d?i(Ut,{name:"eye-off",size:14}):i(Ut,{name:"eye",size:14})})}):void 0,children:L("div",{className:"sf-copybox",children:[c&&i(Gt,{target:l?p:h,value:u,onChange:f}),l?i("textarea",{id:b,ref:p,value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)}):i("input",{id:b,ref:h,type:"text",value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)})]})})}function mc(e,t){return{...e,[pt]:t}}function gc(e){const t=e[N];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[N]:{...t,offPage:!0}}}function bc(e){return!e||typeof e!="object"?!1:e[N]?.offPage===!0}function Sc(e){if(!e[N])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Cr]:!0}}function wc(e){return _r(e)}function _c(e){const t=e[N];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[N]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Fu,SCALAR_TEXT_CONTROLS as vu}from"efficient-easel/draw";function Cc(e,t){if(!e[N])throw new Error("inOwnBox: the field holds no authored text");const{[br]:o,...r}=e;return{...r,[wr]:!0,render:t}}const as=new Set(Pr),he={type:"radio",options:[{value:!0},{value:!1}]},pn={text:{type:"object",objectFields:{text:{type:"text"},hidden:he}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:he}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},V=(e,t)=>{const n=v({...t,[N]:e},{...pn[e.control],label:e.label});if(!as.has(e.control))return n;const o=t.render;return{...Mt(n,"authored-copy"),render:r=>i(xr,{name:r.name,children:o(r)})}},yc="Everything else on this block comes from the linked post. Unlink it to edit by hand.",cs={field:"source.slug",set:!0},xc={not:cs},us="Select a word, then press the highlighter.",ds=new Set([us]),ps=e=>ds.has(e);function Oc(e,t,n){return V({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ic(e,t,n){return V({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ec(e,t,n){return V({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Tc(e,t,n){return V({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Rc(e){return{type:"custom",[dt]:{label:e},...v({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(vr,{value:ut(t),onChange:n,label:e})}}function Nc(e,t,n){return V({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Pc={Design:fo,Animation:mo};function Ac(e,t){return{type:"custom",render:()=>i(fs,{text:e,values:t})}}function fs({text:e,values:t}){return i("p",{className:"sf-note",children:a(e,t)})}function Lc(e){return Ee(e)!==null&&e?.tabs!==void 0}const fn=new Map;function kc(e,t){const n=`${e}\0${t?t.join(""):""}`,o=fn.get(n)??{type:"custom",tabs:t,[Oe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return fn.set(n,o),o}const hn=new Map;function Fc(e){const t=hn.get(e)??{type:"custom",[Oe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return hn.set(e,t),t}function hs(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function vc(e,t){return hs(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function Dc(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function Bc({title:e,children:t}){const[n,o]=Z(()=>!Je.has(e));return i(Ko,{title:e,open:n,onToggle:r=>{o(r),r?Je.delete(e):Je.add(e)},children:t})}const Je=new Set;function ms({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,s=l?a(l):t;return L("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?a(o[c]):c;return i(ke,{content:u,children:i(rr,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function Hc(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(gs,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function gs({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const l=typeof o=="string"?o:void 0,{colors:s,n:c}=nt(),u={background:s.background,surface:s.surface,surface2:wi(s),band:Si(s)},d=n?Ve:t,h=ki(l,t,d),p=rn(void 0,d,u),f=n?Pi:void 0,m=d===Ve?a("the theme's section background"):a("Theme {n} background",{n:c}),g=bs(l,t,s,c,u,r),b=$(p.toUpperCase(),m),w=Fe(l),S=w?ce(w,s,c):null;return S?i(ae,{label:a(e),icon:i(bt,{}),value:S.hex,caption:S.words,onChange:r,changed:!0,onReset:()=>r(f),resetTo:b,choices:g}):i(Ht,{label:a(e),icon:i(bt,{}),value:h?"":rn(l,t,u),inherited:p,resetTo:b,onChange:r,onReset:()=>r(f),choices:g})}function bs(e,t,n,o,r,l){const s=Li(e,t);return[{label:a("No fill"),color:"",selected:s==="none",onPick:()=>l(Ai)},{label:`${a("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:s==="band",onPick:()=>l(Ve)},...tt(Fe(e)??"",n,o,l)]}function Ss(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=Ti(r,t);return i(_,{label:a(e),icon:i(Ne,{}),changed:!l,action:i(O,{words:x()?.panel,label:a(e),changed:!l,detail:a("the theme's image stage"),onReset:()=>o(xi)}),children:ms({swatches:Ei,current:l?Ni:Ri(r,t),onPick:o,names:Ii})})}}}function Gc(e=n=>n,t){return ee({_gSectionTheme:T(Fi),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(kr,{value:e(n),onChange:o,followLabel:t})}})}function me(e){const t=E(),n=cn(e?.view),o=s=>He(e.valueKey,s),r=e.numbersIn??(s=>Y(t[o(s)])!==void 0),l=e.followsView??ks(n,r);return $i({props:{value:void 0,onChange:()=>{},field:{}},row:e.valueKey?e.row:void 0,table:ji,label:a(e.label),grid:e.grid,hasOwn:r(n),view:{tier:n,numbersIn:r,followsView:l},convertTo:e.convertTo??(s=>{const c=Y(t[o(n)]);return c===void 0?{}:{[o(n)]:s(c)}})})}function q({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:s=!0,notch:c,ariaLabel:u,disabled:d=!1,placeholder:h,placeholderWord:p,onClear:f,units:m,inputMax:g}){const b=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:b?"sf-slider has-notch":"sf-slider",style:b?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(fr,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:a(p)}:{},suffix:l||void 0,...m?{units:m}:{},...g!==void 0?{inputMax:g}:{},showInput:s,label:u===void 0?void 0:a(u),disabled:d,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:w=>{w===null?f?.():w!==o&&r(w)}})})}function ws(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:s,restTrack:c,unsetMark:u,icon:d,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:f})=>{const m=typeof p=="number"?p:null,g=m===null;return i(_,{label:a(e),icon:d?K(d):void 0,value:g?u||l===void 0?void 0:a(l):`${m}${h}`,changed:!g,action:u?xe(u,{changed:!g,onReset:()=>f(null)}):i(O,{words:x()?.panel,label:a(e),changed:!g,onReset:()=>f(null)}),hint:typeof s=="string"?a(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:f}):q({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:f})})}}}const te="Corners",_s={kind:"radius"};function Ze(e){return{type:"custom",render:t=>{const{value:n,onChange:o}=t,r=typeof n=="number"&&Number.isFinite(n)?n:null,l=r!==null;return i(_,{label:a(te),icon:i(wt,{}),changed:l,action:xe(e.mark,{changed:l,onReset:()=>o(null)}),hint:e.hint,children:i(Cs,{tier:e,px:r,name:t.name,onRadius:o})})}}}function R(e){const t=G();return[t?.values?.[e],n=>t?.onChange(e,n)]}function mn(){return Mt({type:"custom",render:()=>i(Sr,{})},"always")}function ge(){const e=G();return t=>e?.onChangeMany(t)}function Cs({tier:e,px:t,name:n,onRadius:o}){const r=e.useFollowed(),[l,s]=R(e.sidesKey),c=ge(),u=me({row:e.row??_s,label:te,grid:{min:F,max:Te,step:e.step??1},valueKey:n??"",view:"desktop"}),d=At(l)??[...Nt];return i(ir,{label:a(te),value:d,corners:Ho,onChange:h=>{const p=At(h)??[];s(p.length===Nt.length?null:p)},radius:t,onRadiusChange:u&&n?h=>c({[n]:h,...u.unitPatch(h===null)}):o,radiusMin:u?.grid.min??F,radiusMax:u?.grid.max??Te,radiusStep:u?.grid.step??e.step??1,radiusPlaceholder:u&&u.unit!=="px"?"–":String(r),...u?{radiusUnit:u.unit,units:u.units}:{}})}function gn(e,t){return pe(e,t)}function bn(){return mn()}function ys({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=W(),r=typeof o=="number"?`${o}px`:a("not set");return i(O,{words:x()?.panel,label:a(e),changed:t,detail:o==null?a("the built-in corners"):$(r,a("Styles")),onReset:n})}function xs(){const{cornerRadiusPx:e}=W();return typeof e=="number"?e:F}function Os(){return Ze({sidesKey:"sectionCornerSides",row:Pt,useFollowed:xs,mark:i(ys,{label:te}),hint:Is})}const Is="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Mc(){return ee({_gShape:T("Shape"),sectionCorners:Os(),...gn(Pt,"sectionCorners"),sectionCornerSides:bn(),...M("sectionBorder",Ls),...pe(Zt,"sectionBorder",{tablet:!0,phone:!0})})}const Es=()=>({width:a("Border width"),sides:{top:a("Border top"),right:a("Border right"),bottom:a("Border bottom"),left:a("Border left")},style:a("Border style"),styles:{solid:a("Solid"),dashed:a("Dashed"),dotted:a("Dotted")},color:a("Border color"),unit:"px"});function Ts(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Rs(){let e;try{const t=en(W().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||gi.line}function Ns({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:s={},length:c}){const u=e&&typeof e=="object"?e:{},[d,h]=Z(()=>r?Yo(u,s):!1),p=Es(),f=m=>Ts(r&&l?m:{width:m.width,color:m.color,...l?{style:m.style}:{}});return i(_,{label:a("Border"),icon:i(go,{}),action:r?i(jo,{each:d,label:a("Each side"),onChange:h}):void 0,children:i($o,{label:a("Border"),value:u,each:d,onChange:m=>t(f(m)),placeholder:n,presets:o,words:c?{...p,unit:c.unit}:p,styles:l,max:c?.grid.max??Jt,...c?{step:c.grid.step,units:c.units}:{}})})}function Ps({value:e,onChange:t,view:n}){const[o]=R("sectionBorder"),[r]=R(Be("sectionBorder")),l=Rs(),s=f=>f&&typeof f=="object"?f:{},c=n==="phone"?{...Qt(s(o)),...Qt(s(r))}:n==="tablet"?s(o):{},u=E(),d=ge(),h=I("sectionBorder",n),p=me({row:Zt,label:"Border",grid:{min:0,max:Jt,step:1},valueKey:"sectionBorder",view:n,numbersIn:f=>Qe(u[He("sectionBorder",f)]),convertTo:f=>{const m=s(u[h]);return Qe(m)?{[h]:As(m,f)}:{}}});return i(Ns,{value:e,length:p,onChange:p?f=>d({[h]:f,...p.unitPatch(!Qe(f))}):t,placeholder:{sides:Vo(c),style:c.style??"solid",color:c.color||l},presets:[l],above:c})}const Sn=["width",...mi];function Qe(e){if(!e||typeof e!="object")return!1;const t=e;return Sn.some(n=>Y(t[n])!==void 0)}function As(e,t){const n={...e};for(const o of Sn){const r=Y(n[o]);r!==void 0&&(n[o]=t(r))}return n}function Ls(e){return{type:"custom",render:({value:t,onChange:n})=>i(Ps,{value:t,onChange:n,view:e})}}function ks(e,t){let n=qe[e];for(;n&&qe[n]!==null&&!t(n);)n=qe[n];return n??e}function Uc(e){return{type:"custom",render:()=>i(Fs,{partKey:e})}}function Fs({partKey:e}){const[t]=R("id"),[n]=R("_partStyles"),{textStyles:o}=W(),r=Mr();let l=null;try{l=Br().select}catch{l=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Wo,{name:a("Text"),preview:Dr(s,c,{noStyle:a("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Gr.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(Hr(t,e))}})}function wn(e){const{cornerRadiusPx:t}=W(),n=typeof t=="number"?t:e;let o=null;try{const{appState:l,selectedItem:s}=re(u=>u),c=s?.props?.id?String(s.props.id):void 0;o=c?Uo(l?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Go(r)?r:n}function vs({label:e,changed:t=!1,onReset:n=()=>{}}){const o=wn(F);return i(O,{words:x()?.panel,label:a(e),changed:t,detail:$(`${o}px`,a("the section")),onReset:n})}function Ds(){return i(k,{children:a("Follows the section's Corners until you set a number here.")})}function Bs(){return Ze({sidesKey:"cardCornerSides",row:Lt,useFollowed:()=>wn(F),mark:i(vs,{label:te}),hint:i(Ds,{})})}function Hs(){return{type:"custom",render:()=>i($n,{})}}function Wc(){return{_gShape:T("Shape"),cardCorners:Bs(),...gn(Lt,"cardCorners"),cardCornerSides:bn(),cardCornersApplyAll:Hs()}}function Gs(){return v({type:"custom",[Vi]:!0,render:e=>i(Us,{...e})},{type:"select",label:z,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ms(e,t){const n=qt(e);if(n!=="custom")return a(zt.find(r=>r.value===n)?.label??"");const o=vt(Ke(e,t),t);return o?[...o,100-o.reduce((r,l)=>r+l,0)].join(" / "):a("Custom")}function Us(e){const{value:t,onChange:n}=e,[o]=R("content"),r=Array.isArray(o)?o.length:0,l="follows"in e,s=t!=null,c=s?t:l?e.follows:void 0,u=qt(c),d=r>=2&&r<=Ft,h=()=>[...ur[r]??[]],p=J(null),f=S=>{const C=p.current;C&&JSON.stringify(S)===JSON.stringify(C.shares)?n(C.value):S&&n(S)},m=S=>{S===u||S==="custom"&&!d||n(S==="custom"?h():S)},g=a("The width bar works for 2 to {count} blocks.",{count:Ft}),b=s&&(l||t!=="content"),w=pr().widths.hint(r,cr);return i(_,{label:a(z),icon:i(se,{}),changed:b,hint:u!=="custom"?void 0:d?w:g,action:i(O,{words:x()?.panel,label:a(z),changed:b,disabled:e.readOnly===!0,detail:l?X(S=>a(S),Ms(e.follows,r),e.followsView):a("Fit content"),onReset:()=>n(void 0)}),children:L("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(kt,{label:a(z),value:u,options:zt.map(S=>({value:S.value,label:S.value==="custom"&&!d?g:a(S.label),icon:zi(i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(S.weights).map((C,D)=>i("i",{style:{gridColumn:`span ${C}`}},D))}),a(S.label),S.value==="custom"&&!d?g:a(S.label))})),onChange:m,columns:3,cell:Cn,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&d?i("div",{onFocus:()=>{p.current={value:t,shares:vt(Ke(c,r),r)}},onBlur:()=>{p.current=null},children:i(dr,{label:a(z),count:r,value:Ke(c,r),onChange:f,readOnly:e.readOnly===!0})}):null]})})}function _n(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 Kc(){return A(ui,i(xo,{}),jt,jt[0].value)}function Xc(e){return A("On a phone",i(To,{}),[{label:"In the header",value:"header"},{label:"In the menu",value:"menu"}],e)}function $c(){return y("mobile",an(z,i(se,{}),hi.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),fi,{columns:2,cell:Cn}))}const Cn={width:"5.75rem",height:"3.25rem",words:!0};function jc(){return Ye("share",Gs(),ln)[Be("share")]}function Ws(){return y("mobile",H(Vt,i(St,{}),We,pi,1,We,"",{clear:{phoneFollows:!1,hint:We}}))}const yn={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Vc(){const e=H(Vt,i(St,{}),Yt,di,1,Yt,"",{clear:{emptyLabel:"Auto"}}),t=Ye("columns",e,{...yn,tablet:ln.tablet}),n=Ye("columns",e,yn,{phoneRow:Ws()});return{...t,phoneRow:n.phoneRow}}function Yc(e,t,n,o,r,l,s){return{type:"custom",render:({value:c,onChange:u,name:d})=>i(Ks,{label:e,min:t,max:n,step:o,fallback:r,role:l,value:c,onChange:u,name:d??"",length:s})}}function Ks({label:e,min:t,max:n,step:o,fallback:r,role:l,value:s,onChange:c,name:u,length:d}){const h=E(),p=ge(),f=cn(d?.view),m=me({row:d?.row??{kind:"fontSize"},label:e,grid:{min:t,max:n,step:o},valueKey:d?u:"",view:d?.view??"desktop",numbersIn:b=>b===f&&typeof h[u]=="number",followsView:f,convertTo:b=>typeof h[u]=="number"?{[u]:b(h[u])}:{}}),g=b=>m?p({[u]:b,...m.unitPatch(typeof b!="number")}):c(b);return i(_,{label:a(e),icon:i(Tt,{noun:l}),action:i(O,{words:x()?.panel,label:a(e),changed:!Bi(s),detail:a("the Text style in Styles"),onReset:()=>g(Di),defaultAction:{onPress:()=>g(vi),title:a("Keep this section's own built-in size"),icon:i(bo,{})}}),children:q({min:m?.grid.min??t,max:m?.grid.max??n,step:m?.grid.step??o,value:typeof s=="number"?s:r,...m?{suffix:m.unit,units:m.units}:{suffix:"px"},ariaLabel:e,onChange:g})})}function be(e,t,n){return[{label:"Auto",value:""},...Array.from({length:e},(o,r)=>({label:r===0?`1 ${t}`:`${r+1} ${n}`,value:String(r+1)}))]}function zc(){return{_gCellWidth:T("Cell size"),gridSpan:y("desktop",A("Positions",i(se,{}),be(Zn,"position","positions"),"")),gridRowSpan:y("desktop",A("Rows tall",i(le,{}),be(mt,"row","rows"),"")),[to]:H("At card",i(Ct,{}),1,Qn,1,1,""),[B("gridSpan")]:y("mobile",A("Positions",i(se,{}),[{label:"Full row",value:""},...be(eo,"position","positions").slice(1)],"")),[B("gridRowSpan")]:y("mobile",A("Rows tall",i(le,{}),be(mt,"row","rows"),""))}}function E(){let e=null,t=null;try{e=st(Xs),t=re(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Xs=kn(null);function $s({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:s,fallback:c}){const u=E()[s],d=De(void 0,u,c);return i(k,{children:q({min:e,max:t,step:n,value:De(o,u,c),readout:!1,ariaLabel:r,notch:d,onChange:l})})}function js({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:l=()=>{}}){const s=E()[t],c=De(void 0,s,n);return i(O,{words:x()?.panel,label:a(e),changed:r,detail:X(u=>a(u),`${c}${o}`),onReset:l})}function Vs(e){return ws(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(js,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i($s,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Ys={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},zs={Top:Pe,Bottom:xt,Left:Ot,Right:It},qs=e=>{const t=zs[e];return i(t,{})};function qc(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=w=>Ys[w],l=w=>H(r("Top"),i(Pe,{}),P.min,P.max,P.step,w,"px"),s=(w,S,C,D=P)=>y("mobile",Vs({label:r(w),icon:qs(w),desktopKey:S,min:D.min,max:D.max,step:D.step,fallback:C})),c=e.top??P.min,u=e.bottom??P.min,d="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??P,f=e.side??p.min,m=e.sidePhone??f,g=e.phone===!0,b=w=>g?y("desktop",w):w;return ee({...o?{_gSpacing:T("Padding")}:{},[t]:b(l(c)),...g?{[B(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:b(H(r("Bottom"),i(xt,{}),P.min,P.max,P.step,u,"px")),...g?{[B(n)]:s("Bottom",n,u)}:{}},...e.sides?{[d]:b(H(r("Left"),i(Ot,{}),p.min,p.max,p.step,f,"px")),...g?{[B(d)]:s("Left",d,m,p)}:{},[h]:b(H(r("Right"),i(It,{}),p.min,p.max,p.step,f,"px")),...g?{[B(h)]:s("Right",h,m,p)}:{}}:{}})}function Jc(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,s])=>[l,l in e&&Ee(s)?e[l]:s])),o={};let r=!1;for(const[l,s]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=s}return r||Object.assign(o,n),o}const Se="Width";function Zc(e,t=Hi,n=!0){const o=t.map(r=>({label:Gi[r],value:r}));return ee({...n?{_gWidth:T(Se)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(_,{label:a(Se),icon:i(Ao,{}),action:n?i(ls,{inherited:l?.inherited??!1,onReset:()=>r(Mi),label:Se}):void 0,children:fe({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:Se})})}})}function Qc({fill:e=!1}={}){const t=(r,l)=>({type:"custom",render:({value:s,onChange:c})=>i(Js,{value:s,onChange:c,view:r,badge:l,fill:e})}),n=()=>ve("sectionHeightMode"),o=()=>ve("sectionHeightMode");return ee({_gHeight:T(Q),...M("sectionHeightMode",r=>r==="desktop"?t(r):t(r,l=>i(tl,{view:r,onClear:()=>l(void 0)}))),...M("sectionHeightValue",n),...M("sectionHeightUnit",o)})}function Js({value:e,onChange:t,view:n,badge:o,fill:r=!1}){const l=E(),{mode:s,number:c,unit:u}=Zs(n,l,e);return i(_,{label:Q,icon:K(i(le,{})),action:o?o(t):void 0,children:L("div",{className:"es-width-stack",children:[fe({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"},...r?[{label:"Fill",value:"fill"}]:[]],value:s,onChange:t,ariaLabel:Q}),c?i(el,{view:n,mode:s,menu:u}):null]})})}function xn(e,t){return e==="phone"&&Ge(t)?Kr(t):Wr(t)}function we(e,t){return e==="desktop"||(e==="tablet"?Ge(t):Ur(t))?null:xn(e,t)}function Zs(e,t,n){const r=(l=>ii.includes(l))(n)?n:we(e,t)?.mode??"auto";return{mode:r,number:r!=="auto"&&r!=="fill",unit:r==="fixed"}}function Qs(e,t,n,o){const r=we(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[I("sectionHeightMode",e)]:r.mode,...r.mode==="fixed"?{[I("sectionHeightUnit",e)]:r.unit}:{},...n==="sectionHeightUnit"?{[I("sectionHeightValue",e)]:r.value}:{},[I(n,e)]:o}}function On(e,t,n){const o=G(),r=we(e,E());return!o||!r?{followed:null,write:n}:{followed:r,write:s=>o.onChangeMany(c=>{const u=Qs(e,c,t,s);return u===null?{[I(t,e)]:s}:Object.keys(u).length?u:null})}}function el({view:e,mode:t,menu:n}){const o=G(),r=E(),l=I("sectionHeightValue",e),s=I("sectionHeightUnit",e),c=w=>S=>o?.onChangeMany(()=>({[w]:S})),{followed:u,write:d}=On(e,"sectionHeightValue",c(l)),{write:h}=On(e,"sectionHeightUnit",c(s)),p=t==="screen"?"%":r[s],f=Bn(ai,"px",u?u.unit:p),m=f==="%"?li:si,g=r[l],b=n?{options:["px","%"],label:a("Unit"),onChange:w=>h(w)}:void 0;return q({min:m.min,max:m.max,step:m.step,value:u?null:typeof g=="number"?g:m.fallback,...u?{placeholder:u.value}:{},suffix:f,...b?{units:b}:{},ariaLabel:Q,onChange:d})}function tl({view:e,onClear:t}){const n=E(),o=we(e,n)===null,r=e==="phone"&&Ge(n),l=xn(e,n),s=X(c=>a(c),l.mode==="auto"?a("Auto"):`${l.value}${l.unit}`,r?"tablet":"desktop");return i(O,{words:x()?.panel,label:a(Q),changed:o,detail:s,onReset:t})}function eu(e={}){const t=e.intro===!0,n=l=>({type:"custom",render:({value:s,onChange:c,id:u,name:d})=>i(al,{value:s,onChange:c,labelId:`${u??d??"stickTop"}-label`,view:l,intro:t})}),o=l=>({type:"custom",render:({value:s,onChange:c})=>i(il,{value:s,onChange:c,view:l,intro:t})}),r=l=>({type:"custom",render:({value:s,onChange:c})=>i(sl,{value:s,onChange:c,view:l,intro:t})});return{_gStick:T(Yr,{dot:t?rl:Xt}),...M("stickTop",n),...M("stickTopDistance",o),...pe(Ue,"stickTopDistance",{tablet:!0,phone:!0}),...e.screens?M(Me,r):{},...t?{}:{[Jr]:nl()},...t||e.above===!1?{}:{[jr]:ol()}}}function nl(){const e=A(Zr,i(Pe,{}),Qr,zr);return y("desktop",{...e,render:t=>{const n=e.render({...t,value:ni(t.value),onChange:o=>t.onChange(oi(o))});return xe(n,{hint:a(qr)})}})}function ol(){const e=Tn(Vr,!1,i(Et,{}),$r);return y("desktop",{...e,render:t=>e.render({...t,onChange:n=>t.onChange(n===!0?!0:void 0)})})}const rl={any:[Xt,Xr]};function In(e,t,n,o,r){const l=G(),s=E(),c=e==="desktop"||ne(e,s)?null:et(e,ue(s,{intro:o}));return{followed:c,write:(c||r)&&l?d=>l.onChangeMany(h=>{const p=ll(e,h,d,t,o),f=p===null?{[I(t,e)]:d}:p;return Object.keys(f).length?{...f,...r?.(d)??{}}:null}):n}}function il({value:e,onChange:t,view:n,intro:o}){const r=E(),l=ue(r,{intro:o}),s=h=>{const p=Ji(h);return p==="desktop"||ne(p,r)},c=me({row:Ue,label:"Distance from top",grid:{min:U.min,max:U.max,step:U.step},valueKey:"stickTopDistance",view:n,numbersIn:h=>s(h)&&Y(r[He("stickTopDistance",h)])!==void 0,followsView:n==="phone"&&l.ownTablet?"tablet":"desktop"}),{followed:u,write:d}=In(n,"stickTopDistance",t,o,c?h=>c.unitPatch(h===void 0):void 0);return i("div",{className:"sf-field",children:q({min:c?.grid.min??U.min,max:c?.grid.max??U.max,step:c?.grid.step??U.step,value:u?null:typeof e=="number"?e:U.fallback,...u?{placeholder:u.distance}:{},...c?{suffix:c.unit,units:c.units}:{suffix:"px"},ariaLabel:a("Distance from top"),onChange:d})})}function sl({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=In(n,Me,t,o);return i(_,{label:a(Kt),icon:K(i(le,{})),children:q({min:ie.min,max:ie.max,step:ie.step,value:r?null:Y(e)??ie.default,...r?{placeholder:r.screens}:{},ariaLabel:a(Kt),onChange:l})})}function ne(e,t){return e==="tablet"?ti(t):ei(t)}function et(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance,unit:t.tabletUnit,screens:t.tabletScreens}:{on:t.desktop,distance:t.desktopDistance,unit:t.desktopUnit,screens:t.desktopScreens}}function ll(e,t,n,o="stickTopDistance",r=!1){if(e==="desktop"||ne(e,t))return null;if(n===void 0)return{};const l=et(e,ue(t,{intro:r})),s=e==="phone"&&ne("tablet",t)?h=>I(h,"tablet"):h=>h,c=(h,p)=>t[s(h)]==null?{}:{[I(h,e)]:p},u=Ue.unitKey,d=t[s(u)]==null?{}:{[I(u,e)]:l.unit};return{[I("stickTop",e)]:!0,...c("stickTopDistance",l.distance),...d,...c(Me,l.screens),[I(o,e)]:n}}function al({value:e,onChange:t,labelId:n,view:o,intro:r}){const l=E(),s=ue(l,{intro:r}),c=o==="phone"?s.phone:o==="tablet"?s.tablet:r?s.desktop:e===!0,u=o==="phone"&&s.ownTablet,d=o==="desktop"?null:et(o,s),h=d?.on?ri(d.distance,d.unit):a("Off");return i(_,{label:a(Wt),labelId:n,icon:K(i(Et,{})),action:L(k,{children:[o!=="desktop"?i(O,{words:x()?.panel,label:a(Wt),changed:ne(o,l),detail:X(p=>a(p),h,u?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(Le,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const En="e.g. about";function tu(){return{_gAnchor:T("Anchor"),anchor:V({control:"plainText",label:"Name",placeholder:En},{type:"custom",render:({value:e,onChange:t})=>i(uo,{value:e,onChange:t,nameBox:(n,o)=>i(j,{value:n,onChange:o,label:"Name",placeholder:En,hideable:!1,markup:!1})})})}}function nu(){return{_gAdvanced:T("Advanced"),[Yn]:cl}}const cl={type:"custom",render:({value:e,onChange:t})=>i(_,{label:a("Custom CSS"),icon:K(i(qo,{})),children:i(hr,{"aria-label":a("Custom CSS"),spellCheck:!1,autoGrow:!0,className:"font-mono",value:typeof e=="string"?e:"",onChange:n=>t(n.target.value)})})};function ou(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(lr,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:d=>r(d?d.toISOString():"")})})}}}function ru(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-date`;return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(sr,{id:c,value:Dn(typeof o=="string"?o:null),onChange:u=>r(u?vn(u):"")})})}}}function Tn(e,t,n,o){return{type:"custom",...v({},{...he,label:e}),render:r=>{const{value:l,onChange:s,id:c,name:u}=r,d="follows"in r,h=r,p=typeof l=="boolean",f=typeof h.follows=="boolean"?h.follows:t,m=p?l:d?f:t,g=`${c??u??e}-label`,b=h.readOnly===!0,w=i(Le,{checked:m,onChange:s,disabled:b,ariaLabelledBy:g});return i(_,{label:a(e),labelId:g,icon:n,hint:o===void 0?void 0:a(o),action:d?L(k,{children:[i(O,{words:x()?.panel,label:a(e),changed:p,detail:h.followsNoView?a(f?"On":"Off"):X(S=>a(S),a(f?"On":"Off"),h.followsView),disabled:b,onReset:()=>s(void 0)}),w]}):w})}}}function iu(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(ul,{label:"Background",icon:i(Eo,{}),id:r,value:e,shown:Lo(e),onChange:t})}}}function su(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(ae,{label:a(e),icon:n,value:o||t,onChange:r})}}function ul({label:e,icon:t,id:n,value:o,shown:r,onChange:l}){const{colors:s,n:c}=nt(),u=Fe(o),d=u?ce(u,s,c):null;return i(ae,{label:a(e),icon:t,id:n,value:d?d.hex:r,caption:d?.words,onChange:l,choices:tt(u??"",s,c,l)})}function lu(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(dl,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function tt(e,t,n,o){const r=Ae(e);return gr(t,n).map(l=>({label:l.label,color:l.value,selected:r===l.name,onPick:()=>o(l.name)}))}function dl({value:e,onChange:t,twin:n}){const{colors:o,n:r}=nt(),l=o.background,s=$(l.toUpperCase(),a("Theme {n} background",{n:r})),[c,u]=R(ko),[d]=R(vo),h=typeof d=="string"&&d.trim()!=="",p=Rt(c),f=oe=>u(Rt(oe)||void 0),m=Ae(e),g=m?ce(m,o,r):null,b=tt(e,o,r,t),w=n?()=>t(void 0):()=>t("");let S=l,C=s;if(n){const oe=Ae(n.follows),Ce=Do(n.follows),ye=oe?ce(oe,o,r):Ce?{hex:Ce,words:Ce.toUpperCase()}:null;S=ye?.hex??l,C=X(Pn=>a(Pn),ye?ye.words:s,n.view)}const D=!n&&(Bo(e)||h)?i(pl,{value:p,onChange:f}):null;return g?i(ae,{label:a("Fill"),icon:i(Ne,{}),value:g.hex,caption:g.words,onChange:t,changed:!0,onReset:w,resetTo:C,choices:b,children:D}):i(Ht,{label:a("Fill"),icon:i(Ne,{}),value:e,inherited:S,resetTo:C,onChange:t,onReset:w,choices:b,children:D})}function pl({value:e,onChange:t}){return fe({options:Fo.map(n=>({label:n.label,value:n.value,hint:n.hint})),value:e,onChange:t,ariaLabel:a("Fill")})}function fl(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return de(n);const r=Mo(e,t);if(r.length===0)return null;const l=de(sn(n));if(l!==null)return l;for(let s=r.length-1;s>0;s-=1){const c=de(sn(r[s].sectionAccent));if(c!==null)return c}return de(r[0].sectionAccent)}function nt(){const e=en(W().theme),[t]=R("sectionAccent");let n=null;try{const{appState:r,selectedItem:l}=re(c=>c),s=l?.props?.id?String(l.props.id):void 0;n=s?fl(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:bi(e.themes[o]),n:o+1}}function au(){return mn()}const cu={top:i(Co,{}),right:i(_o,{}),bottom:i(So,{}),left:i(wo,{})};function uu(e,t,n,o,r,l,s){const c=p=>t.find(f=>f.value===p),u=p=>({value:p,label:"",disabled:!0,title:o}),d=p=>{const f=t.find(g=>g.cell===p);if(!f)return u(`missing-${p}`);const m=l?.[p];return m?{value:f.value,label:f.label,icon:m}:{value:f.value,label:f.label}},h=[u("corner-top-left"),d("top"),u("corner-top-right"),d("left"),u("centre"),d("right"),u("corner-bottom-left"),d("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:f})=>{const m=t.some(g=>g.value===p)?p:n;return i(_,{label:a(e),icon:r,value:c(m)?.label?a(c(m).label):s?a(s):"",children:Xi(a,{label:e,value:m,onChange:f,points:h})})}}}function du(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(Lr,{label:e,options:(l.options??t).map(s=>({...s,label:a(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:a(n)}:{}})}}function pu(e,t,n,o){return{type:"custom",options:t,fallback:n,...v({},{type:"select",label:e}),render:({value:r,onChange:l,field:s})=>i(Fr,{label:e,options:(s.options??t).map(c=>({...c,label:a(c.label)})),fallback:s.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:a(o)})}}function fu(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const hl={image:"Image",video:"Video"},hu=Ln.map(e=>({label:hl[e],value:e}));function mu(e,t,n){const o=Object.keys(at).map(r=>({label:at[r],value:r,picture:n[r]}));return{type:"custom",...v({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(gl,{label:e,icon:t,options:o,onChange:r})}}function ml(e,t,n){const o=Hn(e,t,n);if(o!==void 0)return o==="save-makes-frame"?a("A frame is made from this video when you save the page."):o==="starts-dark"?a("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?a("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?a("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?a("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?a("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Mn(e);return r==="frame-missing-image"?a("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?a("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?a("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?a("No image yet. The slide shows its background colour until you choose one."):void 0}function gl({label:e,icon:t,options:n,onChange:o}){const r=G(),l=r?.values??{},s=Gn(l),c=st(Kn),u=Wn(c?.docId??null);let d=null;try{d=re(p=>p.appState.data)}catch{d=null}const h=Un(r?.id,d,u);return i(_,{label:a(e),icon:K(t),hint:ml(l,h,c?.hasUnsavedEdits??!1),children:fe({options:n,value:s,onChange:o,ariaLabel:e})})}function gu(e,t,n,o={}){const r={type:"custom",[Ie]:!0,render:({value:l,onChange:s,name:c})=>i(Ar,{value:l||"",onChange:s,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?y("each",r):r}function bu(e){return ot(e).map(t=>t.path)}function ot(e,t="",n=[]){const o=[];for(const[r,l]of Object.entries(e??{})){const s=t?`${t}.${r}`:r,c=l;if(c&&c[Ie]){o.push({path:s,field:c,along:n});continue}c?.arrayFields&&o.push(...ot(c.arrayFields,`${s}[]`,[...n,c])),c?.objectFields&&o.push(...ot(c.objectFields,s,[...n,c]))}return o}const Su={HeroSingle:[An.image],HeroSlide:["videoFrame","videoFramePhone"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function bl(e){const t=a(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function wu({value:e,onChange:t,label:n}){const o=e||{},r=G(),l=r?r.values!==r.node.props:!0,s=!!o.pending&&l,c=!!o.pending&&!l,u=!!Wi(Ui()).geocode,d=lt(),h=(p,f)=>t({...o,[p]:f??void 0});return L(k,{children:[i(_,{label:a(n),icon:i(yt,{}),action:u?i(ke,{content:a("Find from the address (OpenStreetMap)"),children:i(Dt,{"aria-label":a("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Ro,{})})}):void 0,children:u&&o.status?i(po,{compact:!0,oneLine:!0,spaced:!1,status:s?"busy":o.ok&&!c?"found":"notfound",statusText:s?a("Finding…"):c?a(mr):a(o.status),hint:bl(o)}):null}),i(_,{label:a("Enter by hand"),labelId:d,icon:i(yo,{}),action:i(Le,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:d})}),o.manual&&i(_,{label:a("Latitude, longitude"),icon:i(yt,{}),children:L("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(Bt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:a("Latitude")}),i(Bt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:a("Longitude")})]})})]})}function Sl(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function wl(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function _u(e,t){return e===null?null:t>e?e:null}function _l(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 Cu={label:"Ticker items",icon:i(Io,{})};function yu(e,t,n,o){return{type:"custom",[N]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...v({},{...pn.textList,label:e}),render:({value:r,onChange:l})=>i(Cl,{label:e,icon:K(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function Cl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const s=J(null),[c,u]=Z(null),d=p=>p.map(f=>({text:f?.text??""})),h=p=>{const f=_l(n,p,c);f===null&&(s.current=null),u(f),r(d(p))};return i(zo,{label:a(e),icon:t,noun:a("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(Gt,{target:s,value:Sl(n,c),onChange:p=>r(wl(n,c??-1,p)),disabled:c===null,label:c===null?a("Formatting — click a row first"):a("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,f,m)=>i("input",{type:"text",className:l&&c===f?"sf-list-marking":void 0,value:p?.text??"",placeholder:a(o),"aria-label":a("{label} {n}",{label:a(e),n:f+1}),onChange:g=>m({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,u(f)}})})}function xu(e,t){const n=`${e.label} — row ${t+1}`;return V({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:a("{label} — row {n}",{label:a(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ou(e){return{_gCards:T("Cards"),coverIndex:A("Cover image",i(Oo,{}),Rr,String(Nr),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Ss("Image background",Oi),cardImage:Rn()}}function Iu(){return{outline:A("Card outline",i(No,{}),Ir,Tr),indexBadge:A("Card number",i(Ct,{}),Or,Er),showBadge:Tn("Product badge",!0,i(Tt,{noun:"tag"}))}}function Eu(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...he,label:_e.find(l=>l.id===r).label}),o=r=>v(ve(rt),n(r));return{_gShowOnCard:T("Show on a card"),[rt]:v({type:"custom",render:()=>i(yl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(rt)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const rt="showCardPrice",_e=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function yl({rest:e}){const t=E(),n=ge(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],l=_e.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(it,{parts:_e,changed:l,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(_e.map(({id:s})=>[s,void 0])))})}function Tu(e,t="display"){const n=B(t);return{[t]:y("desktop",{type:"custom",render:({value:o,onChange:r})=>i(it,{parts:e,changed:Zo(o),shown:l=>Qo(o,l),onPress:(l,s)=>r(nr(o,l,s)),onReset:()=>r(void 0)})}),[n]:y("mobile",{type:"custom",render:({value:o,onChange:r})=>i(xl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function it({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l,disabledReason:s}){const c=a("Display");return i(_,{label:c,icon:i(ho,{}),changed:t,action:i(O,{words:x()?.panel,label:c,changed:t,detail:l,onReset:r}),children:i(Jo,{label:c,items:e.map(u=>({id:u.id,label:a(u.label),shown:n(u.id),...s?{disabled:!0,disabledReason:a(s)}:{}})),onChange:o})})}function xl({parts:e,desktopKey:t,value:n,onChange:o}){const r=E()[t];return i(it,{parts:e,changed:tr(n),shown:l=>er(r,n,l),onPress:(l,s)=>o(or(n,l,s)),onReset:()=>o(yr),detail:a("the same as Desktop")})}function Rn(e=jn){return H("Card image",i(wt,{}),F,Te,Vn,F,e,{clear:{hint:F},hint:"Rounds the picture. The card's own corner is in Styles."})}function Ol(){return pe(ht,"cardImage")}function Ru(){return{cardImage:Rn(ht),...Ol()}}function Nu(){return Ze({sidesKey:"cornerSides",row:Jn,step:zn,useFollowed:()=>F,mark:i(Il,{label:qn}),hint:a("Rounds the picture. Left alone it stays square.")})}function Il({label:e,changed:t=!1,onReset:n=()=>{}}){return i(O,{words:x()?.panel,label:a(e),changed:t,onReset:n})}function Pu(){return{type:"custom",render:({value:e,onChange:t})=>i(Nl,{value:typeof e=="string"?e:"",onChange:t})}}const Nn="own";function Au(){const e=[{value:Nn,label:"Layout's own",picture:un(Array.from({length:8},()=>[3,1]))},...Object.entries(ro).map(([t,n])=>({value:t,label:n.label,picture:un([...n.phone,...n.phone])}))];return y("mobile",an("Layout",i(_t,{}),e,Nn,{columns:2,cell:Qi}))}function El({layout:e,width:t}){const n=io(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:so(e).map(([r,l],s)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${l}`,aspectRatio:o}},s))})}const Tl={width:"3.5rem",height:"2.5rem",words:!1},Rl=200;function Nl({value:e,onChange:t}){const[n,o]=Z(null),[r,l]=Z(4),s=J(null);Fn(()=>{const m=s.current;if(!m||typeof ResizeObserver!="function")return;const g=()=>l(m.getBoundingClientRect().width>=Rl?4:3);g();const b=new ResizeObserver(g);return b.observe(m),()=>b.disconnect()},[]);const c=e?Zi(Re,e):void 0,u=c?e:"",d=gt(n,u),h=gt(n,"").length,p=lo("no-symbol"),f=[{value:"",label:a("Not chosen"),icon:qi(p,a("Not chosen"))},...d.map(m=>({value:m,label:a(Re[m].label),icon:i(El,{layout:Re[m],width:40})}))];return i(_,{label:a("Layout"),icon:i(_t,{}),value:c?a(c.label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(kt,{label:a("Layout"),value:u,options:f,onChange:t,columns:r,cell:Tl,header:L("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:a("Photos in a row")}),i(Xo,{options:[{id:"all",label:a("All")},...no.map(m=>({id:String(m),label:String(m)}))],value:n===null?"all":String(n),ariaLabel:a("Photos in a row"),onChange:m=>o(m==="all"?null:Number(m))}),i("span",{className:"text-2xs text-ink-faint",children:a("{n} of {total} layouts",{n:h,total:oo.length})})]})})})})}export{cs as BOUND_TO_POST,yc as BOUND_TO_POST_NOTE,Pc as BUCKET_ICONS,cl as CUSTOM_CSS_ROW,Su as CUSTOM_FIELD_MEDIA,wu as CoordsField,dn as DESKTOP_GAP_NOT_OVERLAP,it as DisplayRow,cu as EDGE_ARROWS,ar as FOCAL_DEFAULT,Oe as FOLD_FIELD_MARKER,us as HIGHLIGHT_HINT,j as HidableTextField,dt as LINK_FIELD_MARKER,dc as Label,Ie as MEDIA_FIELD_MARKER,hu as MEDIA_TYPE_OPTIONS,xc as NOT_BOUND_TO_POST,Bc as PanelBand,fs as PanelNoteLine,Xs as RowPropsContext,pt as SCAFFOLD_FIELD_MARKER,vu as SCALAR_TEXT_CONTROLS,ts as SiteGapDefaultReset,q as Slider,ms as Swatches,Fu as TEXT_CONTROL_KINDS,N as TEXT_FIELD_MARKER,Cu as TICKER_ITEMS_ROW,Cl as TextListField,ul as ThemeFillRow,Se as WIDTH_LABEL,ls as WidthDefaultReset,_l as aimAfterListChange,tu as anchorFields,$ as backTo,Hc as backgroundField,Kc as boxBlockSpacingField,Vc as boxColumnsFields,lu as boxFillField,Ws as boxPhoneRowField,Gs as boxShareField,$c as boxSharePhoneField,jc as boxShareTabletField,fl as boxThemeIndexOf,kc as bucketHeader,Uc as buttonWordsEntryField,Bs as cardCornersField,Ss as cardImageBackgroundField,Rn as cardImageField,Ru as cardImageFields,Ou as cardMediaFields,Wc as cardShapeFields,Eu as cardShowFields,Iu as cardStyleFields,zc as cellWidthFields,su as colorInput,fc as containerDirectionField,ns as containerGapField,os as containerGapPhoneField,pc as containerGapRows,rs as containerGapTabletField,bl as coordsResultTip,Tc as copyText,bn as cornerSidesField,Ze as cornersRowField,gn as cornersUnitFields,nu as customCssFields,ru as date,ou as dateTime,Fc as designGroupHeader,Tu as displayFields,uu as edgePad,tt as fillSlotChoices,_u as focusAfterRemove,au as focusKeptField,vc as foldMarker,Ee as foldMetaOf,hs as foldTitleOf,Qs as followedHeightPatch,ll as followedStickPatch,Pu as galleryLayoutField,Au as galleryLayoutPhoneField,Qc as heightFields,we as heightFollowedBy,Zs as heightLayersAt,hc as heroGroupPlacementPoints,ut as hidableText,ps as hintIsWhileTyping,Nu as imageCornersField,Cc as inOwnBox,Lc as isBucketHeader,mn as keptBy,Rc as linkField,ml as loadingRowHint,mu as loadingShowsField,bu as mediaFieldPaths,ot as mediaFields,du as multiSelect,iu as pageBackgroundField,Ac as panelNote,Vs as phoneOverrideField,Xc as phonePlaceField,Ec as plainText,Nc as plainTextarea,ws as pxField,Dc as quietMarker,ct as readHidable,Sl as rowText,pu as searchSelect,bs as sectionBandChoices,Os as sectionCornersField,Mc as sectionShapeFields,Gc as sectionThemeFields,wl as setRowText,Yc as sizeField,fu as sourceField,qc as spacingFields,eu as stickFields,Jc as swapPadding,Oc as text,Xn as textFieldIdentifier,bc as textFieldOffPage,wc as textFieldPanelOnly,yu as textList,xu as textListRowField,Ic as textarea,Tn as toggle,gu as upload,me as useLengthRow,ge as useSelectedPatch,E as useSelectedProps,R as useSelectedSibling,es as useSiteGapDetail,Zc as widthField,_c as withIdentifier,gc as withOffPage,Sc as withPanelOnly,mc as withScaffold};
@@ -1,5 +1,11 @@
1
+ import { type TierFrames } from "../../../render/lib/content/section-padding.js";
1
2
  type Props = Record<string, unknown>;
2
- type FrameOf = (props: Props) => number;
3
+ type FrameOf = (props: Props) => number | TierFrames;
3
4
  type Note = (props: Props, frame: number) => string | null;
5
+ export declare function ownPadFallbackAt(frameOf: FrameOf, values: Props, key: string | undefined): {
6
+ top: number;
7
+ bottom: number;
8
+ };
9
+ export declare function ownPadNoteAt(frameOf: FrameOf, note: Note, values: Props, key: string): string | null;
4
10
  export declare function ownPaddingFields(frameOf: FrameOf, note: Note, label?: string): Record<string, unknown>;
5
11
  export {};
@@ -1 +1 @@
1
- import{jsx as i,Fragment as u,jsxs as c}from"react/jsx-runtime";import{useSelectedHost as d}from"efficient-easel/easel";import{SECTION_PAD_KEYS as m,padTotalKeys as f}from"../../../render/lib/content/section-padding.js";import{sidesPaddingFields as p}from"./box-fields.js";function j({frameOf:t,note:o}){const e=d()?.values,n=e?o(e,t(e)):null;return n?i("p",{className:"es-field-hint",children:n}):null}const O=new Set(f().filter(t=>t.startsWith(m.top)));function F(t,o,e){const n=p({tablet:!0,siteSide:!0,...e?{label:e}:{},useFallback:()=>{const s=d()?.values,r=s?t(s):0;return{top:r,bottom:r}}});return Object.fromEntries(Object.entries(n).map(([s,r])=>{const a=r.render;return!O.has(s)||typeof a!="function"?[s,r]:[s,{...r,render:l=>c(u,{children:[a(l),i(j,{frameOf:t,note:o})]})}]}))}export{F as ownPaddingFields};
1
+ import{jsx as i,Fragment as f,jsxs as p}from"react/jsx-runtime";import{useSelectedHost as d}from"efficient-easel/easel";import{VIEW_TIERS as O,viewKeyAt as P}from"efficient-easel/draw";import{SECTION_PAD_KEYS as c,frameAt as u,padTotalKeys as b}from"../../../render/lib/content/section-padding.js";import{sidesPaddingFields as j}from"./box-fields.js";const m=t=>O.find(r=>Object.values(c).some(e=>P(e,r)===t))??"desktop";function w(t,r,e){const n=u(t(r),m(e));return{top:n,bottom:n}}function x(t,r,e,n){return r(e,u(t(e),m(n)))}function S({frameOf:t,note:r,rowKey:e}){const n=d()?.values,o=n?x(t,r,n,e):null;return o?i("p",{className:"es-field-hint",children:o}):null}const _=new Set(b().filter(t=>t.startsWith(c.top)));function K(t,r,e){const n=j({tablet:!0,siteSide:!0,...e?{label:e}:{},useFallback:o=>{const s=d()?.values;return s?w(t,s,o.name):{top:0,bottom:0}}});return Object.fromEntries(Object.entries(n).map(([o,s])=>{const a=s.render;return!_.has(o)||typeof a!="function"?[o,s]:[o,{...s,render:l=>p(f,{children:[a(l),i(S,{frameOf:t,note:r,rowKey:o})]})}]}))}export{w as ownPadFallbackAt,x as ownPadNoteAt,K as ownPaddingFields};
@@ -30,3 +30,7 @@ export declare const GENERAL_ROOT_FIELDS: {
30
30
  export declare const PAGE_STYLE_FIELDS: readonly ["pageBackground", "topSpace", "widthChoice"];
31
31
  export declare const RECORD_TYPE_LABEL = "Record type";
32
32
  export declare function withRecordTypeRow(fields: Record<string, unknown>, rootProps?: Record<string, unknown> | null): Record<string, unknown>;
33
+ export declare function withSiteFooterRows(fields: Record<string, unknown>, rootProps?: Record<string, unknown> | null): Record<string, unknown>;
34
+ export declare function resolveSiteFooterData<D extends {
35
+ props?: Record<string, unknown> | null;
36
+ }>(data: D): D | Promise<D>;
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{ListIcon as w,PaddingTopIcon as T}from"efficient-easel/icons";import h from"../../components/WidthFollowField.js";import{say as a}from"../../../format/lib/editor-words.js";import{PRODUCT_RECORD_TYPE as E,TEMPLATE_RECORD_TYPE_PROP as p,declaredRecordType as R,recordTypes as s,recordTypesRevision as l}from"../../../format/lib/content/record-types.js";import{pageBackgroundField as f}from"./controls.js";import{select as u}from"./box-fields.js";import{isEditorOnDynamicPage as g}from"../../../format/lib/document/editor-page-context.js";import{DEFAULT_TOP_SPACE as P}from"../../../render/lib/document/header-clearance.js";function _(){return{type:"custom",render:({value:e,onChange:n})=>i(h,{value:e==="full"?"full":e==="content"?"content":void 0,resolved:"content",label:"Page width",followsLabel:a("Follows the site"),hint:a("Whether this page sits on the site's content column, or runs edge to edge."),onChange:o=>n(o)})}}const y=[{label:"Auto",value:"auto"},{label:"Shared",value:"shared"},{label:"Its own",value:"own"}],I={pageBackground:f(),topSpace:u("Top space",i(T,{}),y,P),widthChoice:_()},B=["pageBackground","topSpace","widthChoice"],O="Record type",c=new Map;let d=-1;function L(e){d!==l()&&(c.clear(),d=l());const n=s(),o=n.some(r=>r.key===e)?"":e;let t=c.get(o);return t||(t=u(O,i(w,{}),[...n.map(r=>({label:r.label,value:r.key})),...o?[{label:o,value:o}]:[]],E),c.set(o,t)),t}const m=new WeakMap;function W(e,n){if(!g()||s().length<2||p in e)return e;const o=L(R(n)),t=m.get(e);if(t&&t.row===o)return t.fields;const r={[p]:o,...e};return m.set(e,{row:o,fields:r}),r}export{I as GENERAL_ROOT_FIELDS,B as PAGE_STYLE_FIELDS,O as RECORD_TYPE_LABEL,y as TOP_SPACE_OPTIONS,_ as pageWidthField,W as withRecordTypeRow};
1
+ import{jsx as i}from"react/jsx-runtime";import{ListIcon as d,PaddingTopIcon as T,PaddingXIcon as R}from"efficient-easel/icons";import g from"../../components/WidthFollowField.js";import{say as c}from"../../../format/lib/editor-words.js";import{PRODUCT_RECORD_TYPE as w,TEMPLATE_RECORD_TYPE_PROP as a,declaredRecordType as P,recordTypes as u,recordTypesRevision as E}from"../../../format/lib/content/record-types.js";import{CUSTOM_CSS_ROW as h,pageBackgroundField as C,toggle as I}from"./controls.js";import{SITE_FOOTER_KIND as m}from"../../../format/lib/content/footer.js";import{SIDE_SPACE_ONCE_PROP as _}from"../../../format/lib/content/page-width.js";import{SITE_OFFICES_PROP as s}from"../../../format/lib/content/site-offices.js";import{SITE_CSS_KEY as F}from"../../../format/lib/content/site-css.js";import{needsGeocodeWork as y}from"./geocode-resolve.js";import{group as D}from"efficient-easel/screen/lib/document/box-fields";import{FOOTPRINT_OFFICES_FIELD as A,resolveOfficeCoords as k}from"./blocks/general/Footprint/fields.js";import{select as l}from"./box-fields.js";import{isEditorOnDynamicPage as x}from"../../../format/lib/document/editor-page-context.js";import{DEFAULT_TOP_SPACE as W}from"../../../render/lib/document/header-clearance.js";function b(){return{type:"custom",render:({value:e,onChange:t})=>i(g,{value:e==="full"?"full":e==="content"?"content":void 0,resolved:"content",label:"Page width",followsLabel:c("Follows the site"),hint:c("Whether this page sits on the site's content column, or runs edge to edge."),onChange:o=>t(o)})}}const v=[{label:"Auto",value:"auto"},{label:"Shared",value:"shared"},{label:"Its own",value:"own"}],re={pageBackground:C(),topSpace:l("Top space",i(T,{}),v,W),widthChoice:b()},ne=["pageBackground","topSpace","widthChoice"],L="Record type",p=new Map;let f=-1;function N(e){f!==E()&&(p.clear(),f=E());const t=u(),o=t.some(n=>n.key===e)?"":e;let r=p.get(o);return r||(r=l(L,i(d,{}),[...t.map(n=>({label:n.label,value:n.key})),...o?[{label:o,value:o}]:[]],w),p.set(o,r)),r}const S=new WeakMap;function ie(e,t){if(!x()||u().length<2||a in e)return e;const o=N(P(t)),r=S.get(e);if(r&&r.row===o)return r.fields;const n={[a]:o,...e};return S.set(e,{row:o,fields:n}),n}const B="On: the site's Side space is counted once at each edge of every page. Off: as before.",M=I("Count side space once",!1,i(R,{}),B),Y={_gWebsite:D("Website"),[_]:M,[s]:A,[F]:h},O=new WeakMap;function se(e,t){if(t?.kind!==m||_ in e)return e;let o=O.get(e);return o||(o={...e,...Y},O.set(e,o)),o}function pe(e){const t=e?.props;if(t?.kind!==m||!Array.isArray(t[s]))return e;const o=t[s];return y(o)?k(o).then(r=>({...e,props:{...t,[s]:[...r]}})):e}export{re as GENERAL_ROOT_FIELDS,ne as PAGE_STYLE_FIELDS,L as RECORD_TYPE_LABEL,v as TOP_SPACE_OPTIONS,b as pageWidthField,pe as resolveSiteFooterData,ie as withRecordTypeRow,se as withSiteFooterRows};
@@ -1,4 +1,4 @@
1
- import type { CSSProperties, ReactNode, MouseEvent } from "react";
1
+ import { type CSSProperties, type ReactNode, type MouseEvent } from "react";
2
2
  import { type ThemeValue, type HeadingTypographyValue } from "../../../format/lib/theme.js";
3
3
  import { type FontsValue } from "../../../format/lib/fonts.js";
4
4
  import { type EditingBridges } from "../../../render/lib/document/editing-bridges.js";
@@ -24,7 +24,7 @@ export declare function EditorThemedBody({ propsTheme, propsFonts, propsCornerSt
24
24
  overlay?: ReactNode;
25
25
  children?: ReactNode;
26
26
  }): import("react").JSX.Element;
27
- export declare function SiteThemeCarrier({ propsTheme, propsFonts, propsCornerStyle, propsCornerRadiusPx, propsHeadingCompression, propsHeadingTypography, pageBackground, chromeInheritsSiteBackground, onClickCapture, body, }: {
27
+ export declare function SiteThemeCarrier({ propsTheme, propsFonts, propsCornerStyle, propsCornerRadiusPx, propsHeadingCompression, propsHeadingTypography, pageBackground, chromeInheritsSiteBackground, onClickCapture, siteFooterRootProps, body, }: {
28
28
  propsTheme?: ThemeValue;
29
29
  propsFonts?: FontsValue;
30
30
  propsCornerStyle?: string;
@@ -34,6 +34,7 @@ export declare function SiteThemeCarrier({ propsTheme, propsFonts, propsCornerSt
34
34
  pageBackground?: string;
35
35
  chromeInheritsSiteBackground?: boolean;
36
36
  onClickCapture?: (e: MouseEvent<HTMLDivElement>) => void;
37
+ siteFooterRootProps?: Record<string, unknown>;
37
38
  body: (contentStyle: CSSProperties) => ReactNode;
38
39
  }): import("react").JSX.Element;
39
40
  export declare const suppressPreviewNav: (e: MouseEvent<HTMLDivElement>) => void;
@@ -1,2 +1,2 @@
1
- import{jsx as o,Fragment as M,jsxs as P}from"react/jsx-runtime";import{accentItalicCss as $,storedTextStyles as K,textStylesCss as X}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as Y,PAGE_WIDTH_ATTR as q,siteWidthTokens as J,siteGutterTokens as Q,siteGutterPhoneClass as Z,siteGutterPhoneTokens as ee,heroBackgroundTokens as te}from"../../../format/lib/content/page-width.js";import{siteBlockGapPhoneClass as oe,siteBlockGapPhoneTokens as ne,siteBlockGapTokens as re}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as ie}from"../../../render/components/PreviewHeaderContext.js";import{SitePhotographyProvider as se}from"../../../render/components/SitePhotographyContext.js";import{ThemeLightInkProvider as ae}from"../../../render/components/ThemeLightInkContext.js";import{CORNER_STYLE_TO_PX as de,normalizeCornerStyle as ce,normalizeCornerRadius as le,themeColorStyle as pe,themeLightInk as he,typeSizesStyle as me,headingTypographyStyle as ue,normalizeHeadingTypography as fe,themeAccentStyle as ge,themeButtonStyle as Se,themePresetAccentVars as ye,themeSurfaceStyle as xe,siteCornerRadiusTokens as Te,shadowColorTokens as ke,headingCompressionAttr as Ce,cardShadowAttr as Pe,cardGapAttr as Ge,hoverEffectAttr as Ee}from"../../../format/lib/theme.js";import{fontRoleStyle as Ae}from"../../../format/lib/fonts.js";import{wordStyleTokens as ve}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as _e,pageHasHeaderSection as G,pageTakesTopSpace as Be,topSpaceMarker as Re,TOP_SPACE_ATTR as Ie,HEADER_CLEARANCE_CLASS as we}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as He,HEADER_INK_ATTR as We}from"../../../render/lib/document/header-ink.js";import{useEasel as be}from"efficient-easel/easel";import{useCardContentSwitchPass as Ne}from"../../components/useCardContentSwitchPass.js";import{pageBackgroundVars as De}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as Fe}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as Le}from"../../../render/lib/document/editing-bridges.js";import Ue from"../../components/SectionTextPartBridge.js";import{PageContentsFromDocument as E}from"../../../render/components/PageContentsContext.js";const ze={SectionTextParts:Ue};import{PageWidthWrapper as ft,PublishedPageFrame as gt,pageWidthTokens as St}from"../../../render/lib/document/page-frame.js";const je="color-mix(in oklab, var(--bg) 40%, #ffffff)",Ve="12vh";function Oe({style:n,children:i}){const{appState:s}=be(g=>g),t=s.data.content,r=s.data.root;if(_e(t))return o("div",{className:"sf-themed-content",style:{...n,background:je,minHeight:"100vh",paddingBottom:Ve},children:o("div",{style:{background:"var(--bg)"},children:o(E,{content:t,children:i})})});const a=G(t)&&Be(r,t),d=G(t)?Re(r,t):null,m=d?{[Ie]:d}:null,c=Y(r?.widthChoice),u=c?{[q]:c}:null,l=a?null:He(t),f=l?{[We]:l}:null;return o("div",{className:`sf-themed-content${a?` ${we}`:""}`,style:n,...f,...m,...u,children:o("div",{style:{background:"var(--bg)",minHeight:"100%"},children:o(E,{content:t,children:i})})})}function pt({propsTheme:n,propsFonts:i,propsCornerStyle:s,propsCornerRadiusPx:t,propsHeadingCompression:r,propsHeadingTypography:a,pageBackground:d,chromeInheritsSiteBackground:m,suppressPreviewNav:c,footer:u,overlay:l,children:f}){return Ne(),o(Me,{propsTheme:n,propsFonts:i,propsCornerStyle:s,propsCornerRadiusPx:t,propsHeadingCompression:r,propsHeadingTypography:a,pageBackground:d,chromeInheritsSiteBackground:m,onClickCapture:c,body:g=>P(M,{children:[o(Oe,{style:g,children:f}),u,l]})})}function Me({propsTheme:n,propsFonts:i,propsCornerStyle:s,propsCornerRadiusPx:t,propsHeadingCompression:r,propsHeadingTypography:a,pageBackground:d,chromeInheritsSiteBackground:m,onClickCapture:c,body:u}){const{theme:l,fonts:f,sizes:g,cornerRadiusPx:A,cardShadow:S,shadowColor:v,cardGap:_,hoverEffect:y,headingCompression:B,siteWidth:R,siteGutter:I,siteGutterPhone:x,blockGap:w,blockGapPhone:T,siteLengthUnits:H,headingTypography:W,heroBackgroundFollowsWidth:b,photographyGrayscale:N,textStyles:D,wordStyles:F,themeFromDocument:e}=ie(),p=e?n:l,L=e?i:f,U=e?void 0:g,z=e?t===void 0?de[ce(s)]:le(t):A,h=e?{}:H,j=e?r:B,k=e?a:W,C=[X(K(e?void 0:D)),$(fe(k).italicStrong)].filter(Boolean).join(`
2
- `),V=Fe(),O={...pe(p),...me(U),...ue(k),...V.style,...m?{}:De(d)};return P("div",{className:`sf-theme-surfaces sf-theme-accent ${[Z(e?void 0:x),oe(e?void 0:T)].filter(Boolean).join(" ")}`.trim(),style:{...Ae(L),...ve(e?null:F),...ge(p),...Se(p),...ye(p),...xe(p),...Te(z,h.cornerRadiusUnit),...ke(e?void 0:S,e?void 0:v,e?void 0:y),...J(e?void 0:R,h.siteWidthUnit),...Q(e?void 0:I,h.siteGutterUnit),...ee(e?void 0:x,h.siteGutterPhoneUnit),...re(e?void 0:w,h.blockGapUnit),...ne(e?void 0:T,h.blockGapPhoneUnit),...te(e?void 0:b)},"data-sf-headings":Ce(j),"data-sf-card-shadow":e?void 0:Pe(S),"data-sf-card-gap":e?void 0:Ge(_),"data-sf-card-hover":e?void 0:Ee(y),onClickCapture:c,children:[C?o("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:C}}):null,o(se,{grayscale:e?void 0:N,children:o(Le,{value:ze,children:o(ae,{ink:he(p),children:u(O)})})})]})}const ht=n=>{n.target?.closest?.("a")&&n.preventDefault()};export{ze as EDITING_BRIDGES,Oe as EditorPageBody,pt as EditorThemedBody,ft as PageWidthWrapper,gt as PublishedPageFrame,je as SECTION_PREVIEW_CANVAS,Ve as SECTION_PREVIEW_CANVAS_TAIL,Me as SiteThemeCarrier,St as pageWidthTokens,ht as suppressPreviewNav};
1
+ import{jsx as t,Fragment as X,jsxs as E}from"react/jsx-runtime";import{Suspense as Y}from"react";import{accentItalicCss as q,storedTextStyles as J,textStylesCss as Q}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as Z,PAGE_WIDTH_ATTR as ee,siteWidthTokens as te,siteGutterTokens as oe,siteGutterPhoneClass as re,siteGutterPhoneTokens as ne,heroBackgroundTokens as ie,SIDE_ONCE_ATTR as se,sideSpaceOnceAttr as ae}from"../../../format/lib/content/page-width.js";import{SITE_FOOTER_KIND as de}from"../../../format/lib/content/footer.js";import{siteBlockGapPhoneClass as ce,siteBlockGapPhoneTokens as pe,siteBlockGapTokens as le}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as he}from"../../../render/components/PreviewHeaderContext.js";import{usePreviewFooter as me}from"../../components/PreviewFooterContext.js";import{SiteRootPropsProvider as fe}from"../../../render/components/SiteRootProps.js";import{SITE_CSS_SCOPE_ATTR as ue,siteCssScopeAttr as Se}from"../../../format/lib/content/site-css.js";import{SitePhotographyProvider as ge}from"../../../render/components/SitePhotographyContext.js";import{ThemeLightInkProvider as Te}from"../../../render/components/ThemeLightInkContext.js";import{CORNER_STYLE_TO_PX as ye,normalizeCornerStyle as xe,normalizeCornerRadius as ke,themeColorStyle as Ce,themeLightInk as Pe,typeSizesStyle as Ee,headingTypographyStyle as _e,normalizeHeadingTypography as Ae,themeAccentStyle as Ge,themeButtonStyle as ve,themePresetAccentVars as Re,themeSurfaceStyle as Ie,siteCornerRadiusTokens as Be,shadowColorTokens as we,headingCompressionAttr as He,cardShadowAttr as We,cardGapAttr as be,hoverEffectAttr as Ne}from"../../../format/lib/theme.js";import{fontRoleStyle as De}from"../../../format/lib/fonts.js";import{wordStyleTokens as Fe}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as Oe,pageHasHeaderSection as _,pageTakesTopSpace as Le,topSpaceMarker as Ue,TOP_SPACE_ATTR as ze,HEADER_CLEARANCE_CLASS as je}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as Ve,HEADER_INK_ATTR as Me}from"../../../render/lib/document/header-ink.js";import{useEasel as A}from"efficient-easel/easel";import{useCardContentSwitchPass as $e}from"../../components/useCardContentSwitchPass.js";import{pageBackgroundVars as Ke}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as Xe}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as Ye}from"../../../render/lib/document/editing-bridges.js";import qe from"../../components/SectionTextPartBridge.js";import{PageContentsFromDocument as G}from"../../../render/components/PageContentsContext.js";const Je={SectionTextParts:qe};import{PageWidthWrapper as It,PublishedPageFrame as Bt,pageWidthTokens as wt}from"../../../render/lib/document/page-frame.js";const Qe="color-mix(in oklab, var(--bg) 40%, #ffffff)",Ze="12vh";function et({style:r,children:a}){const{appState:d}=A(m=>m),o=d.data.content,n=d.data.root;if(Oe(o))return t("div",{className:"sf-themed-content",style:{...r,background:Qe,minHeight:"100vh",paddingBottom:Ze},children:t("div",{style:{background:"var(--bg)"},children:t(G,{content:o,children:a})})});const c=_(o)&&Le(n,o),p=_(o)?Ue(n,o):null,S=p?{[ze]:p}:null,l=Z(n?.widthChoice),i=l?{[ee]:l}:null,h=c?null:Ve(o),s=h?{[Me]:h}:null;return t("div",{className:`sf-themed-content${c?` ${je}`:""}`,style:r,...s,...S,...i,children:t("div",{style:{background:"var(--bg)",minHeight:"100%"},children:t(G,{content:o,children:a})})})}function At({propsTheme:r,propsFonts:a,propsCornerStyle:d,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:c,pageBackground:p,chromeInheritsSiteBackground:S,suppressPreviewNav:l,footer:i,overlay:h,children:s}){$e();const m=A(g=>g.appState.data.root?.props);return t(tt,{siteFooterRootProps:m?.kind===de?m:void 0,propsTheme:r,propsFonts:a,propsCornerStyle:d,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:c,pageBackground:p,chromeInheritsSiteBackground:S,onClickCapture:l,body:g=>E(X,{children:[t(et,{style:g,children:s}),i,h]})})}function tt({propsTheme:r,propsFonts:a,propsCornerStyle:d,propsCornerRadiusPx:o,propsHeadingCompression:n,propsHeadingTypography:c,pageBackground:p,chromeInheritsSiteBackground:S,onClickCapture:l,siteFooterRootProps:i,body:h}){const{chromeRootProps:s}=me(),{theme:m,fonts:g,sizes:v,cornerRadiusPx:R,cardShadow:T,shadowColor:I,cardGap:B,hoverEffect:y,headingCompression:w,siteWidth:H,siteGutter:W,siteGutterPhone:x,blockGap:b,blockGapPhone:k,siteLengthUnits:N,headingTypography:D,heroBackgroundFollowsWidth:F,photographyGrayscale:O,textStyles:L,wordStyles:U,themeFromDocument:e}=he(),f=e?r:m,z=e?a:g,j=e?void 0:v,V=e?o===void 0?ye[xe(d)]:ke(o):R,u=e?{}:N,M=e?n:w,C=e?c:D,P=[Q(J(e?void 0:L)),q(Ae(C).italicStrong)].filter(Boolean).join(`
2
+ `),$=Xe(),K={...Ce(f),...Ee(j),..._e(C),...$.style,...S?{}:Ke(p)};return E("div",{className:`sf-theme-surfaces sf-theme-accent ${[re(e?void 0:x),ce(e?void 0:k)].filter(Boolean).join(" ")}`.trim(),style:{...De(z),...Fe(e?null:U),...Ge(f),...ve(f),...Re(f),...Ie(f),...Be(V,u.cornerRadiusUnit),...we(e?void 0:T,e?void 0:I,e?void 0:y),...te(e?void 0:H,u.siteWidthUnit),...oe(e?void 0:W,u.siteGutterUnit),...ne(e?void 0:x,u.siteGutterPhoneUnit),...le(e?void 0:b,u.blockGapUnit),...pe(e?void 0:k,u.blockGapPhoneUnit),...ie(e?void 0:F)},"data-sf-headings":He(M),[se]:ae(i??s),[ue]:Se(i??s),"data-sf-card-shadow":e?void 0:We(T),"data-sf-card-gap":e?void 0:be(B),"data-sf-card-hover":e?void 0:Ne(y),onClickCapture:l,children:[P?t("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:P}}):null,t(ge,{grayscale:e?void 0:O,children:t(Ye,{value:Je,children:t(Te,{ink:Pe(f),children:t(Y,{fallback:null,children:t(fe,{rootProps:i??s,children:h(K)})})})})})]})}const Gt=r=>{r.target?.closest?.("a")&&r.preventDefault()};export{Je as EDITING_BRIDGES,et as EditorPageBody,At as EditorThemedBody,It as PageWidthWrapper,Bt as PublishedPageFrame,Qe as SECTION_PREVIEW_CANVAS,Ze as SECTION_PREVIEW_CANVAS_TAIL,tt as SiteThemeCarrier,wt as pageWidthTokens,Gt as suppressPreviewNav};
@@ -1 +1 @@
1
- import{withRecordTypeRow as l}from"./page-root-fields.js";import{dropEmptyHeadings as p}from"./panel-drop-empty-headings.js";import{PASS_INSPECTOR as f}from"./passes/inspector.js";import{finishRenderRegistry as R}from"../../../render/lib/document/render-registry.js";function F(s){const d=R(s,f),i=s.root,c=i.resolveFields,h=s.root?.showWhenFacts??{},n=(e,o,r)=>{const t=o?.props;return p(f.rowsShownForNode(l(e,t),{props:t},r,h),"page")};return i.resolveFields=c?(e,o)=>{const r=c(e,o);return r instanceof Promise?r.then(t=>n(t??o.fields,e,o)):n(r??o.fields,e,o)}:(e,o)=>n(o.fields,e,o),d}export{F as finishRegistry};
1
+ import{resolveSiteFooterData as i,withRecordTypeRow as w,withSiteFooterRows as m}from"./page-root-fields.js";import{dropEmptyHeadings as v}from"./panel-drop-empty-headings.js";import{PASS_INSPECTOR as h}from"./passes/inspector.js";import{finishRenderRegistry as F}from"../../../render/lib/document/render-registry.js";function P(n){const p=F(n,h),c=n.root,f=c.resolveFields,R=n.root?.showWhenFacts??{},s=(e,o,t)=>{const r=o?.props;return v(h.rowsShownForNode(m(w(e,r),r),{props:r},t,R),"page")};c.resolveFields=f?(e,o)=>{const t=f(e,o);return t instanceof Promise?t.then(r=>s(r??o.fields,e,o)):s(t??o.fields,e,o)}:(e,o)=>s(o.fields,e,o);const l=n.root,d=l.resolveData;return l.resolveData=d?(e,o)=>{const t=d(e,o);return t instanceof Promise?t.then(r=>i(r)):i(t)}:e=>i(e),p}export{P as finishRegistry};
@@ -18,6 +18,7 @@ export type PinnedChromeState = {
18
18
  unpublished: boolean;
19
19
  loadFailed: boolean;
20
20
  sections?: readonly SharedSectionNote[];
21
+ rootProps?: Record<string, unknown> | null;
21
22
  };
22
23
  export type SharedSectionNote = {
23
24
  section: string;
@@ -1 +1 @@
1
- "use client";import{settleCountNode as ee,settleCountSources as te}from"../../format/lib/content/count-numbers.js";import{newId as oe}from"efficient-easel/data";import{SITE_FOOTER_SLUG as A}from"../../format/lib/content/footer.js";import{offeredSetsOf as D}from"./editor-blocks.js";import{isBackendError as L}from"efficient-easel/screen/lib/backend-error";import{isEfficientBackend as G}from"efficient-easel/screen/lib/session";import{noteLoaded as M,notePublished as T,noteSaved as N,pageLiveState as ne}from"./page-live-state.js";import{noteVideoFramesLoaded as ie,noteVideoFramesSaved as se}from"./page-video-frames.js";import{noteSiteLiveState as re,refreshSiteLiveState as J}from"./site-live-state.js";import{say as le}from"../../format/lib/editor-words.js";import{sendSiteWrites as ae}from"../../format/lib/site-writes.js";import{isPopupPageLayout as ce}from"../../format/lib/popup/new-popup.js";import{spliceChrome as de,splitChrome as U}from"./pinned-chrome-doc.js";import{references as ue,sectionNodeOf as fe,spliceShared as me,splitShared as ve}from"../../format/lib/shared-section-docs.js";import{setActiveSharedSections as W}from"../../format/lib/shared-sections-active.js";import{setActivePinnedChrome as Y}from"../../format/lib/pinned-chrome-lock.js";import{backendOf as q}from"./website-session.js";function V(o){return!!(o?.publish&&o.liveState)}function he(o,i){if(!V(o))return;const{versions:l,nameVersion:d,restoreVersion:s,previewVersion:n}=o;if(!(!l||!d||!s||!n))return{list:()=>l.call(o,i),name:(f,w)=>d.call(o,f,w,i),restore:(f,w)=>s.call(o,f,w??{},i),preview:f=>n.call(o,f,i)}}function pe(o,i){return async(l,d)=>{try{await ae()}catch(n){throw new Error(le("A change waiting to go live could not be saved."),{cause:n})}return(await o.publish(i)).state==="live"?re({state:"live",changes:[]}):J(0),{version:d??null}}}function x(o,i,l){const d=i?{siteId:i}:void 0;return{resolve:s=>o.load({slug:s,...d}).then(n=>(n&&(M(n.id,n.live),ie(n.id,n.videoFrames)),n)),saveLayout:(s,n,f,w)=>o.save(s,{layout:n},{version:f,clientId:w??""}).then(v=>(N(s,v.live),se(s,v.videoFrames),J(),v)),rereadVersion:o.version?s=>o.version(s):void 0,publish:V(l)?pe(l,d):o.publish?(s,n)=>o.publish(s,n?{version:n}:void 0).then(f=>(T(s,f.live),f)):void 0,listPages:()=>o.list(d),createPage:o.create?s=>o.create({...s,...d}):void 0,deletePage:o.remove?(s,n)=>o.remove(s,n):void 0}}function we(o,i,l,d,s=!1){let n=null;const f=new Set;let w=!1,v=new Map,y=new Map,m=new Map,P=new Map,g={docId:null,lockHolder:null,conflict:null,saveFailed:!1,unpublished:!1,loadFailed:!1,sections:[]};const k=new Set,E=()=>{if(!n)return!1;const e=ne(n.id);return e==="changed"||e==="never"||e===void 0&&w},S=e=>{g={...g,...e,docId:n?.id??null,unpublished:E(),sections:[...m.values()]};for(const t of k)t()},F=(e,t,r)=>{t?m.set(e,{section:e,title:v.get(e)?.title??"",problem:t,holder:r}):m.delete(e)},H=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},C=e=>f.has(e),R=()=>new Map([...v].map(([e,t])=>[e,t.layout])),j=()=>oe("SharedSection"),_=(e,t,r,a)=>{const c=H(t);v.set(e,{layout:c,version:r,savedJson:JSON.stringify(c),title:a})},z={state:()=>g,subscribe:e=>(k.add(e),()=>{k.delete(e)})},X={sectionOf:e=>y.get(e)?.section??null,heldElsewhere:e=>{const t=y.get(e)?.section;return!!(t&&m.get(t)?.problem==="lock")},adopt:(e,t)=>{_(t.id,t.layout,t.layout_updated_at,t.title),y.set(e,{section:t.id,refId:j()}),P.set(t.id,t.used_on),S({})},place:e=>{if([...y.values()].some(a=>a.section===e.id))return null;const t=fe(H(e.layout)),r=typeof t?.props?.id=="string"?t.props.id:null;return!t||!r||!t.type?null:(_(e.id,e.layout,e.layout_updated_at,e.title),y.set(r,{section:e.id,refId:j()}),P.set(e.id,e.used_on),t)},usedOn:e=>P.get(e)??null,learn:e=>{for(const t of e){P.set(t.id,t.used_on);const r=v.get(t.id);r&&(r.title=t.title);const a=m.get(t.id);a&&m.set(t.id,{...a,title:t.title})}S({})}},Z=async(e,t)=>{for(const[r,a]of e){const c=v.get(r),u=JSON.stringify(a);if(!(!c||u===c.savedJson||m.get(r)?.problem==="lock"))try{const h=await o.save(r,{layout:a},{version:c.version,clientId:t??""});N(r,h.live),c.layout=a,c.version=h.version,c.savedJson=u,F(r,null)}catch(h){L(h,"changed-elsewhere")?F(r,"conflict"):L(h,"lock-taken")?F(r,"lock",h.holder??void 0):F(r,"save")}}e.size&&J(),S({})};return{resolve:async e=>{if(Y(e===A?null:z),W(e===A?null:X),v=new Map,y=new Map,m=new Map,P=new Map,e===A)return l.resolve(e);let t=!1;const[r,a]=await Promise.all([l.resolve(e),o.load({slug:A,...i}).catch(()=>(t=!0,null))]);if(a&&!ce(r?.layout)){M(a.id,a.live);const p=H(a.layout);n={id:a.id,layout:p,version:a.version,savedJson:""}}else n=null;if(w=!1,!r)return S({conflict:null,saveFailed:!1,loadFailed:t}),r;const c=H(r.layout),u=ue(c),h=await Promise.all(u.map(p=>o.load({id:p.section,...i}).catch(()=>null)));u.forEach((p,$)=>{const b=h[$];b?(M(b.id,b.live),_(p.section,b.layout,b.version,"")):(v.delete(p.section),m.set(p.section,{section:p.section,title:"",problem:"load"}))});const B=me(c,R());if(y=B.held,!n)return y.size&&f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:t}),y.size?{...r,layout:B.working}:r;const O=de(B.working,n.layout);return n.savedJson=JSON.stringify(U(O,n.layout).chrome),f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:!1}),{...r,layout:O}},saveLayout:async(e,t,r,a)=>{if(!C(e))return l.saveLayout(e,t,r,a);const c=n,u=c?U(t,c.layout):{page:t,chrome:null},h=ve(u.page,y,R()),B=await l.saveLayout(e,h.page,r,a);if(await Z(h.docs,a),!c)return B;const O=JSON.stringify(u.chrome);if(!u.chrome||O===c.savedJson||g.lockHolder)return B;try{const p=await o.save(c.id,{layout:u.chrome},{version:c.version,clientId:a??""});N(c.id,p.live),J(),c.layout=u.chrome,c.version=p.version,c.savedJson=O,w=!0,S({conflict:null,saveFailed:!1})}catch(p){L(p,"changed-elsewhere")?S({conflict:p.conflict??{savedBy:"",savedByYou:!1,secondsAgo:0}}):L(p,"lock-taken")?S({lockHolder:p.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}}):S({saveFailed:!0})}return B},publish:l.publish?async(e,t)=>{const r=await l.publish(e,t),a=n;if(a&&C(e)&&!s&&o.publish&&E()&&!g.lockHolder){const c=await o.publish(a.id,a.version?{version:a.version}:void 0);T(a.id,c.live),c.version!==null&&(a.version=c.version),w=!1,S({})}if(C(e)&&!s&&o.publish)for(const[c,u]of v){if(m.get(c)?.problem==="lock")continue;const h=await o.publish(c,u.version?{version:u.version}:void 0);T(c,h.live),h.version!==null&&(u.version=h.version)}return r}:void 0,lock:d?{claim:async(e,t,r)=>{const a=await d.claim(e,t,r);if(!C(e))return a;const c=n;if(c)try{await d.claim(c.id,t,!1),g.lockHolder&&S({lockHolder:null})}catch(u){L(u,"lock-taken")&&S({lockHolder:u.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}})}for(const u of v.keys())try{await d.claim(u,t,!1),m.get(u)?.problem==="lock"&&F(u,null)}catch(h){L(h,"lock-taken")&&F(u,"lock",h.holder??void 0)}return v.size&&S({}),a},release:async(e,t)=>{if(await d.release(e,t),!C(e))return;const r=n;r&&!g.lockHolder&&await d.release(r.id,t).catch(()=>{});for(const a of v.keys())m.get(a)?.problem!=="lock"&&await d.release(a,t).catch(()=>{})}}:void 0,pinnedChrome:z}}function K(o){const i=(l,d,s)=>o.save(l,d.layout?{...d,layout:te(d.layout)}:d,s);return new Proxy(o,{get(l,d){if(d==="save")return i;const s=Reflect.get(l,d,l);return typeof s=="function"?s.bind(l):s}})}function Te(o,i,l){return o.update(i,ee(l))}function Ne(o,i=q(),l=D(),d={}){const s=G(i),n=o?{siteId:o}:void 0,f=s?!!o:!0,w=i.site.update,v=s&&l.commerce&&l.service,y=!!d.editsPinnedInPlace&&v,m=V(i.site)?i.site:void 0,P=K(i.pages),g=x(P,o,m),k=y?we(P,n,g,i.lock,!!m):null;return{capabilities:{canPublish:!!m||!!i.pages.publish,hasSiteSettings:s,hasSiteTheme:!!i.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!i.pages.create,canDeletePagesInline:!!i.pages.remove,hasEditLock:!!i.lock,hasEditGuard:!0,hasPinnedChrome:v,editsPinnedInPlace:y,explainsSiteSettings:!1,hasSiteRecord:f,canEditSiteRecord:f&&!!w,hasPreviewLink:s||!!i.preview,hasCatalog:s&&l.commerce,hasForms:s&&l.service,hasBlog:!!i.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...g,...Q(g.resolve),lock:i.lock,...k,site:f?()=>i.site.get(n):void 0,siteLiveState:m?()=>m.liveState(n):void 0,siteVersions:he(m,n),updateSite:f&&w?E=>w(E,n):void 0,previewHref:i.preview?E=>i.preview.href(E):void 0}}function Ve(o,i=q(),l=D()){const d=G(i),s=i.templates,n=s?K(s.pages(o)):{list:()=>Promise.reject(new Error(I)),load:()=>Promise.reject(new Error(I)),save:()=>Promise.reject(new Error(I))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!n.create,canDeletePagesInline:!!n.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:d&&l.commerce&&l.service,editsPinnedInPlace:!1,explainsSiteSettings:d,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:d&&l.commerce,hasForms:d&&l.service,hasBlog:!!i.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...x(n,void 0),...Q(x(n,void 0).resolve),publish:void 0,templateName:s?()=>s.get(o).then(f=>f.name):void 0}}function Q(o){return{resolve:i=>(Y(null),W(null),o(i))}}const I="This editor's backend has no website templates.";export{Ne as makeSitePageAdapter,Ve as makeTemplatePageAdapter,Te as saveSectionTemplate,K as settlingPages};
1
+ "use client";import{settleCountNode as ee,settleCountSources as te}from"../../format/lib/content/count-numbers.js";import{newId as oe}from"efficient-easel/data";import{SITE_FOOTER_SLUG as A}from"../../format/lib/content/footer.js";import{offeredSetsOf as D}from"./editor-blocks.js";import{isBackendError as L}from"efficient-easel/screen/lib/backend-error";import{isEfficientBackend as G}from"efficient-easel/screen/lib/session";import{noteLoaded as M,notePublished as T,noteSaved as N,pageLiveState as ne}from"./page-live-state.js";import{noteVideoFramesLoaded as se,noteVideoFramesSaved as ie}from"./page-video-frames.js";import{noteSiteLiveState as re,refreshSiteLiveState as J}from"./site-live-state.js";import{say as le}from"../../format/lib/editor-words.js";import{sendSiteWrites as ae}from"../../format/lib/site-writes.js";import{isPopupPageLayout as ce}from"../../format/lib/popup/new-popup.js";import{chromeRootProps as de,spliceChrome as ue,splitChrome as U}from"./pinned-chrome-doc.js";import{references as fe,sectionNodeOf as me,spliceShared as ve,splitShared as he}from"../../format/lib/shared-section-docs.js";import{setActiveSharedSections as W}from"../../format/lib/shared-sections-active.js";import{setActivePinnedChrome as Y}from"../../format/lib/pinned-chrome-lock.js";import{backendOf as q}from"./website-session.js";function R(o){return!!(o?.publish&&o.liveState)}function pe(o,s){if(!R(o))return;const{versions:l,nameVersion:d,restoreVersion:i,previewVersion:n}=o;if(!(!l||!d||!i||!n))return{list:()=>l.call(o,s),name:(f,w)=>d.call(o,f,w,s),restore:(f,w)=>i.call(o,f,w??{},s),preview:f=>n.call(o,f,s)}}function we(o,s){return async(l,d)=>{try{await ae()}catch(n){throw new Error(le("A change waiting to go live could not be saved."),{cause:n})}return(await o.publish(s)).state==="live"?re({state:"live",changes:[]}):J(0),{version:d??null}}}function V(o,s,l){const d=s?{siteId:s}:void 0;return{resolve:i=>o.load({slug:i,...d}).then(n=>(n&&(M(n.id,n.live),se(n.id,n.videoFrames)),n)),saveLayout:(i,n,f,w)=>o.save(i,{layout:n},{version:f,clientId:w??""}).then(v=>(N(i,v.live),ie(i,v.videoFrames),J(),v)),rereadVersion:o.version?i=>o.version(i):void 0,publish:R(l)?we(l,d):o.publish?(i,n)=>o.publish(i,n?{version:n}:void 0).then(f=>(T(i,f.live),f)):void 0,listPages:()=>o.list(d),createPage:o.create?i=>o.create({...i,...d}):void 0,deletePage:o.remove?(i,n)=>o.remove(i,n):void 0}}function Se(o,s,l,d,i=!1){let n=null;const f=new Set;let w=!1,v=new Map,y=new Map,m=new Map,P=new Map,g={docId:null,lockHolder:null,conflict:null,saveFailed:!1,unpublished:!1,loadFailed:!1,sections:[]};const k=new Set,E=()=>{if(!n)return!1;const e=ne(n.id);return e==="changed"||e==="never"||e===void 0&&w},S=e=>{g={...g,...e,docId:n?.id??null,unpublished:E(),sections:[...m.values()],rootProps:de(n?.layout)};for(const t of k)t()},F=(e,t,r)=>{t?m.set(e,{section:e,title:v.get(e)?.title??"",problem:t,holder:r}):m.delete(e)},H=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},C=e=>f.has(e),I=()=>new Map([...v].map(([e,t])=>[e,t.layout])),j=()=>oe("SharedSection"),_=(e,t,r,a)=>{const c=H(t);v.set(e,{layout:c,version:r,savedJson:JSON.stringify(c),title:a})},z={state:()=>g,subscribe:e=>(k.add(e),()=>{k.delete(e)})},X={sectionOf:e=>y.get(e)?.section??null,heldElsewhere:e=>{const t=y.get(e)?.section;return!!(t&&m.get(t)?.problem==="lock")},adopt:(e,t)=>{_(t.id,t.layout,t.layout_updated_at,t.title),y.set(e,{section:t.id,refId:j()}),P.set(t.id,t.used_on),S({})},place:e=>{if([...y.values()].some(a=>a.section===e.id))return null;const t=me(H(e.layout)),r=typeof t?.props?.id=="string"?t.props.id:null;return!t||!r||!t.type?null:(_(e.id,e.layout,e.layout_updated_at,e.title),y.set(r,{section:e.id,refId:j()}),P.set(e.id,e.used_on),t)},usedOn:e=>P.get(e)??null,learn:e=>{for(const t of e){P.set(t.id,t.used_on);const r=v.get(t.id);r&&(r.title=t.title);const a=m.get(t.id);a&&m.set(t.id,{...a,title:t.title})}S({})}},Z=async(e,t)=>{for(const[r,a]of e){const c=v.get(r),u=JSON.stringify(a);if(!(!c||u===c.savedJson||m.get(r)?.problem==="lock"))try{const h=await o.save(r,{layout:a},{version:c.version,clientId:t??""});N(r,h.live),c.layout=a,c.version=h.version,c.savedJson=u,F(r,null)}catch(h){L(h,"changed-elsewhere")?F(r,"conflict"):L(h,"lock-taken")?F(r,"lock",h.holder??void 0):F(r,"save")}}e.size&&J(),S({})};return{resolve:async e=>{if(Y(e===A?null:z),W(e===A?null:X),v=new Map,y=new Map,m=new Map,P=new Map,e===A)return l.resolve(e);let t=!1;const[r,a]=await Promise.all([l.resolve(e),o.load({slug:A,...s}).catch(()=>(t=!0,null))]);if(a&&!ce(r?.layout)){M(a.id,a.live);const p=H(a.layout);n={id:a.id,layout:p,version:a.version,savedJson:""}}else n=null;if(w=!1,!r)return S({conflict:null,saveFailed:!1,loadFailed:t}),r;const c=H(r.layout),u=fe(c),h=await Promise.all(u.map(p=>o.load({id:p.section,...s}).catch(()=>null)));u.forEach((p,$)=>{const b=h[$];b?(M(b.id,b.live),_(p.section,b.layout,b.version,"")):(v.delete(p.section),m.set(p.section,{section:p.section,title:"",problem:"load"}))});const B=ve(c,I());if(y=B.held,!n)return y.size&&f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:t}),y.size?{...r,layout:B.working}:r;const O=ue(B.working,n.layout);return n.savedJson=JSON.stringify(U(O,n.layout).chrome),f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:!1}),{...r,layout:O}},saveLayout:async(e,t,r,a)=>{if(!C(e))return l.saveLayout(e,t,r,a);const c=n,u=c?U(t,c.layout):{page:t,chrome:null},h=he(u.page,y,I()),B=await l.saveLayout(e,h.page,r,a);if(await Z(h.docs,a),!c)return B;const O=JSON.stringify(u.chrome);if(!u.chrome||O===c.savedJson||g.lockHolder)return B;try{const p=await o.save(c.id,{layout:u.chrome},{version:c.version,clientId:a??""});N(c.id,p.live),J(),c.layout=u.chrome,c.version=p.version,c.savedJson=O,w=!0,S({conflict:null,saveFailed:!1})}catch(p){L(p,"changed-elsewhere")?S({conflict:p.conflict??{savedBy:"",savedByYou:!1,secondsAgo:0}}):L(p,"lock-taken")?S({lockHolder:p.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}}):S({saveFailed:!0})}return B},publish:l.publish?async(e,t)=>{const r=await l.publish(e,t),a=n;if(a&&C(e)&&!i&&o.publish&&E()&&!g.lockHolder){const c=await o.publish(a.id,a.version?{version:a.version}:void 0);T(a.id,c.live),c.version!==null&&(a.version=c.version),w=!1,S({})}if(C(e)&&!i&&o.publish)for(const[c,u]of v){if(m.get(c)?.problem==="lock")continue;const h=await o.publish(c,u.version?{version:u.version}:void 0);T(c,h.live),h.version!==null&&(u.version=h.version)}return r}:void 0,lock:d?{claim:async(e,t,r)=>{const a=await d.claim(e,t,r);if(!C(e))return a;const c=n;if(c)try{await d.claim(c.id,t,!1),g.lockHolder&&S({lockHolder:null})}catch(u){L(u,"lock-taken")&&S({lockHolder:u.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}})}for(const u of v.keys())try{await d.claim(u,t,!1),m.get(u)?.problem==="lock"&&F(u,null)}catch(h){L(h,"lock-taken")&&F(u,"lock",h.holder??void 0)}return v.size&&S({}),a},release:async(e,t)=>{if(await d.release(e,t),!C(e))return;const r=n;r&&!g.lockHolder&&await d.release(r.id,t).catch(()=>{});for(const a of v.keys())m.get(a)?.problem!=="lock"&&await d.release(a,t).catch(()=>{})}}:void 0,pinnedChrome:z}}function K(o){const s=(l,d,i)=>o.save(l,d.layout?{...d,layout:te(d.layout)}:d,i);return new Proxy(o,{get(l,d){if(d==="save")return s;const i=Reflect.get(l,d,l);return typeof i=="function"?i.bind(l):i}})}function Ne(o,s,l){return o.update(s,ee(l))}function Re(o,s=q(),l=D(),d={}){const i=G(s),n=o?{siteId:o}:void 0,f=i?!!o:!0,w=s.site.update,v=i&&l.commerce&&l.service,y=!!d.editsPinnedInPlace&&v,m=R(s.site)?s.site:void 0,P=K(s.pages),g=V(P,o,m),k=y?Se(P,n,g,s.lock,!!m):null;return{capabilities:{canPublish:!!m||!!s.pages.publish,hasSiteSettings:i,hasSiteTheme:!!s.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!s.pages.create,canDeletePagesInline:!!s.pages.remove,hasEditLock:!!s.lock,hasEditGuard:!0,hasPinnedChrome:v,editsPinnedInPlace:y,explainsSiteSettings:!1,hasSiteRecord:f,canEditSiteRecord:f&&!!w,hasPreviewLink:i||!!s.preview,hasCatalog:i&&l.commerce,hasForms:i&&l.service,hasBlog:!!s.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...g,...Q(g.resolve),lock:s.lock,...k,site:f?()=>s.site.get(n):void 0,siteLiveState:m?()=>m.liveState(n):void 0,siteVersions:pe(m,n),updateSite:f&&w?E=>w(E,n):void 0,previewHref:s.preview?E=>s.preview.href(E):void 0}}function Ve(o,s=q(),l=D()){const d=G(s),i=s.templates,n=i?K(i.pages(o)):{list:()=>Promise.reject(new Error(x)),load:()=>Promise.reject(new Error(x)),save:()=>Promise.reject(new Error(x))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!n.create,canDeletePagesInline:!!n.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:d&&l.commerce&&l.service,editsPinnedInPlace:!1,explainsSiteSettings:d,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:d&&l.commerce,hasForms:d&&l.service,hasBlog:!!s.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...V(n,void 0),...Q(V(n,void 0).resolve),publish:void 0,templateName:i?()=>i.get(o).then(f=>f.name):void 0}}function Q(o){return{resolve:s=>(Y(null),W(null),o(s))}}const x="This editor's backend has no website templates.";export{Re as makeSitePageAdapter,Ve as makeTemplatePageAdapter,Ne as saveSectionTemplate,K as settlingPages};
@@ -1,6 +1,7 @@
1
1
  export type ChromeLayout = Record<string, unknown>;
2
2
  export declare const PINNED_CHROME_TYPES: readonly string[];
3
3
  export declare function idsNotThePagesOwn(working: ChromeLayout | null | undefined, isShared: (id: string) => boolean): Set<string>;
4
+ export declare function chromeRootProps(chrome: ChromeLayout | null | undefined): Record<string, unknown> | null;
4
5
  export declare function spliceChrome(page: ChromeLayout, chrome: ChromeLayout | null): ChromeLayout;
5
6
  export declare function splitChrome(working: ChromeLayout, chrome: ChromeLayout | null): {
6
7
  page: ChromeLayout;
@@ -1 +1 @@
1
- import{isSectionGroupType as C,SITE_FOOTER_TYPE as z,SITE_HEADER_TYPE as h,siteFooterDocChrome as k}from"../../format/lib/document/section-groups.js";import{zoneOwner as F}from"../../render/lib/document/selection-parent.js";import{isNode as D}from"efficient-easel/data";const m="Footer",A=[h,m,z],y=e=>{const t=e?.content;return Array.isArray(t)?t:[]},p=e=>{const t=e?.zones;return t&&typeof t=="object"&&!Array.isArray(t)?t:null},a=e=>{const t=e?.props?.id;return typeof t=="string"?t:void 0},I=e=>F(e)?.ownerId??"";function N(e){const t=k(y(e)),n=t.some(r=>r?.type===z);return t.filter(r=>r?.type===h||r?.type===z||r?.type===m&&!n)}function b(e,t){const n=new Set,r=o=>{if(Array.isArray(o)){for(const c of o)r(c);return}if(!(!o||typeof o!="object")){if(D(o)){const c=a(o);c&&n.add(c)}for(const c of Object.values(o))r(c)}};if(r(e),t){let o=!0;const c=new Set;for(;o;){o=!1;for(const[d,u]of Object.entries(t))c.has(d)||!n.has(I(d))||(c.add(d),r(u),o=!0)}}return n}function M(e,t){const n=y(e).filter(r=>{const o=a(r);return typeof r?.type=="string"&&A.includes(r.type)||o!==void 0&&t(o)});return n.length?b(n,p(e)):new Set}function T(e,t){const n={},r={};for(const[o,c]of Object.entries(e??{}))(t.has(I(o))?n:r)[o]=c;return{owned:n,rest:r}}function v(e,t){if(!t)return e;const n=N(t);if(!n.length)return e;const r=n.filter(u=>u.type===h),o=n.filter(u=>u.type!==h),c={...e,content:[...r,...y(e),...o]},{owned:d}=T(p(t),b(n,p(t)));return Object.keys(d).length&&(c.zones={...p(e)??{},...d}),c}function G(e,t){if(!t)return{page:e,chrome:null};const n=N(t),r=new Set(n.map(a).filter(s=>!!s)),o=[],c=[];for(const s of y(e)){const i=a(s);i&&r.has(i)||C(s?.type)?c.push(s):o.push(s)}const d=new Map(c.map(s=>[a(s),s])),u=new Set;let f=k(y(t)).flatMap(s=>{const i=a(s);if(!i||!r.has(i))return[s];const l=d.get(i);return l?(u.add(l),[l]):[]});for(const s of c)u.has(s)||f.some(i=>i?.type===s.type)||(f=s.type===h?[s,...f]:[...f,s]);f=k(f);const P=f.length===y(t).length&&f.every((s,i)=>s===y(t)[i]),j=p(e),x=b(f,j),{owned:w,rest:S}=T(j,x),_=T(p(t),b(n,p(t))).owned,g={...t,content:P?t.content:[...f]},O=p(t);if(O||Object.keys(w).length){const s={};for(const[i,l]of Object.entries(O??{}))i in _?i in w&&(s[i]=w[i]):s[i]=l;for(const[i,l]of Object.entries(w))i in s||(s[i]=l);g.zones=s,O&&R(g.zones,O)&&(g.zones=O)}const E={...e,content:o};return j&&(Object.keys(S).length||!Object.keys(_).length?E.zones=S:delete E.zones),{page:E,chrome:g}}function R(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((o,c)=>o===r[c]&&e[o]===t[o])}function W(e,t){return n=>e(n)||n!==void 0&&A.includes(n)&&t()}export{A as PINNED_CHROME_TYPES,M as idsNotThePagesOwn,W as lockedWhileHeld,v as spliceChrome,G as splitChrome};
1
+ import{isSectionGroupType as C,SITE_FOOTER_TYPE as z,SITE_HEADER_TYPE as h,siteFooterDocChrome as k}from"../../format/lib/document/section-groups.js";import{zoneOwner as F}from"../../render/lib/document/selection-parent.js";import{isNode as R}from"efficient-easel/data";const m="Footer",P=[h,m,z],y=e=>{const t=e?.content;return Array.isArray(t)?t:[]},u=e=>{const t=e?.zones;return t&&typeof t=="object"&&!Array.isArray(t)?t:null},a=e=>{const t=e?.props?.id;return typeof t=="string"?t:void 0},_=e=>F(e)?.ownerId??"";function I(e){const t=k(y(e)),n=t.some(r=>r?.type===z);return t.filter(r=>r?.type===h||r?.type===z||r?.type===m&&!n)}function g(e,t){const n=new Set,r=o=>{if(Array.isArray(o)){for(const c of o)r(c);return}if(!(!o||typeof o!="object")){if(R(o)){const c=a(o);c&&n.add(c)}for(const c of Object.values(o))r(c)}};if(r(e),t){let o=!0;const c=new Set;for(;o;){o=!1;for(const[d,p]of Object.entries(t))c.has(d)||!n.has(_(d))||(c.add(d),r(p),o=!0)}}return n}function M(e,t){const n=y(e).filter(r=>{const o=a(r);return typeof r?.type=="string"&&P.includes(r.type)||o!==void 0&&t(o)});return n.length?g(n,u(e)):new Set}function T(e,t){const n={},r={};for(const[o,c]of Object.entries(e??{}))(t.has(_(o))?n:r)[o]=c;return{owned:n,rest:r}}function v(e){const t=e?.root,n=t&&typeof t=="object"?t.props:void 0;return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function G(e,t){if(!t)return e;const n=I(t);if(!n.length)return e;const r=n.filter(p=>p.type===h),o=n.filter(p=>p.type!==h),c={...e,content:[...r,...y(e),...o]},{owned:d}=T(u(t),g(n,u(t)));return Object.keys(d).length&&(c.zones={...u(e)??{},...d}),c}function W(e,t){if(!t)return{page:e,chrome:null};const n=I(t),r=new Set(n.map(a).filter(s=>!!s)),o=[],c=[];for(const s of y(e)){const i=a(s);i&&r.has(i)||C(s?.type)?c.push(s):o.push(s)}const d=new Map(c.map(s=>[a(s),s])),p=new Set;let f=k(y(t)).flatMap(s=>{const i=a(s);if(!i||!r.has(i))return[s];const l=d.get(i);return l?(p.add(l),[l]):[]});for(const s of c)p.has(s)||f.some(i=>i?.type===s.type)||(f=s.type===h?[s,...f]:[...f,s]);f=k(f);const N=f.length===y(t).length&&f.every((s,i)=>s===y(t)[i]),j=u(e),x=g(f,j),{owned:w,rest:A}=T(j,x),S=T(u(t),g(n,u(t))).owned,b={...t,content:N?t.content:[...f]},O=u(t);if(O||Object.keys(w).length){const s={};for(const[i,l]of Object.entries(O??{}))i in S?i in w&&(s[i]=w[i]):s[i]=l;for(const[i,l]of Object.entries(w))i in s||(s[i]=l);b.zones=s,O&&D(b.zones,O)&&(b.zones=O)}const E={...e,content:o};return j&&(Object.keys(A).length||!Object.keys(S).length?E.zones=A:delete E.zones),{page:E,chrome:b}}function D(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((o,c)=>o===r[c]&&e[o]===t[o])}function B(e,t){return n=>e(n)||n!==void 0&&P.includes(n)&&t()}export{P as PINNED_CHROME_TYPES,v as chromeRootProps,M as idsNotThePagesOwn,B as lockedWhileHeld,G as spliceChrome,W as splitChrome};
@@ -36,11 +36,19 @@ export interface TypeScriptApi {
36
36
  isExternalModuleReference(node: unknown): boolean;
37
37
  isNamespaceImport(node: unknown): boolean;
38
38
  isNamedExports(node: unknown): boolean;
39
+ isNamedImports(node: unknown): boolean;
39
40
  }
40
41
  export declare function moduleSpecifiers(ts: TypeScriptApi, fileName: string, text: string): ModuleSpecifier[];
41
42
  export declare function importIsTypeOnly(ts: TypeScriptApi, node: SyntaxNode): boolean;
42
43
  export declare function exportIsTypeOnly(ts: TypeScriptApi, node: SyntaxNode): boolean;
43
44
  export declare function importsOf(ts: TypeScriptApi, fileName: string, text: string): string[];
45
+ export interface ImportBinding {
46
+ spec: string;
47
+ imported: string;
48
+ local: string;
49
+ }
50
+ export declare function importBindingsOf(ts: TypeScriptApi, fileName: string, text: string): ImportBinding[];
51
+ export declare function sourcePathOf(paths: ReadonlySet<string>, spec: string, from: string): string | null;
44
52
  export declare function packageNameOf(spec: string): string;
45
53
  export declare function relinkSpecifiers(ts: TypeScriptApi, fileName: string, text: string, retarget: (spec: string) => string | null): {
46
54
  text: string;