domma-cms 1.51.2 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/admin/js/lib/theme-settings-arrange.js +1 -1
- package/admin/js/templates/theme.html +18 -0
- package/admin/js/views/theme.js +5 -5
- package/docs/screenshots/theme-switcher-public.png +0 -0
- package/docs/screenshots/theme-switcher-settings.png +0 -0
- package/docs/theming.md +35 -1
- package/package.json +1 -1
- package/public/css/theme-switcher.css +1 -1
- package/public/js/site.js +1 -1
- package/public/js/theme-switcher.js +1 -1
- package/server/services/renderer.js +9 -1
- package/server/services/siteGitignore.js +13 -0
- package/server/services/themeSettings.js +19 -4
- package/server/templates/page.html +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.52.0] - 2026-11-10
|
|
4
|
+
|
|
5
|
+
- Choose the allowed public themes in the Theme tool and optionally offer Follow system with a selected light/dark pair. Visitor choices persist, follow live device preference changes when requested, and take precedence over scheduled day/night defaults. Floating, menu and page switchers share the same restrictions.
|
|
6
|
+
|
|
7
|
+
## [1.51.3] - 2026-11-10
|
|
8
|
+
|
|
9
|
+
- Keep the Job Board's records about people out of site repos: companies and their teams, jobs, applications, CVs, messages, interviews, notes, reviews, testimonials, alerts, saved jobs and searches, credits and orders, the talent pool, proposals, quotes and its public copies. Bookings and waiting lists, onboarding enrolments and e-card buyers, sends and opt-outs are kept out too. Regenerating a site's .gitignore (Site Manager's site-gitignore script) stops tracking their data.json; the files stay on disk.
|
|
10
|
+
|
|
3
11
|
## [1.51.2] - 2026-11-10
|
|
4
12
|
|
|
5
13
|
- Keep page editor comment and code fence highlighting in the same type style as the textarea, so visible text lines up with clicks and drag selection across fonts, wrapping and scrolling.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{THEMES as m}from"./themes.js";export const FILL_TOKENS=["--dm-card-bg","--dm-surface"],VISIBLE_TOKENS=[...FILL_TOKENS,"--dm-text","--dm-primary","--dm-background"],SWITCHER_POSITIONS=["right-center","left-center","bottom-right","bottom-left","top-right","top-left"],newOverrideId=()=>`ov-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;export function cloneOverride(e={},t=newOverrideId){return{id:e.id||t(),label:String(e.label??""),enabled:e.enabled!==!1,scope:String(e.scope??""),theme:String(e.theme??""),tokens:{...e.tokens||{}},css:String(e.css??"")}}export function formFromConfig(e={}){const t=e.autoTheme||{},
|
|
1
|
+
import{THEMES as m}from"./themes.js";export const FILL_TOKENS=["--dm-card-bg","--dm-surface"],VISIBLE_TOKENS=[...FILL_TOKENS,"--dm-text","--dm-primary","--dm-background"],SWITCHER_POSITIONS=["right-center","left-center","bottom-right","bottom-left","top-right","top-left"],newOverrideId=()=>`ov-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;export function cloneOverride(e={},t=newOverrideId){return{id:e.id||t(),label:String(e.label??""),enabled:e.enabled!==!1,scope:String(e.scope??""),theme:String(e.theme??""),tokens:{...e.tokens||{}},css:String(e.css??"")}}export function formFromConfig(e={}){const t=e.autoTheme||{},n=e.switcher||{};return{theme:e.theme||"charcoal-dark",adminTheme:e.adminTheme||"charcoal-dark",autoEnabled:!!t.enabled,dayTheme:t.dayTheme||"charcoal-light",nightTheme:t.nightTheme||"charcoal-dark",dayStart:t.dayStart||"07:00",nightStart:t.nightStart||"19:00",fontFamily:e.font?.family||"Roboto",fontSize:String(e.font?.size??16),adminFontFamily:e.font?.adminFamily||"",fontStylesheet:e.font?.stylesheet||"",swEnabled:n.enabled===!0,swAllThemes:!Array.isArray(n.themes)||!n.themes.length,swThemes:Array.isArray(n.themes)?[...n.themes]:[],swFollowSystem:n.followSystem===!0,swLightTheme:n.lightTheme||"charcoal-light",swDarkTheme:n.darkTheme||"charcoal-dark",swPosition:SWITCHER_POSITIONS.includes(n.position)?n.position:"right-center",swOffsetX:String(n.offsetX??32),swOffsetY:String(n.offsetY??32),overrides:(Array.isArray(e.overrides)?e.overrides:[]).map(r=>cloneOverride(r))}}const h=(e,t)=>{const n=Number.parseInt(e,10);return Number.isFinite(n)?n:t};export function payloadFromForm(e,t={}){const n={enabled:!!e.autoEnabled,dayTheme:e.dayTheme||"charcoal-light",nightTheme:e.nightTheme||"charcoal-dark",dayStart:e.dayStart||"07:00",nightStart:e.nightStart||"19:00"};return{theme:n.enabled?n.dayTheme:e.theme,adminTheme:e.adminTheme,autoTheme:n,font:{family:e.fontFamily||"Roboto",size:h(e.fontSize,16)||16,...e.adminFontFamily&&{adminFamily:e.adminFontFamily},..."adminFamily"in(t.font||{})&&!e.adminFontFamily&&{adminFamily:""},...(e.fontStylesheet||"stylesheet"in(t.font||{}))&&{stylesheet:String(e.fontStylesheet||"").trim()}},switcher:{enabled:!!e.swEnabled,position:e.swPosition||"right-center",offsetX:h(e.swOffsetX,0),offsetY:h(e.swOffsetY,0),themes:e.swAllThemes?[]:[...e.swThemes||[]],followSystem:!!e.swFollowSystem,lightTheme:e.swLightTheme||"charcoal-light",darkTheme:e.swDarkTheme||"charcoal-dark"},overrides:(e.overrides||[]).map(r=>({id:r.id,label:String(r.label??"").trim(),enabled:r.enabled!==!1,scope:String(r.scope??"").trim(),theme:r.theme||"",tokens:Object.fromEntries(Object.entries(r.tokens||{}).map(([i,s])=>[String(i).trim(),String(s??"").trim()]).filter(([i,s])=>i&&s)),css:String(r.css??"")}))}}export function snapshot(e,t={}){const n=payloadFromForm(e,t);return JSON.stringify(n)}function l(e){const t=/^(\d{1,2}):(\d{2})$/.exec(String(e||""));return t?Number(t[1])*60+Number(t[2]):null}export function dayOrNight(e={},t=new Date){const n=l(e.dayStart)??420,r=l(e.nightStart)??1140,i=t.getHours()*60+t.getMinutes();return n===r?"day":n<r?i>=n&&i<r?"day":"night":i>=r&&i<n?"night":"day"}export function themeLabel(e,t=[]){if(!e)return"";const n=t.find(i=>i.id===e);if(n)return n.label;const r=m.find(i=>i.id===e);return r?r.admin?`${r.label} ${r.name}`:`${r.label} (${r.dark?"dark":"light"})`:e}export function themeDiff(e,t,n=6){const r=e||{},i=t||{},s=Object.keys(i).filter(a=>String(r[a]??"").toLowerCase()!==String(i[a]).toLowerCase()),o=[...VISIBLE_TOKENS.filter(a=>s.includes(a)),...s.filter(a=>!VISIBLE_TOKENS.includes(a))];return{changed:s.length,total:Object.keys(i).length,keepsFill:!FILL_TOKENS.some(a=>s.includes(a)),shown:o.slice(0,n).map(a=>({name:a,from:r[a]||"",to:i[a]})),more:Math.max(0,o.length-n)}}export const swatchColour=e=>/^#[0-9a-f]{3,8}$/i.test(String(e||""))?String(e):"";export function knownThemeIds(e={}){return new Set([...e.themes||[],...(e.custom||[]).map(t=>t.id)])}export function themeProblems(e,t){if(!t||!t.size)return[];t=new Set([...t,"core-light","core-dark"]);const n=[],r=(i,s)=>{s&&!t.has(s)&&n.push({where:i,id:s})};return e.autoEnabled?(r("Day theme",e.dayTheme),r("Night theme",e.nightTheme)):r("Site theme",e.theme),r("Admin theme",e.adminTheme),(e.overrides||[]).forEach((i,s)=>r(`Override "${i.label||i.scope||s+1}"`,i.theme)),n}export function overrideRow(e,t,{custom:n=[],known:r=null}={}){const i=Object.keys(e.tokens||{}).filter(o=>o&&String(e.tokens[o]??"").trim()).length,s=[e.scope||"no selector yet",e.theme?`adopts ${themeLabel(e.theme,n)}`:"",i?`${i} token${i===1?"":"s"}`:"",String(e.css||"").trim()?"custom CSS":""].filter(Boolean);return{id:e.id,name:e.label||e.scope||`Override ${t+1}`,meta:s.join(" \xB7 "),off:e.enabled===!1,missing:!!(e.theme&&r&&r.size&&!r.has(e.theme)),empty:!e.theme&&!i&&!String(e.css||"").trim()}}export function moveItem(e,t,n){const r=t+n;if(t<0||t>=e.length||r<0||r>=e.length)return e;const i=[...e],[s]=i.splice(t,1);return i.splice(r,0,s),i}
|
|
@@ -102,6 +102,24 @@
|
|
|
102
102
|
<input id="thx-sw-y" type="number" class="form-input" min="0" max="400" data-model="swOffsetY.value">
|
|
103
103
|
</div>
|
|
104
104
|
</div>
|
|
105
|
+
<div class="thx-setting">
|
|
106
|
+
<label class="form-label" for="thx-sw-all">Offer all built-in themes</label>
|
|
107
|
+
<input id="thx-sw-all" type="checkbox" class="form-switch" data-model="swAllThemes.value">
|
|
108
|
+
</div>
|
|
109
|
+
<div data-bind-hidden="swAllThemes.value">
|
|
110
|
+
<label class="form-label" for="thx-sw-themes">Allowed visitor themes</label>
|
|
111
|
+
<select id="thx-sw-themes" class="form-select" multiple size="8" aria-describedby="thx-sw-help"></select>
|
|
112
|
+
<p id="thx-sw-help" class="text-muted">Select the themes visitors may choose. Use Ctrl or Command to select more than one. Applies to floating, menu and page switchers.</p>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="thx-setting">
|
|
115
|
+
<label class="form-label" for="thx-sw-system">Offer Follow system
|
|
116
|
+
<span data-help="Visitors can follow their device's light or dark preference. With no saved choice, this is the default. A manual choice stays selected until they choose Follow system again. This is separate from scheduled day/night switching."></span></label>
|
|
117
|
+
<input id="thx-sw-system" type="checkbox" class="form-switch" data-model="swFollowSystem.value">
|
|
118
|
+
</div>
|
|
119
|
+
<div class="thx-grid" data-bind-hidden="!swFollowSystem.value">
|
|
120
|
+
<div><label class="form-label" for="thx-sw-light">System light theme</label><select id="thx-sw-light" class="form-select" data-model="swLightTheme.value"></select></div>
|
|
121
|
+
<div><label class="form-label" for="thx-sw-dark">System dark theme</label><select id="thx-sw-dark" class="form-select" data-model="swDarkTheme.value"></select></div>
|
|
122
|
+
</div>
|
|
105
123
|
</div>
|
|
106
124
|
|
|
107
125
|
<div class="thx-card dm-settings-section">
|
package/admin/js/views/theme.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{api as
|
|
1
|
+
import{api as T}from"../api.js";import{enhanceFontSelect as Ke}from"../lib/font-picker.js";import{applyAdminTheme as ut,refreshAdminTheme as ze}from"../lib/admin-theme.js";import{addBannerAction as Be}from"../lib/plugin-chrome.js";import{helpPopovers as _e}from"../lib/help-popover.js";import{onceClosed as pt,openMenuAt as He,sidebarCount as ft}from"../lib/tool-kit.js";import{populateThemeSelect as Ue}from"../lib/themes.js";import{cloneOverride as Q,dayOrNight as vt,formFromConfig as X,knownThemeIds as bt,moveItem as Ve,overrideRow as yt,payloadFromForm as Z,snapshot as ve,swatchColour as Ye,themeDiff as kt,themeLabel as gt,themeProblems as wt}from"../lib/theme-settings-arrange.js";import{fmtDateTime as xt}from"../lib/dates.js";const be=/^\/theme(\?.*)?$/,Et="#/theme",j="theme.draft",St=[{value:"#site-navbar",label:"Navigation bar"},{value:"#site-footer",label:"Footer"},{value:".site-content",label:"Page content area"},{value:".page-body",label:"Page body (inside the container)"},{value:".site-sidebar",label:"Sidebar"},{value:".card",label:"Every card"},{value:".cms-form-embed",label:"Embedded forms"},{value:".cms-collection",label:"Collection displays"}],Tt=`
|
|
2
2
|
<div class="thx-row" data-id="{{id}}" tabindex="0" data-bind-class="off && 'is-off'">
|
|
3
3
|
<span class="thx-main"><strong>{{name}}</strong><small>{{meta}}</small></span>
|
|
4
4
|
<span class="thx-chip is-danger" data-bind-hidden="!missing" title="Its theme no longer exists">Theme gone</span>
|
|
5
5
|
<span class="thx-chip is-warn" data-bind-hidden="!empty" title="No theme, token or CSS - it changes nothing">Empty</span>
|
|
6
6
|
<span class="thx-chip" data-bind-hidden="!off">Off</span>
|
|
7
7
|
<button type="button" class="thx-kebab" aria-label="Actions for {{name}}" title="Actions">\u22EE</button>
|
|
8
|
-
</div>`,
|
|
8
|
+
</div>`,ye=u=>String(u??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function Ct(u){const y=document.createElement("template");return y.innerHTML=u.trim(),y.content.firstElementChild}let C=null,We=!1;function Mt(){We||!window.R?.use||(We=!0,R.use((u,y,c)=>!(be.test(y?.path||"")&&!be.test(u?.path||""))||!C?.dirty()?c():E.confirm("You have unsaved theme changes. Leave anyway? They are kept as a draft for your next visit.").then(h=>{h?c():history.replaceState(null,"","#/theme")})),M.subscribe("router:afterChange",({to:u}={})=>{if(C&&!be.test(u?.path||"")){const y=C;C=null,y.dispose()}}))}export const themeView={templateUrl:"/admin/js/templates/theme.html",async onMount(u){if(Mt(),C){const e=C;C=null,e.dispose()}const y=[],c=e=>(y.push(e),e);let ee=!1;const h=u.get(0).querySelector(".thx")||u.get(0),q=()=>!ee&&h.isConnected,ke=E.loader(u.get(0),{type:"dots"});let F,O;try{[F,O]=await Promise.all([T.theme.get(),T.theme.catalog().catch(()=>({themes:[],tokens:[],custom:[]}))])}catch(e){ke.destroy(),E.toast(`Could not load the theme settings: ${e.message||e}`,{type:"error"});return}if(ke.destroy(),!h.isConnected)return;const te=O.tokens||[],K=Array.isArray(O.custom)?O.custom:[],ge=bt(O),f=M.observable(F),x=X(F),n={};for(const[e,t]of Object.entries(x))n[e]=M.observable(t);const we=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].value])),oe=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].peek()])),z=M.observable(ve(x,F)),B=M.observable(!1),P=M.observable([]),ne=M.observable("(nothing yet)"),ae=M.observable(!1),Je=M.computed(()=>ve(we(),f.value)),_=M.computed(()=>Je.value!==z.value),xe=M.computed(()=>wt(we(),ge)),Ee=M.observable([]);c(M.effect(()=>{Ee.value=n.overrides.value.map((e,t)=>yt(e,t,{custom:K,known:ge}))}));const N=e=>gt(e,K),Ge={...n,saving:B,rows:Ee,cssText:ne,cssError:ae,dirty:_,errorsText:M.computed(()=>P.value.join(" \xB7 ")),problemsText:M.computed(()=>xe.value.length?`${xe.value.map(e=>`${e.where}: "${e.id}"`).join(", ")} - no longer available, so its base theme shows. Pick another.`:""),liveSite:M.computed(()=>{const e=f.value;if(e.autoTheme?.enabled){const t=vt(e.autoTheme)==="day"?"day":"night";return`Site: ${N(e.autoTheme.dayTheme)} by day, ${N(e.autoTheme.nightTheme)} by night (${t} now)`}return`Site: ${N(e.theme||"charcoal-dark")}`}),liveAdmin:M.computed(()=>`Admin: ${N(f.value.adminTheme||"charcoal-dark")}`),liveOverrides:M.computed(()=>{const e=f.value.overrides||[],t=e.filter(o=>o.enabled!==!1).length;return e.length?`${t} override${t===1?"":"s"} on`:""}),liveSwitcher:M.computed(()=>f.value.switcher?.enabled?"Theme switcher on":"")};function Se(e){if(!K.length)return;const t=document.createElement("optgroup");t.label="Custom themes";for(const o of K){const a=document.createElement("option");a.value=o.id,a.textContent=`${o.label} (on ${o.baseTheme})`,t.appendChild(a)}e.appendChild(t)}function se(e,t){if(t&&![...e.options].some(o=>o.value===t)){const o=document.createElement("option");o.value=t,o.textContent=`${t} (not available)`,e.appendChild(o)}}const H=(e,t,o)=>{const a=h.querySelector(e);return Ue(a,o),Se(a),se(a,t),a};H("#thx-site",x.theme),H("#thx-admin",x.adminTheme,{includeAdmin:!0}),H("#thx-day",x.dayTheme),H("#thx-night",x.nightTheme);const U=h.querySelector("#thx-sw-themes");for(const e of O.themes||[]){const t=document.createElement("option");t.value=e,t.textContent=N(e),U.appendChild(t)}U.addEventListener("change",()=>{n.swThemes.value=[...U.selectedOptions].map(e=>e.value)}),c(M.effect(()=>{const e=n.swThemes.value;for(const t of U.options)t.selected=e.includes(t.value)}));for(const[e,t]of[["#thx-sw-light","-light"],["#thx-sw-dark","-dark"]]){const o=h.querySelector(e);for(const a of(O.themes||[]).filter(r=>r.endsWith(t))){const r=document.createElement("option");r.value=a,r.textContent=N(a),o.appendChild(r)}se(o,t==="-light"?x.swLightTheme:x.swDarkTheme)}let re=0;async function Qe(e){const t=++re;try{const o=await T.theme.admin(e);if(t!==re||!q())return;ut(o)}catch{}}let Te=!0;c(M.effect(()=>{const e=n.adminTheme.value||"charcoal-dark";if(Te){Te=!1;return}Qe(e)})),c(()=>{re++,(n.adminTheme.peek()||"charcoal-dark")!==(f.peek().adminTheme||"charcoal-dark")&&ze(T)});let le=null,ie=0;async function V(){const e=++ie;try{const t=await T.theme.compile(Z(oe(),f.peek()));if(e!==ie||!q())return;ne.value=t.css?.trim()||"(no overrides - nothing is injected)",ae.value=!1}catch(t){if(e!==ie||!q())return;ne.value=t.message||String(t),ae.value=!0}}c(M.effect(()=>{n.overrides.value,clearTimeout(le),le=setTimeout(V,400)})),c(()=>clearTimeout(le));async function ce(){if(!B.peek()){if(!n.swAllThemes.peek()&&!n.swThemes.peek().length){P.value=["Choose at least one allowed visitor theme, or offer all built-in themes."],E.toast("Choose the visitor themes before saving.",{type:"error"});return}B.value=!0,P.value=[];try{const e=await T.theme.save(Z(oe(),f.peek()));if(!q())return;f.value=e;const t=X(e);for(const[o,a]of Object.entries(t))n[o].value=a;z.value=ve(t,e);try{S.remove?S.remove(j):S.set(j,null)}catch{}await ze(T),ft(Et),E.toast("Theme saved.",{type:"success"}),V()}catch(e){P.value=e.validation||[e.message||"Could not save the theme."],E.toast("Theme not saved - see the message at the top.",{type:"error"})}finally{B.value=!1}}}async function Xe(){if(!await E.confirm("Throw away your unsaved theme changes?"))return;const e=X(f.peek());for(const[t,o]of Object.entries(e))n[t].value=o;P.value=[]}const Ce=e=>n.overrides.peek().find(t=>t.id===e),$=e=>{n.overrides.value=e},de=(e,t)=>$(n.overrides.peek().map(o=>o.id===e?t:o)),Ze=e=>n.overrides.peek().findIndex(t=>t.id===e),me=new Map;async function Me(e){if(!e)return null;if(me.has(e))return me.get(e);const o=(await T.theme.themeTokens(e).catch(()=>null))?.tokens||null;return me.set(e,o),o}const et=()=>(n.autoEnabled.peek()?n.dayTheme.peek():n.theme.peek())||"charcoal-dark",Y=new Set;function W(e){const t=e?Ce(e):Q({});if(!t)return;const o=!e,a=Q(t),r={label:M.observable(a.label),scope:M.observable(a.scope),enabled:M.observable(a.enabled),theme:M.observable(a.theme),css:M.observable(a.css),tokenErr:M.observable("")},d=E.slideover({title:o?"New override":`Override: ${ye(t.label||t.scope||"untitled")}`,size:"md",position:"right"}),v=Ct(`
|
|
9
9
|
<div class="thx-form">
|
|
10
10
|
<div class="thx-grid">
|
|
11
11
|
<div>
|
|
@@ -22,7 +22,7 @@ import{api as w}from"../api.js";import{enhanceFontSelect as Ie}from"../lib/font-
|
|
|
22
22
|
<label class="form-label" for="thx-o-scope">Target selector
|
|
23
23
|
<span data-help-title="Target selector" data-help="The region to re-theme - a CSS selector. Everything inside it follows. Pick a common region from the list or type your own (#site-navbar, .card, .page-body \u2026)."></span></label>
|
|
24
24
|
<input id="thx-o-scope" type="text" class="form-input font-mono" list="thx-scope-options" placeholder="#site-navbar" data-model="scope.value">
|
|
25
|
-
<datalist id="thx-scope-options">${
|
|
25
|
+
<datalist id="thx-scope-options">${St.map(s=>`<option value="${s.value}" label="${s.label}"></option>`).join("")}</datalist>
|
|
26
26
|
</div>
|
|
27
27
|
<div>
|
|
28
28
|
<label class="form-label" for="thx-o-theme">Adopt a theme here
|
|
@@ -39,7 +39,7 @@ import{api as w}from"../api.js";import{enhanceFontSelect as Ie}from"../lib/font-
|
|
|
39
39
|
<span data-icon="plus" data-icon-size="13"></span> Add token</button>
|
|
40
40
|
<small class="thx-err" data-bind-hidden="!tokenErr.value" data-bind-text="tokenErr.value"></small>
|
|
41
41
|
</div>
|
|
42
|
-
<details class="thx-o-css"${
|
|
42
|
+
<details class="thx-o-css"${a.css?" open":""}>
|
|
43
43
|
<summary>Custom CSS for this override</summary>
|
|
44
44
|
<textarea class="form-input font-mono" rows="4" style="margin-top:.5rem" placeholder="#site-navbar .brand { letter-spacing: .04em; }" data-model="css.value"></textarea>
|
|
45
45
|
<small class="thx-hint">Appended verbatim after the generated rule - you own these selectors. Prefer tokens: they survive a Domma upgrade; hand-written rules fight the cascade.</small>
|
|
@@ -52,4 +52,4 @@ import{api as w}from"../api.js";import{enhanceFontSelect as Ie}from"../lib/font-
|
|
|
52
52
|
<button type="button" class="btn btn-sm btn-primary" data-on-click="done">
|
|
53
53
|
<span data-icon="check" data-icon-size="13"></span> ${o?"Add":"Done"}</button>
|
|
54
54
|
</div>
|
|
55
|
-
</div>`),
|
|
55
|
+
</div>`),he=v.querySelector("#thx-o-theme");Ue(he,{includeDefault:!0,defaultLabel:"Keep the site theme"}),Se(he),se(he,a.theme);const at=v.querySelector("#thx-token-names");for(const s of te){const i=document.createElement("option");i.value=s,at.appendChild(i)}const ue=v.querySelector(".thx-toks");function De(s="",i=""){const b=document.createElement("div");b.className="thx-tok";const l=document.createElement("input");l.type="text",l.className="form-input font-mono thx-tok-name",l.placeholder="--dm-primary",l.setAttribute("list","thx-token-names"),l.value=s,l.setAttribute("aria-label","Token");const p=document.createElement("input");p.type="text",p.className="form-input thx-tok-value",p.placeholder="#0096c7",p.value=i,p.setAttribute("aria-label","Value");const k=document.createElement("input");k.type="color",k.title="Pick a colour";const g=Ye(i);/^#[0-9a-f]{6}$/i.test(g)&&(k.value=g),k.addEventListener("input",()=>{p.value=k.value});const w=document.createElement("button");return w.type="button",w.className="btn btn-sm btn-ghost",w.textContent="\xD7",w.title="Remove this token",w.addEventListener("click",()=>b.remove()),b.append(l,p,k,w),b}for(const[s,i]of Object.entries(a.tokens))ue.appendChild(De(s,i));function Re(){const s={},i=[];return ue.querySelectorAll(".thx-tok").forEach(b=>{const l=b.querySelector(".thx-tok-name").value.trim(),p=b.querySelector(".thx-tok-value").value.trim();!l||!p||(te.length&&!te.includes(l)&&i.push(l),s[l]=p)}),{tokens:s,bad:i}}const je=()=>({...a,label:r.label.peek(),scope:r.scope.peek(),enabled:r.enabled.peek(),theme:r.theme.peek(),css:r.css.peek(),tokens:Re().tokens}),st=JSON.stringify(Z({overrides:[a]}).overrides),rt=()=>JSON.stringify(Z({overrides:[je()]}).overrides)!==st,pe=v.querySelector(".thx-diff-host");let Pe=0;async function lt(){const s=++Pe;pe.replaceChildren();const i=r.theme.peek();if(!i)return;const b=et(),l=document.createElement("div");if(l.className="thx-diff",l.style.marginTop=".5rem",i===b){const m=document.createElement("p");m.textContent="That is already the site theme, so this changes nothing on its own. Set a token below instead.",l.appendChild(m),pe.appendChild(l);return}const[p,k]=await Promise.all([Me(b),Me(i)]);if(s!==Pe||!p||!k)return;const g=kt(p,k),w=document.createElement("p");if(w.textContent=`Changes ${g.changed} of ${g.total} tokens here.`,l.appendChild(w),g.keepsFill){const m=document.createElement("p");m.className="is-warn",m.textContent="Both themes use the same surface colour, so this region keeps the fill it has now. Set --dm-card-bg (a card) or --dm-surface (most other regions) below to change it.",l.appendChild(m)}const G=document.createElement("div");G.className="thx-diff-list";const Ie=m=>{const D=document.createElement("span");return D.className="thx-sw",D.style.background=Ye(m)||"transparent",D};for(const m of g.shown){const D=document.createElement("span");D.append(Ie(m.from),document.createTextNode(`${m.name} `),Ie(m.to)),G.appendChild(D)}if(g.more){const m=document.createElement("span");m.textContent=`+${g.more} more`,G.appendChild(m)}l.appendChild(G),pe.appendChild(l)}const it=M.effect(()=>{r.theme.value,lt()});let J=!1,fe=!1;const Fe={addToken:()=>{const s=De();ue.appendChild(s),s.querySelector("input").focus()},cancel:()=>d.close(),async remove(){await E.confirm(`Remove the override "${ye(t.label||t.scope||"untitled")}"? It goes when you save.`)&&($(n.overrides.peek().filter(s=>s.id!==t.id)),J=!0,d.close())},done(){const{bad:s}=Re();if(s.length){r.tokenErr.value=`Not a token this Domma defines: ${s.join(", ")}. Pick one from the list.`;return}const i=je();o?$([...n.overrides.peek(),i]):de(t.id,i),J=!0,d.close()}};d.element.appendChild(v);const ct=_e(v),dt=M.applyBindings(r,v,{methods:Fe}),mt=s=>{(s.ctrlKey||s.metaKey)&&s.key==="Enter"&&(s.preventDefault(),Fe.done())};v.addEventListener("keydown",mt),Y.add(d),pt(d,()=>{it(),dt.dispose(),ct(),Y.delete(d)});const ht=d.close.bind(d);d.close=async s=>{if(!J&&s!==!0&&rt()){if(fe)return;fe=!0;const i=await E.confirm("Discard your changes to this override?");if(fe=!1,!i)return}return J=!0,ht()},I.scan(v),d.open(),v.querySelector(o?"#thx-o-scope":"#thx-o-label")?.focus()}function tt(e){const t=Ce(e);if(!t)return[];const o=Ze(e),a=n.overrides.peek().length;return[{header:t.label||t.scope||`Override ${o+1}`},{label:"Edit\u2026",icon:"edit",action:()=>W(e)},t.enabled?{label:"Switch off",icon:"pause",action:()=>de(e,{...t,enabled:!1})}:{label:"Switch on",icon:"play",action:()=>de(e,{...t,enabled:!0})},{label:"Duplicate",icon:"copy",action:()=>{const r=Q({...t,id:"",label:t.label?`${t.label} copy`:""}),d=[...n.overrides.peek()];d.splice(o+1,0,r),$(d)}},{type:"divider"},{label:"Move up",icon:"arrow-up",disabled:o<=0,action:()=>$(Ve(n.overrides.peek(),o,-1))},{label:"Move down",icon:"arrow-down",disabled:o>=a-1,action:()=>$(Ve(n.overrides.peek(),o,1))},{type:"divider"},{label:"Remove\u2026",icon:"trash",danger:!0,action:async()=>{await E.confirm(`Remove the override "${ye(t.label||t.scope||"untitled")}"? It goes when you save.`)&&$(n.overrides.peek().filter(r=>r.id!==e))}}]}const L=h.querySelector(".thx-list");L.innerHTML=Tt,E.tabs(h.querySelector(".thx-tabs"),{tabSelector:".tab-item",panelSelector:".tab-panel"});const ot=M.applyBindings(Ge,h,{methods:{save:ce,discard:Xe,refreshCss:V,addOverride:()=>W(null)}});c(()=>ot.dispose());const Oe=[Ke(h.querySelector("#thx-font"),{label:"Font family",stylesheet:()=>n.fontStylesheet.peek()}),Ke(h.querySelector("#thx-admin-font"),{label:"Admin font family",stylesheet:()=>n.fontStylesheet.peek()})];c(()=>Oe.forEach(e=>e.destroy())),c(M.effect(()=>{n.fontFamily.value,n.adminFontFamily.value,n.fontStylesheet.value,queueMicrotask(()=>{q()&&Oe.forEach(e=>e.refresh())})})),c(_e(h,{position:"bottom"}));const nt=E.contextMenu(L,{cursor:"glyph",match:".thx-row",inherit:!1,density:"compact",items:e=>tt(e.dataset.id)});c(()=>nt?.destroy?.());const $e=e=>{const t=e.target.closest(".thx-row");if(t){if(e.target.closest(".thx-kebab")){He(e.target.closest(".thx-kebab"));return}W(t.dataset.id)}},Ae=e=>{const t=e.target.closest(".thx-row");t&&(e.key==="F10"&&e.shiftKey?(e.preventDefault(),He(t)):e.key==="Enter"&&e.target===t&&W(t.dataset.id))};L.addEventListener("click",$e),L.addEventListener("keydown",Ae),c(()=>{L.removeEventListener("click",$e),L.removeEventListener("keydown",Ae)}),Be(u,{id:"theme-view-site",icon:"external-link",title:"View site",onClick:()=>window.open("/","_blank","noopener")}),Be(u,{id:"theme-save",icon:"save",title:"Save (Ctrl+S)",onClick:()=>ce()});const qe=e=>{!(e.ctrlKey||e.metaKey)||e.key!=="s"||Y.size||(e.preventDefault(),e.stopImmediatePropagation(),ce())};document.addEventListener("keydown",qe,!0),c(()=>document.removeEventListener("keydown",qe,!0));const Ne=()=>{if(_.peek())try{S.set(j,{form:oe(),base:z.peek(),at:new Date().toISOString()})}catch{}},Le=e=>{_.peek()&&(Ne(),e.preventDefault(),e.returnValue="")};window.addEventListener("beforeunload",Le),c(()=>window.removeEventListener("beforeunload",Le)),C={dirty:()=>_.peek(),dispose(){ee=!0,Ne(),[...Y].forEach(e=>{try{e.close(!0)}catch{}}),y.splice(0).reverse().forEach(e=>{try{e()}catch{}})}},I.scan(h),V();let A=null;try{A=S.get(j)}catch{}if(A?.form){try{S.remove?S.remove(j):S.set(j,null)}catch{}const e=A.base&&A.base!==z.peek(),t=A.at?` (${xt(A.at)})`:"",o=e?`You left unsaved theme changes${t}, but the saved settings have changed since. Restore your version anyway?`:`You left unsaved theme changes${t}. Restore them?`;if(await E.confirm(o)&&q()){const a={...X(f.peek()),...A.form};a.overrides=(a.overrides||[]).map(r=>Q(r));for(const[r,d]of Object.entries(a))n[r]&&(n[r].value=d)}}}};
|
|
Binary file
|
|
Binary file
|
package/docs/theming.md
CHANGED
|
@@ -282,12 +282,46 @@ Enable it at **Content → Theme → Theme Switcher**, or in `config/theme.json`
|
|
|
282
282
|
| `enabled` | `false` | `false` emits no stylesheet, no script and no settings at all |
|
|
283
283
|
| `position` | `right-center` | `right-center`, `left-center`, `bottom-right`, `bottom-left`, `top-right`, `top-left` |
|
|
284
284
|
| `offsetX` / `offsetY` | `32` | Pixels from the anchored edges, 0 to 400 |
|
|
285
|
-
| `themes` | `[]` |
|
|
285
|
+
| `themes` | `[]` | Allowed built-in themes; empty means every theme the stylesheet ships |
|
|
286
|
+
| `followSystem` | `false` | Offers Follow system; new visitors follow their device when enabled |
|
|
287
|
+
| `lightTheme` | `charcoal-light` | Built-in light theme used by Follow system; must be allowed |
|
|
288
|
+
| `darkTheme` | `charcoal-dark` | Built-in dark theme used by Follow system; must be allowed |
|
|
286
289
|
|
|
287
290
|
Each dot's colours are that theme's own `--dm-primary` and `--dm-secondary`, so a theme added to
|
|
288
291
|
`domma-themes.css` appears automatically. Was the `theme-switcher` plugin until 0.67.0, which
|
|
289
292
|
hardcoded 26 dots against a stylesheet carrying 32 themes.
|
|
290
293
|
|
|
294
|
+
### Restricting the visitor choices
|
|
295
|
+
|
|
296
|
+
Under **Theme > Theme switcher**, turn off **Offer all built-in themes** and select
|
|
297
|
+
**Allowed visitor themes**. This controls floating, menu and shortcode switchers,
|
|
298
|
+
including when the floating switcher is disabled. A shortcode can narrow this list,
|
|
299
|
+
but cannot offer themes excluded by the site.
|
|
300
|
+
|
|
301
|
+
For a branded site such as Job Board, select `ocean-light` and `ocean-dark`, enable
|
|
302
|
+
**Offer Follow system**, then choose those same themes as the system light/dark pair:
|
|
303
|
+
|
|
304
|
+
```json
|
|
305
|
+
"switcher": {
|
|
306
|
+
"enabled": true,
|
|
307
|
+
"themes": ["ocean-light", "ocean-dark"],
|
|
308
|
+
"followSystem": true,
|
|
309
|
+
"lightTheme": "ocean-light",
|
|
310
|
+
"darkTheme": "ocean-dark"
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
With exactly this pair, visitors see **Light**, **Dark** and **Follow system**.
|
|
315
|
+
Follow system is selected until a visitor makes a manual choice, and reacts to device
|
|
316
|
+
preference changes while the page is open. Manual choices survive reloads and take
|
|
317
|
+
precedence over scheduled day/night switching. The visitor can return to Follow system
|
|
318
|
+
at any time. A previously saved theme removed from the allowed list falls back to
|
|
319
|
+
Follow system when offered, otherwise the allowed site default or first allowed theme.
|
|
320
|
+
If browser storage is blocked, switching still works for the current page.
|
|
321
|
+
|
|
322
|
+
Existing sites retain all their themes and do not acquire Follow system by upgrading.
|
|
323
|
+
Custom Theme Roller themes remain outside the public switcher.
|
|
324
|
+
|
|
291
325
|
## Custom Themes (the Theme Roller)
|
|
292
326
|
|
|
293
327
|
A custom theme is a built-in theme plus the `--dm-*` tokens changed on top of it. The **Theme Roller**
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.dm-theme-switcher{position:fixed;z-index:9998}.dm-ts-trigger{width:48px;height:48px;border-radius:50%;border:2px solid rgba(255,255,255,.25);cursor:pointer;padding:0;transition:transform .18s ease,box-shadow .18s ease;box-shadow:0 3px 12px #0006,0 0 0 1px #ffffff14}.dm-ts-trigger:hover{transform:scale(1.14);box-shadow:0 6px 20px #00000080,0 0 0 1px #ffffff26}.dm-ts-options{position:absolute;display:grid;grid-template-columns:repeat(2,28px);gap:8px;padding:10px;background:var(--dm-surface, #1e2030);border:1px solid var(--dm-border, rgba(255, 255, 255, .12));border-radius:14px;box-shadow:0 10px 28px #00000073;opacity:0;visibility:hidden;transform:scale(.92) translateY(6px);transform-origin:bottom right;transition:opacity .18s ease,transform .18s ease,visibility .18s;pointer-events:none;bottom:56px;right:0;max-height:60vh;overflow-y:auto}.dm-theme-switcher.dm-ts-left .dm-ts-options{right:auto;left:0;transform-origin:bottom left}.dm-theme-switcher.dm-ts-top .dm-ts-options{bottom:auto;top:56px;transform:scale(.92) translateY(-6px);transform-origin:top right}.dm-theme-switcher.dm-ts-top.dm-ts-left .dm-ts-options{transform-origin:top left}.dm-theme-switcher:hover .dm-ts-options,.dm-theme-switcher:focus-within .dm-ts-options{opacity:1;visibility:visible;transform:scale(1) translateY(0);pointer-events:all}.dm-theme-switcher.dm-ts-top:hover .dm-ts-options,.dm-theme-switcher.dm-ts-top:focus-within .dm-ts-options{transform:scale(1) translateY(0)}.dm-ts-dot{width:28px;height:28px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;position:relative;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;box-shadow:0 1px 4px #00000059;outline:none}.dm-ts-dot:hover{transform:scale(1.22)}.dm-ts-dot.active{border-color:#fff;box-shadow:0 0 0 2px #ffffff80,0 2px 8px #0006}.dm-ts-dot:after,.dm-ts-trigger:after{content:attr(data-tooltip);position:absolute;top:50%;transform:translateY(-50%);background:#0a0c14eb;color:#fff;padding:4px 9px;border-radius:5px;font-size:.7rem;font-family:system-ui,sans-serif;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:1}.dm-theme-switcher:not(.dm-ts-left) .dm-ts-dot:after,.dm-theme-switcher:not(.dm-ts-left) .dm-ts-trigger:after{right:calc(100% + 7px);left:auto}.dm-theme-switcher.dm-ts-left .dm-ts-dot:after,.dm-theme-switcher.dm-ts-left .dm-ts-trigger:after{left:calc(100% + 7px);right:auto}.dm-ts-dot:hover:after,.dm-ts-trigger:hover:after{opacity:1}.dm-theme-switcher.dm-ts-inline{position:relative;display:inline-block;vertical-align:middle;z-index:20}.dm-ts-inline .dm-ts-trigger{width:28px;height:28px}.dm-theme-switcher.dm-ts-inline .dm-ts-options{top:36px}.dm-menu-theme-switcher{display:flex;align-items:center;padding:.375rem .75rem;list-style:none}@media(prefers-reduced-motion:reduce){.dm-ts-trigger,.dm-ts-dot,.dm-ts-options{transition:none}}
|
|
1
|
+
.dm-theme-switcher{position:fixed;z-index:9998}.dm-ts-trigger{width:48px;height:48px;border-radius:50%;border:2px solid rgba(255,255,255,.25);cursor:pointer;padding:0;transition:transform .18s ease,box-shadow .18s ease;box-shadow:0 3px 12px #0006,0 0 0 1px #ffffff14}.dm-ts-trigger:hover{transform:scale(1.14);box-shadow:0 6px 20px #00000080,0 0 0 1px #ffffff26}.dm-ts-options{position:absolute;display:grid;grid-template-columns:repeat(2,28px);gap:8px;padding:10px;background:var(--dm-surface, #1e2030);border:1px solid var(--dm-border, rgba(255, 255, 255, .12));border-radius:14px;box-shadow:0 10px 28px #00000073;opacity:0;visibility:hidden;transform:scale(.92) translateY(6px);transform-origin:bottom right;transition:opacity .18s ease,transform .18s ease,visibility .18s;pointer-events:none;bottom:56px;right:0;max-height:60vh;overflow-y:auto}.dm-theme-switcher.dm-ts-left .dm-ts-options{right:auto;left:0;transform-origin:bottom left}.dm-theme-switcher.dm-ts-top .dm-ts-options{bottom:auto;top:56px;transform:scale(.92) translateY(-6px);transform-origin:top right}.dm-theme-switcher.dm-ts-top.dm-ts-left .dm-ts-options{transform-origin:top left}.dm-theme-switcher:hover .dm-ts-options,.dm-theme-switcher:focus-within .dm-ts-options{opacity:1;visibility:visible;transform:scale(1) translateY(0);pointer-events:all}.dm-theme-switcher.dm-ts-top:hover .dm-ts-options,.dm-theme-switcher.dm-ts-top:focus-within .dm-ts-options{transform:scale(1) translateY(0)}.dm-ts-dot{width:28px;height:28px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;position:relative;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;box-shadow:0 1px 4px #00000059;outline:none}.dm-ts-dot:hover{transform:scale(1.22)}.dm-ts-dot[data-theme=system]{color:#102b46;font:700 20px/1 system-ui,sans-serif}.dm-ts-dot:focus-visible{outline:2px solid var(--dm-text, #fff);outline-offset:3px}.dm-ts-dot.active{border-color:#fff;box-shadow:0 0 0 2px #ffffff80,0 2px 8px #0006}.dm-ts-dot:after,.dm-ts-trigger:after{content:attr(data-tooltip);position:absolute;top:50%;transform:translateY(-50%);background:#0a0c14eb;color:#fff;padding:4px 9px;border-radius:5px;font-size:.7rem;font-family:system-ui,sans-serif;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:1}.dm-theme-switcher:not(.dm-ts-left) .dm-ts-dot:after,.dm-theme-switcher:not(.dm-ts-left) .dm-ts-trigger:after{right:calc(100% + 7px);left:auto}.dm-theme-switcher.dm-ts-left .dm-ts-dot:after,.dm-theme-switcher.dm-ts-left .dm-ts-trigger:after{left:calc(100% + 7px);right:auto}.dm-ts-dot:hover:after,.dm-ts-trigger:hover:after{opacity:1}.dm-theme-switcher.dm-ts-inline{position:relative;display:inline-block;vertical-align:middle;z-index:20}.dm-ts-inline .dm-ts-trigger{width:28px;height:28px}.dm-theme-switcher.dm-ts-inline .dm-ts-options{top:36px}.dm-menu-theme-switcher{display:flex;align-items:center;padding:.375rem .75rem;list-style:none}@media(prefers-reduced-motion:reduce){.dm-ts-trigger,.dm-ts-dot,.dm-ts-options{transition:none}}.dm-ts-labelled .dm-ts-options{grid-template-columns:minmax(140px,1fr)}.dm-ts-labelled .dm-ts-dot{width:100%;height:36px;border-radius:8px;padding:6px 10px;background:var(--dm-background, #102b46)!important;color:var(--dm-text, #fff);font:500 14px/1.2 system-ui,sans-serif;text-align:left}.dm-ts-labelled .dm-ts-dot:hover{transform:none}.dm-ts-labelled .dm-ts-dot.active{border-color:var(--dm-primary, #55dde0)}
|
package/public/js/site.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyMobileMenu as ae,initCarouselPopup as ie}from"/public/js/mobile-ui.mjs?v=20261016-mobile-options";import{installSmoothCarets as re}from"/public/js/smooth-caret.js";import{decodeBase64Json as V}from"/public/js/utf8-base64.mjs";import{makeBadgeEl as U,applyColour as G,applyPill as ce,applyFloat as le,applyHighlight as Y,applyItemHighlight as de,itemHighlightAttrs as me,currentItems as K,menuAlign as ue,applyClasses as P,cssClasses as X,applyEntrance as J}from"/public/js/menu-decor.mjs?v=20261109-current-query";import{applyMenuLook as pe,applyFooterLook as fe}from"/public/js/menu-cards.mjs?v=20261109-current-query";import{initPageMotion as he}from"/public/js/page-motion.mjs?v=20261029-page-motion";import{applyFooterShowcase as ge}from"/public/js/footer-showcase.mjs?v=20261029-footer-showcase";import{initFloatingMenus as ye}from"/public/js/menu-float.js?v=20260829-float-panel";import{enhancePickerFields as Q,markInvalidFields as Z,showValidationPopup as ee}from"/public/js/forms.js?v=20261109-form-embed";import{buildWizardSteps as ve}from"/public/js/form-steps.mjs";import{mountMotionControl as be}from"/public/js/motion-control.mjs?v=20261031-launchers";import{applyFormClasses as te,applyFormEntrance as oe,applySubmitButtons as we,applyWizardButtons as Ce}from"/public/js/form-submit.mjs";import{captureFileFields as ne,destroyDropzones as Se,fileBlueprint as xe,restoreFileFields as ke,setFileLimits as Le,splitFiles as $e,submitBody as Ee,totalTooLarge as Ae,wireFileFields as Te}from"/public/js/form-files.mjs";document.addEventListener("click",d=>{const r=d.target?.closest?.(".dm-banner__dismiss");r&&(d.preventDefault(),r.closest(".dm-banner")?.remove())}),$(()=>{re(document);const d=window.__CMS_NAV__||{},r=window.__CMS_SITE__||{},M=r.brandingEnabled!==!1&&d.brand?.enabled!==!1;if(r.autoTheme?.enabled){let o=function(c){const p=(c||"07:00").split(":");return+p[0]*60+(+p[1]||0)},e=function(){const c=new Date,p=c.getHours()*60+c.getMinutes();return p>=o(a.dayStart)&&p<o(a.nightStart)?a.dayTheme:a.nightTheme},t=function(c){const p=a.apply&&a.apply[c]||{theme:c,custom:""};Domma.theme.set(p.theme);for(const n of[...document.body.classList])n.startsWith("dm-custom-")&&document.body.classList.remove(n);p.custom&&document.body.classList.add(p.custom)};const a=r.autoTheme;t(e()),setInterval(()=>t(e()),6e4)}const x=$("#site-navbar");if(x.length&&d.brand){let e=function(l,v=0){return Array.isArray(l)?l.filter(m=>!(m&&(m.type==="spacer"||m.type==="theme-switcher"))).filter(m=>!(m&&m.type==="separator"&&v===0)).map(m=>m&&m.type==="separator"?{divider:!0}:Array.isArray(m?.items)?{...m,items:e(m.items,v+1)}:m):l};const a={...d.brand},o=a.size&&a.size!=="md"?` navbar-brand-${a.size}`:"";if(a.logo||a.icon||a.tagline){let l="";a.logo?l+=`<img src="${a.logo}" class="navbar-brand-logo" alt="${a.text||""}">`:a.icon&&(l+=`<span data-icon="${a.icon}" style="width:1.1em;height:1.1em;margin-right:.35em;vertical-align:middle;"></span>`),a.text&&(l+=`<span class="navbar-brand-text${o}">${a.text}</span>`),a.tagline&&(l+=`<small class="navbar-brand-tagline">${a.tagline}</small>`),a.html=l}else o&&a.text&&(a.html=`<span class="navbar-brand-text${o}">${a.text}</span>`);const t=e(d.items||[]),c=d.position==="floating",p=d.orientation==="vertical";x.get(0).querySelector(":scope > .cms-nojs-links")?.remove(),Domma.elements.navbar("#site-navbar",{brand:M?a:null,items:t,variant:d.variant||"dark",position:c?"static":d.position||"sticky",collapsible:!0,appearOnHover:!!d.appearOnHover}),Domma.icons.scan("#site-navbar");const n=x.get(0);ae(n,d.mobile);const h=()=>{if(!p)return;const v=n.querySelector('a[aria-current="page"]')?.closest(".navbar-dropdown");v&&!v.classList.contains("open")&&v.querySelector(":scope > .navbar-dropdown-toggle")?.click()};n.classList.add(`dm-nav-align-${ue(d)||"centre"}`),p&&x.get(0).classList.add("dm-nav-vertical",d.side==="right"?"dm-nav-vertical-right":"dm-nav-vertical-left");const f=d.dock||{};p&&!c&&qe(n,d.side==="right"),!p&&f.hideOnScroll&&Me(n),Y(n,d),J(n,d),P(n,d.class),c&&(le(x.get(0),d),ye(x.get(0).parentNode||document));const u=n.querySelector(".navbar-toggle"),y=n.querySelector(".navbar-collapse");if(u&&y){let l=null;const v=()=>{y.classList.contains("show")&&u.click()},m=()=>{l&&(l.remove(),l=null),document.body.classList.remove("dm-drawer-open")},g=()=>{l||(l=document.createElement("div"),l.className="dm-navbar-backdrop",l.addEventListener("click",v),document.body.appendChild(l),document.body.classList.add("dm-drawer-open"))};u.addEventListener("click",()=>{requestAnimationFrame(()=>{y.classList.contains("show")?(h(),g()):m()})}),y.addEventListener("click",C=>{C.target.closest("a")&&requestAnimationFrame(m)}),document.addEventListener("keydown",C=>{C.key==="Escape"&&y.classList.contains("show")&&v()})}const b=n.querySelector(".navbar-nav");if(b){const l=Array.from(b.children);let v=0;for(const m of d.items||[])if(!(m&&m.type==="separator")){if(m&&m.type==="spacer"){const g=document.createElement("li"),C=["xs","sm","md","lg","xl","flex"].includes(m.size)?m.size:"md";g.className=`dm-menu-spacer dm-menu-spacer--${C}`,g.setAttribute("aria-hidden","true"),b.insertBefore(g,l[v]||null);continue}if(m&&m.type==="theme-switcher"){const g=document.createElement("li");g.className="dm-menu-theme-switcher";const C=document.createElement("span");C.dataset.themeSwitcher="menu",C.dataset.position="inline",g.appendChild(C),b.insertBefore(g,l[v]||null);continue}v++}window.CMSThemeSwitcher?.scan(b)}const A=K(t,location.pathname+location.search);n.querySelectorAll("[data-path]").forEach(l=>{const v=l.dataset.path.split(".").map(Number),m=v.length>1,g=v.reduce((I,B)=>I?.items?.[B],{items:t});if(!g)return;g.colour&&G(l,g.colour),g.pill&&!m&&ce(l,g.pill),de(l,g),P(l.closest("li"),g.class);const C=U(g.badge);C&&l.appendChild(C),A.has(g)&&(l.classList.add("active"),l.setAttribute("aria-current","page"))}),pe(n,d,t),h()}let z=null;const w=$("#site-footer");if(w.length){let c=function(i){return String(i??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},p=function(i){return c(i).replace(/'/g,"'")},n=function(i){if(i&&i.type==="separator")return'<li class="footer-sep"><hr></li>';if(i&&i.type==="spacer")return`<li class="dm-menu-spacer dm-menu-spacer--${["xs","sm","md","lg","xl","flex"].includes(i.size)?i.size:"md"}" aria-hidden="true"></li>`;if(i&&i.type==="theme-switcher")return'<li class="dm-menu-theme-switcher"><span data-theme-switcher="menu" data-position="inline"></span></li>';const L=p(i.url||"#"),q=c(i.text||""),D=Array.isArray(i.items)&&i.items.length?`<ul>${i.items.map(n).join("")}</ul>`:"",N=me(i),W=[N.hover&&` data-menu-item-hover="${p(N.hover)}"`,N.active&&` data-menu-item-active="${p(N.active)}"`].filter(Boolean).join(""),j=N.accent?` style="--dm-menu-highlight:${p(N.accent)}"`:"",O=X(i.class).join(" ");return`<li${O?` class="${p(O)}"`:""}><a href="${L}"${W}${j}>${q}</a>${D}</li>`},f=function(){if(!r.footer)return"";const i=Object.keys(o).filter(q=>a[q]);if(!i.length)return"";const L=X(r.footer.socialClass).join(" ");return`<div class="footer-social">${i.map(q=>{const{label:D,svg:N}=o[q];return`<a href="${a[q]}" target="_blank" rel="noopener noreferrer" aria-label="${D}" class="footer-social-link${L?` ${p(L)}`:""}">${N}</a>`}).join("")}</div>`},A=function(i){if(!i||i.type==="separator"||i.type==="spacer")return"";if(i.type==="theme-switcher")return`<li class="cms-footer-col">${n(i).replace(/^<li[^>]*>|<\/li>$/g,"")}</li>`;const L=Array.isArray(i.items)&&i.items.length?`<ul>${i.items.map(n).join("")}</ul>`:"",q=b(i)?`<span class="cms-footer-col-title">${c(i.text||"")}</span>`:`<a class="cms-footer-col-title" href="${p(i.url||"#")}">${c(i.text||"")}</a>`,D=["cms-footer-col",...X(i.class)].join(" ");return`<li class="${p(D)}">${q}${L}</li>`},m=function(i,L,q=!1){return(i||[]).forEach(D=>{D&&(D.type==="separator"||D.type==="spacer"||D.type==="theme-switcher")||(q&&b(D)||L.push(D),Array.isArray(D.items)&&D.items.length&&m(D.items,L))}),L};const a=r.social||{},o={twitter:{label:"X / Twitter",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.742l7.73-8.835L1.254 2.25H8.08l4.259 5.629L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>'},facebook:{label:"Facebook",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>'},instagram:{label:"Instagram",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>'},linkedin:{label:"LinkedIn",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>'},github:{label:"GitHub",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'},youtube:{label:"YouTube",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.495 6.205a3.007 3.007 0 00-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 00.527 6.205a31.247 31.247 0 00-.522 5.805 31.247 31.247 0 00.522 5.783 3.007 3.007 0 002.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 002.088-2.088 31.247 31.247 0 00.5-5.783 31.247 31.247 0 00-.5-5.805zM9.609 15.601V8.408l6.264 3.602z"/></svg>'}};let e='<div class="footer-inner container">';const t=window.__CMS_FOOTER__||{primary:[],legal:[],copyright:""},h=(()=>{const i=r.cookieConsent;if(!i||i.showSettingsLink===!1)return"";const L=q=>(q||[]).some(D=>D&&(D.url==="#cookie-settings"||L(D.items)));return L(t.primary)||L(t.legal)?"":`<li class="cms-cookie-settings"><a href="#cookie-settings">${c(i.settingsLinkText||"Cookie settings")}</a></li>`})(),u=["columns","row"].includes(r.footer?.layout)?r.footer.layout:"auto",y=r.footer?.look==="showcase"||u==="columns"||u==="auto"&&t.primary.some(i=>Array.isArray(i?.items)&&i.items.length),b=i=>y&&!i.url&&Array.isArray(i.items)&&i.items.length>0;if(y){const i=d.brand||{},L=M&&(i.text||r.title)||"",q=M?i.logo?`<img src="${p(i.logo)}" class="cms-footer-brand-logo" alt="">`:i.icon?'<span class="cms-footer-brand-icon"></span>':"":"",D=String(r.footer?.blurb||"").trim();e='<div class="footer-inner footer-inner--columns container"><div class="cms-footer-top">',e+=`<div class="cms-footer-brand">${L||q?`<a class="cms-footer-brand-name" href="${p(i.url||"/")}">${q}<span>${c(L)}</span></a>`:""}${D?`<p class="cms-footer-blurb">${c(D)}</p>`:""}${f()}</div>`,t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary footer-nav--columns" aria-label="Footer"><ul>${t.primary.map(A).join("")}</ul></nav>`),e+='</div><div class="cms-footer-bottom">',t.copyright&&(e+=`<p class="cms-footer-copyright">${c(t.copyright)}</p>`),(t.legal.length||h)&&(e+=`<nav class="footer-nav footer-nav--legal" aria-label="Legal"><ul>${t.legal.map(n).join("")}${h}</ul></nav>`),e+="</div>"}else t.copyright&&(e+=`<p>${c(t.copyright)}</p>`),t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary"><ul>${t.primary.map(n).join("")}</ul></nav>`),(t.legal.length||h)&&(e+=`<nav class="footer-nav footer-nav--legal"><ul>${t.legal.map(n).join("")}${h}</ul></nav>`),e+=f();e+="</div>",w.get(0).querySelector(":scope > .cms-nojs-links")?.remove();const l=w.get(0).querySelector(":scope > .cms-footer-blocks");l?.remove(),w.html(e),l&&w.get(0).prepend(l),window.CMSThemeSwitcher?.scan(w.get(0));const v=w.get(0).querySelector(".cms-footer-brand-icon");v&&d.brand?.icon&&v.setAttribute("data-icon",d.brand.icon),P(w.get(0),r.footer?.class),y&&ge(w.get(0),r);const g=[...m(t.primary,[],!0),...m(t.legal,[])],C=K([...t.primary||[],...t.legal||[]],location.pathname+location.search),I=w.get(0).querySelectorAll(".footer-nav a"),B=[];I.forEach((i,L)=>{const q=g[L];if(!q)return;if(B.push({a:i,item:q}),q.icon){const N=document.createElement("span");N.className="cms-footer-ic",N.setAttribute("data-icon",String(q.icon)),N.setAttribute("data-icon-size","15"),N.setAttribute("aria-hidden","true"),i.prepend(N)}q.colour&&G(i,q.colour);const D=U(q.badge);D&&i.appendChild(D),C.has(q)&&(i.classList.add("is-active"),i.setAttribute("aria-current","page"))}),Y(w.get(0).querySelector(".footer-nav--primary"),{highlight:t.primaryHighlight}),Y(w.get(0).querySelector(".footer-nav--legal"),{highlight:t.legalHighlight}),J(w.get(0).querySelector(".footer-nav--primary"),{entrance:t.primaryEntrance}),J(w.get(0).querySelector(".footer-nav--legal"),{entrance:t.legalEntrance}),P(w.get(0).querySelector(".footer-nav--primary"),t.primaryClass),P(w.get(0).querySelector(".footer-nav--legal"),t.legalClass),fe(w.get(0),t,B),z=w.get(0).querySelector(".cms-footer-bottom")||w.get(0).querySelector(".footer-inner")}be(r.motion||{enabled:r.footer?.showMotionToggle!==!1,default:r.footer?.motionDefault,placement:"footer",control:r.footer?.motionControl,label:"Reduce motion"},{footer:z,navbar:document.querySelector("#site-navbar .navbar-container")?.closest("#site-navbar")||null});const k=document.getElementById("site-sidebar");k&&De(k),Domma.icons.scan(),Domma.syntax?.scan&&Domma.syntax.scan();const s=$(".page-body");if(s.length){s.find(".accordion").each(function(){Domma.elements.accordion(this,{allowMultiple:this.dataset.multi==="true"})}),s.find(".tabs").each(function(){Domma.elements.tabs(this)}),s.find(".carousel").each(function(){const o={primary:"--dm-primary",secondary:"--dm-secondary",accent:"--dm-primary",text:"--dm-text",surface:"--dm-surface",background:"--dm-background",success:"--dm-success",warning:"--dm-warning",danger:"--dm-danger",info:"--dm-info"},e=f=>{const u=String(f||"").trim();return u?o[u.toLowerCase()]?`var(${o[u.toLowerCase()]})`:CSS.supports("color",u)?u:"":""},t=e(this.dataset.background),c=e(this.dataset.arrowBackground),p=e(this.dataset.arrowColor);t&&(this.style.setProperty("--dm-carousel-background",t),this.classList.add("dm-carousel-custom-background")),c&&this.style.setProperty("--dm-carousel-arrow-background",c),p&&this.style.setProperty("--dm-carousel-arrow-color",p);const n=["top","middle","bottom"].includes(this.dataset.arrowPosition)?this.dataset.arrowPosition:"middle";this.classList.add(`dm-carousel-arrows-${n}`);const h={autoplay:this.dataset.autoplay==="true",interval:parseInt(this.dataset.interval,10)||5e3,loop:this.dataset.loop!=="false",animation:this.dataset.animation||"slide",heightMode:this.dataset.heightMode==="average"?"average":"crop"};if(this.dataset.height){const f=Number(this.dataset.height);Number.isFinite(f)&&f>0&&(h.height=f)}if(this.dataset.animationDuration){const f=parseInt(this.dataset.animationDuration,10);Number.isFinite(f)&&(h.animationDuration=f)}this.dataset.animationEasing&&(h.animationEasing=this.dataset.animationEasing),this.dataset.ctx&&(this._dmCtxSlides=Array.from(this.querySelectorAll(".carousel-slide")).map(f=>f.cloneNode(!0)),this._dmCarouselOpts=h),this._dmCarousel=Domma.elements.carousel(this,h),ie(this)}),s.find(".dm-countdown").each(function(){const o={autoStart:!0},e=String(this.dataset.format||"").trim(),t=String(this.dataset.to||"").trim(),c=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t),p=c?new Date(+c[1],+c[2]-1,+c[3]).getTime():t?new Date(t).getTime():NaN;Number.isFinite(p)?o.duration=Math.max(0,p-Date.now()):this.dataset.duration&&(o.duration=(parseInt(this.dataset.duration,10)||0)*1e3);const n=/^dd:/i.test(e);o.format=n?"hh:mm:ss":e||(o.duration>=36e5?"hh:mm:ss":"mm:ss");const h=this,f=y=>String(y).padStart(2,"0"),u=y=>{const b=Math.max(0,Math.floor(y/1e3)),A=h.querySelector(".dm-timer-time");A&&(A.textContent=`${f(Math.floor(b/86400))}:${f(Math.floor(b%86400/3600))}:${f(Math.floor(b%3600/60))}:${f(b%60)}`)};n&&(o.onTick=u),Domma.elements.timer(this,o),n&&u(o.duration||0)}),s.find("[data-tooltip]:not(.dm-range-slider)").each(function(){Domma.elements.tooltip(this,{content:$(this).data("tooltip"),position:$(this).data("tooltip-position")||"top"})}),s.find(".dm-progression").each(function(){const o=Array.from(this.querySelectorAll(".dm-progression-item")).map(c=>{const p={title:c.querySelector(".dm-progression-item-title")?.textContent?.trim()||"",description:c.querySelector(".dm-progression-item-body")?.innerHTML?.trim()||""};return c.dataset.date&&(p.date=c.dataset.date),c.dataset.status&&(p.status=c.dataset.status),c.dataset.eventIcon&&(p.icon=c.dataset.eventIcon),c.dataset.entryId&&(p._entryId=c.dataset.entryId),p}),e=this.dataset.layout==="centred"?"centered":this.dataset.layout||"vertical",t=Domma.elements.progression(this,{layout:e,theme:this.dataset.theme||"minimal",mode:this.dataset.mode||"timeline",statusIcons:!0,allowHtml:!0,...o.length?{items:o}:{}});if((this.dataset.mode||"timeline")==="timeline"){const c={completed:{label:"Completed",icon:"check-circle",tone:"success"},planned:{label:"Planned",icon:"circle",tone:"secondary"},"in-progress":{label:"In progress",icon:"clock",tone:"primary"},blocked:{label:"Blocked",icon:"alert-circle",tone:"danger"}};this.querySelectorAll(".dm-progression-item").forEach((p,n)=>{const h=o[n];if(!h)return;const f=p.querySelector(".dm-progression-title");if(h.icon&&f){const y=document.createElement("span");y.dataset.icon=h.icon,y.style.cssText="display:inline-flex;vertical-align:middle;margin-right:.4em",y.setAttribute("aria-hidden","true"),f.prepend(y)}const u=c[h.status];if(u&&f){const y=document.createElement("span");y.className=`badge badge-${u.tone} cms-timeline-status`,y.style.cssText="display:inline-flex;align-items:center;gap:.35em;margin:.4rem 0";const b=document.createElement("span");b.dataset.icon=u.icon,b.dataset.iconSize="14",b.setAttribute("aria-hidden","true"),y.append(b,document.createTextNode(u.label)),f.after(y)}})}Domma.icons.scan(this),o.length&&(this._dmCtx={instance:t,items:o})});try{Domma.effects.reveal(".page-body .hero",{animation:"slide-up",duration:480,threshold:.06,stagger:60,once:!1})}catch{}const a=matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.classList.contains("dm-reduced-motion");document.querySelectorAll(".page-body .row[data-reveal]").forEach(o=>{const e=o.dataset.revealMode||"stagger",t=o.dataset.revealAnimation||"slide-up",c=parseInt(o.dataset.revealDuration,10)||(t.startsWith("swoosh")?700:400),p=parseInt(o.dataset.revealStagger,10)||(t.startsWith("swoosh")?90:60),n=parseInt(o.dataset.revealDelay,10)||0,h=o.dataset.revealDirection==="rtl",f=o.dataset.revealReplay==="true",u=Array.from(o.children);if(a&&t.startsWith("swoosh"))return;const y={"slide-up":"translateY(30px)","slide-down":"translateY(-30px)","slide-left":"translateX(30px)","slide-right":"translateX(-30px)",zoom:"scale(0.85)",flip:"perspective(600px) rotateX(15deg)",swoosh:"translateY(36px) scale(0.96)"},b=m=>t!=="swoosh-sides"?y[t]||"":u.length>1&&m===0?"translateX(-64px) rotate(-1.5deg)":u.length>1&&m===u.length-1?"translateX(64px) rotate(1.5deg)":"translateY(40px) scale(0.94)",A=t.startsWith("swoosh"),l=A?"cubic-bezier(.2,.8,.2,1)":"ease",v=(m,g)=>{m.style.opacity="0",m.style.transform=b(g),A&&(m.style.filter="blur(10px)")};u.forEach((m,g)=>{m.style.transition="none",v(m,g)}),o.offsetWidth,u.forEach((m,g)=>{m.style.transition=`opacity ${c}ms ${l}, transform ${c}ms ${l}`+(A?`, filter ${c}ms ${l}`:"");const C=h?u.length-1-g:g;m.style.transitionDelay=e==="stagger"?`${n+C*p}ms`:`${n}ms`}),requestAnimationFrame(()=>requestAnimationFrame(()=>{const m=new IntersectionObserver(g=>{g.forEach(C=>{if(C.isIntersecting){if(C.target.offsetWidth,C.target.style.opacity="1",C.target.style.transform="",A&&(C.target.style.filter=""),!f){m.unobserve(C.target);const I=C.target;I.addEventListener("transitionend",function B(i){i.target!==I||i.propertyName!=="opacity"||(I.removeEventListener("transitionend",B),I.style.transition="",I.style.transitionDelay="")})}}else f&&C.boundingClientRect.top>0&&v(C.target,u.indexOf(C.target))})},{threshold:.1,rootMargin:"100000px 0px 0px 0px"});u.forEach(g=>m.observe(g))}))}),he(document.querySelector(".page-body")||document),s.find(".card[data-collapsible]").each(function(){const o=this.querySelector(".card-header");o&&o.addEventListener("click",()=>this.classList.toggle("is-collapsed"))}),s.find(".dm-so-trigger").each(function(){this.addEventListener("click",()=>{const o=this.dataset.soTarget,e=document.getElementById(o);if(!e)return;const t=E.slideover({title:e.dataset.soTitle||"",size:e.dataset.soSize||"md",position:e.dataset.soPosition||"right"});e.style.display="",t.setContent(e),t.open()})})}if(typeof $.setup=="function"){const a=Object.assign({},window.__CMS_DCONFIG__||{});if(document.querySelectorAll(".dm-page-config[data-config]").forEach(o=>{try{const e=V(o.dataset.config);Object.assign(a,e)}catch{}}),Object.keys(a).length>0){const o={};for(const[e,t]of Object.entries(a)){const c=t?.events?.click,{confirm:p,toast:n,alert:h,prompt:f,...u}=c||{};if(p||n||h||f){$(e).on("click",async function(W){if(W.preventDefault(),p&&!await E.confirm(p))return;let j=null;if(!(f&&(j=await E.prompt(f,{inputPlaceholder:u.promptPlaceholder||"",inputValue:u.promptDefault||""}),j===null))){{const O=$(u.target||this);u.toggleClass&&O.toggleClass(u.toggleClass),u.addClass&&O.addClass(u.addClass),u.removeClass&&O.removeClass(u.removeClass),j!==null&&(u.setText&&O.text(j),u.setVal&&O.val(j),u.setAttr&&O.attr(u.setAttr,j))}u.href&&se(u.href),n&&E.toast(n,{type:u.toastType||"success"}),h&&E.alert(h)}});const{target:b,toggleClass:A,addClass:l,removeClass:v,setText:m,setVal:g,setAttr:C,href:I,toastType:B,promptPlaceholder:i,promptDefault:L,...q}=u,D={...t.events};Object.keys(q).length?D.click=b?{target:b,...q}:q:delete D.click;const N={...t,events:D};Object.keys(D).length||delete N.events,Object.keys(N).length&&(o[e]=N)}else o[e]=t}$.setup(o)}}s.length&&R(s.get(0))}),window.wireCTAButtons=R;function se(d){if(!_e(d)){console.warn("[site] refused to go to",String(d).slice(0,60));return}const r=document.body?.classList.contains("dm-launcher-embed")&&window.top!==window;(r?window.top:window).location.href=d}function _e(d){const r=String(d??"").replace(/[\u0000-\u0020\u007f-\u00a0\u200b-\u200f\ufeff]/g,"").toLowerCase();return!r||r.includes("\\")||r.startsWith("//")?!1:/^(\/|#|\?|\.\.?\/)/.test(r)||/^(https?:\/\/|mailto:|tel:)/.test(r)?!0:!/^[a-z][a-z0-9+.-]*:/.test(r)}function R(d){d.querySelectorAll(".dm-cta-trigger").forEach(r=>{r.__ctaWired||(r.__ctaWired=!0,r.addEventListener("click",async()=>{const M=r.dataset.action,x=r.dataset.entry,z=r.dataset.confirm;let w=S.get("auth_token");if(!w){E.toast("Please log in to perform this action.",{type:"warning"});return}if(z&&!await E.confirm(z))return;const k=Array.from(r.childNodes).map(a=>a.cloneNode(!0));r.disabled=!0,r.textContent="Running\u2026";const s=a=>fetch(`/api/actions/${M}/public`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r.dataset.scope?{entryId:x,scope:r.dataset.scope}:{entryId:x})});try{let a=await s(w);if(a.status===401){const e=S.get("auth_refresh_token");if(e){const t=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(t.ok){const{token:c}=await t.json();S.set("auth_token",c),w=c,a=await s(w)}}}const o=await a.json().catch(()=>({}));if(!a.ok||o.success===!1)throw new Error(o.error||o.message||`Error ${a.status}`);E.toast(o.message||"Action completed.",{type:"success"})}catch(a){E.toast(a.message||"Action failed.",{type:"error"})}finally{r.disabled=!1,r.textContent="",k.forEach(a=>r.appendChild(a)),Domma.icons.scan(r)}}))})}(function(){const r=document.querySelectorAll('.dm-collection-hydrate[data-collection-scope="mine"]');if(!r.length)return;const M=S.get("auth_token");function x(w,k){const s=document.createElement("div");s.className="dm-collection-display dm-collection-empty";const a=document.createElement("p");if(k){a.appendChild(document.createTextNode("Please "));const o=document.createElement("a");o.href="/login",o.textContent="sign in",a.appendChild(o),a.appendChild(document.createTextNode(" to view your entries."))}else a.textContent=w;return s.appendChild(a),s}function z(w,k){const s=document.createElement("template");s.innerHTML=k||"",w.replaceWith(s.content)}r.forEach(async w=>{const k=w.dataset.collectionAttrs;if(!k)return;if(!M){w.replaceChildren(x("",!0));return}const s=a=>fetch("/api/collections/render-scope",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({attrs:k})});try{let a=M,o=await s(a);if(o.status===401){const t=S.get("auth_refresh_token");if(t){const c=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(c.ok){const{token:p}=await c.json();S.set("auth_token",p),a=p,o=await s(a)}}}if(!o.ok){const{error:t}=await o.json().catch(()=>({}));w.replaceChildren(x(t||"Unable to load entries.",!1));return}const{html:e}=await o.json();z(w,e),window.DommaCollectionBrowser?.hydrate&&window.DommaCollectionBrowser.hydrate(document)}catch{w.replaceChildren(x("Unable to load entries.",!1))}}),setTimeout(()=>{typeof Domma<"u"&&Domma.icons?.scan&&Domma.icons.scan(),typeof Domma<"u"&&Domma.syntax?.scan&&Domma.syntax.scan(),R(document.body)},100)})(),(function(){const r=document.querySelectorAll("[data-collection-table]");!r.length||typeof T>"u"||!T.create||r.forEach(M=>{let x;try{x=V(M.dataset.payload)}catch{return}const{columns:z,rows:w,search:k,sortable:s,exportable:a,pageSize:o,empty:e,ctaConfig:t,slug:c,exportCfg:p}=x;if(!z?.length)return;if(t){const f=z.findIndex(u=>u.key==="_cta");f!==-1&&(z[f]={key:"_cta",title:"",render:(u,y)=>{const b=document.createElement("button");if(b.className=`btn btn-${t.style||"primary"} dm-cta-trigger`,b.dataset.action=t.action||"",t.scope&&(b.dataset.scope=t.scope),b.dataset.entry=y._entryId||"",t.confirm&&(b.dataset.confirm=t.confirm),t.icon){const A=document.createElement("span");A.dataset.icon=t.icon,b.appendChild(A),b.appendChild(document.createTextNode(" "))}return b.appendChild(document.createTextNode(t.label||"Run")),b}})}const n="col-table-"+Math.random().toString(36).slice(2,7),h=document.createElement("div");h.id=n,M.replaceChildren(h),T.create("#"+n,{data:w,columns:z,search:k,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(h),M._dmTable={columns:z,rows:w,slug:c,exportCfg:p,render(f){T.create("#"+n,{data:f,columns:z,search:k,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(h)}}})})(),(function(){const r=document.querySelectorAll("[data-form-inline]");if(!r.length||typeof F>"u")return;function M(s){const a=s&&s.logic;return!!(a&&(a.visibility||a.requirement))}function x(s,a){const o={};return(s||[]).forEach(e=>{if(e.type==="page-break"||e.type==="spacer"||!e.name)return;const t=e.type==="chooser"||!!(e.variant&&["select","radio","checkbox-group"].includes(e.type)),c=e.type==="checkbox"?"boolean":e.type==="date"||e.type==="icon"||e.type==="image"?"string":t?"chooser":e.type,p={...e.formConfig||{}};p.span==="full"&&a&&(p.span=a);const n={type:c,required:M(e)?!1:e.required,label:e.label,options:e.options,formConfig:{...e.placeholder&&{placeholder:e.placeholder},...e.helper&&{hint:e.helper},...e.tooltip&&{tooltip:e.tooltip},...p}};e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.min!==void 0&&(n.min=e.min),e.max!==void 0&&(n.max=e.max),t&&(e.variant&&(n.variant=e.variant),(e.multiple||e.type==="checkbox-group")&&(n.multiple=!0),e.density&&(n.density=e.density),e.columns&&(n.columns=e.columns),e.accent&&(n.accent=e.accent),e.accentStyle&&(n.accentStyle=e.accentStyle),e.glow&&(n.glow=!0),e.glowColour&&(n.glowColour=e.glowColour),e.shadow&&(n.shadow=e.shadow),e.shadowColour&&(n.shadowColour=e.shadowColour)),o[e.name]=e.type==="file"?xe(e,n):n}),o}function z(s){const a={};return(s||[]).forEach(o=>{if(!(!o.name||o.type==="page-break"||o.type==="spacer")&&(o.type==="select"||o.type==="multiselect")&&o.required){const e=(o.options||[])[0];e&&(a[o.name]=typeof e=="object"?e.value:e)}}),a}function w(s,a){(a||[]).forEach(o=>{if(o.type!=="date"||!o.name)return;const e=s.querySelector(`[name="${o.name}"]`);e&&e.type!=="date"&&(e.type="date")})}function k(s,a,o){let e=s.querySelector(".cms-form-message");e||(e=document.createElement("p"),e.className="cms-form-message",s.appendChild(e)),e.textContent=a,e.style.cssText=o?"color:var(--dm-danger);margin-top:.75rem;":"color:var(--dm-success);margin-top:.75rem;"}r.forEach(s=>{let a;try{a=V(s.dataset.formInline)}catch{return}s.querySelector(":scope > .cms-form-embed-summary")?.remove();const o=a.fields||[],e=a.settings||{},t=Number(e.columns)===3?3:2,c=e.layout||"grid",p=o.some(A=>A.type==="page-break"),n=new Map;Le(s,a.fileLimits,n),Te(s,o);const h=async A=>{if(s.dataset.triggerBlocked==="true"){const l=s._formLogicRuntime,v=l&&l.submitBlock?l.submitBlock().reasons:[];k(s,v.join(" ")||"This form cannot be submitted yet.",!0);const m=new Error("Blocked by a form trigger");throw m.formSubmitFailed=!0,m}try{const l=s.querySelector(".fb-form-honeypot"),v=l?.querySelector('input[type="text"]')||null,m=l?.querySelector('[name="_t"]')||null,g=Object.assign({},A);delete g._t,l?.dataset.hpName&&delete g[l.dataset.hpName],v!==null&&(g._hp=v.value),m!==null&&(g._t=m.value);const C=new Map(n);ne(s,C);const I=$e(g,o,C),B=Ae(s,I.files);if(B){k(s,B,!0);const L=new Error(B);throw L.formSubmitFailed=!0,L}const i=await H.post(`/api/forms/submit/${a.slug}`,I.files.size?Ee(I.values,I.files).body:I.values);if(i&&i.error){k(s,i.error,!0);const L=new Error(i.error);throw L.formSubmitFailed=!0,L}if(i?.redirect){se(i.redirect);return}for(Se(s);s.firstChild;)s.removeChild(s.firstChild);k(s,i?.message||e.successMessage||"Thank you for your submission.",!1)}catch(l){throw l.formSubmitFailed||k(s,l.message||"Submission failed. Please try again.",!0),l}},f=Date.now();function u(A){const l=A.querySelector("form");if(!l||l.querySelector(".fb-form-honeypot"))return;const v=document.createElement("div");v.className="fb-form-honeypot",v.setAttribute("aria-hidden","true");const m=document.createElement("input");m.name=l.querySelector('[name="website"]')?"_website":"website",v.dataset.hpName=m.name,m.type="text",m.tabIndex=-1,m.autocomplete="url",m.placeholder="https://",v.appendChild(m);const g=document.createElement("input");g.name="_t",g.type="hidden",g.value=f,v.appendChild(g),l.appendChild(v)}function y(A){if(!window.FormLogicEngine||!o.some(v=>v.logic||Array.isArray(v.triggers)&&v.triggers.length))return null;const l=new window.FormLogicEngine.FormLogicRuntime(a,s,A?{baseValues:A}:void 0);if(l.init(),s._formLogicRuntime=l,s._formLogicObserved)return l;if(s._formLogicObserved=!0,s.parentNode&&typeof MutationObserver<"u"){const v=new MutationObserver(function(m){for(const g of m)for(const C of g.removedNodes)if(C===s||C.nodeType===1&&C.contains&&C.contains(s)){s._formLogicRuntime&&s._formLogicRuntime.destroy(),v.disconnect();return}});v.observe(s.parentNode,{childList:!0,subtree:!1}),s._formLogicObserver=v}return l}let b=!1;if(s.addEventListener("dm-form-end",A=>{const l=A.detail?.validation;if(l&&!l.valid){Z(s,l.missing),ee(l);return}b||(b=!0,h(A.detail?.values||{}).catch(()=>{}).finally(()=>{b=!1}))}),p&&F.wizard){const A=ve(o,a.title),l=A.map(i=>({title:i.title,description:i.description,fields:x(i.fields,t)})),v=A.map(i=>i.fields);let m=0,g=null,C=null;const I=i=>{const L=window.FormLogicEngine;if(!L||!L.validateFields)return;const q=L.validateFields(s,v[m]||[]);q.valid||(i.preventDefault(),i.stopImmediatePropagation(),Z(s,q.missing),ee(q))},B=()=>{const i=v[m]||o;Ce(s,e),te(s,e,i),oe(s,e),w(s,i),Q(s,i),ke(s,n),e.honeypot!==!1&&u(s),g&&g.destroy(),g=y(C?.getStepData?C.getStepData():void 0),s.querySelectorAll(".wizard-next, .wizard-submit").forEach(L=>L.addEventListener("click",I,!0))};C=F.wizard(s,{schema:{steps:l},layout:c,columns:t,finishText:e.submitText||"Finish",onSubmit:h,onStepChange:i=>{ne(s,n),m=i,setTimeout(B,0)}}),s.addEventListener("dm-form-trigger",i=>{if(i.detail?.type!=="goto-step"||!C?.goToStep)return;const L=Number(i.detail.action.step);!Number.isFinite(L)||L<0||L>=l.length||L!==m&&C.goToStep(L)}),Promise.resolve(C).then(B)}else if(F.render){const A=F.render(s,x(o,t),z(o),{submitText:e.submitText||"Submit",layout:c,columns:t,onSubmit:h});Promise.resolve(A).then(function(){we(s,e,c),te(s,e,o),oe(s,e),w(s,o),Q(s,o),e.honeypot!==!1&&u(s),y()})}})})();function qe(d,r){const M=document.body,x=M.classList,z=new Set((M.dataset.railSite||"").split(" ").filter(Boolean)),w=()=>window.matchMedia("(min-width: 993px)").matches;d.querySelectorAll(".navbar-link, .navbar-dropdown-toggle").forEach(t=>{const c=t.textContent.trim();c&&(t.setAttribute("title",c),t.querySelector("svg, [data-icon]")||(t.dataset.initial=c.charAt(0).toUpperCase()))});const k=document.createElement("button");k.type="button",k.className="dm-nav-collapse-toggle";const s=()=>{const t=x.contains("dm-vnav-collapsed");k.setAttribute("aria-pressed",String(t)),k.setAttribute("aria-label",t?"Expand menu":"Collapse menu"),k.title=k.getAttribute("aria-label");const c=r?"chevrons-left":"chevrons-right",p=r?"chevrons-right":"chevrons-left";k.innerHTML=`<span data-icon="${t?c:p}"></span>`,window.Domma&&Domma.icons&&Domma.icons.scan(k)},a=t=>{x.toggle("dm-vnav-collapsed",t),S.set("nav_collapsed",t),s()};k.addEventListener("click",()=>a(!x.contains("dm-vnav-collapsed"))),s();const o=d.querySelector(".navbar-container")||d;o.insertBefore(k,o.firstChild?.nextSibling||null);const e=t=>{x.toggle("dm-vnav-autohide",t),x.toggle("dm-vnav-collapsible",!t&&z.has("collapsible")),t?x.remove("dm-vnav-collapsed"):z.has("collapsible")&&S.get("nav_collapsed")===!0&&x.add("dm-vnav-collapsed"),d.classList.remove("dm-nav-revealed"),s()};d.addEventListener("pointerdown",t=>{x.contains("dm-vnav-autohide")&&t.pointerType!=="mouse"&&!d.classList.contains("dm-nav-revealed")&&(d.classList.add("dm-nav-revealed"),t.preventDefault())}),document.addEventListener("pointerdown",t=>{d.contains(t.target)||d.classList.remove("dm-nav-revealed")}),window.E&&typeof E.contextMenu=="function"&&E.contextMenu(d,{items:()=>{const t=x.contains("dm-vnav-autohide"),c=x.contains("dm-vnav-collapsed"),p=S.has("nav_autohide")||S.has("nav_collapsed");return[{header:"Menu"},{label:c?"Expand menu":"Collapse to icons",icon:c?"maximize":"minimize",disabled:!w()||t||!z.has("collapsible"),action:()=>a(!c)},{label:t?"Keep on screen":"Hide when not in use",icon:t?"eye":"eye-off",disabled:!w(),action:()=>{S.set("nav_autohide",!t),e(!t)}},{type:"divider"},{label:"Reset to the site's setting",icon:"refresh",disabled:!p,action:()=>{S.remove("nav_autohide"),S.remove("nav_collapsed"),e(z.has("autohide")),x.toggle("dm-vnav-collapsed",!z.has("autohide")&&z.has("start-collapsed")),s()}}]}})}function Me(d){d.classList.add("dm-nav-scroll-hide");let r=window.scrollY,M=!1;window.addEventListener("scroll",()=>{M||(M=!0,requestAnimationFrame(()=>{M=!1;const x=window.scrollY,z=d.matches(":focus-within")||d.querySelector(".navbar-dropdown.open, .navbar-collapse.show");x>r&&x>d.offsetHeight&&!z?d.classList.add("dm-nav-scrolled-away"):x<r&&d.classList.remove("dm-nav-scrolled-away"),r=x}))},{passive:!0})}function De(d){let r={};try{r=JSON.parse(d.dataset.contents||"{}")}catch{}const M=d.closest(".site-main"),x=document.querySelector(".site-content"),z=new Set(String(r.exclude||"").split(",").map(n=>n.trim().toLowerCase()).filter(Boolean)),w=n=>!n.closest(".hero, .card, .accordion, .tabs, figure, #site-sidebar"),k=n=>(x?[...x.querySelectorAll(n)]:[]).filter(w).filter(h=>!z.has(h.textContent.trim().toLowerCase())),s=r.headings==="h2"?k("h2"):r.headings==="h3"?k("h3"):r.headings==="h2h3"?k("h2, h3"):k("h2").length?k("h2"):k("h3");if(!s.length){M?.classList.add("no-sidebar-items");return}const a=new Set([...document.querySelectorAll("[id]")].map(n=>n.id)),o=document.createElement("nav");o.className="dm-contents",o.setAttribute("aria-label",r.title||"Page contents"),r.hover&&(o.dataset.menuHover=r.hover),r.selected&&(o.dataset.menuActive=r.selected),r.accent&&o.style.setProperty("--dm-menu-highlight",r.accent.startsWith("#")?r.accent:`var(--dm-${r.accent})`),r.font&&(o.style.fontFamily=r.font),r.fontSize&&(o.style.fontSize=r.fontSize),r.fontWeight&&(o.style.fontWeight=r.fontWeight);const e=document.createElement("div");e.className="dm-contents-head";const t=document.createElement("p");t.className="dm-contents-title",t.textContent=r.title||"",e.appendChild(t),o.appendChild(e);const c=document.createElement("ol");c.className="dm-contents-list"+(r.numbered?" is-numbered":"");const p=[];for(const n of s){if(!n.id){const u=(n.textContent||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"section";let y=u;for(let b=2;a.has(y);b++)y=`${u}-${b}`;a.add(y),n.id=y}const h=document.createElement("li");h.className=`dm-contents-item dm-contents-${n.tagName.toLowerCase()}`;const f=document.createElement("a");f.href=`#${n.id}`,f.textContent=n.textContent.trim(),h.appendChild(f),c.appendChild(h),p.push([n,f])}if(o.appendChild(c),d.replaceChildren(o),r.scrollSpy!==!1&&"IntersectionObserver"in window){const n=new Map,h=()=>{const u=p.find(([y])=>n.get(y))||null;p.forEach(([,y])=>{const b=u&&y===u[1];y.classList.toggle("is-active",!!b),b?y.setAttribute("aria-current","location"):y.removeAttribute("aria-current")})},f=new IntersectionObserver(u=>{u.forEach(y=>n.set(y.target,y.isIntersecting)),h()},{rootMargin:"-80px 0px -60% 0px"});p.forEach(([u])=>f.observe(u))}if(M?.classList.contains("contents-collapsible")){const n=document.createElement("button");n.type="button",n.className="dm-contents-toggle";const h=()=>{const f=M.classList.contains("contents-collapsed");n.setAttribute("aria-expanded",String(!f)),n.setAttribute("aria-label",f?"Show the contents":"Hide the contents"),n.title=n.getAttribute("aria-label"),n.innerHTML=`<span data-icon="${f?"list":"x"}"></span>`,window.Domma?.icons&&Domma.icons.scan(n)};n.addEventListener("click",()=>{S.set("contents_collapsed",M.classList.toggle("contents-collapsed")),h()}),h(),e.insertBefore(n,e.firstChild)}if(M?.classList.contains("contents-floating")&&r.movable){o.classList.add("is-movable");const n=S.get("contents_position");n&&Number.isFinite(n.x)&&Object.assign(d.style,{left:`${n.x}px`,top:`${n.y}px`,right:"auto",bottom:"auto"}),e.addEventListener("pointerdown",h=>{if(h.target.closest("button"))return;const f=d.getBoundingClientRect(),u=h.clientX-f.left,y=h.clientY-f.top,b=l=>{const v=Math.max(0,Math.min(window.innerWidth-f.width,l.clientX-u)),m=Math.max(0,Math.min(window.innerHeight-40,l.clientY-y));Object.assign(d.style,{left:`${v}px`,top:`${m}px`,right:"auto",bottom:"auto"})},A=()=>{document.removeEventListener("pointermove",b),S.set("contents_position",{x:parseInt(d.style.left,10),y:parseInt(d.style.top,10)})};document.addEventListener("pointermove",b),document.addEventListener("pointerup",A,{once:!0})})}window.E&&typeof E.contextMenu=="function"&&E.contextMenu(d,{items:()=>{const n=M?.classList.contains("contents-collapsible"),h=M?.classList.contains("contents-collapsed"),f=p.find(([,u])=>u.classList.contains("is-active"));return[{header:"Contents"},...n?[{label:h?"Show the contents":"Collapse to a button",icon:h?"list":"minimize",action:()=>d.querySelector(".dm-contents-toggle")?.click()}]:[],{label:"Copy a link to this section",icon:"link",disabled:!f,action:async()=>{const u=`${location.origin}${location.pathname}#${f[0].id}`;try{await _.copyToClipboard(u),E.toast("Link copied.",{type:"success"})}catch{E.toast("Could not copy the link.",{type:"error"})}}},{label:"Back to the top",icon:"arrow-up",action:()=>window.scrollTo({top:0,behavior:"smooth"})}]}}),M?.classList.contains("contents-autohide")&&(d.addEventListener("pointerdown",n=>{n.pointerType!=="mouse"&&!d.classList.contains("is-revealed")&&(d.classList.add("is-revealed"),n.preventDefault())}),document.addEventListener("pointerdown",n=>{d.contains(n.target)||d.classList.remove("is-revealed")}))}
|
|
1
|
+
import{applyMobileMenu as ae,initCarouselPopup as ie}from"/public/js/mobile-ui.mjs?v=20261016-mobile-options";import{installSmoothCarets as re}from"/public/js/smooth-caret.js";import{decodeBase64Json as V}from"/public/js/utf8-base64.mjs";import{makeBadgeEl as U,applyColour as G,applyPill as ce,applyFloat as le,applyHighlight as Y,applyItemHighlight as de,itemHighlightAttrs as me,currentItems as K,menuAlign as ue,applyClasses as P,cssClasses as X,applyEntrance as J}from"/public/js/menu-decor.mjs?v=20261109-current-query";import{applyMenuLook as pe,applyFooterLook as fe}from"/public/js/menu-cards.mjs?v=20261109-current-query";import{initPageMotion as he}from"/public/js/page-motion.mjs?v=20261029-page-motion";import{applyFooterShowcase as ge}from"/public/js/footer-showcase.mjs?v=20261029-footer-showcase";import{initFloatingMenus as ye}from"/public/js/menu-float.js?v=20260829-float-panel";import{enhancePickerFields as Q,markInvalidFields as Z,showValidationPopup as ee}from"/public/js/forms.js?v=20261109-form-embed";import{buildWizardSteps as ve}from"/public/js/form-steps.mjs";import{mountMotionControl as be}from"/public/js/motion-control.mjs?v=20261031-launchers";import{applyFormClasses as te,applyFormEntrance as oe,applySubmitButtons as we,applyWizardButtons as Ce}from"/public/js/form-submit.mjs";import{captureFileFields as ne,destroyDropzones as Se,fileBlueprint as xe,restoreFileFields as ke,setFileLimits as Le,splitFiles as $e,submitBody as Ee,totalTooLarge as Ae,wireFileFields as Te}from"/public/js/form-files.mjs";document.addEventListener("click",d=>{const r=d.target?.closest?.(".dm-banner__dismiss");r&&(d.preventDefault(),r.closest(".dm-banner")?.remove())}),$(()=>{re(document);const d=window.__CMS_NAV__||{},r=window.__CMS_SITE__||{},q=r.brandingEnabled!==!1&&d.brand?.enabled!==!1;if(r.autoTheme?.enabled){let o=function(c){const p=(c||"07:00").split(":");return+p[0]*60+(+p[1]||0)},e=function(){const c=new Date,p=c.getHours()*60+c.getMinutes();return p>=o(a.dayStart)&&p<o(a.nightStart)?a.dayTheme:a.nightTheme},t=function(c){if(window.CMSThemeSwitcher?.hasPreference())return;const p=a.apply&&a.apply[c]||{theme:c,custom:""};Domma.theme.set(p.theme);for(const n of[...document.body.classList])n.startsWith("dm-custom-")&&document.body.classList.remove(n);p.custom&&document.body.classList.add(p.custom)};const a=r.autoTheme;t(e()),setInterval(()=>t(e()),6e4)}const x=$("#site-navbar");if(x.length&&d.brand){let e=function(l,v=0){return Array.isArray(l)?l.filter(m=>!(m&&(m.type==="spacer"||m.type==="theme-switcher"))).filter(m=>!(m&&m.type==="separator"&&v===0)).map(m=>m&&m.type==="separator"?{divider:!0}:Array.isArray(m?.items)?{...m,items:e(m.items,v+1)}:m):l};const a={...d.brand},o=a.size&&a.size!=="md"?` navbar-brand-${a.size}`:"";if(a.logo||a.icon||a.tagline){let l="";a.logo?l+=`<img src="${a.logo}" class="navbar-brand-logo" alt="${a.text||""}">`:a.icon&&(l+=`<span data-icon="${a.icon}" style="width:1.1em;height:1.1em;margin-right:.35em;vertical-align:middle;"></span>`),a.text&&(l+=`<span class="navbar-brand-text${o}">${a.text}</span>`),a.tagline&&(l+=`<small class="navbar-brand-tagline">${a.tagline}</small>`),a.html=l}else o&&a.text&&(a.html=`<span class="navbar-brand-text${o}">${a.text}</span>`);const t=e(d.items||[]),c=d.position==="floating",p=d.orientation==="vertical";x.get(0).querySelector(":scope > .cms-nojs-links")?.remove(),Domma.elements.navbar("#site-navbar",{brand:q?a:null,items:t,variant:d.variant||"dark",position:c?"static":d.position||"sticky",collapsible:!0,appearOnHover:!!d.appearOnHover}),Domma.icons.scan("#site-navbar");const n=x.get(0);ae(n,d.mobile);const h=()=>{if(!p)return;const v=n.querySelector('a[aria-current="page"]')?.closest(".navbar-dropdown");v&&!v.classList.contains("open")&&v.querySelector(":scope > .navbar-dropdown-toggle")?.click()};n.classList.add(`dm-nav-align-${ue(d)||"centre"}`),p&&x.get(0).classList.add("dm-nav-vertical",d.side==="right"?"dm-nav-vertical-right":"dm-nav-vertical-left");const f=d.dock||{};p&&!c&&Me(n,d.side==="right"),!p&&f.hideOnScroll&&qe(n),Y(n,d),J(n,d),P(n,d.class),c&&(le(x.get(0),d),ye(x.get(0).parentNode||document));const u=n.querySelector(".navbar-toggle"),y=n.querySelector(".navbar-collapse");if(u&&y){let l=null;const v=()=>{y.classList.contains("show")&&u.click()},m=()=>{l&&(l.remove(),l=null),document.body.classList.remove("dm-drawer-open")},g=()=>{l||(l=document.createElement("div"),l.className="dm-navbar-backdrop",l.addEventListener("click",v),document.body.appendChild(l),document.body.classList.add("dm-drawer-open"))};u.addEventListener("click",()=>{requestAnimationFrame(()=>{y.classList.contains("show")?(h(),g()):m()})}),y.addEventListener("click",C=>{C.target.closest("a")&&requestAnimationFrame(m)}),document.addEventListener("keydown",C=>{C.key==="Escape"&&y.classList.contains("show")&&v()})}const b=n.querySelector(".navbar-nav");if(b){const l=Array.from(b.children);let v=0;for(const m of d.items||[])if(!(m&&m.type==="separator")){if(m&&m.type==="spacer"){const g=document.createElement("li"),C=["xs","sm","md","lg","xl","flex"].includes(m.size)?m.size:"md";g.className=`dm-menu-spacer dm-menu-spacer--${C}`,g.setAttribute("aria-hidden","true"),b.insertBefore(g,l[v]||null);continue}if(m&&m.type==="theme-switcher"){const g=document.createElement("li");g.className="dm-menu-theme-switcher";const C=document.createElement("span");C.dataset.themeSwitcher="menu",C.dataset.position="inline",g.appendChild(C),b.insertBefore(g,l[v]||null);continue}v++}window.CMSThemeSwitcher?.scan(b)}const A=K(t,location.pathname+location.search);n.querySelectorAll("[data-path]").forEach(l=>{const v=l.dataset.path.split(".").map(Number),m=v.length>1,g=v.reduce((I,B)=>I?.items?.[B],{items:t});if(!g)return;g.colour&&G(l,g.colour),g.pill&&!m&&ce(l,g.pill),de(l,g),P(l.closest("li"),g.class);const C=U(g.badge);C&&l.appendChild(C),A.has(g)&&(l.classList.add("active"),l.setAttribute("aria-current","page"))}),pe(n,d,t),h()}let z=null;const w=$("#site-footer");if(w.length){let c=function(i){return String(i??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},p=function(i){return c(i).replace(/'/g,"'")},n=function(i){if(i&&i.type==="separator")return'<li class="footer-sep"><hr></li>';if(i&&i.type==="spacer")return`<li class="dm-menu-spacer dm-menu-spacer--${["xs","sm","md","lg","xl","flex"].includes(i.size)?i.size:"md"}" aria-hidden="true"></li>`;if(i&&i.type==="theme-switcher")return'<li class="dm-menu-theme-switcher"><span data-theme-switcher="menu" data-position="inline"></span></li>';const L=p(i.url||"#"),M=c(i.text||""),D=Array.isArray(i.items)&&i.items.length?`<ul>${i.items.map(n).join("")}</ul>`:"",N=me(i),W=[N.hover&&` data-menu-item-hover="${p(N.hover)}"`,N.active&&` data-menu-item-active="${p(N.active)}"`].filter(Boolean).join(""),j=N.accent?` style="--dm-menu-highlight:${p(N.accent)}"`:"",O=X(i.class).join(" ");return`<li${O?` class="${p(O)}"`:""}><a href="${L}"${W}${j}>${M}</a>${D}</li>`},f=function(){if(!r.footer)return"";const i=Object.keys(o).filter(M=>a[M]);if(!i.length)return"";const L=X(r.footer.socialClass).join(" ");return`<div class="footer-social">${i.map(M=>{const{label:D,svg:N}=o[M];return`<a href="${a[M]}" target="_blank" rel="noopener noreferrer" aria-label="${D}" class="footer-social-link${L?` ${p(L)}`:""}">${N}</a>`}).join("")}</div>`},A=function(i){if(!i||i.type==="separator"||i.type==="spacer")return"";if(i.type==="theme-switcher")return`<li class="cms-footer-col">${n(i).replace(/^<li[^>]*>|<\/li>$/g,"")}</li>`;const L=Array.isArray(i.items)&&i.items.length?`<ul>${i.items.map(n).join("")}</ul>`:"",M=b(i)?`<span class="cms-footer-col-title">${c(i.text||"")}</span>`:`<a class="cms-footer-col-title" href="${p(i.url||"#")}">${c(i.text||"")}</a>`,D=["cms-footer-col",...X(i.class)].join(" ");return`<li class="${p(D)}">${M}${L}</li>`},m=function(i,L,M=!1){return(i||[]).forEach(D=>{D&&(D.type==="separator"||D.type==="spacer"||D.type==="theme-switcher")||(M&&b(D)||L.push(D),Array.isArray(D.items)&&D.items.length&&m(D.items,L))}),L};const a=r.social||{},o={twitter:{label:"X / Twitter",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.742l7.73-8.835L1.254 2.25H8.08l4.259 5.629L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>'},facebook:{label:"Facebook",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>'},instagram:{label:"Instagram",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>'},linkedin:{label:"LinkedIn",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>'},github:{label:"GitHub",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'},youtube:{label:"YouTube",svg:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.495 6.205a3.007 3.007 0 00-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 00.527 6.205a31.247 31.247 0 00-.522 5.805 31.247 31.247 0 00.522 5.783 3.007 3.007 0 002.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 002.088-2.088 31.247 31.247 0 00.5-5.783 31.247 31.247 0 00-.5-5.805zM9.609 15.601V8.408l6.264 3.602z"/></svg>'}};let e='<div class="footer-inner container">';const t=window.__CMS_FOOTER__||{primary:[],legal:[],copyright:""},h=(()=>{const i=r.cookieConsent;if(!i||i.showSettingsLink===!1)return"";const L=M=>(M||[]).some(D=>D&&(D.url==="#cookie-settings"||L(D.items)));return L(t.primary)||L(t.legal)?"":`<li class="cms-cookie-settings"><a href="#cookie-settings">${c(i.settingsLinkText||"Cookie settings")}</a></li>`})(),u=["columns","row"].includes(r.footer?.layout)?r.footer.layout:"auto",y=r.footer?.look==="showcase"||u==="columns"||u==="auto"&&t.primary.some(i=>Array.isArray(i?.items)&&i.items.length),b=i=>y&&!i.url&&Array.isArray(i.items)&&i.items.length>0;if(y){const i=d.brand||{},L=q&&(i.text||r.title)||"",M=q?i.logo?`<img src="${p(i.logo)}" class="cms-footer-brand-logo" alt="">`:i.icon?'<span class="cms-footer-brand-icon"></span>':"":"",D=String(r.footer?.blurb||"").trim();e='<div class="footer-inner footer-inner--columns container"><div class="cms-footer-top">',e+=`<div class="cms-footer-brand">${L||M?`<a class="cms-footer-brand-name" href="${p(i.url||"/")}">${M}<span>${c(L)}</span></a>`:""}${D?`<p class="cms-footer-blurb">${c(D)}</p>`:""}${f()}</div>`,t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary footer-nav--columns" aria-label="Footer"><ul>${t.primary.map(A).join("")}</ul></nav>`),e+='</div><div class="cms-footer-bottom">',t.copyright&&(e+=`<p class="cms-footer-copyright">${c(t.copyright)}</p>`),(t.legal.length||h)&&(e+=`<nav class="footer-nav footer-nav--legal" aria-label="Legal"><ul>${t.legal.map(n).join("")}${h}</ul></nav>`),e+="</div>"}else t.copyright&&(e+=`<p>${c(t.copyright)}</p>`),t.primary.length&&(e+=`<nav class="footer-nav footer-nav--primary"><ul>${t.primary.map(n).join("")}</ul></nav>`),(t.legal.length||h)&&(e+=`<nav class="footer-nav footer-nav--legal"><ul>${t.legal.map(n).join("")}${h}</ul></nav>`),e+=f();e+="</div>",w.get(0).querySelector(":scope > .cms-nojs-links")?.remove();const l=w.get(0).querySelector(":scope > .cms-footer-blocks");l?.remove(),w.html(e),l&&w.get(0).prepend(l),window.CMSThemeSwitcher?.scan(w.get(0));const v=w.get(0).querySelector(".cms-footer-brand-icon");v&&d.brand?.icon&&v.setAttribute("data-icon",d.brand.icon),P(w.get(0),r.footer?.class),y&&ge(w.get(0),r);const g=[...m(t.primary,[],!0),...m(t.legal,[])],C=K([...t.primary||[],...t.legal||[]],location.pathname+location.search),I=w.get(0).querySelectorAll(".footer-nav a"),B=[];I.forEach((i,L)=>{const M=g[L];if(!M)return;if(B.push({a:i,item:M}),M.icon){const N=document.createElement("span");N.className="cms-footer-ic",N.setAttribute("data-icon",String(M.icon)),N.setAttribute("data-icon-size","15"),N.setAttribute("aria-hidden","true"),i.prepend(N)}M.colour&&G(i,M.colour);const D=U(M.badge);D&&i.appendChild(D),C.has(M)&&(i.classList.add("is-active"),i.setAttribute("aria-current","page"))}),Y(w.get(0).querySelector(".footer-nav--primary"),{highlight:t.primaryHighlight}),Y(w.get(0).querySelector(".footer-nav--legal"),{highlight:t.legalHighlight}),J(w.get(0).querySelector(".footer-nav--primary"),{entrance:t.primaryEntrance}),J(w.get(0).querySelector(".footer-nav--legal"),{entrance:t.legalEntrance}),P(w.get(0).querySelector(".footer-nav--primary"),t.primaryClass),P(w.get(0).querySelector(".footer-nav--legal"),t.legalClass),fe(w.get(0),t,B),z=w.get(0).querySelector(".cms-footer-bottom")||w.get(0).querySelector(".footer-inner")}be(r.motion||{enabled:r.footer?.showMotionToggle!==!1,default:r.footer?.motionDefault,placement:"footer",control:r.footer?.motionControl,label:"Reduce motion"},{footer:z,navbar:document.querySelector("#site-navbar .navbar-container")?.closest("#site-navbar")||null});const k=document.getElementById("site-sidebar");k&&De(k),Domma.icons.scan(),Domma.syntax?.scan&&Domma.syntax.scan();const s=$(".page-body");if(s.length){s.find(".accordion").each(function(){Domma.elements.accordion(this,{allowMultiple:this.dataset.multi==="true"})}),s.find(".tabs").each(function(){Domma.elements.tabs(this)}),s.find(".carousel").each(function(){const o={primary:"--dm-primary",secondary:"--dm-secondary",accent:"--dm-primary",text:"--dm-text",surface:"--dm-surface",background:"--dm-background",success:"--dm-success",warning:"--dm-warning",danger:"--dm-danger",info:"--dm-info"},e=f=>{const u=String(f||"").trim();return u?o[u.toLowerCase()]?`var(${o[u.toLowerCase()]})`:CSS.supports("color",u)?u:"":""},t=e(this.dataset.background),c=e(this.dataset.arrowBackground),p=e(this.dataset.arrowColor);t&&(this.style.setProperty("--dm-carousel-background",t),this.classList.add("dm-carousel-custom-background")),c&&this.style.setProperty("--dm-carousel-arrow-background",c),p&&this.style.setProperty("--dm-carousel-arrow-color",p);const n=["top","middle","bottom"].includes(this.dataset.arrowPosition)?this.dataset.arrowPosition:"middle";this.classList.add(`dm-carousel-arrows-${n}`);const h={autoplay:this.dataset.autoplay==="true",interval:parseInt(this.dataset.interval,10)||5e3,loop:this.dataset.loop!=="false",animation:this.dataset.animation||"slide",heightMode:this.dataset.heightMode==="average"?"average":"crop"};if(this.dataset.height){const f=Number(this.dataset.height);Number.isFinite(f)&&f>0&&(h.height=f)}if(this.dataset.animationDuration){const f=parseInt(this.dataset.animationDuration,10);Number.isFinite(f)&&(h.animationDuration=f)}this.dataset.animationEasing&&(h.animationEasing=this.dataset.animationEasing),this.dataset.ctx&&(this._dmCtxSlides=Array.from(this.querySelectorAll(".carousel-slide")).map(f=>f.cloneNode(!0)),this._dmCarouselOpts=h),this._dmCarousel=Domma.elements.carousel(this,h),ie(this)}),s.find(".dm-countdown").each(function(){const o={autoStart:!0},e=String(this.dataset.format||"").trim(),t=String(this.dataset.to||"").trim(),c=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t),p=c?new Date(+c[1],+c[2]-1,+c[3]).getTime():t?new Date(t).getTime():NaN;Number.isFinite(p)?o.duration=Math.max(0,p-Date.now()):this.dataset.duration&&(o.duration=(parseInt(this.dataset.duration,10)||0)*1e3);const n=/^dd:/i.test(e);o.format=n?"hh:mm:ss":e||(o.duration>=36e5?"hh:mm:ss":"mm:ss");const h=this,f=y=>String(y).padStart(2,"0"),u=y=>{const b=Math.max(0,Math.floor(y/1e3)),A=h.querySelector(".dm-timer-time");A&&(A.textContent=`${f(Math.floor(b/86400))}:${f(Math.floor(b%86400/3600))}:${f(Math.floor(b%3600/60))}:${f(b%60)}`)};n&&(o.onTick=u),Domma.elements.timer(this,o),n&&u(o.duration||0)}),s.find("[data-tooltip]:not(.dm-range-slider)").each(function(){Domma.elements.tooltip(this,{content:$(this).data("tooltip"),position:$(this).data("tooltip-position")||"top"})}),s.find(".dm-progression").each(function(){const o=Array.from(this.querySelectorAll(".dm-progression-item")).map(c=>{const p={title:c.querySelector(".dm-progression-item-title")?.textContent?.trim()||"",description:c.querySelector(".dm-progression-item-body")?.innerHTML?.trim()||""};return c.dataset.date&&(p.date=c.dataset.date),c.dataset.status&&(p.status=c.dataset.status),c.dataset.eventIcon&&(p.icon=c.dataset.eventIcon),c.dataset.entryId&&(p._entryId=c.dataset.entryId),p}),e=this.dataset.layout==="centred"?"centered":this.dataset.layout||"vertical",t=Domma.elements.progression(this,{layout:e,theme:this.dataset.theme||"minimal",mode:this.dataset.mode||"timeline",statusIcons:!0,allowHtml:!0,...o.length?{items:o}:{}});if((this.dataset.mode||"timeline")==="timeline"){const c={completed:{label:"Completed",icon:"check-circle",tone:"success"},planned:{label:"Planned",icon:"circle",tone:"secondary"},"in-progress":{label:"In progress",icon:"clock",tone:"primary"},blocked:{label:"Blocked",icon:"alert-circle",tone:"danger"}};this.querySelectorAll(".dm-progression-item").forEach((p,n)=>{const h=o[n];if(!h)return;const f=p.querySelector(".dm-progression-title");if(h.icon&&f){const y=document.createElement("span");y.dataset.icon=h.icon,y.style.cssText="display:inline-flex;vertical-align:middle;margin-right:.4em",y.setAttribute("aria-hidden","true"),f.prepend(y)}const u=c[h.status];if(u&&f){const y=document.createElement("span");y.className=`badge badge-${u.tone} cms-timeline-status`,y.style.cssText="display:inline-flex;align-items:center;gap:.35em;margin:.4rem 0";const b=document.createElement("span");b.dataset.icon=u.icon,b.dataset.iconSize="14",b.setAttribute("aria-hidden","true"),y.append(b,document.createTextNode(u.label)),f.after(y)}})}Domma.icons.scan(this),o.length&&(this._dmCtx={instance:t,items:o})});try{Domma.effects.reveal(".page-body .hero",{animation:"slide-up",duration:480,threshold:.06,stagger:60,once:!1})}catch{}const a=matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.classList.contains("dm-reduced-motion");document.querySelectorAll(".page-body .row[data-reveal]").forEach(o=>{const e=o.dataset.revealMode||"stagger",t=o.dataset.revealAnimation||"slide-up",c=parseInt(o.dataset.revealDuration,10)||(t.startsWith("swoosh")?700:400),p=parseInt(o.dataset.revealStagger,10)||(t.startsWith("swoosh")?90:60),n=parseInt(o.dataset.revealDelay,10)||0,h=o.dataset.revealDirection==="rtl",f=o.dataset.revealReplay==="true",u=Array.from(o.children);if(a&&t.startsWith("swoosh"))return;const y={"slide-up":"translateY(30px)","slide-down":"translateY(-30px)","slide-left":"translateX(30px)","slide-right":"translateX(-30px)",zoom:"scale(0.85)",flip:"perspective(600px) rotateX(15deg)",swoosh:"translateY(36px) scale(0.96)"},b=m=>t!=="swoosh-sides"?y[t]||"":u.length>1&&m===0?"translateX(-64px) rotate(-1.5deg)":u.length>1&&m===u.length-1?"translateX(64px) rotate(1.5deg)":"translateY(40px) scale(0.94)",A=t.startsWith("swoosh"),l=A?"cubic-bezier(.2,.8,.2,1)":"ease",v=(m,g)=>{m.style.opacity="0",m.style.transform=b(g),A&&(m.style.filter="blur(10px)")};u.forEach((m,g)=>{m.style.transition="none",v(m,g)}),o.offsetWidth,u.forEach((m,g)=>{m.style.transition=`opacity ${c}ms ${l}, transform ${c}ms ${l}`+(A?`, filter ${c}ms ${l}`:"");const C=h?u.length-1-g:g;m.style.transitionDelay=e==="stagger"?`${n+C*p}ms`:`${n}ms`}),requestAnimationFrame(()=>requestAnimationFrame(()=>{const m=new IntersectionObserver(g=>{g.forEach(C=>{if(C.isIntersecting){if(C.target.offsetWidth,C.target.style.opacity="1",C.target.style.transform="",A&&(C.target.style.filter=""),!f){m.unobserve(C.target);const I=C.target;I.addEventListener("transitionend",function B(i){i.target!==I||i.propertyName!=="opacity"||(I.removeEventListener("transitionend",B),I.style.transition="",I.style.transitionDelay="")})}}else f&&C.boundingClientRect.top>0&&v(C.target,u.indexOf(C.target))})},{threshold:.1,rootMargin:"100000px 0px 0px 0px"});u.forEach(g=>m.observe(g))}))}),he(document.querySelector(".page-body")||document),s.find(".card[data-collapsible]").each(function(){const o=this.querySelector(".card-header");o&&o.addEventListener("click",()=>this.classList.toggle("is-collapsed"))}),s.find(".dm-so-trigger").each(function(){this.addEventListener("click",()=>{const o=this.dataset.soTarget,e=document.getElementById(o);if(!e)return;const t=E.slideover({title:e.dataset.soTitle||"",size:e.dataset.soSize||"md",position:e.dataset.soPosition||"right"});e.style.display="",t.setContent(e),t.open()})})}if(typeof $.setup=="function"){const a=Object.assign({},window.__CMS_DCONFIG__||{});if(document.querySelectorAll(".dm-page-config[data-config]").forEach(o=>{try{const e=V(o.dataset.config);Object.assign(a,e)}catch{}}),Object.keys(a).length>0){const o={};for(const[e,t]of Object.entries(a)){const c=t?.events?.click,{confirm:p,toast:n,alert:h,prompt:f,...u}=c||{};if(p||n||h||f){$(e).on("click",async function(W){if(W.preventDefault(),p&&!await E.confirm(p))return;let j=null;if(!(f&&(j=await E.prompt(f,{inputPlaceholder:u.promptPlaceholder||"",inputValue:u.promptDefault||""}),j===null))){{const O=$(u.target||this);u.toggleClass&&O.toggleClass(u.toggleClass),u.addClass&&O.addClass(u.addClass),u.removeClass&&O.removeClass(u.removeClass),j!==null&&(u.setText&&O.text(j),u.setVal&&O.val(j),u.setAttr&&O.attr(u.setAttr,j))}u.href&&se(u.href),n&&E.toast(n,{type:u.toastType||"success"}),h&&E.alert(h)}});const{target:b,toggleClass:A,addClass:l,removeClass:v,setText:m,setVal:g,setAttr:C,href:I,toastType:B,promptPlaceholder:i,promptDefault:L,...M}=u,D={...t.events};Object.keys(M).length?D.click=b?{target:b,...M}:M:delete D.click;const N={...t,events:D};Object.keys(D).length||delete N.events,Object.keys(N).length&&(o[e]=N)}else o[e]=t}$.setup(o)}}s.length&&R(s.get(0))}),window.wireCTAButtons=R;function se(d){if(!_e(d)){console.warn("[site] refused to go to",String(d).slice(0,60));return}const r=document.body?.classList.contains("dm-launcher-embed")&&window.top!==window;(r?window.top:window).location.href=d}function _e(d){const r=String(d??"").replace(/[\u0000-\u0020\u007f-\u00a0\u200b-\u200f\ufeff]/g,"").toLowerCase();return!r||r.includes("\\")||r.startsWith("//")?!1:/^(\/|#|\?|\.\.?\/)/.test(r)||/^(https?:\/\/|mailto:|tel:)/.test(r)?!0:!/^[a-z][a-z0-9+.-]*:/.test(r)}function R(d){d.querySelectorAll(".dm-cta-trigger").forEach(r=>{r.__ctaWired||(r.__ctaWired=!0,r.addEventListener("click",async()=>{const q=r.dataset.action,x=r.dataset.entry,z=r.dataset.confirm;let w=S.get("auth_token");if(!w){E.toast("Please log in to perform this action.",{type:"warning"});return}if(z&&!await E.confirm(z))return;const k=Array.from(r.childNodes).map(a=>a.cloneNode(!0));r.disabled=!0,r.textContent="Running\u2026";const s=a=>fetch(`/api/actions/${q}/public`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r.dataset.scope?{entryId:x,scope:r.dataset.scope}:{entryId:x})});try{let a=await s(w);if(a.status===401){const e=S.get("auth_refresh_token");if(e){const t=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(t.ok){const{token:c}=await t.json();S.set("auth_token",c),w=c,a=await s(w)}}}const o=await a.json().catch(()=>({}));if(!a.ok||o.success===!1)throw new Error(o.error||o.message||`Error ${a.status}`);E.toast(o.message||"Action completed.",{type:"success"})}catch(a){E.toast(a.message||"Action failed.",{type:"error"})}finally{r.disabled=!1,r.textContent="",k.forEach(a=>r.appendChild(a)),Domma.icons.scan(r)}}))})}(function(){const r=document.querySelectorAll('.dm-collection-hydrate[data-collection-scope="mine"]');if(!r.length)return;const q=S.get("auth_token");function x(w,k){const s=document.createElement("div");s.className="dm-collection-display dm-collection-empty";const a=document.createElement("p");if(k){a.appendChild(document.createTextNode("Please "));const o=document.createElement("a");o.href="/login",o.textContent="sign in",a.appendChild(o),a.appendChild(document.createTextNode(" to view your entries."))}else a.textContent=w;return s.appendChild(a),s}function z(w,k){const s=document.createElement("template");s.innerHTML=k||"",w.replaceWith(s.content)}r.forEach(async w=>{const k=w.dataset.collectionAttrs;if(!k)return;if(!q){w.replaceChildren(x("",!0));return}const s=a=>fetch("/api/collections/render-scope",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({attrs:k})});try{let a=q,o=await s(a);if(o.status===401){const t=S.get("auth_refresh_token");if(t){const c=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(c.ok){const{token:p}=await c.json();S.set("auth_token",p),a=p,o=await s(a)}}}if(!o.ok){const{error:t}=await o.json().catch(()=>({}));w.replaceChildren(x(t||"Unable to load entries.",!1));return}const{html:e}=await o.json();z(w,e),window.DommaCollectionBrowser?.hydrate&&window.DommaCollectionBrowser.hydrate(document)}catch{w.replaceChildren(x("Unable to load entries.",!1))}}),setTimeout(()=>{typeof Domma<"u"&&Domma.icons?.scan&&Domma.icons.scan(),typeof Domma<"u"&&Domma.syntax?.scan&&Domma.syntax.scan(),R(document.body)},100)})(),(function(){const r=document.querySelectorAll("[data-collection-table]");!r.length||typeof T>"u"||!T.create||r.forEach(q=>{let x;try{x=V(q.dataset.payload)}catch{return}const{columns:z,rows:w,search:k,sortable:s,exportable:a,pageSize:o,empty:e,ctaConfig:t,slug:c,exportCfg:p}=x;if(!z?.length)return;if(t){const f=z.findIndex(u=>u.key==="_cta");f!==-1&&(z[f]={key:"_cta",title:"",render:(u,y)=>{const b=document.createElement("button");if(b.className=`btn btn-${t.style||"primary"} dm-cta-trigger`,b.dataset.action=t.action||"",t.scope&&(b.dataset.scope=t.scope),b.dataset.entry=y._entryId||"",t.confirm&&(b.dataset.confirm=t.confirm),t.icon){const A=document.createElement("span");A.dataset.icon=t.icon,b.appendChild(A),b.appendChild(document.createTextNode(" "))}return b.appendChild(document.createTextNode(t.label||"Run")),b}})}const n="col-table-"+Math.random().toString(36).slice(2,7),h=document.createElement("div");h.id=n,q.replaceChildren(h),T.create("#"+n,{data:w,columns:z,search:k,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(h),q._dmTable={columns:z,rows:w,slug:c,exportCfg:p,render(f){T.create("#"+n,{data:f,columns:z,search:k,sortable:s,exportable:a,pageSize:o,emptyMessage:e}),t&&R(h)}}})})(),(function(){const r=document.querySelectorAll("[data-form-inline]");if(!r.length||typeof F>"u")return;function q(s){const a=s&&s.logic;return!!(a&&(a.visibility||a.requirement))}function x(s,a){const o={};return(s||[]).forEach(e=>{if(e.type==="page-break"||e.type==="spacer"||!e.name)return;const t=e.type==="chooser"||!!(e.variant&&["select","radio","checkbox-group"].includes(e.type)),c=e.type==="checkbox"?"boolean":e.type==="date"||e.type==="icon"||e.type==="image"?"string":t?"chooser":e.type,p={...e.formConfig||{}};p.span==="full"&&a&&(p.span=a);const n={type:c,required:q(e)?!1:e.required,label:e.label,options:e.options,formConfig:{...e.placeholder&&{placeholder:e.placeholder},...e.helper&&{hint:e.helper},...e.tooltip&&{tooltip:e.tooltip},...p}};e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.min!==void 0&&(n.min=e.min),e.max!==void 0&&(n.max=e.max),t&&(e.variant&&(n.variant=e.variant),(e.multiple||e.type==="checkbox-group")&&(n.multiple=!0),e.density&&(n.density=e.density),e.columns&&(n.columns=e.columns),e.accent&&(n.accent=e.accent),e.accentStyle&&(n.accentStyle=e.accentStyle),e.glow&&(n.glow=!0),e.glowColour&&(n.glowColour=e.glowColour),e.shadow&&(n.shadow=e.shadow),e.shadowColour&&(n.shadowColour=e.shadowColour)),o[e.name]=e.type==="file"?xe(e,n):n}),o}function z(s){const a={};return(s||[]).forEach(o=>{if(!(!o.name||o.type==="page-break"||o.type==="spacer")&&(o.type==="select"||o.type==="multiselect")&&o.required){const e=(o.options||[])[0];e&&(a[o.name]=typeof e=="object"?e.value:e)}}),a}function w(s,a){(a||[]).forEach(o=>{if(o.type!=="date"||!o.name)return;const e=s.querySelector(`[name="${o.name}"]`);e&&e.type!=="date"&&(e.type="date")})}function k(s,a,o){let e=s.querySelector(".cms-form-message");e||(e=document.createElement("p"),e.className="cms-form-message",s.appendChild(e)),e.textContent=a,e.style.cssText=o?"color:var(--dm-danger);margin-top:.75rem;":"color:var(--dm-success);margin-top:.75rem;"}r.forEach(s=>{let a;try{a=V(s.dataset.formInline)}catch{return}s.querySelector(":scope > .cms-form-embed-summary")?.remove();const o=a.fields||[],e=a.settings||{},t=Number(e.columns)===3?3:2,c=e.layout||"grid",p=o.some(A=>A.type==="page-break"),n=new Map;Le(s,a.fileLimits,n),Te(s,o);const h=async A=>{if(s.dataset.triggerBlocked==="true"){const l=s._formLogicRuntime,v=l&&l.submitBlock?l.submitBlock().reasons:[];k(s,v.join(" ")||"This form cannot be submitted yet.",!0);const m=new Error("Blocked by a form trigger");throw m.formSubmitFailed=!0,m}try{const l=s.querySelector(".fb-form-honeypot"),v=l?.querySelector('input[type="text"]')||null,m=l?.querySelector('[name="_t"]')||null,g=Object.assign({},A);delete g._t,l?.dataset.hpName&&delete g[l.dataset.hpName],v!==null&&(g._hp=v.value),m!==null&&(g._t=m.value);const C=new Map(n);ne(s,C);const I=$e(g,o,C),B=Ae(s,I.files);if(B){k(s,B,!0);const L=new Error(B);throw L.formSubmitFailed=!0,L}const i=await H.post(`/api/forms/submit/${a.slug}`,I.files.size?Ee(I.values,I.files).body:I.values);if(i&&i.error){k(s,i.error,!0);const L=new Error(i.error);throw L.formSubmitFailed=!0,L}if(i?.redirect){se(i.redirect);return}for(Se(s);s.firstChild;)s.removeChild(s.firstChild);k(s,i?.message||e.successMessage||"Thank you for your submission.",!1)}catch(l){throw l.formSubmitFailed||k(s,l.message||"Submission failed. Please try again.",!0),l}},f=Date.now();function u(A){const l=A.querySelector("form");if(!l||l.querySelector(".fb-form-honeypot"))return;const v=document.createElement("div");v.className="fb-form-honeypot",v.setAttribute("aria-hidden","true");const m=document.createElement("input");m.name=l.querySelector('[name="website"]')?"_website":"website",v.dataset.hpName=m.name,m.type="text",m.tabIndex=-1,m.autocomplete="url",m.placeholder="https://",v.appendChild(m);const g=document.createElement("input");g.name="_t",g.type="hidden",g.value=f,v.appendChild(g),l.appendChild(v)}function y(A){if(!window.FormLogicEngine||!o.some(v=>v.logic||Array.isArray(v.triggers)&&v.triggers.length))return null;const l=new window.FormLogicEngine.FormLogicRuntime(a,s,A?{baseValues:A}:void 0);if(l.init(),s._formLogicRuntime=l,s._formLogicObserved)return l;if(s._formLogicObserved=!0,s.parentNode&&typeof MutationObserver<"u"){const v=new MutationObserver(function(m){for(const g of m)for(const C of g.removedNodes)if(C===s||C.nodeType===1&&C.contains&&C.contains(s)){s._formLogicRuntime&&s._formLogicRuntime.destroy(),v.disconnect();return}});v.observe(s.parentNode,{childList:!0,subtree:!1}),s._formLogicObserver=v}return l}let b=!1;if(s.addEventListener("dm-form-end",A=>{const l=A.detail?.validation;if(l&&!l.valid){Z(s,l.missing),ee(l);return}b||(b=!0,h(A.detail?.values||{}).catch(()=>{}).finally(()=>{b=!1}))}),p&&F.wizard){const A=ve(o,a.title),l=A.map(i=>({title:i.title,description:i.description,fields:x(i.fields,t)})),v=A.map(i=>i.fields);let m=0,g=null,C=null;const I=i=>{const L=window.FormLogicEngine;if(!L||!L.validateFields)return;const M=L.validateFields(s,v[m]||[]);M.valid||(i.preventDefault(),i.stopImmediatePropagation(),Z(s,M.missing),ee(M))},B=()=>{const i=v[m]||o;Ce(s,e),te(s,e,i),oe(s,e),w(s,i),Q(s,i),ke(s,n),e.honeypot!==!1&&u(s),g&&g.destroy(),g=y(C?.getStepData?C.getStepData():void 0),s.querySelectorAll(".wizard-next, .wizard-submit").forEach(L=>L.addEventListener("click",I,!0))};C=F.wizard(s,{schema:{steps:l},layout:c,columns:t,finishText:e.submitText||"Finish",onSubmit:h,onStepChange:i=>{ne(s,n),m=i,setTimeout(B,0)}}),s.addEventListener("dm-form-trigger",i=>{if(i.detail?.type!=="goto-step"||!C?.goToStep)return;const L=Number(i.detail.action.step);!Number.isFinite(L)||L<0||L>=l.length||L!==m&&C.goToStep(L)}),Promise.resolve(C).then(B)}else if(F.render){const A=F.render(s,x(o,t),z(o),{submitText:e.submitText||"Submit",layout:c,columns:t,onSubmit:h});Promise.resolve(A).then(function(){we(s,e,c),te(s,e,o),oe(s,e),w(s,o),Q(s,o),e.honeypot!==!1&&u(s),y()})}})})();function Me(d,r){const q=document.body,x=q.classList,z=new Set((q.dataset.railSite||"").split(" ").filter(Boolean)),w=()=>window.matchMedia("(min-width: 993px)").matches;d.querySelectorAll(".navbar-link, .navbar-dropdown-toggle").forEach(t=>{const c=t.textContent.trim();c&&(t.setAttribute("title",c),t.querySelector("svg, [data-icon]")||(t.dataset.initial=c.charAt(0).toUpperCase()))});const k=document.createElement("button");k.type="button",k.className="dm-nav-collapse-toggle";const s=()=>{const t=x.contains("dm-vnav-collapsed");k.setAttribute("aria-pressed",String(t)),k.setAttribute("aria-label",t?"Expand menu":"Collapse menu"),k.title=k.getAttribute("aria-label");const c=r?"chevrons-left":"chevrons-right",p=r?"chevrons-right":"chevrons-left";k.innerHTML=`<span data-icon="${t?c:p}"></span>`,window.Domma&&Domma.icons&&Domma.icons.scan(k)},a=t=>{x.toggle("dm-vnav-collapsed",t),S.set("nav_collapsed",t),s()};k.addEventListener("click",()=>a(!x.contains("dm-vnav-collapsed"))),s();const o=d.querySelector(".navbar-container")||d;o.insertBefore(k,o.firstChild?.nextSibling||null);const e=t=>{x.toggle("dm-vnav-autohide",t),x.toggle("dm-vnav-collapsible",!t&&z.has("collapsible")),t?x.remove("dm-vnav-collapsed"):z.has("collapsible")&&S.get("nav_collapsed")===!0&&x.add("dm-vnav-collapsed"),d.classList.remove("dm-nav-revealed"),s()};d.addEventListener("pointerdown",t=>{x.contains("dm-vnav-autohide")&&t.pointerType!=="mouse"&&!d.classList.contains("dm-nav-revealed")&&(d.classList.add("dm-nav-revealed"),t.preventDefault())}),document.addEventListener("pointerdown",t=>{d.contains(t.target)||d.classList.remove("dm-nav-revealed")}),window.E&&typeof E.contextMenu=="function"&&E.contextMenu(d,{items:()=>{const t=x.contains("dm-vnav-autohide"),c=x.contains("dm-vnav-collapsed"),p=S.has("nav_autohide")||S.has("nav_collapsed");return[{header:"Menu"},{label:c?"Expand menu":"Collapse to icons",icon:c?"maximize":"minimize",disabled:!w()||t||!z.has("collapsible"),action:()=>a(!c)},{label:t?"Keep on screen":"Hide when not in use",icon:t?"eye":"eye-off",disabled:!w(),action:()=>{S.set("nav_autohide",!t),e(!t)}},{type:"divider"},{label:"Reset to the site's setting",icon:"refresh",disabled:!p,action:()=>{S.remove("nav_autohide"),S.remove("nav_collapsed"),e(z.has("autohide")),x.toggle("dm-vnav-collapsed",!z.has("autohide")&&z.has("start-collapsed")),s()}}]}})}function qe(d){d.classList.add("dm-nav-scroll-hide");let r=window.scrollY,q=!1;window.addEventListener("scroll",()=>{q||(q=!0,requestAnimationFrame(()=>{q=!1;const x=window.scrollY,z=d.matches(":focus-within")||d.querySelector(".navbar-dropdown.open, .navbar-collapse.show");x>r&&x>d.offsetHeight&&!z?d.classList.add("dm-nav-scrolled-away"):x<r&&d.classList.remove("dm-nav-scrolled-away"),r=x}))},{passive:!0})}function De(d){let r={};try{r=JSON.parse(d.dataset.contents||"{}")}catch{}const q=d.closest(".site-main"),x=document.querySelector(".site-content"),z=new Set(String(r.exclude||"").split(",").map(n=>n.trim().toLowerCase()).filter(Boolean)),w=n=>!n.closest(".hero, .card, .accordion, .tabs, figure, #site-sidebar"),k=n=>(x?[...x.querySelectorAll(n)]:[]).filter(w).filter(h=>!z.has(h.textContent.trim().toLowerCase())),s=r.headings==="h2"?k("h2"):r.headings==="h3"?k("h3"):r.headings==="h2h3"?k("h2, h3"):k("h2").length?k("h2"):k("h3");if(!s.length){q?.classList.add("no-sidebar-items");return}const a=new Set([...document.querySelectorAll("[id]")].map(n=>n.id)),o=document.createElement("nav");o.className="dm-contents",o.setAttribute("aria-label",r.title||"Page contents"),r.hover&&(o.dataset.menuHover=r.hover),r.selected&&(o.dataset.menuActive=r.selected),r.accent&&o.style.setProperty("--dm-menu-highlight",r.accent.startsWith("#")?r.accent:`var(--dm-${r.accent})`),r.font&&(o.style.fontFamily=r.font),r.fontSize&&(o.style.fontSize=r.fontSize),r.fontWeight&&(o.style.fontWeight=r.fontWeight);const e=document.createElement("div");e.className="dm-contents-head";const t=document.createElement("p");t.className="dm-contents-title",t.textContent=r.title||"",e.appendChild(t),o.appendChild(e);const c=document.createElement("ol");c.className="dm-contents-list"+(r.numbered?" is-numbered":"");const p=[];for(const n of s){if(!n.id){const u=(n.textContent||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"section";let y=u;for(let b=2;a.has(y);b++)y=`${u}-${b}`;a.add(y),n.id=y}const h=document.createElement("li");h.className=`dm-contents-item dm-contents-${n.tagName.toLowerCase()}`;const f=document.createElement("a");f.href=`#${n.id}`,f.textContent=n.textContent.trim(),h.appendChild(f),c.appendChild(h),p.push([n,f])}if(o.appendChild(c),d.replaceChildren(o),r.scrollSpy!==!1&&"IntersectionObserver"in window){const n=new Map,h=()=>{const u=p.find(([y])=>n.get(y))||null;p.forEach(([,y])=>{const b=u&&y===u[1];y.classList.toggle("is-active",!!b),b?y.setAttribute("aria-current","location"):y.removeAttribute("aria-current")})},f=new IntersectionObserver(u=>{u.forEach(y=>n.set(y.target,y.isIntersecting)),h()},{rootMargin:"-80px 0px -60% 0px"});p.forEach(([u])=>f.observe(u))}if(q?.classList.contains("contents-collapsible")){const n=document.createElement("button");n.type="button",n.className="dm-contents-toggle";const h=()=>{const f=q.classList.contains("contents-collapsed");n.setAttribute("aria-expanded",String(!f)),n.setAttribute("aria-label",f?"Show the contents":"Hide the contents"),n.title=n.getAttribute("aria-label"),n.innerHTML=`<span data-icon="${f?"list":"x"}"></span>`,window.Domma?.icons&&Domma.icons.scan(n)};n.addEventListener("click",()=>{S.set("contents_collapsed",q.classList.toggle("contents-collapsed")),h()}),h(),e.insertBefore(n,e.firstChild)}if(q?.classList.contains("contents-floating")&&r.movable){o.classList.add("is-movable");const n=S.get("contents_position");n&&Number.isFinite(n.x)&&Object.assign(d.style,{left:`${n.x}px`,top:`${n.y}px`,right:"auto",bottom:"auto"}),e.addEventListener("pointerdown",h=>{if(h.target.closest("button"))return;const f=d.getBoundingClientRect(),u=h.clientX-f.left,y=h.clientY-f.top,b=l=>{const v=Math.max(0,Math.min(window.innerWidth-f.width,l.clientX-u)),m=Math.max(0,Math.min(window.innerHeight-40,l.clientY-y));Object.assign(d.style,{left:`${v}px`,top:`${m}px`,right:"auto",bottom:"auto"})},A=()=>{document.removeEventListener("pointermove",b),S.set("contents_position",{x:parseInt(d.style.left,10),y:parseInt(d.style.top,10)})};document.addEventListener("pointermove",b),document.addEventListener("pointerup",A,{once:!0})})}window.E&&typeof E.contextMenu=="function"&&E.contextMenu(d,{items:()=>{const n=q?.classList.contains("contents-collapsible"),h=q?.classList.contains("contents-collapsed"),f=p.find(([,u])=>u.classList.contains("is-active"));return[{header:"Contents"},...n?[{label:h?"Show the contents":"Collapse to a button",icon:h?"list":"minimize",action:()=>d.querySelector(".dm-contents-toggle")?.click()}]:[],{label:"Copy a link to this section",icon:"link",disabled:!f,action:async()=>{const u=`${location.origin}${location.pathname}#${f[0].id}`;try{await _.copyToClipboard(u),E.toast("Link copied.",{type:"success"})}catch{E.toast("Could not copy the link.",{type:"error"})}}},{label:"Back to the top",icon:"arrow-up",action:()=>window.scrollTo({top:0,behavior:"smooth"})}]}}),q?.classList.contains("contents-autohide")&&(d.addEventListener("pointerdown",n=>{n.pointerType!=="mouse"&&!d.classList.contains("is-revealed")&&(d.classList.add("is-revealed"),n.preventDefault())}),document.addEventListener("pointerdown",n=>{d.contains(n.target)||d.classList.remove("is-revealed")}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";var
|
|
1
|
+
(function(){"use strict";var i=window.__CMS_THEME_SWITCHER__;if(!i||!Array.isArray(i.themes)||!i.themes.length)return;var Y=["top-left","top-right","left-center","right-center","bottom-left","bottom-right"],x=[],h=null,f=null,m=null,A="domma-cms:theme",r=i.system,c=i.themes.map(function(e){return e.id});r&&(c.indexOf(r.lightTheme)===-1||c.indexOf(r.darkTheme)===-1)&&(r=null);function I(){try{return localStorage.getItem(A)||localStorage.getItem("domma-theme")}catch{return null}}function w(e){try{localStorage.setItem(A,e)}catch{}}function N(e){return r?e.concat([{id:"system",label:"Follow system",from:"#f8fafc",to:"#102b46"}]):e}function X(e){if(!e)return i.themes;var t=String(e).split(",").map(function(o){return o.trim()}).filter(Boolean),n=i.themes.filter(function(o){return t.indexOf(o.id)!==-1});return n.length?n:i.themes}function S(e){var t=N(e.themes||i.themes),n=e.position==="inline",o=Y.indexOf(e.position)!==-1?e.position:"right-center",u=o==="left-center"||o==="bottom-left"||o==="top-left",v=o==="bottom-left"||o==="bottom-right",p=o==="top-left"||o==="top-right",C=e.offsetX!=null?e.offsetX:32,k=e.offsetY!=null?e.offsetY:32,l=document.createElement("div");l.className="dm-theme-switcher"+(n?" dm-ts-inline dm-ts-left dm-ts-top":(u?" dm-ts-left":"")+(p?" dm-ts-top":"")),l.setAttribute("role","navigation"),l.setAttribute("aria-label","Theme switcher");var d=document.createElement("button");d.type="button",d.className="dm-ts-trigger",d.setAttribute("data-tooltip","Switch theme"),d.setAttribute("aria-label","Switch theme"),d.setAttribute("aria-haspopup","true"),d.setAttribute("aria-expanded","false");var L=360/t.length;d.style.background="conic-gradient("+t.map(function(s,a){return(s.from||"#888")+" "+(a*L).toFixed(2)+"deg "+((a+1)*L).toFixed(2)+"deg"}).join(", ")+")",d.addEventListener("click",function(){var s=d.getAttribute("aria-expanded")==="true";d.setAttribute("aria-expanded",String(!s))});var g=document.createElement("div");return g.className="dm-ts-options",r&&i.themes.length===2&&(l.className+=" dm-ts-labelled"),g.setAttribute("role","menu"),t.forEach(function(s){var a=document.createElement("button");a.type="button",a.className="dm-ts-dot",a.dataset.theme=s.id,a.setAttribute("data-tooltip",s.label),a.setAttribute("aria-label",s.label),a.setAttribute("role","menuitemradio"),a.setAttribute("aria-checked","false"),r&&i.themes.length===2?a.textContent=s.label:s.id==="system"&&(a.textContent="\u25D0"),a.style.background="linear-gradient(135deg, "+(s.from||"#888")+", "+(s.to||s.from||"#888")+")",a.addEventListener("click",function(){_(a.dataset.theme)}),g.appendChild(a),x.push(a)}),l.appendChild(d),l.appendChild(g),n||Object.assign(l.style,{right:u?"auto":C+"px",left:u?C+"px":"auto",top:p?k+"px":v?"auto":"50vh",bottom:v?k+"px":"auto",transform:p||v?"none":"translateY(-50%)"}),b(),l}function E(e){var t=(e||document).querySelectorAll("[data-theme-switcher]:not([data-ts-mounted])");Array.prototype.forEach.call(t,function(n){n.setAttribute("data-ts-mounted","");var o=function(v){var p=parseInt(v,10);return isFinite(p)?p:null},u=S({position:n.dataset.position||"inline",offsetX:o(n.dataset.offsetX),offsetY:o(n.dataset.offsetY),themes:X(n.dataset.themes)});u.classList.contains("dm-ts-inline")?n.appendChild(u):document.body.appendChild(u)})}function y(){if(h){var e=f==="system"&&r?m&&m.matches?r.darkTheme:r.lightTheme:f;!e||c.indexOf(e)===-1||(h.set(e),document.body.className=document.body.className.split(" ").filter(function(t){return t.indexOf("dm-custom-")!==0}).join(" "),b())}}function _(e){!h||(e!=="system"||!r)&&c.indexOf(e)===-1||(f=e,w(e),y())}function b(){if(h){var e=f==="system"?"system":h.get();x.forEach(function(t){var n=t.dataset.theme===e;t.classList.toggle("active",n),t.setAttribute("aria-checked",String(n))})}}function O(e,t){typeof Domma<"u"&&Domma.theme?e(Domma.theme):t>0&&setTimeout(function(){O(e,t-1)},100)}O(function(e){h=e,e.onChange(b);var t=I();if(t==="system"&&r||c.indexOf(t)!==-1?f=t:r?f="system":t&&(f=c.indexOf(i.defaultTheme)!==-1?i.defaultTheme:c[0]),r&&window.matchMedia){m=window.matchMedia("(prefers-color-scheme: dark)");var n=function(){f==="system"&&y()};m.addEventListener?m.addEventListener("change",n):m.addListener&&m.addListener(n)}f&&(w(f),y()),b()},30),window.CMSThemeSwitcher={scan:E,hasPreference:function(){return f!==null}};function T(){i.floating!==!1&&document.body.appendChild(S({position:i.position,offsetX:i.offsetX,offsetY:i.offsetY})),E(document)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",T):T()})();
|
|
@@ -85,7 +85,7 @@ function buildSearchAssets() {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
const THEME_SWITCHER_ASSET_V = '
|
|
88
|
+
const THEME_SWITCHER_ASSET_V = '20261110-ts-system';
|
|
89
89
|
const ANALYTICS_ASSET_V = '20260922-analytics';
|
|
90
90
|
const CONSENT_ASSET_V = '20261022-consent-reopen';
|
|
91
91
|
const GOOGLE_ANALYTICS_ASSET_V = '20261022-ga4';
|
|
@@ -293,8 +293,16 @@ function buildThemeSwitcherAssets(themeCfg, page = {}) {
|
|
|
293
293
|
};
|
|
294
294
|
});
|
|
295
295
|
|
|
296
|
+
const system = sw.followSystem === true && wanted.includes(sw.lightTheme) && wanted.includes(sw.darkTheme)
|
|
297
|
+
? {lightTheme: sw.lightTheme, darkTheme: sw.darkTheme} : null;
|
|
298
|
+
if (system && themes.length === 2) {
|
|
299
|
+
themes.sort((a, b) => (a.id === system.lightTheme ? -1 : 1));
|
|
300
|
+
themes.forEach(t => { t.label = t.id === system.lightTheme ? 'Light' : 'Dark'; });
|
|
301
|
+
}
|
|
296
302
|
const payload = {
|
|
297
303
|
floating,
|
|
304
|
+
system,
|
|
305
|
+
defaultTheme: themeCfg.theme,
|
|
298
306
|
position: sw.position || 'right-center',
|
|
299
307
|
offsetX: sw.offsetX ?? 32,
|
|
300
308
|
offsetY: sw.offsetY ?? 32,
|
|
@@ -89,6 +89,19 @@ export const PRIVATE_DATA = [
|
|
|
89
89
|
// discount codes, Calendar's RSVPs, the job board's people and applications.
|
|
90
90
|
'shop-orders', 'shop-pro-codes', 'calendar-rsvps',
|
|
91
91
|
'jb-applications', 'jb-candidate-profiles', 'jb-signups',
|
|
92
|
+
// ...and everything else the job board keeps about people: companies and their
|
|
93
|
+
// teams, agents and their candidates, CVs, messages, interviews, notes, reviews,
|
|
94
|
+
// testimonials, alerts, saved jobs and searches, credits and orders, the talent pool,
|
|
95
|
+
// proposals, quotes, views - and its public copies, which it rebuilds by itself.
|
|
96
|
+
'jb-agent-candidates', 'jb-agent-companies', 'jb-agent-settings', 'jb-alerts', 'jb-application-notes',
|
|
97
|
+
'jb-companies', 'jb-company-members', 'jb-contact-requests', 'jb-credit-ledger', 'jb-credit-orders',
|
|
98
|
+
'jb-cvs', 'jb-interviews', 'jb-job-views', 'jb-jobs', 'jb-messages', 'jb-notes', 'jb-proposals',
|
|
99
|
+
'jb-public-companies', 'jb-public-jobs', 'jb-quotes', 'jb-reviews', 'jb-saved-jobs', 'jb-saved-searches',
|
|
100
|
+
'jb-talent-access', 'jb-talent-pool', 'jb-testimonials',
|
|
101
|
+
// Bookings and waiting lists, onboarding enrolments, e-card buyers, sends and opt-outs.
|
|
102
|
+
'booking-bookings', 'booking-pro-waitlist', 'onboard-enrolments',
|
|
103
|
+
'cards-pro-signups', 'cards-pro-purchases', 'cards-pro-gifts', 'cards-pro-ledger',
|
|
104
|
+
'ecards-deliveries', 'ecards-suppressions',
|
|
92
105
|
// Visitor chat (Launchers, 1.28.0): conversations, names and emails, and the
|
|
93
106
|
// questions visitors asked. The Knowledge (chat-knowledge) is authored and stays.
|
|
94
107
|
'chat-sessions', 'chat-messages', 'chat-unanswered', 'chat-saved',
|
|
@@ -104,7 +104,10 @@ export function defaultThemeConfig() {
|
|
|
104
104
|
position: 'right-center',
|
|
105
105
|
offsetX: 32,
|
|
106
106
|
offsetY: 32,
|
|
107
|
-
themes: []
|
|
107
|
+
themes: [],
|
|
108
|
+
followSystem: false,
|
|
109
|
+
lightTheme: 'charcoal-light',
|
|
110
|
+
darkTheme: 'charcoal-dark'
|
|
108
111
|
},
|
|
109
112
|
overrides: []
|
|
110
113
|
};
|
|
@@ -465,7 +468,7 @@ export function loadThemeConfigSync() {
|
|
|
465
468
|
*/
|
|
466
469
|
export async function saveThemeConfig(input) {
|
|
467
470
|
const stored = await loadThemeConfig();
|
|
468
|
-
const errors = validateThemeConfig(input, {remembered: rememberedIds(stored)});
|
|
471
|
+
const errors = validateThemeConfig(input, {remembered: rememberedIds(stored), currentSwitcher: stored.switcher});
|
|
469
472
|
if (errors.length) {
|
|
470
473
|
const err = new Error(errors.join('; '));
|
|
471
474
|
err.validation = errors;
|
|
@@ -631,7 +634,7 @@ function isSafeTokenValue(value) {
|
|
|
631
634
|
* @param {object} input
|
|
632
635
|
* @returns {string[]}
|
|
633
636
|
*/
|
|
634
|
-
export function validateThemeConfig(input, {remembered = []} = {}) {
|
|
637
|
+
export function validateThemeConfig(input, {remembered = [], currentSwitcher = {}} = {}) {
|
|
635
638
|
const errors = [];
|
|
636
639
|
if (!input || typeof input !== 'object') return ['Theme config must be an object'];
|
|
637
640
|
|
|
@@ -669,7 +672,7 @@ export function validateThemeConfig(input, {remembered = []} = {}) {
|
|
|
669
672
|
}
|
|
670
673
|
}
|
|
671
674
|
if (input.switcher) {
|
|
672
|
-
const sw = input.switcher;
|
|
675
|
+
const sw = {...defaultThemeConfig().switcher, ...currentSwitcher, ...input.switcher};
|
|
673
676
|
const POSITIONS = ['right-center', 'left-center', 'bottom-right', 'bottom-left',
|
|
674
677
|
'top-left', 'top-right'];
|
|
675
678
|
if (sw.position !== undefined && !POSITIONS.includes(sw.position)) {
|
|
@@ -681,6 +684,18 @@ export function validateThemeConfig(input, {remembered = []} = {}) {
|
|
|
681
684
|
errors.push(`switcher.${key} must be between 0 and 400`);
|
|
682
685
|
}
|
|
683
686
|
}
|
|
687
|
+
if (typeof sw.followSystem !== 'boolean') errors.push('switcher.followSystem must be true or false');
|
|
688
|
+
for (const [key, suffix] of [['lightTheme', '-light'], ['darkTheme', '-dark']]) {
|
|
689
|
+
checkTheme(sw[key], `switcher.${key}`, builtins);
|
|
690
|
+
if (sw.followSystem) {
|
|
691
|
+
if (typeof sw[key] !== 'string' || !sw[key].endsWith(suffix)) {
|
|
692
|
+
errors.push(`switcher.${key} must be a ${suffix.slice(1)} theme`);
|
|
693
|
+
}
|
|
694
|
+
if (Array.isArray(sw.themes) && sw.themes.length && !sw.themes.includes(sw[key])) {
|
|
695
|
+
errors.push(`switcher.${key} must be included in switcher.themes`);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
684
699
|
if (sw.themes !== undefined) {
|
|
685
700
|
if (!Array.isArray(sw.themes)) {
|
|
686
701
|
errors.push('switcher.themes must be an array');
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
<script src="/public/js/form-logic-engine.js?v=20261031-forms-reduce-motion" defer></script>
|
|
189
189
|
|
|
190
190
|
<!-- Site initialisation -->
|
|
191
|
-
<script src="/public/js/site.js?v=
|
|
191
|
+
<script src="/public/js/site.js?v=20261110-theme-preference" type="module"></script>
|
|
192
192
|
<script src="/public/js/collection-context.js?v=20261010-utf8-payloads" type="module"></script>
|
|
193
193
|
{{ctxMenusModule}}
|
|
194
194
|
<!-- [image zoom] pictures' full-size view - only on a page that has one -->
|