domma-cms 1.51.3 → 1.53.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.
@@ -1,11 +1,11 @@
1
- import{api as w}from"../api.js";import{enhanceFontSelect as Ie}from"../lib/font-picker.js";import{applyAdminTheme as ht,refreshAdminTheme as Ke}from"../lib/admin-theme.js";import{addBannerAction as ze}from"../lib/plugin-chrome.js";import{helpPopovers as Be}from"../lib/help-popover.js";import{onceClosed as ut,openMenuAt as _e,sidebarCount as pt}from"../lib/tool-kit.js";import{populateThemeSelect as He}from"../lib/themes.js";import{cloneOverride as G,dayOrNight as ft,formFromConfig as Q,knownThemeIds as vt,moveItem as Ue,overrideRow as bt,payloadFromForm as X,snapshot as pe,swatchColour as Ve,themeDiff as yt,themeLabel as kt,themeProblems as gt}from"../lib/theme-settings-arrange.js";import{fmtDateTime as xt}from"../lib/dates.js";const fe=/^\/theme(\?.*)?$/,wt="#/theme",D="theme.draft",Et=[{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"}],St=`
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>`,ve=h=>String(h??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function Tt(h){const y=document.createElement("template");return y.innerHTML=h.trim(),y.content.firstElementChild}let T=null,Ye=!1;function Ct(){Ye||!window.R?.use||(Ye=!0,R.use((h,y,c)=>!(fe.test(y?.path||"")&&!fe.test(h?.path||""))||!T?.dirty()?c():E.confirm("You have unsaved theme changes. Leave anyway? They are kept as a draft for your next visit.").then(p=>{p?c():history.replaceState(null,"","#/theme")})),M.subscribe("router:afterChange",({to:h}={})=>{if(T&&!fe.test(h?.path||"")){const y=T;T=null,y.dispose()}}))}export const themeView={templateUrl:"/admin/js/templates/theme.html",async onMount(h){if(Ct(),T){const e=T;T=null,e.dispose()}const y=[],c=e=>(y.push(e),e);let Z=!1;const p=h.get(0).querySelector(".thx")||h.get(0),O=()=>!Z&&p.isConnected,be=E.loader(h.get(0),{type:"dots"});let j,L;try{[j,L]=await Promise.all([w.theme.get(),w.theme.catalog().catch(()=>({themes:[],tokens:[],custom:[]}))])}catch(e){be.destroy(),E.toast(`Could not load the theme settings: ${e.message||e}`,{type:"error"});return}if(be.destroy(),!p.isConnected)return;const ee=L.tokens||[],P=Array.isArray(L.custom)?L.custom:[],ye=vt(L),f=M.observable(j),A=Q(j),n={};for(const[e,t]of Object.entries(A))n[e]=M.observable(t);const ke=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].value])),te=()=>Object.fromEntries(Object.keys(n).map(e=>[e,n[e].peek()])),F=M.observable(pe(A,j)),K=M.observable(!1),z=M.observable([]),oe=M.observable("(nothing yet)"),ne=M.observable(!1),Je=M.computed(()=>pe(ke(),f.value)),B=M.computed(()=>Je.value!==F.value),ge=M.computed(()=>gt(ke(),ye)),xe=M.observable([]);c(M.effect(()=>{xe.value=n.overrides.value.map((e,t)=>bt(e,t,{custom:P,known:ye}))}));const _=e=>kt(e,P),We={...n,saving:K,rows:xe,cssText:oe,cssError:ne,dirty:B,errorsText:M.computed(()=>z.value.join(" \xB7 ")),problemsText:M.computed(()=>ge.value.length?`${ge.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=ft(e.autoTheme)==="day"?"day":"night";return`Site: ${_(e.autoTheme.dayTheme)} by day, ${_(e.autoTheme.nightTheme)} by night (${t} now)`}return`Site: ${_(e.theme||"charcoal-dark")}`}),liveAdmin:M.computed(()=>`Admin: ${_(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 we(e){if(!P.length)return;const t=document.createElement("optgroup");t.label="Custom themes";for(const o of P){const s=document.createElement("option");s.value=o.id,s.textContent=`${o.label} (on ${o.baseTheme})`,t.appendChild(s)}e.appendChild(t)}function Ee(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 s=p.querySelector(e);return He(s,o),we(s),Ee(s,t),s};H("#thx-site",A.theme),H("#thx-admin",A.adminTheme,{includeAdmin:!0}),H("#thx-day",A.dayTheme),H("#thx-night",A.nightTheme);let ae=0;async function Ge(e){const t=++ae;try{const o=await w.theme.admin(e);if(t!==ae||!O())return;ht(o)}catch{}}let Se=!0;c(M.effect(()=>{const e=n.adminTheme.value||"charcoal-dark";if(Se){Se=!1;return}Ge(e)})),c(()=>{ae++,(n.adminTheme.peek()||"charcoal-dark")!==(f.peek().adminTheme||"charcoal-dark")&&Ke(w)});let se=null,re=0;async function U(){const e=++re;try{const t=await w.theme.compile(X(te(),f.peek()));if(e!==re||!O())return;oe.value=t.css?.trim()||"(no overrides - nothing is injected)",ne.value=!1}catch(t){if(e!==re||!O())return;oe.value=t.message||String(t),ne.value=!0}}c(M.effect(()=>{n.overrides.value,clearTimeout(se),se=setTimeout(U,400)})),c(()=>clearTimeout(se));async function le(){if(!K.peek()){K.value=!0,z.value=[];try{const e=await w.theme.save(X(te(),f.peek()));if(!O())return;f.value=e;const t=Q(e);for(const[o,s]of Object.entries(t))n[o].value=s;F.value=pe(t,e);try{S.remove?S.remove(D):S.set(D,null)}catch{}await Ke(w),pt(wt),E.toast("Theme saved.",{type:"success"}),U()}catch(e){z.value=e.validation||[e.message||"Could not save the theme."],E.toast("Theme not saved - see the message at the top.",{type:"error"})}finally{K.value=!1}}}async function Qe(){if(!await E.confirm("Throw away your unsaved theme changes?"))return;const e=Q(f.peek());for(const[t,o]of Object.entries(e))n[t].value=o;z.value=[]}const Te=e=>n.overrides.peek().find(t=>t.id===e),C=e=>{n.overrides.value=e},ie=(e,t)=>C(n.overrides.peek().map(o=>o.id===e?t:o)),Xe=e=>n.overrides.peek().findIndex(t=>t.id===e),ce=new Map;async function Ce(e){if(!e)return null;if(ce.has(e))return ce.get(e);const o=(await w.theme.themeTokens(e).catch(()=>null))?.tokens||null;return ce.set(e,o),o}const Ze=()=>(n.autoEnabled.peek()?n.dayTheme.peek():n.theme.peek())||"charcoal-dark",V=new Set;function Y(e){const t=e?Te(e):G({});if(!t)return;const o=!e,s=G(t),i={label:M.observable(s.label),scope:M.observable(s.scope),enabled:M.observable(s.enabled),theme:M.observable(s.theme),css:M.observable(s.css),tokenErr:M.observable("")},d=E.slideover({title:o?"New override":`Override: ${ve(t.label||t.scope||"untitled")}`,size:"md",position:"right"}),v=Tt(`
8
+ </div>`,ye=u=>String(u??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");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">${Et.map(a=>`<option value="${a.value}" label="${a.label}"></option>`).join("")}</datalist>
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"${s.css?" open":""}>
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>`),de=v.querySelector("#thx-o-theme");He(de,{includeDefault:!0,defaultLabel:"Keep the site theme"}),we(de),Ee(de,s.theme);const nt=v.querySelector("#thx-token-names");for(const a of ee){const l=document.createElement("option");l.value=a,nt.appendChild(l)}const me=v.querySelector(".thx-toks");function De(a="",l=""){const b=document.createElement("div");b.className="thx-tok";const r=document.createElement("input");r.type="text",r.className="form-input font-mono thx-tok-name",r.placeholder="--dm-primary",r.setAttribute("list","thx-token-names"),r.value=a,r.setAttribute("aria-label","Token");const u=document.createElement("input");u.type="text",u.className="form-input thx-tok-value",u.placeholder="#0096c7",u.value=l,u.setAttribute("aria-label","Value");const k=document.createElement("input");k.type="color",k.title="Pick a colour";const g=Ve(l);/^#[0-9a-f]{6}$/i.test(g)&&(k.value=g),k.addEventListener("input",()=>{u.value=k.value});const x=document.createElement("button");return x.type="button",x.className="btn btn-sm btn-ghost",x.textContent="\xD7",x.title="Remove this token",x.addEventListener("click",()=>b.remove()),b.append(r,u,k,x),b}for(const[a,l]of Object.entries(s.tokens))me.appendChild(De(a,l));function Le(){const a={},l=[];return me.querySelectorAll(".thx-tok").forEach(b=>{const r=b.querySelector(".thx-tok-name").value.trim(),u=b.querySelector(".thx-tok-value").value.trim();!r||!u||(ee.length&&!ee.includes(r)&&l.push(r),a[r]=u)}),{tokens:a,bad:l}}const Re=()=>({...s,label:i.label.peek(),scope:i.scope.peek(),enabled:i.enabled.peek(),theme:i.theme.peek(),css:i.css.peek(),tokens:Le().tokens}),at=JSON.stringify(X({overrides:[s]}).overrides),st=()=>JSON.stringify(X({overrides:[Re()]}).overrides)!==at,he=v.querySelector(".thx-diff-host");let je=0;async function rt(){const a=++je;he.replaceChildren();const l=i.theme.peek();if(!l)return;const b=Ze(),r=document.createElement("div");if(r.className="thx-diff",r.style.marginTop=".5rem",l===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.",r.appendChild(m),he.appendChild(r);return}const[u,k]=await Promise.all([Ce(b),Ce(l)]);if(a!==je||!u||!k)return;const g=yt(u,k),x=document.createElement("p");if(x.textContent=`Changes ${g.changed} of ${g.total} tokens here.`,r.appendChild(x),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.",r.appendChild(m)}const W=document.createElement("div");W.className="thx-diff-list";const Fe=m=>{const q=document.createElement("span");return q.className="thx-sw",q.style.background=Ve(m)||"transparent",q};for(const m of g.shown){const q=document.createElement("span");q.append(Fe(m.from),document.createTextNode(`${m.name} `),Fe(m.to)),W.appendChild(q)}if(g.more){const m=document.createElement("span");m.textContent=`+${g.more} more`,W.appendChild(m)}r.appendChild(W),he.appendChild(r)}const lt=M.effect(()=>{i.theme.value,rt()});let J=!1,ue=!1;const Pe={addToken:()=>{const a=De();me.appendChild(a),a.querySelector("input").focus()},cancel:()=>d.close(),async remove(){await E.confirm(`Remove the override "${ve(t.label||t.scope||"untitled")}"? It goes when you save.`)&&(C(n.overrides.peek().filter(a=>a.id!==t.id)),J=!0,d.close())},done(){const{bad:a}=Le();if(a.length){i.tokenErr.value=`Not a token this Domma defines: ${a.join(", ")}. Pick one from the list.`;return}const l=Re();o?C([...n.overrides.peek(),l]):ie(t.id,l),J=!0,d.close()}};d.element.appendChild(v);const it=Be(v),ct=M.applyBindings(i,v,{methods:Pe}),dt=a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),Pe.done())};v.addEventListener("keydown",dt),V.add(d),ut(d,()=>{lt(),ct.dispose(),it(),V.delete(d)});const mt=d.close.bind(d);d.close=async a=>{if(!J&&a!==!0&&st()){if(ue)return;ue=!0;const l=await E.confirm("Discard your changes to this override?");if(ue=!1,!l)return}return J=!0,mt()},I.scan(v),d.open(),v.querySelector(o?"#thx-o-scope":"#thx-o-label")?.focus()}function et(e){const t=Te(e);if(!t)return[];const o=Xe(e),s=n.overrides.peek().length;return[{header:t.label||t.scope||`Override ${o+1}`},{label:"Edit\u2026",icon:"edit",action:()=>Y(e)},t.enabled?{label:"Switch off",icon:"pause",action:()=>ie(e,{...t,enabled:!1})}:{label:"Switch on",icon:"play",action:()=>ie(e,{...t,enabled:!0})},{label:"Duplicate",icon:"copy",action:()=>{const i=G({...t,id:"",label:t.label?`${t.label} copy`:""}),d=[...n.overrides.peek()];d.splice(o+1,0,i),C(d)}},{type:"divider"},{label:"Move up",icon:"arrow-up",disabled:o<=0,action:()=>C(Ue(n.overrides.peek(),o,-1))},{label:"Move down",icon:"arrow-down",disabled:o>=s-1,action:()=>C(Ue(n.overrides.peek(),o,1))},{type:"divider"},{label:"Remove\u2026",icon:"trash",danger:!0,action:async()=>{await E.confirm(`Remove the override "${ve(t.label||t.scope||"untitled")}"? It goes when you save.`)&&C(n.overrides.peek().filter(i=>i.id!==e))}}]}const N=p.querySelector(".thx-list");N.innerHTML=St,E.tabs(p.querySelector(".thx-tabs"),{tabSelector:".tab-item",panelSelector:".tab-panel"});const tt=M.applyBindings(We,p,{methods:{save:le,discard:Qe,refreshCss:U,addOverride:()=>Y(null)}});c(()=>tt.dispose());const Me=[Ie(p.querySelector("#thx-font"),{label:"Font family",stylesheet:()=>n.fontStylesheet.peek()}),Ie(p.querySelector("#thx-admin-font"),{label:"Admin font family",stylesheet:()=>n.fontStylesheet.peek()})];c(()=>Me.forEach(e=>e.destroy())),c(M.effect(()=>{n.fontFamily.value,n.adminFontFamily.value,n.fontStylesheet.value,queueMicrotask(()=>{O()&&Me.forEach(e=>e.refresh())})})),c(Be(p,{position:"bottom"}));const ot=E.contextMenu(N,{cursor:"glyph",match:".thx-row",inherit:!1,density:"compact",items:e=>et(e.dataset.id)});c(()=>ot?.destroy?.());const $e=e=>{const t=e.target.closest(".thx-row");if(t){if(e.target.closest(".thx-kebab")){_e(e.target.closest(".thx-kebab"));return}Y(t.dataset.id)}},Oe=e=>{const t=e.target.closest(".thx-row");t&&(e.key==="F10"&&e.shiftKey?(e.preventDefault(),_e(t)):e.key==="Enter"&&e.target===t&&Y(t.dataset.id))};N.addEventListener("click",$e),N.addEventListener("keydown",Oe),c(()=>{N.removeEventListener("click",$e),N.removeEventListener("keydown",Oe)}),ze(h,{id:"theme-view-site",icon:"external-link",title:"View site",onClick:()=>window.open("/","_blank","noopener")}),ze(h,{id:"theme-save",icon:"save",title:"Save (Ctrl+S)",onClick:()=>le()});const Ae=e=>{!(e.ctrlKey||e.metaKey)||e.key!=="s"||V.size||(e.preventDefault(),e.stopImmediatePropagation(),le())};document.addEventListener("keydown",Ae,!0),c(()=>document.removeEventListener("keydown",Ae,!0));const Ne=()=>{if(B.peek())try{S.set(D,{form:te(),base:F.peek(),at:new Date().toISOString()})}catch{}},qe=e=>{B.peek()&&(Ne(),e.preventDefault(),e.returnValue="")};window.addEventListener("beforeunload",qe),c(()=>window.removeEventListener("beforeunload",qe)),T={dirty:()=>B.peek(),dispose(){Z=!0,Ne(),[...V].forEach(e=>{try{e.close(!0)}catch{}}),y.splice(0).reverse().forEach(e=>{try{e()}catch{}})}},I.scan(p),U();let $=null;try{$=S.get(D)}catch{}if($?.form){try{S.remove?S.remove(D):S.set(D,null)}catch{}const e=$.base&&$.base!==F.peek(),t=$.at?` (${xt($.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)&&O()){const s={...Q(f.peek()),...$.form};s.overrides=(s.overrides||[]).map(i=>G(i));for(const[i,d]of Object.entries(s))n[i]&&(n[i].value=d)}}}};
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)}}}};
@@ -0,0 +1,53 @@
1
+ # Admin assistant
2
+
3
+ Enable the core mechanism at **System > Site Settings > General > Admin assistant**.
4
+ It starts switched off. A settings editor can choose its display name, Della/Dot/Daisy
5
+ artwork (or none), additional context and rules. Global character visibility and reduced
6
+ motion preferences still apply. This is separate from public visitor chat.
7
+
8
+ Once enabled, signed-in users see **Ask Della** (or the chosen name) throughout their
9
+ admin screens. The panel answers questions and drafts plain text that the person can
10
+ copy into an editor. It has no action tools and cannot save, publish, send, inspect
11
+ records or change settings. Core help currently covers Pages, Theme and Site Settings;
12
+ other screens get general help until their plugin registers more specific guidance.
13
+
14
+ Questions, up to ten recent messages and permission-filtered help are sent to the site's
15
+ existing AI service. The current screen's records, page content, CVs, files and form
16
+ values are not attached. Conversations stay in browser memory, are cleared on sign-out
17
+ or a user change, and can be cleared in the panel. They are not saved as visitor chats.
18
+ The site's shared AI context and rules are combined with the admin-specific settings.
19
+
20
+ The Manager needs the admin-assistant AI mode update. It uses the existing hosted AI
21
+ entitlement and monthly allowance. A site with no configured AI service shows an
22
+ unavailable message. Older Managers are detected and asked to update; their visitor
23
+ answer mode is not silently used for admin assistance.
24
+
25
+ ## Plugin help and assistant identities
26
+
27
+ A plugin can register static guidance during startup through its supplied hooks:
28
+
29
+ ```js
30
+ hooks.registerAdminAssistant({
31
+ routes: ['/plugins/example'],
32
+ permission: 'example.read',
33
+ name: 'Your helper',
34
+ character: 'della',
35
+ context: 'Describe this tool and its documented operations here.'
36
+ });
37
+ ```
38
+
39
+ The CMS stamps the registration with the plugin's name. The registered permission and
40
+ the signed-in user's admin scope must both permit the current route before its guidance
41
+ or identity is used. A plugin cannot replace another plugin's registration. Context is
42
+ static text, capped at 8,000 characters; the hook does not accept record loaders or
43
+ action handlers. A custom name does not create a new artwork pack. Dash's Job Board
44
+ integration and pose pack are separate work.
45
+
46
+ Authenticated endpoints:
47
+
48
+ - `GET /api/admin-assistant/config?route=/theme` returns presentation and availability.
49
+ - `POST /api/admin-assistant/ask` accepts `question`, `route` and bounded `history`.
50
+
51
+ The server derives the assistant, context, rules and AI mode. Request fields cannot
52
+ replace them. Requests are rate limited; disabled assistants and inaccessible tools
53
+ are rejected before the AI service is called.
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` | `[]` | **A filter, not a list to maintain.** Empty means every theme the stylesheet ships |
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,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.51.3",
3
+ "version": "1.53.0",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},p=function(i){return c(i).replace(/'/g,"&#39;")},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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},p=function(i){return c(i).replace(/'/g,"&#39;")},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 o=window.__CMS_THEME_SWITCHER__;if(!o||!Array.isArray(o.themes)||!o.themes.length)return;var E=["top-left","top-right","left-center","right-center","bottom-left","bottom-right"],h=[],u=null;function S(t){if(!t)return o.themes;var e=String(t).split(",").map(function(n){return n.trim()}).filter(Boolean),a=o.themes.filter(function(n){return e.indexOf(n.id)!==-1});return a.length?a:o.themes}function b(t){var e=t.themes||o.themes,a=t.position==="inline",n=E.indexOf(t.position)!==-1?t.position:"right-center",d=n==="left-center"||n==="bottom-left"||n==="top-left",m=n==="bottom-left"||n==="bottom-right",l=n==="top-left"||n==="top-right",y=t.offsetX!=null?t.offsetX:32,x=t.offsetY!=null?t.offsetY:32,f=document.createElement("div");f.className="dm-theme-switcher"+(a?" dm-ts-inline dm-ts-left dm-ts-top":(d?" dm-ts-left":"")+(l?" dm-ts-top":"")),f.setAttribute("role","navigation"),f.setAttribute("aria-label","Theme switcher");var r=document.createElement("button");r.type="button",r.className="dm-ts-trigger",r.setAttribute("data-tooltip","Switch theme"),r.setAttribute("aria-label","Switch theme"),r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false");var w=360/e.length;r.style.background="conic-gradient("+e.map(function(s,i){return(s.from||"#888")+" "+(i*w).toFixed(2)+"deg "+((i+1)*w).toFixed(2)+"deg"}).join(", ")+")",r.addEventListener("click",function(){var s=r.getAttribute("aria-expanded")==="true";r.setAttribute("aria-expanded",String(!s))});var p=document.createElement("div");return p.className="dm-ts-options",p.setAttribute("role","menu"),e.forEach(function(s){var i=document.createElement("button");i.type="button",i.className="dm-ts-dot",i.dataset.theme=s.id,i.setAttribute("data-tooltip",s.label),i.setAttribute("aria-label",s.label),i.setAttribute("role","menuitem"),i.style.background="linear-gradient(135deg, "+(s.from||"#888")+", "+(s.to||s.from||"#888")+")",i.addEventListener("click",function(){C(i.dataset.theme)}),p.appendChild(i),h.push(i)}),f.appendChild(r),f.appendChild(p),a||Object.assign(f.style,{right:d?"auto":y+"px",left:d?y+"px":"auto",top:l?x+"px":m?"auto":"50vh",bottom:m?x+"px":"auto",transform:l||m?"none":"translateY(-50%)"}),c(),f}function v(t){var e=(t||document).querySelectorAll("[data-theme-switcher]:not([data-ts-mounted])");Array.prototype.forEach.call(e,function(a){a.setAttribute("data-ts-mounted","");var n=function(m){var l=parseInt(m,10);return isFinite(l)?l:null},d=b({position:a.dataset.position||"inline",offsetX:n(a.dataset.offsetX),offsetY:n(a.dataset.offsetY),themes:S(a.dataset.themes)});d.classList.contains("dm-ts-inline")?a.appendChild(d):document.body.appendChild(d)})}function C(t){u&&(u.set(t),document.body.className=document.body.className.split(" ").filter(function(e){return e.indexOf("dm-custom-")!==0}).join(" "),c())}function c(){if(u){var t=u.get();h.forEach(function(e){e.classList.toggle("active",e.dataset.theme===t)})}}function g(t,e){typeof Domma<"u"&&Domma.theme?t(Domma.theme):e>0&&setTimeout(function(){g(t,e-1)},100)}g(function(t){u=t,t.onChange(c),c()},30),window.CMSThemeSwitcher={scan:v};function A(){o.floating!==!1&&document.body.appendChild(b({position:o.position,offsetX:o.offsetX,offsetY:o.offsetY})),v(document)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A):A()})();
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()})();