webim-adapter 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +375 -329
- package/build/webim-embed.js +2 -2
- package/build/webim-ssr.js +86 -40
- package/package.json +1 -1
package/build/webim-embed.js
CHANGED
|
@@ -10,5 +10,5 @@ Error generating stack: `+e.message+`
|
|
|
10
10
|
`)}var S=[{key:`tablet`,max:991},{key:`mobileLandscape`,max:767},{key:`mobile`,max:478}],C=e=>Object.entries(m(e)).map(([e,t])=>`${y(e)}: ${t} !important;`).join(` `);function w(e,t){return S.map(({key:n,max:r})=>{let i=t?.[n]?C(t[n]):``;return i?`@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }`:``}).filter(Boolean).join(`
|
|
11
11
|
`)}function T(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=w(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
|
|
12
12
|
`)}function E(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=x(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
|
|
13
|
-
`)}var ee=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,D={light:{background:`#ffffff`,text:`#111827`,accent:`#111827`,accentText:`#ffffff`,primary:{light:`#4b5563`,main:`#111827`,dark:`#030712`,contrastText:`#ffffff`},secondary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`}},dark:{background:`#0f172a`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},te={font:`system`,headingFont:`inherit`,light:D.light,dark:D.dark},ne={system:{label:`System`,value:ee},inter:{label:`Inter`,value:`"Inter", ${ee}`},outfit:{label:`Outfit`,value:`"Outfit", ${ee}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},re=(e,t)=>ne[e]?.value??t,ie=(e,...t)=>{let n=Object.assign({},e,...t);return n.primary={...e.primary,...t.reduce((e,t)=>({...e,...t?.primary}),{})},n.secondary={...e.secondary,...t.reduce((e,t)=>({...e,...t?.secondary}),{})},n};function ae(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??te.font,headingFont:i??te.headingFont,light:ie(D.light,a,t),dark:ie(D.dark,n)}}function oe(e){return{"--page-bg":e.background,"--page-text":e.text,"--page-accent":e.accent,"--page-accent-text":e.accentText,"--page-primary-light":e.primary.light,"--page-primary":e.primary.main,"--page-primary-dark":e.primary.dark,"--page-primary-contrast":e.primary.contrastText,"--page-secondary-light":e.secondary.light,"--page-secondary":e.secondary.main,"--page-secondary-dark":e.secondary.dark,"--page-secondary-contrast":e.secondary.contrastText}}function se(e){let t=ae(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:re(t.font,ee),"--page-heading-font":t.headingFont===`inherit`?`inherit`:re(t.headingFont,`inherit`)}}function O(e,t=`light`){let n=ae(e);return{...se(e),...oe(n[t]??n.light)}}function k(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function ce({page:e,settings:t,tenant:n,apiUrl:r,locale:i}){let a={...t?.global??{},...t?.tenant??{}},o=e.meta??{};return{schema:1,title:e.title,slug:e.slug,blocks:i&&o.i18n?.[i]?.blocks||e.blocks,theme:k(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,seo:o.seo,direction:o.direction,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var le=async e=>{let t=await e.json().catch(()=>null);if(!e.ok||t?.success===!1)throw Error(t?.error?.message||`Request failed (${e.status})`);return t?.payload??t};async function ue({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a,page:o,fetch:s}){if(!e)throw Error(`fetchPage: apiUrl is required`);if(!n)throw Error(`fetchPage: slug is required`);let c=s??fetch,l=e.replace(/\/$/,``),u={...t?{"x-tenant":t}:{},...a?{authorization:`Bearer ${a}`}:{}},[d,f]=await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i?`?preview=${encodeURIComponent(i)}`:``}`,{headers:u}).then(le),c(`${l}/settings/public`,{headers:u}).then(le)]),p=ce({page:d,settings:f,tenant:t,apiUrl:l,locale:r}),m=[...new Set(Object.values(p.blocks??{}).map(e=>e?.type?.resolvedName===`CollectionList`?e.props?.collection:e?.type?.resolvedName===`TableBlock`||e?.type?.resolvedName===`OrgChartBlock`?e.props?.source:null).filter(Boolean))];if(m.length){let e=e=>e.startsWith(`api:`)?`${l}/data/${encodeURIComponent(e.slice(4))}`:`${l}/dynamic/${encodeURIComponent(e)}?all=1${r?`&locale=${encodeURIComponent(r)}`:``}`,t=await Promise.all(m.map(t=>c(e(t),{headers:u}).then(le).then(e=>{let n=Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[],r=Number(e?.total?.filtered??e?.total?.all??n.length);return[[t,n],[`${t}:total`,Number.isFinite(r)?r:n.length]]}).catch(()=>[[t,[]]])));p.datasets=Object.fromEntries(t.flat())}let h=Number(o);return Number.isFinite(h)&&h>=1&&(p.datasets={...p.datasets??{},__page:Math.floor(h)}),p}new Map([{family:`Bebas Neue`,fallback:`sans-serif`},{family:`Crimson Text`,fallback:`serif`},{family:`DM Sans`,fallback:`sans-serif`},{family:`Fira Sans`,fallback:`sans-serif`},{family:`Inter`,fallback:`sans-serif`},{family:`JetBrains Mono`,fallback:`monospace`},{family:`Josefin Sans`,fallback:`sans-serif`},{family:`Karla`,fallback:`sans-serif`},{family:`Lato`,fallback:`sans-serif`},{family:`Lora`,fallback:`serif`},{family:`Manrope`,fallback:`sans-serif`},{family:`Merriweather`,fallback:`serif`},{family:`Montserrat`,fallback:`sans-serif`},{family:`Nunito`,fallback:`sans-serif`},{family:`Open Sans`,fallback:`sans-serif`},{family:`Oswald`,fallback:`sans-serif`},{family:`Outfit`,fallback:`sans-serif`},{family:`Playfair Display`,fallback:`serif`},{family:`Poppins`,fallback:`sans-serif`},{family:`Quicksand`,fallback:`sans-serif`},{family:`Raleway`,fallback:`sans-serif`},{family:`Roboto`,fallback:`sans-serif`},{family:`Rubik`,fallback:`sans-serif`},{family:`Source Sans 3`,fallback:`sans-serif`},{family:`Space Grotesk`,fallback:`sans-serif`},{family:`Work Sans`,fallback:`sans-serif`}].map(e=>[e.family,e]));function de(e){return e.length?`https://fonts.googleapis.com/css2?${e.map(e=>`family=${e.replace(/ /g,`+`)}:wght@100..900`).join(`&`)}&display=swap`:null}var A=e=>de([e]),j=e=>{let t=typeof e==`string`&&e.match(/^"([^"]+)"/);return t?t[1]:null};function fe(e,t){let n=new Set,r=e=>{for(let t of Object.values(e||{}))for(let e of[`style`,`hover`,`pressed`,`focused`]){let r=j(t.props?.[e]?.fontFamily);r&&n.add(r)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return[...n].sort()}var pe=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),me=e=>pe.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,he=(e,t)=>e===`ltr`||e===`rtl`?e:t?me(t):void 0,ge=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=e(((e,t)=>{t.exports=ge()}))(),_e=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),ve=(0,l.createContext)(null),ye=e=>{let t=Number(e?.__page);if(Number.isFinite(t)&&t>=1)return Math.floor(t);if(typeof window>`u`)return 1;let n=Number(new URLSearchParams(window.location.search).get(`page`));return Number.isFinite(n)&&n>=1?Math.floor(n):1},be=(0,l.createContext)(null),xe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Se(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Ce=e=>{let t=[];for(let[n,r]of Object.entries(e??{})){if(!/^[\w-]+$/.test(n))continue;t.push(n);let e=Array.isArray(r)?r[0]:r,i=Array.isArray(r)?`${n}.0`:n;if(e&&typeof e==`object`&&!Array.isArray(e))for(let n of Object.keys(e))/^[\w-]+$/.test(n)&&t.push(`${i}.${n}`)}return t};function we(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):typeof e==`object`&&!Array.isArray(e)&&(`label`in e||`name`in e||`slug`in e)?String(e.label??e.name??e.slug??``):Array.isArray(e)?e.map(e=>typeof e==`string`?e:Array.isArray(e?.parts)?e.parts.map(e=>e?.text??``).join(``):Array.isArray(e?.items)?e.items.map(e=>e?.text??``).join(` `):e&&(e.label!=null||e.name!=null||e.slug!=null)?String(e.label??e.name??e.slug):``).filter(Boolean).join(` `):``}function Te(e,t){let n=t?.data??{},r=Ce(n);if(!r.length)return e;let i=RegExp(`:(${r.map(xe).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>we(Se(n,t))):Array.isArray(e)?e.map(a):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,a(t)])):e;return a(e)}var Ee={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},De={margin:0},Oe={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},ke={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},Ae={display:`flex`,flexDirection:`column`};function je({style:e}){let t=e?.backgroundVideo;if(!t)return null;let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:-1,pointerEvents:`none`},r=e?.overlayColor?`color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity??50}%, transparent)`:null;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,M.jsx)(`div`,{style:{...n,background:r}})]})}var Me=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...m(e)}:{...t,...m(e)};function Ne({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`div`,{ref:t,style:{...ke,...m(e)},children:[(0,M.jsx)(je,{style:e}),n]})}function Pe({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`section`,{ref:t,style:Me(e,Ae),children:[(0,M.jsx)(je,{style:e}),n]})}function Fe({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,M.jsxs)(`div`,{ref:n,style:i?{...i,...Me(e)}:Me(e),children:[(0,M.jsx)(je,{style:e}),r]})}function Ie({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,M.jsx)(n,{ref:a,style:{...Ee,...m(r)},children:ze(t,e,i)})}var Le={fontFamily:ne.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Re(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,M.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,M.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,M.jsx)(`code`,{style:Le,children:i})),t.includes(`strike`)&&(i=(0,M.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,M.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,M.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,M.jsx)(`strong`,{children:i})),n&&(i=(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`},children:i})),i}function ze(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,M.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,M.jsx)(l.Fragment,{children:ze(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,M.jsx)(`sup`,{children:r}):e.sub&&(r=(0,M.jsx)(`sub`,{children:r})),e.code&&(r=(0,M.jsx)(`code`,{style:Le,children:r})),e.strike&&(r=(0,M.jsx)(`s`,{children:r})),e.underline&&(r=(0,M.jsx)(`u`,{children:r})),e.italic&&(r=(0,M.jsx)(`em`,{children:r})),e.bold&&(r=(0,M.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,M.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href&&(r=(0,M.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`},children:r})),(0,M.jsx)(l.Fragment,{children:r},t)}):t}function Be({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,M.jsx)(`span`,{style:m(a),children:e?.length?ze(e,t):Re(t,n,r,i)})}var Ve={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16};function He({align:e=`center`,width:t,wrap:n}={}){let r=t?`${t}%`:void 0;if(e===`full`)return{width:`100%`};let i=e===`left`||e===`right`;return i&&(n??!0)?{float:e,width:r??`50%`,maxWidth:`100%`,marginTop:`4px`,marginBottom:`12px`,...e===`left`?{marginRight:`20px`,marginLeft:0}:{marginLeft:`20px`,marginRight:0}}:i?{width:r??`fit-content`,maxWidth:`100%`,...e===`left`?{marginLeft:0,marginRight:`auto`}:{marginLeft:`auto`,marginRight:0}}:{width:r??`fit-content`,maxWidth:`100%`,marginLeft:`auto`,marginRight:`auto`}}function Ue(e=[],t,n){let r=n??((e,n)=>ze(e,n,t));return e.map((t,n)=>{let i={marginTop:0,marginBottom:n===e.length-1?0:14};if(t.type===`image`){if(!t.src)return null;let e=(0,M.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,M.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...He(t)},children:[t.href?(0,M.jsx)(`a`,{href:t.href,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`},children:e}):e,t.caption&&(0,M.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return et(t.url)?(0,M.jsx)(`div`,{style:{...i,...He({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,M.jsx)(tt,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`divider`)return(0,M.jsx)(`hr`,{style:{...i,border:0,borderTop:`1px solid rgba(148, 163, 184, 0.4)`}},n);if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,M.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,M.jsx)(`blockquote`,{style:{...Ge,...i},children:r(t.parts,t.text)},n);if(Ve[t.type]){let e=t.type;return(0,M.jsx)(e,{style:{...Ee,fontSize:Ve[t.type],...i},children:r(t.parts,t.text)},n)}return(0,M.jsx)(`p`,{style:{...De,...i},children:r(t.parts,t.text)},n)})}function We({content:e,style:t,linked:n,nodeRef:r}){return(0,M.jsx)(`div`,{ref:r,style:{display:`flow-root`,...m(t)},children:Ue(e,n)})}var Ge={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function Ke({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`blockquote`,{ref:i,style:{...Ge,...m(n)},children:ze(t,e,r)})}function qe({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,M.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...m(n)},children:t.map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:ze(e.parts,e.text)},t))})}function Je({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`p`,{ref:i,style:{...De,...m(n)},children:ze(t,e,r)})}var Ye={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function Xe({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Ye,...m(i)},children:ze(t,e,a)})}function Ze({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Oe,...m(i)},children:ze(t,e,a)})}function Qe({src:e,alt:t,style:n,nodeRef:r}){return e?(0,M.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...m(n)}}):null}function $e({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,M.jsx)(`video`,{ref:s,src:e,poster:t||void 0,controls:n,autoPlay:r,muted:a||r,loop:i,playsInline:!0,style:{display:`block`,width:`100%`,maxWidth:`100%`,...m(o)}}):null}var et=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function tt({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=et(e);if(!c)return null;let l=new URLSearchParams({rel:`0`});return t&&l.set(`autoplay`,`1`),(n||t)&&l.set(`mute`,`1`),i||l.set(`controls`,`0`),r&&(l.set(`loop`,`1`),l.set(`playlist`,c)),Number(a)>0&&l.set(`start`,String(Math.floor(Number(a)))),(0,M.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...m(o)},children:(0,M.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${c}?${l}`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})})}function nt({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,M.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...m(r)}}):null}function rt({code:e,runScripts:t=!0,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(null);return(0,l.useEffect)(()=>{i&&(i.innerHTML=e||``,t&&i.querySelectorAll(`script`).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of e.attributes)t.setAttribute(n,r);t.text=e.textContent,e.replaceWith(t)}))},[i,e,t]),(0,M.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:m(n)})}function it({height:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function at({style:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...m(e)}})}var ot={position:`absolute`,top:`50%`,transform:`translateY(-50%)`,width:36,height:36,borderRadius:`50%`,border:0,cursor:`pointer`,background:`rgba(17, 24, 39, 0.45)`,color:`#fff`,fontSize:20,lineHeight:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0},st={bottom:{inset:`auto 0 0 0`,padding:`40px 24px 20px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.55))`},top:{inset:`0 0 auto 0`,padding:`20px 24px 40px`,background:`linear-gradient(rgba(0, 0, 0, 0.55), transparent)`},middle:{inset:0,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:24,textShadow:`0 2px 12px rgba(0, 0, 0, 0.6)`}},ct=48;function lt({count:e,renderSlide:t,autoplay:n=!0,interval:r=5,height:i=320,swipe:a=!0,style:o,nodeRef:s}){let[c,u]=(0,l.useState)(0),[d,f]=(0,l.useState)(!1),[p,h]=(0,l.useState)(null),g=e?Math.min(c,e-1):0;if((0,l.useEffect)(()=>{if(!n||d||p||e<2)return;let t=setInterval(()=>u(t=>(t+1)%e),Math.max(2,Number(r)||5)*1e3);return()=>clearInterval(t)},[n,d,p,r,e]),!e)return null;let _=t=>u((t+e)%e),v=()=>{if(!p)return;let{dx:e}=p;h(null),e<-48?_(g+1):e>ct&&_(g-1)};return(0,M.jsxs)(`div`,{ref:s,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPointerDown:a&&e>1?e=>{e.pointerType===`mouse`&&e.button!==0||e.target.closest(`button`)||(e.currentTarget.setPointerCapture(e.pointerId),h({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>h(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:v,onPointerCancel:v,style:{position:`relative`,overflow:`hidden`,width:`100%`,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...m(o)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,height:i,transform:`translateX(calc(${-g*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,M.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...ot,left:12},onClick:()=>_(g-1),children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...ot,right:12},onClick:()=>_(g+1),children:`›`}),(0,M.jsx)(`div`,{style:{position:`absolute`,bottom:10,left:0,right:0,display:`flex`,justifyContent:`center`,gap:6},children:Array.from({length:e},(e,t)=>(0,M.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>_(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===g?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var ut=(e,t)=>({position:`absolute`,inset:0,backgroundImage:e?`url(${e})`:`none`,backgroundColor:t||(e?void 0:`rgba(148, 163, 184, 0.25)`),backgroundSize:`cover`,backgroundPosition:`center`});function dt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,M.jsx)(lt,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:ut(i.image)}),(i.title||i.text)&&(0,M.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...st[t]??st.bottom},children:[i.title&&(0,M.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,M.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function ft({slides:e=[],linked:t,...n}){return e.length?(0,M.jsx)(lt,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:ut(r.image,r.color)}),(0,M.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}function pt({images:e=[],columns:t=3,gap:n=8,showNames:r=!1,lightbox:i=!0,style:a,nodeRef:o,inert:s}){let c=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],u=Math.max(0,Number(n)||0),d=s?e=>e.preventDefault():void 0,[f,p]=(0,l.useState)(null),h=i&&!s&&f!==null&&c[f];(0,l.useEffect)(()=>{if(!h)return;let e=e=>{e.key===`Escape`&&p(null),e.key===`ArrowRight`&&p(e=>(e+1)%c.length),e.key===`ArrowLeft`&&p(e=>(e-1+c.length)%c.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,c.length]);let g=e=>{if(typeof e.name==`string`&&e.name.trim())return e.name;if(typeof e.alt==`string`&&e.alt.trim())return e.alt;try{let t=String(e.src).split(`?`)[0].split(`/`).pop();return decodeURIComponent(t??``)}catch{return``}};return(0,M.jsxs)(`div`,{ref:o,style:{columnCount:Math.min(Math.max(Number(t)||3,1),8),columnGap:u,width:`100%`,...m(a)},children:[c.map((e,t)=>{let n=(0,M.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,M.jsx)(`img`,{src:e.src,alt:e.alt??``,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),r&&g(e)&&(0,M.jsx)(`span`,{style:{position:`absolute`,insetInline:0,bottom:0,padding:`14px 10px 8px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.65))`,color:`#fff`,fontSize:12,lineHeight:1.3,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:g(e)})]}),a=e.href?(0,M.jsx)(`a`,{href:e.href,onClick:d,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:n}):i&&!s?(0,M.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>p(t),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&p(t),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:n}):n;return(0,M.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:u,borderRadius:`inherit`,overflow:`hidden`},children:a},t)}),!c.length&&(0,M.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:`Pick images in Settings to fill the gallery`}),h&&(0,M.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>p(null),style:{position:`fixed`,inset:0,zIndex:1400,background:`rgba(0, 0, 0, 0.86)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24},children:[(0,M.jsx)(`img`,{src:c[f].src,alt:c[f].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),g(c[f])&&(0,M.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:g(c[f])}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>p(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),c.length>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),p(e=>(e-1+c.length)%c.length)},style:{position:`absolute`,left:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),p(e=>(e+1)%c.length)},style:{position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`›`})]})]})]})}var mt={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},ht={background:`var(--page-bg, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.25)`,boxShadow:`0 16px 40px rgba(15, 23, 42, 0.16)`,zIndex:60};function gt({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768}){let[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(!1),[h,g]=(0,l.useState)(!1),[_,v]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u)return;let e=new ResizeObserver(()=>p(u.offsetWidth<c));return e.observe(u),()=>e.disconnect()},[u,c]);let y=s===`hamburger`||s===`auto`&&f,b=(e,t)=>(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...mt,display:`block`,...t},children:[e.label,e.desc&&(0,M.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]},e.key);return(0,M.jsxs)(`nav`,{ref:e=>{d(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...m(a)},children:[(t||e)&&(()=>{let i=(0,M.jsxs)(M.Fragment,{children:[t&&(0,M.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,M.jsx)(`span`,{style:{fontWeight:700,fontSize:18,fontFamily:`var(--page-heading-font, inherit)`},children:e})]}),a={display:`flex`,alignItems:`center`,gap:10,color:`inherit`,textDecoration:`none`};return n?(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,M.jsx)(`div`,{style:a,children:i})})(),(0,M.jsx)(`div`,{style:{flexGrow:1}}),y?(0,M.jsx)(`button`,{type:`button`,"aria-label":h?`Close menu`:`Open menu`,onClick:()=>g(!h),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:h?`✕`:`☰`}):(0,M.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:i.map(e=>{let t=e.children??[];if(!t.length)return(0,M.jsx)(`a`,{href:e.href||`#`,style:mt,children:e.label},e.key);let n=e.type===`mega`;return(0,M.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>v(e.key),onMouseLeave:()=>v(null),children:[(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...mt,cursor:`pointer`},children:[e.label,` `,(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),_===e.key&&(n?(0,M.jsx)(`div`,{style:{...ht,position:`absolute`,left:0,right:0,top:`100%`,padding:24,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(170px, 1fr))`,gap:16},children:t.map(e=>b(e,{padding:`6px 8px`,borderRadius:6}))}):(0,M.jsx)(`div`,{style:{...ht,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>b(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),y&&h&&(0,M.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:i.map(e=>(0,M.jsxs)(l.Fragment,{children:[(0,M.jsx)(`a`,{href:e.href||`#`,style:{...mt,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>b(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function _t({tabs:e=[],linked:t,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(0),o=e.length?Math.min(i,e.length-1):0;return e.length?(0,M.jsxs)(`div`,{ref:r,style:{width:`100%`,...m(n)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>a(t),style:{background:`transparent`,border:0,padding:`10px 16px`,fontSize:14,fontFamily:`inherit`,color:`inherit`,cursor:`pointer`,opacity:t===o?1:.6,fontWeight:t===o?600:500,boxShadow:t===o?`inset 0 -2px 0 var(--page-accent, #111827)`:`none`},children:e.label||`Tab ${t+1}`},e.key))}),e.map((e,n)=>(0,M.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function vt({items:e=[],linked:t,multiple:n=!1,style:r,nodeRef:i}){let[a,o]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let s=e=>o(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,M.jsx)(`div`,{ref:i,style:{width:`100%`,...m(r)},children:e.map((n,r)=>{let i=a.has(n.key);return(0,M.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid rgba(148, 163, 184, 0.35)`:`none`},children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>s(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:`transparent`,border:0,padding:`14px 4px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:`inherit`,textAlign:`left`,cursor:`pointer`},children:[n.title||`Item ${r+1}`,(0,M.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:i?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,M.jsx)(`div`,{style:{display:i?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var yt={display:`flex`,flexDirection:`column`,gap:`12px`},bt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},xt={padding:`10px 12px`,border:`1px solid #d1d5db`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`#ffffff`,color:`#111827`},St={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},Ct=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function wt(e,t){if(!e)return!0;let n=t[e.field],r=n==null||n===``?``:String(n),i=e.value??``;switch(e.op){case`eq`:return r===i;case`neq`:return r!==i;case`contains`:return r.toLowerCase().includes(i.toLowerCase());case`gt`:return Number(r)>Number(i);case`lt`:return Number(r)<Number(i);case`empty`:return r===``;case`notEmpty`:return r!==``;default:return!1}}var Tt={display:`flex`,flexDirection:`column`,gap:6},Et={font:`inherit`,fontSize:15,padding:`10px 12px`,borderRadius:8,border:`1px solid rgba(148, 163, 184, 0.55)`,background:`transparent`,color:`inherit`,width:`100%`,boxSizing:`border-box`};function Dt(e,t){let n=Array.isArray(e?.options)?e.options:[];if(!e?.parentField)return n;let r=t?.[e.parentField];return r?n.filter(e=>typeof e==`string`?!1:!e.parent||e.parent===r):[]}function Ot({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,M.jsxs)(`span`,{style:{...bt,fontSize:14},children:[e.label,e.required?` *`:``]}),o={name:e.name,required:e.required||void 0,placeholder:e.placeholder||void 0,disabled:r||void 0,style:Et,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,M.jsx)(e.variant&&e.variant!==`p`?e.variant:`p`,{style:{margin:0,color:e.color||`inherit`,fontSize:{h1:32,h2:26,h3:21,h4:18,h5:16,h6:14,p:15}[e.variant]??16,fontWeight:e.variant===`p`?400:700,lineHeight:1.35},children:e.label}):e.type===`image`?e.src?(0,M.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,M.jsx)(tt,{url:e.src,style:{width:`100%`}}):(0,M.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,M.jsxs)(`label`,{style:Tt,children:[a,e.type===`textarea`||e.multiline?(0,M.jsx)(`textarea`,{...o,rows:4,style:{...Et,resize:`vertical`}}):e.type===`select`?(0,M.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,M.jsx)(`option`,{value:``,children:e.placeholder||`—`}),Dt(e,i).map((e,t)=>(0,M.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,M.jsx)(`input`,{type:`checkbox`,name:e.name,required:e.required||void 0,disabled:r||void 0,checked:!!t,onChange:t=>n(e.name,t.target.checked),style:{width:18,height:18}}):e.type===`upload`?(0,M.jsx)(`input`,{type:`file`,name:e.name,accept:e.accept||void 0,required:e.required||void 0,disabled:r||void 0,onChange:t=>n(e.name,t.target.files?.[0]?.name??``),style:{font:`inherit`,fontSize:14}}):(0,M.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,M.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function kt({style:e,action:t,method:n,name:r,enctype:i,formSlug:a,auto:o,submitLabel:s,nodeRef:c,inert:u,children:d,linked:f,show:p}){let{tenant:h,apiUrl:g}=(0,l.useContext)(_e),[_,v]=(0,l.useState)(`form`),[y,b]=(0,l.useState)(null),[x,S]=(0,l.useState)({}),[C,w]=(0,l.useState)(0),T=u?p||`form`:_;(0,l.useEffect)(()=>{if(!o||!a)return;let e=!0;return fetch(`${g||`/api`}/forms/${encodeURIComponent(a)}`,{headers:h?{"x-tenant":h}:{}}).then(e=>e.json()).then(t=>e&&b(t?.payload&&typeof t.payload==`object`?t.payload:null)).catch(()=>e&&b(null)),()=>{e=!1}},[o,a,h,g]);let E=[{section:null,fields:[]}];for(let e of Array.isArray(y?.fields)?y.fields:[])e.type===`section`?E.push({section:e,fields:[]}):E[E.length-1].fields.push(e);let ee=E.filter(e=>e.section||e.fields.length),D=ee.filter(e=>!e.section||wt(e.section.condition,x)).map(e=>({...e,fields:e.fields.filter(e=>wt(e.condition,x))})),te=ee.length>1,ne=Math.min(C,Math.max(0,D.length-1)),re=te?D[ne]?.fields??[]:D.flatMap(e=>e.fields),ie=re.filter(e=>{let t=x[e.name];return e.required&&(t==null||t===``||t===!1)}),ae=ne>=D.length-1,oe=(e,t)=>S(n=>{let r={...n,[e]:t};for(let t of Array.isArray(y?.fields)?y.fields:[])t?.parentField===e&&delete r[t.name];return r});return(0,M.jsxs)(`div`,{ref:c,style:m(e),children:[(0,M.jsx)(`form`,{action:t||void 0,method:n||`post`,name:r||void 0,encType:i||void 0,onSubmit:async e=>{if(e.preventDefault(),!u){if(a){let t={};if(o)for(let[e,n]of Object.entries(x))n!=null&&n!==``&&(t[e]=n);else for(let[n,r]of new FormData(e.currentTarget).entries())typeof r==`string`&&(t[n]=r===`on`||r);try{let e=await fetch(`${g||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...h?{"x-tenant":h}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);v(e.ok&&n?.success!==!1?`success`:`error`)}catch{v(`error`)}return}if(!t){v(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});v(r.ok?`success`:`error`)}catch{v(`error`)}}},style:{...yt,display:T===`success`?`none`:`flex`},children:o&&a?(0,M.jsxs)(M.Fragment,{children:[te&&(0,M.jsx)(Wt,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:ne+1,style:{marginBottom:8}}),te&&D[ne]?.section?.help&&(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[ne].section.help}),re.map(e=>(0,M.jsx)(Ot,{field:e,value:x[e.name],values:x,onChange:oe,inert:u},e.name)),(0,M.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[te&&ne>0&&(0,M.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>w(ne-1),style:{...Oe,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),te&&!ae?(0,M.jsx)(`button`,{type:`button`,disabled:u||ie.length>0,onClick:()=>w(ne+1),style:{...Oe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ie.length?.5:1},children:`Next`}):(0,M.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...Oe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,M.jsx)(`div`,{style:{display:T===`success`?`block`:`none`},children:f?.success??null}),(0,M.jsx)(`div`,{style:{display:T===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var At=null,jt=()=>At||(At=new Promise(e=>{if(typeof window>`u`)return;if(window.grecaptcha?.render)return e(window.grecaptcha);window.__webimRecaptchaReady=()=>e(window.grecaptcha);let t=document.createElement(`script`);t.src=`https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit`,t.async=!0,document.head.appendChild(t)}),At);function Mt({siteKey:e,theme:t,size:n,style:r,nodeRef:i,inert:a}){let o=(0,l.useContext)(_e),s=o?.settings&&typeof o.settings==`object`?o.settings[`google.recaptchaKey`]:``,c=typeof e==`string`&&e.trim()||(typeof s==`string`?s.trim():``),u=(0,l.useRef)(null),d=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(a||!c||d.current||!u.current)return;let e=!0;return jt().then(r=>{if(!(!e||d.current||!u.current||!r?.render)){d.current=!0;try{r.render(u.current,{sitekey:c,theme:t===`dark`?`dark`:`light`,size:n===`compact`?`compact`:`normal`})}catch{}}}),()=>{e=!1}},[a,c,t,n]),a){let e=t===`dark`;return(0,M.jsxs)(`div`,{ref:i,style:m(r),children:[(0,M.jsxs)(`div`,{style:{width:n===`compact`?164:302,boxSizing:`border-box`,padding:`12px 14px`,display:`flex`,alignItems:`center`,gap:12,borderRadius:4,border:`1px solid ${e?`#52565b`:`#d3d3d3`}`,background:e?`#222528`:`#f9f9f9`,color:e?`#f1f1f1`:`#282828`,fontSize:14,fontFamily:`Roboto, Arial, sans-serif`},children:[(0,M.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,M.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!c&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:11,color:`#b45309`},children:`Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it.`})]})}return c?(0,M.jsx)(`div`,{ref:i,style:m(r),children:(0,M.jsx)(`div`,{ref:u})}):null}function Nt({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,M.jsx)(`label`,{ref:r,style:{...bt,...m(n)},children:ze(t,e,i)})}function Pt({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...xt,...m(i)},...Ct(o)})}function Ft({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...xt,resize:`vertical`,...m(i)},...Ct(o)})}function It({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,M.jsxs)(`label`,{ref:o,style:{...St,...m(a)},children:[(0,M.jsx)(`input`,{type:e,name:n||void 0,value:r||void 0,required:!s&&!!i,onClick:s?e=>e.preventDefault():void 0,tabIndex:s?-1:void 0,style:{margin:0,accentColor:`var(--page-accent, #111827)`}}),t]})}function Lt({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsxs)(`select`,{ref:a,name:e||void 0,required:!o&&!!r,defaultValue:``,onMouseDown:o?e=>e.preventDefault():void 0,tabIndex:o?-1:void 0,style:{...xt,appearance:`auto`,...m(i)},children:[t!==``&&(0,M.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,M.jsx)(`option`,{value:e,children:e},t))]})}function Rt({name:e,accept:t,required:n,text:r=`Choose a file…`,style:i,nodeRef:a,inert:o}){let[s,c]=(0,l.useState)(null);return(0,M.jsxs)(`label`,{ref:a,style:{...xt,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...m(i)},children:[(0,M.jsx)(`input`,{type:`file`,name:e||void 0,accept:t||void 0,required:!o&&!!n,disabled:!!o,onChange:e=>c(e.target.files?.[0]?.name??null),style:{display:`none`}}),(0,M.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function zt({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,M.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...Oe,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...m(t)},children:e})}function Bt({cols:e=2,rows:t=1,style:n,nodeRef:r,linked:i}){let a=Math.max(1,(Number(e)||1)*(Number(t)||1));return(0,M.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...m(n)},children:Array.from({length:a},(e,t)=>(0,M.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function Vt({collection:e,limit:t=6,layout:n=`grid`,columns:r=3,imageField:i,titleField:a=`name`,textField:o,custom:s,templateId:c,paged:u,style:d,nodeRef:f}){let{tenant:p,apiUrl:h,locale:g}=(0,l.useContext)(_e),_=(0,l.useContext)(be),v=(0,l.useContext)(ve),y=v?.[e],b=u?ye(v):1,[x,S]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||y)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((b-1)*e)),r.set(`limit`,String(e))}let i=r.toString(),a=e.startsWith(`api:`)?`${h}/data/${encodeURIComponent(e.slice(4))}`:`${h}/dynamic/${encodeURIComponent(e)}${i?`?${i}`:``}`;return fetch(a,{headers:p?{"x-tenant":p}:{}}).then(e=>e.json()).then(e=>{let t=Array.isArray(e?.payload)?e.payload:Array.isArray(e?.payload?.data)?e.payload.data:[];return n&&S(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&S([])),()=>{n=!1}},[e,p,h,g,y,u,b,t]),!e)return null;let C=Math.max(1,Number(t)||6),w=u?y||e.startsWith(`api:`)?(y??x??[]).slice((b-1)*C,b*C):(x??[]).slice(0,C):(y??x??[]).slice(0,C),T=Math.min(Math.max(Number(r)||3,1),6),E=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${T}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,M.jsx)(`div`,{ref:f,style:{width:`100%`,...E,...m(d)},children:w.map(e=>(0,M.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>Te(t,e))},e.id??e?.data?.slug))}):(0,M.jsx)(`div`,{ref:f,style:{width:`100%`,...E,...m(d)},children:w.map(e=>{let t=i?Se(e?.data,i):null,r=a?we(Se(e?.data,a)):null,s=o?Se(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:we(s),u=n===`list`;return(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,M.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,M.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,M.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:Ue(c)})]})]},e.id??e?.data?.slug)})})}function Ht({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,M.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...m(n)},children:(0,M.jsx)(`ol`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,listStyle:`none`,margin:0,padding:0,fontSize:14},children:e.map((n,r)=>{let i=r===e.length-1;return(0,M.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,M.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,M.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,M.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Ut({pages:e=5,current:t=1,prevNext:n=!0,href:r=`#`,source:i,pageSize:a=6,align:o,hideEmpty:s,inert:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(_e),h=(0,l.useContext)(ve),[g,_]=(0,l.useState)(null),v=i?Number(h?.[`${i}:total`]):NaN;(0,l.useEffect)(()=>{if(!i||Number.isFinite(v))return;let e=!0,t=i.startsWith(`api:`)?`${p}/data/${encodeURIComponent(i.slice(4))}`:`${p}/dynamic/${encodeURIComponent(i)}?limit=1`;return fetch(t,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{if(!e)return;let n=t?.payload,r=Array.isArray(n)?n.length:Number(n?.total?.filtered??n?.total?.all??(Array.isArray(n?.data)?n.data.length:0));_(Number.isFinite(r)?r:0)}).catch(()=>e&&_(0)),()=>{e=!1}},[i,f,p,v]);let y=Math.max(1,Number(a)||6),b=Number.isFinite(v)?v:g;if(i&&b===null||i&&s&&!(b>0))return null;let x=Math.min(Math.max(i?Math.ceil(b/y):Number(e)||1,1),50),S=Math.min(Math.max(i?ye(h):Number(t)||1,1),x),C=e=>{if(i){if(typeof window<`u`){let t=new URLSearchParams(window.location.search);return t.set(`page`,String(e)),`?${t.toString()}`}return`?page=${e}`}return r&&r!==`#`?r.replace(`{page}`,String(e)):`#`},w=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,T=c?e=>e.preventDefault():void 0,E=e=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:36,height:36,padding:`0 8px`,borderRadius:8,fontSize:14,textDecoration:`none`,color:e?`var(--page-accent-text, #ffffff)`:`inherit`,background:e?`var(--page-accent, #111827)`:`transparent`,border:e?`1px solid transparent`:`1px solid rgba(148, 163, 184, 0.4)`});return(0,M.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:w,...m(u)},children:[n&&(0,M.jsx)(`a`,{href:S>1?C(S-1):`#`,onClick:T,"aria-label":`Previous`,style:{...E(!1),opacity:S>1?1:.4},children:`‹`}),Array.from({length:x},(e,t)=>t+1).map(e=>(0,M.jsx)(`a`,{href:C(e),onClick:T,"aria-current":e===S?`page`:void 0,style:E(e===S),children:e},e)),n&&(0,M.jsx)(`a`,{href:S<x?C(S+1):`#`,onClick:T,"aria-label":`Next`,style:{...E(!1),opacity:S<x?1:.4},children:`›`})]})}function Wt({steps:e=[],active:t=1,vertical:n=!1,style:r,nodeRef:i}){if(!e.length)return null;let a=Math.min(Math.max(Number(t)||1,1),e.length),o=e=>({width:32,height:32,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:14,fontWeight:600,flexShrink:0,color:e===`todo`?`inherit`:`var(--page-accent-text, #ffffff)`,background:e===`todo`?`transparent`:`var(--page-accent, #111827)`,border:e===`todo`?`1px solid rgba(148, 163, 184, 0.5)`:`1px solid transparent`,opacity:e===`todo`?.6:1,boxShadow:e===`active`?`0 0 0 4px rgba(99, 102, 241, 0.2)`:`none`}),s=e=>({flexGrow:1,alignSelf:`center`,background:e?`var(--page-accent, #111827)`:`rgba(148, 163, 184, 0.4)`,...n?{width:2,minHeight:24,marginLeft:15,alignSelf:`auto`}:{height:2,minWidth:24}});return(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...m(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,M.jsxs)(l.Fragment,{children:[t>0&&(0,M.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,M.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,M.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var Gt={small:{w:132,h:46,name:11.5,title:10,avatar:28},medium:{w:168,h:56,name:13,title:11,avatar:36},large:{w:210,h:70,name:15.5,title:12.5,avatar:46}},Kt=e=>Gt[e]??Gt.medium;Gt.medium.w,Gt.medium.h;function qt(e,{size:t=`medium`,horizontal:n=!1}={}){let r=Kt(t),i=n?r.h:r.w,a=n?16:20,o=(n?r.w:r.h)+(n?56:48),s=Array.isArray(e)?e.filter(e=>e&&e.id):[],c=new Set(s.map(e=>e.id)),l=new Map,u=[];for(let e of s)e.parent&&c.has(e.parent)&&e.parent!==e.id?(l.has(e.parent)||l.set(e.parent,[]),l.get(e.parent).push(e)):u.push(e);let d=new Map,f=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=(l.get(e.id)??[]).reduce((e,n,r)=>e+f(n,t)+(r?a:0),0),r=Math.max(i,n);return d.set(e.id,r),r};u.forEach(e=>f(e,new Set));let p=[],m=[],h=0,g=(e,t,s,c)=>{if(c.has(e.id))return;c.add(e.id);let u=t+((d.get(e.id)??i)-i)/2,f=s*o,_=n?f:u,v=n?u:f;p.push({node:e,x:_,y:v}),h=Math.max(h,f+(n?r.w:r.h));let y=t;for(let t of l.get(e.id)??[]){let e=y+((d.get(t.id)??i)-i)/2+i/2,l=(s+1)*o;m.push(n?{from:{x:f+r.w,y:u+r.h/2},to:{x:l,y:e}}:{from:{x:u+r.w/2,y:f+r.h},to:{x:e,y:l}}),g(t,y,s+1,c),y+=(d.get(t.id)??i)+a}},_=0,v=new Set;for(let e of u)g(e,_,0,v),_+=(d.get(e.id)??i)+a;let y=Math.max(_-a,i);return{boxes:p,links:m,width:n?Math.max(h,r.w):y,height:n?y:Math.max(h,r.h),horizontal:n}}var Jt=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},Yt=e=>{let t=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e??``).trim());if(!t)return`#ffffff`;let n=t[1];n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=parseInt(n,16);return .299*(r>>16&255)+.587*(r>>8&255)+.114*(r&255)>150?`#111827`:`#ffffff`},Xt=e=>!!(e?.cv?.trim?.()||e?.photo);function Zt(e,t={}){let n=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],r=e=>Array.isArray(e)?e[0]:e,i=e=>e==null?``:we(e);return n.map(e=>{let n=e.data??{},a=r(n[t.parentField]),o=a&&typeof a==`object`?a.id??null:a||null;return{id:e.id,name:i(n[t.nameField||`name`])||i(n.name)||`Untitled`,title:t.titleField?i(n[t.titleField]):``,photo:t.photoField&&r(n[t.photoField])||``,parent:t.parentField?o:null,cv:t.cvField?i(n[t.cvField]):``,href:t.hrefField?i(n[t.hrefField]):``}})}var Qt={size:36,pad:10};function $t({node:e,onClose:t}){return(0,l.useEffect)(()=>{let e=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,M.jsx)(`div`,{onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":e.name,style:{position:`fixed`,inset:0,zIndex:1e3,background:`rgba(15, 23, 42, 0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16},children:(0,M.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{background:`var(--page-bg, #ffffff)`,color:`var(--page-text, #111827)`,borderRadius:14,maxWidth:420,width:`100%`,maxHeight:`80vh`,overflowY:`auto`,padding:24,position:`relative`,boxShadow:`0 24px 64px rgba(15, 23, 42, 0.35)`},children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:t,style:{position:`absolute`,top:10,right:10,width:30,height:30,border:0,borderRadius:8,background:`transparent`,color:`inherit`,fontSize:18,lineHeight:1,cursor:`pointer`,opacity:.6},children:`×`}),(0,M.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,M.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,M.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,M.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,M.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-block`,marginTop:6,padding:`8px 14px`,borderRadius:8,fontSize:13,fontWeight:600,textDecoration:`none`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:`Open profile ↗`})]})})}function en({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,size:c=`medium`,horizontal:u=!1,style:d,nodeRef:f,interactive:p=!0}){let h=(0,l.useId)(),[g,_]=(0,l.useState)(null),{tenant:v,apiUrl:y}=(0,l.useContext)(_e),b=(0,l.useContext)(ve)?.[t],[x,S]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||b)return;let e=!0;return fetch(`${y}/dynamic/${encodeURIComponent(t)}`,{headers:v?{"x-tenant":v}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&S(n)}).catch(()=>e&&S([])),()=>{e=!1}},[t,v,y,b]);let C=t?Zt(b??x??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s}):e,w=Kt(c),{boxes:T,links:E,width:ee,height:D}=qt(C,{size:c,horizontal:u});if(!T.length)return!p&&t?(0,M.jsxs)(`div`,{ref:f,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...m(d)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let te=new Set(T.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,M.jsxs)(`div`,{ref:f,style:{maxWidth:`100%`,overflowX:`auto`,...m(d)},children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 ${ee} ${D}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:ee,height:`auto`,margin:`0 auto`},children:[E.map((e,t)=>(0,M.jsx)(`path`,{d:u?`M ${e.from.x} ${e.from.y} H ${(e.from.x+e.to.x)/2} V ${e.to.y} H ${e.to.x}`:`M ${e.from.x} ${e.from.y} V ${(e.from.y+e.to.y)/2} H ${e.to.x} V ${e.to.y}`,fill:`none`,stroke:`rgba(148, 163, 184, 0.7)`,strokeWidth:`1.5`},t)),T.map(({node:e,x:t,y:n})=>{let r=te.has(e.id),i=!!e.color2,a=!!e.color||r||i,o=e.color||(r?`var(--page-accent, #4f46e5)`:`var(--page-bg, #ffffff)`),s=e.color?Yt(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?Yt(e.color2):s,l=p&&(Xt(e)||e.href),u=()=>Xt(e)?_(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+Qt.pad+w.avatar+8:t+w.w/2,f=e.photo?`start`:`middle`,m=e.photo?Math.floor((w.w-w.avatar-26)/7):Math.floor(w.w/7.6),g=w.h/2,v=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,M.jsxs)(`g`,{onClick:l?u:void 0,style:l?{cursor:`pointer`}:void 0,role:l?`button`:void 0,"aria-label":l?`Open ${e.name||e.title}'s profile`:void 0,children:[i&&e.gradient?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`linearGradient`,{id:`${h}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,M.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,M.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:`url(#${h}-${e.id}-grad)`})]}):i?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${h}-${e.id}-box`,children:(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`})}),(0,M.jsxs)(`g`,{clipPath:`url(#${h}-${e.id}-box)`,children:[(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:g,fill:o}),(0,M.jsx)(`rect`,{x:t,y:n+g,width:w.w,height:w.h-g,fill:e.color2})]})]}):(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${h}-${e.id}`,children:(0,M.jsx)(`circle`,{cx:t+Qt.pad+w.avatar/2,cy:n+w.h/2,r:w.avatar/2})}),(0,M.jsx)(`image`,{href:e.photo,x:t+Qt.pad,y:n+(w.h-w.avatar)/2,width:w.avatar,height:w.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${h}-${e.id})`})]}),i&&!e.gradient?(0,M.jsxs)(M.Fragment,{children:[e.title&&(0,M.jsx)(`text`,{x:d,y:n+g/2+w.title*.35,textAnchor:f,fontSize:w.title,fontWeight:`600`,fill:s,children:Jt(e.title,m+4)}),e.name&&(0,M.jsx)(`text`,{x:d,y:n+g+g/2+w.name*.35,textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:c,children:Jt(e.name,m)})]}):(0,M.jsxs)(M.Fragment,{children:[v[0]&&(0,M.jsx)(`text`,{x:d,y:n+(v[1]?w.h*.43:w.h*.57),textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:s,children:Jt(v[0],m)}),v[1]&&(0,M.jsx)(`text`,{x:d,y:n+w.h*.73,textAnchor:f,fontSize:w.title,opacity:`0.7`,fill:s,children:Jt(v[1],m+4)})]})]},e.id)})]}),g&&(0,M.jsx)($t,{node:g,onClose:()=>_(null)})]})}function tn({columns:e=[],rows:t=[],source:n,limit:r=10,striped:i=!0,bordered:a=!1,compact:o=!1,paged:s,emptyText:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(_e),h=(0,l.useContext)(ve),g=h?.[n],_=s?ye(h):1,[v,y]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!n||g)return;let e=!0,t=Math.max(1,Number(r)||10),i=s&&!n.startsWith(`api:`)?`?offset=${(_-1)*t}&limit=${t}`:``,a=n.startsWith(`api:`)?`${p}/data/${encodeURIComponent(n.slice(4))}`:`${p}/dynamic/${encodeURIComponent(n)}${i}`;return fetch(a,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];return e&&y(n)}).catch(()=>e&&y([])),()=>{e=!1}},[n,f,p,g,s,_,r]),!e.length)return null;let b=Math.max(1,Number(r)||10),x=n?s?g||n.startsWith(`api:`)?(g??v??[]).slice((_-1)*b,_*b):(v??[]).slice(0,b):(g??v??[]).slice(0,b):null,S=x?x.map(t=>e.map(e=>we(Se(t?.data,e.field)))):t,C=!!n&&!(n&&!g&&v===null)&&S.length===0,w=o?`6px 10px`:`10px 14px`,T=`1px solid rgba(148, 163, 184, 0.35)`,E=a?{border:T}:{borderBottom:T};return(0,M.jsx)(`div`,{ref:d,style:{width:`100%`,overflowX:`auto`,...m(u)},children:(0,M.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:14,...a?{border:T}:{}},children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e.map((e,t)=>(0,M.jsx)(`th`,{style:{textAlign:`left`,fontWeight:600,padding:w,background:`rgba(148, 163, 184, 0.12)`,...E},children:e.label??e},t))})}),(0,M.jsxs)(`tbody`,{children:[C&&(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:e.length,style:{padding:w,textAlign:`center`,opacity:.6,...E},children:c||`No data yet`})}),S.map((t,n)=>(0,M.jsx)(`tr`,{style:i&&n%2==1?{background:`rgba(148, 163, 184, 0.07)`}:void 0,children:e.map((e,n)=>(0,M.jsx)(`td`,{style:{padding:w,...E},children:t?.[n]??``},n))},n))]})]})})}var nn={PageRoot:Ne,Section:Pe,Container:Fe,Heading:Ie,TextBlock:Je,ButtonBlock:Ze,ImageBlock:Qe,Spacer:it,Divider:at,SliderBlock:dt,CanvasSlider:ft,TabsBlock:_t,QuickStack:Bt,CollectionList:Vt,BreadcrumbsBlock:Ht,PaginationBlock:Ut,StepperBlock:Wt,OrgChartBlock:en,TableBlock:tn,MasonryBlock:pt,AccordionBlock:vt,NavbarBlock:gt,ListBlock:qe,TextSpan:Be,QuoteBlock:Ke,TextLink:Xe,RichTextBlock:We,RichContentBlock:We,VideoBlock:$e,YouTubeBlock:tt,IframeBlock:nt,EmbedBlock:rt,FormBlock:kt,FormLabel:Nt,FormInput:Pt,FormTextarea:Ft,FormCheckbox:e=>(0,M.jsx)(It,{kind:`checkbox`,...e}),FormRadio:e=>(0,M.jsx)(It,{kind:`radio`,...e}),FormSelect:Lt,FormFile:Rt,FormRecaptcha:Mt,FormSubmit:zt},rn={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},an=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}}),on=()=>{let e=(0,l.useContext)(an);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function sn({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(_e),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,[c,u]=(0,l.useState)(t??null),[d,f]=(0,l.useState)(t?`user`:n?`guest`:`idle`),p=(0,l.useRef)(!1),m=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),h=(0,l.useCallback)(()=>n?Promise.resolve(null):m(`/site/me`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.payload??null;return u(t),f(t?`user`:`guest`),t}).catch(()=>(u(null),f(`guest`),null)),[m,n]),g=(0,l.useCallback)(()=>m(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{u(null),f(`guest`)}),[m]),_=(0,l.useCallback)(()=>{p.current||n||t||(p.current=!0,f(`loading`),h())},[n,t,h]),v=(0,l.useMemo)(()=>({user:c,status:d,ensure:_,refresh:h,signOut:g}),[c,d,_,h,g]);return(0,M.jsx)(an.Provider,{value:v,children:e})}function cn({when:e,children:t}){let{status:n}=on();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function ln({mode:e=`login`,redirect:t,emailLabel:n=`Email`,passwordLabel:r=`Password`,nameLabel:i=`Name`,submitLabel:a,style:o,nodeRef:s,inert:c,linked:u,show:d}){let{tenant:f,apiUrl:p,settings:h}=(0,l.useContext)(_e),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(``),[b,x]=(0,l.useState)(!1),S=e===`register`,C=c?d||`form`:g,w=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,T=async e=>{if(e.preventDefault(),c)return;let n=new FormData(e.currentTarget);x(!0),y(``);try{let e=await fetch(`${p||`/api`}/site/${S?`register`:`login`}`,{method:`post`,headers:{"content-type":`application/json`,...f?{"x-tenant":f}:{}},credentials:`same-origin`,body:JSON.stringify({email:n.get(`email`),password:n.get(`password`),...S?{name:n.get(`name`)||``}:{}})}),r=await e.json().catch(()=>null);if(!e.ok||r?.success===!1){y(r?.error?.message||`Sign-in failed`),_(`error`),x(!1);return}if(_(`success`),typeof window<`u`){let e=w(t)||w(new URLSearchParams(window.location.search).get(`next`))||w(h?.[`site.authRedirect`])||w(h?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{y(`Sign-in failed`),_(`error`),x(!1)}};return(0,M.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...m(o)},children:[(0,M.jsxs)(`form`,{onSubmit:T,style:{display:C===`form`?`grid`:`none`,gap:10},children:[S?(0,M.jsxs)(`label`,{style:{...bt,display:`grid`,gap:6},children:[i,(0,M.jsx)(`input`,{name:`name`,type:`text`,style:xt,...Ct(c)})]}):null,(0,M.jsxs)(`label`,{style:{...bt,display:`grid`,gap:6},children:[n,(0,M.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:xt,...Ct(c)})]}),(0,M.jsxs)(`label`,{style:{...bt,display:`grid`,gap:6},children:[r,(0,M.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:xt,...Ct(c)})]}),(0,M.jsx)(`button`,{type:c?`button`:`submit`,disabled:b||void 0,style:{...Oe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:b?.6:1},children:a||(S?`Create account`:`Sign in`)}),v?(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:v}):null]}),(0,M.jsx)(`div`,{style:{display:C===`success`?`block`:`none`},children:u?.success??null}),(0,M.jsx)(`div`,{style:{display:C===`error`?`block`:`none`},children:u?.error??null})]})}function un({greeting:e=`Hi`,signOutLabel:t=`Sign out`,showEmail:n=!1,style:r,nodeRef:i,inert:a,linked:o,show:s}){let{user:c,status:l,signOut:u}=on(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,M.jsx)(`div`,{ref:i,style:{minHeight:24,...m(r)}}):d===`user`?(0,M.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...m(r)},children:[(0,M.jsxs)(`span`,{style:{...bt,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,M.jsx)(`span`,{style:{...bt,opacity:.7},children:f.email}):null,(0,M.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...Oe,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...Ct(a),children:t})]}):(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...m(r)},children:o?.signedOut??null})}var dn=[rn],fn={SiteLoginForm:ln,SiteAccountMenu:un};new Set(dn.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var pn=new Map;function mn(e){if(pn.has(e))return pn.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return pn.set(e,n),n}function hn(e){let t=e&&typeof e==`object`?e.builder_plugins:null,n=t&&typeof t==`object`?t.plugins:null;return n&&typeof n==`object`?n:{}}async function gn(e,t){let n=await mn(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var _n={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function vn({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(_e),o=hn(a?.settings)[e],s=(0,l.useRef)(null),c=(0,l.useRef)(null),u={tenant:a?.tenant??``,apiUrl:a?.apiUrl??`/api`,locale:a?.locale??``,settings:a?.settings??null},d=(0,l.useRef)(u);d.current=u;let f=JSON.stringify(n??{});return(0,l.useEffect)(()=>{let e=s.current;if(!o?.code||!e)return;let n=!0;return gn(o.code,t).then(e=>{if(!(!n||!e||!s.current)){c.current=e;try{e.mount(s.current,JSON.parse(f),d.current)}catch{c.current=null}}}).catch(()=>{}),()=>{n=!1;let t=c.current;c.current=null;try{t?.unmount?.(e)}catch{}e&&(e.innerHTML=``)}},[o?.code,t]),(0,l.useEffect)(()=>{let e=c.current,t=s.current;if(!(!e||!t))try{e.update?e.update(t,JSON.parse(f),d.current):(e.unmount?.(t),t.innerHTML=``,e.mount(t,JSON.parse(f),d.current))}catch{}},[f]),o?(0,M.jsx)(`div`,{ref:i,style:m(r),children:(0,M.jsx)(`div`,{ref:s})}):(0,M.jsxs)(`div`,{ref:i,style:{..._n,...m(r)},children:[`Plugin “`,e,`” is not installed`]})}var yn={...nn,...fn,PluginBlock:vn};function bn(e,t,n,r=new Set,i=void 0){let a=t[e];if(!a||a.hidden)return null;let o=a.type?.resolvedName,s=i?.mapProps?i.mapProps(a.props??{},o):a.props??{};if(o===`ComponentInstance`){let t=a.props?.componentId,o=n?.[t];if(!o?.template||r.has(t))return null;let s=new Set(r).add(t);return(0,M.jsx)(l.Fragment,{children:bn(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=yn[o];if(!c)return null;let u=(a.nodes??[]).map(e=>bn(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,i])=>[e,bn(i,t,n,r)])):void 0,p=(0,M.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),v(t,s))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,M.jsx)(cn,{when:s.when,children:p},e):p}var xn=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `);function Sn({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,tenant:o,apiUrl:s,datasets:c,locale:u,direction:d,settings:f,siteUser:p}){let m=a?.js?.trim();if((0,l.useEffect)(()=>{if(!m)return;let e=document.createElement(`script`);return e.text=m,document.body.appendChild(e),()=>e.remove()},[m]),!e?.ROOT)return null;let h={lang:u||void 0,dir:he(d,u)},g=`.webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }`,_={minHeight:`100%`,display:`flex`,flexDirection:`column`},v=bn(`ROOT`,e,n),y=(0,l.useMemo)(()=>({render:(t,r)=>bn(t,e,n,void 0,{mapProps:r})}),[e,n]),b=E(e,n),x=T(e,n),S=a?.css?.trim(),C=fe(e,n).map(e=>(0,M.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:A(e)},e));if(r!==`auto`)return(0,M.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`,locale:u||``,settings:f??null},children:(0,M.jsx)(sn,{initialUser:p,children:(0,M.jsx)(ve.Provider,{value:c??null,children:(0,M.jsx)(be.Provider,{value:y,children:(0,M.jsxs)(`div`,{...h,className:`webim-page`,style:{..._,...O(t,r),...i},children:[C,(0,M.jsx)(`style`,{children:g}),b&&(0,M.jsx)(`style`,{children:b}),x&&(0,M.jsx)(`style`,{children:x}),S&&(0,M.jsx)(`style`,{children:S}),v]})})})})});let w=ae(t);return(0,M.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`,locale:u||``,settings:f??null},children:(0,M.jsx)(sn,{initialUser:p,children:(0,M.jsx)(ve.Provider,{value:c??null,children:(0,M.jsx)(be.Provider,{value:y,children:(0,M.jsxs)(`div`,{...h,className:`webim-page`,style:{..._,...se(t),...i},children:[(0,M.jsx)(`style`,{children:`.webim-page { ${xn(oe(w.light))} }
|
|
14
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
13
|
+
`)}var ee=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,D={light:{background:`#ffffff`,text:`#111827`,accent:`#111827`,accentText:`#ffffff`,primary:{light:`#4b5563`,main:`#111827`,dark:`#030712`,contrastText:`#ffffff`},secondary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`}},dark:{background:`#0f172a`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},te={font:`system`,headingFont:`inherit`,light:D.light,dark:D.dark},ne={system:{label:`System`,value:ee},inter:{label:`Inter`,value:`"Inter", ${ee}`},outfit:{label:`Outfit`,value:`"Outfit", ${ee}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},re=(e,t)=>ne[e]?.value??t,ie=(e,...t)=>{let n=Object.assign({},e,...t);return n.primary={...e.primary,...t.reduce((e,t)=>({...e,...t?.primary}),{})},n.secondary={...e.secondary,...t.reduce((e,t)=>({...e,...t?.secondary}),{})},n};function ae(e){let{light:t,dark:n,font:r,headingFont:i,...a}=e??{};return{font:r??te.font,headingFont:i??te.headingFont,light:ie(D.light,a,t),dark:ie(D.dark,n)}}function oe(e){return{"--page-bg":e.background,"--page-text":e.text,"--page-accent":e.accent,"--page-accent-text":e.accentText,"--page-primary-light":e.primary.light,"--page-primary":e.primary.main,"--page-primary-dark":e.primary.dark,"--page-primary-contrast":e.primary.contrastText,"--page-secondary-light":e.secondary.light,"--page-secondary":e.secondary.main,"--page-secondary-dark":e.secondary.dark,"--page-secondary-contrast":e.secondary.contrastText}}function se(e){let t=ae(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:re(t.font,ee),"--page-heading-font":t.headingFont===`inherit`?`inherit`:re(t.headingFont,`inherit`)}}function O(e,t=`light`){let n=ae(e);return{...se(e),...oe(n[t]??n.light)}}function k(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function ce({page:e,settings:t,tenant:n,apiUrl:r,locale:i}){let a={...t?.global??{},...t?.tenant??{}},o=e.meta??{};return{schema:1,title:e.title,slug:e.slug,blocks:i&&o.i18n?.[i]?.blocks||e.blocks,theme:k(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,seo:o.seo,direction:o.direction,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var le=async e=>{let t=await e.json().catch(()=>null);if(!e.ok||t?.success===!1)throw Error(t?.error?.message||`Request failed (${e.status})`);return t?.payload??t};async function ue({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a,page:o,fetch:s}){if(!e)throw Error(`fetchPage: apiUrl is required`);if(!n)throw Error(`fetchPage: slug is required`);let c=s??fetch,l=e.replace(/\/$/,``),u={...t?{"x-tenant":t}:{},...a?{authorization:`Bearer ${a}`}:{}},[d,f]=await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i?`?preview=${encodeURIComponent(i)}`:``}`,{headers:u}).then(le),c(`${l}/settings/public`,{headers:u}).then(le)]),p=ce({page:d,settings:f,tenant:t,apiUrl:l,locale:r}),m=[...new Set(Object.values(p.blocks??{}).map(e=>e?.type?.resolvedName===`CollectionList`?e.props?.collection:e?.type?.resolvedName===`TableBlock`||e?.type?.resolvedName===`OrgChartBlock`?e.props?.source:null).filter(Boolean))];if(m.length){let e=e=>e.startsWith(`api:`)?`${l}/data/${encodeURIComponent(e.slice(4))}`:`${l}/dynamic/${encodeURIComponent(e)}?all=1${r?`&locale=${encodeURIComponent(r)}`:``}`,t=await Promise.all(m.map(t=>c(e(t),{headers:u}).then(le).then(e=>{let n=Array.isArray(e)?e:Array.isArray(e?.data)?e.data:[],r=Number(e?.total?.filtered??e?.total?.all??n.length);return[[t,n],[`${t}:total`,Number.isFinite(r)?r:n.length]]}).catch(()=>[[t,[]]])));p.datasets=Object.fromEntries(t.flat())}let h=Number(o);return Number.isFinite(h)&&h>=1&&(p.datasets={...p.datasets??{},__page:Math.floor(h)}),p}new Map([{family:`Bebas Neue`,fallback:`sans-serif`},{family:`Crimson Text`,fallback:`serif`},{family:`DM Sans`,fallback:`sans-serif`},{family:`Fira Sans`,fallback:`sans-serif`},{family:`Inter`,fallback:`sans-serif`},{family:`JetBrains Mono`,fallback:`monospace`},{family:`Josefin Sans`,fallback:`sans-serif`},{family:`Karla`,fallback:`sans-serif`},{family:`Lato`,fallback:`sans-serif`},{family:`Lora`,fallback:`serif`},{family:`Manrope`,fallback:`sans-serif`},{family:`Merriweather`,fallback:`serif`},{family:`Montserrat`,fallback:`sans-serif`},{family:`Nunito`,fallback:`sans-serif`},{family:`Open Sans`,fallback:`sans-serif`},{family:`Oswald`,fallback:`sans-serif`},{family:`Outfit`,fallback:`sans-serif`},{family:`Playfair Display`,fallback:`serif`},{family:`Poppins`,fallback:`sans-serif`},{family:`Quicksand`,fallback:`sans-serif`},{family:`Raleway`,fallback:`sans-serif`},{family:`Roboto`,fallback:`sans-serif`},{family:`Rubik`,fallback:`sans-serif`},{family:`Source Sans 3`,fallback:`sans-serif`},{family:`Space Grotesk`,fallback:`sans-serif`},{family:`Work Sans`,fallback:`sans-serif`}].map(e=>[e.family,e]));function de(e){return e.length?`https://fonts.googleapis.com/css2?${e.map(e=>`family=${e.replace(/ /g,`+`)}:wght@100..900`).join(`&`)}&display=swap`:null}var A=e=>de([e]),j=e=>{let t=typeof e==`string`&&e.match(/^"([^"]+)"/);return t?t[1]:null};function fe(e,t){let n=new Set,r=e=>{for(let t of Object.values(e||{}))for(let e of[`style`,`hover`,`pressed`,`focused`]){let r=j(t.props?.[e]?.fontFamily);r&&n.add(r)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return[...n].sort()}var pe=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),me=e=>pe.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,he=(e,t)=>e===`ltr`||e===`rtl`?e:t?me(t):void 0,ge=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=e(((e,t)=>{t.exports=ge()}))(),_e=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),ve=(0,l.createContext)(null),ye=e=>{let t=Number(e?.__page);if(Number.isFinite(t)&&t>=1)return Math.floor(t);if(typeof window>`u`)return 1;let n=Number(new URLSearchParams(window.location.search).get(`page`));return Number.isFinite(n)&&n>=1?Math.floor(n):1},be=(0,l.createContext)(null),xe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Se(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Ce=e=>{let t=[];for(let[n,r]of Object.entries(e??{})){if(!/^[\w-]+$/.test(n))continue;t.push(n);let e=Array.isArray(r)?r[0]:r,i=Array.isArray(r)?`${n}.0`:n;if(e&&typeof e==`object`&&!Array.isArray(e))for(let n of Object.keys(e))/^[\w-]+$/.test(n)&&t.push(`${i}.${n}`)}return t};function we(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):typeof e==`object`&&!Array.isArray(e)&&(`label`in e||`name`in e||`slug`in e)?String(e.label??e.name??e.slug??``):Array.isArray(e)?e.map(e=>typeof e==`string`?e:Array.isArray(e?.parts)?e.parts.map(e=>e?.text??``).join(``):Array.isArray(e?.items)?e.items.map(e=>e?.text??``).join(` `):e&&(e.label!=null||e.name!=null||e.slug!=null)?String(e.label??e.name??e.slug):``).filter(Boolean).join(` `):``}function Te(e,t){let n=t?.data??{},r=Ce(n);if(!r.length)return e;let i=RegExp(`:(${r.map(xe).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>we(Se(n,t))):Array.isArray(e)?e.map(a):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,a(t)])):e;return a(e)}var Ee={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},De={margin:0},Oe={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},ke={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},Ae={display:`flex`,flexDirection:`column`};function je({style:e}){let t=e?.backgroundVideo;if(!t)return null;let n={position:`absolute`,inset:0,width:`100%`,height:`100%`,zIndex:-1,pointerEvents:`none`},r=e?.overlayColor?`color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity??50}%, transparent)`:null;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,M.jsx)(`div`,{style:{...n,background:r}})]})}var Me=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...m(e)}:{...t,...m(e)};function Ne({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`div`,{ref:t,style:{...ke,...m(e)},children:[(0,M.jsx)(je,{style:e}),n]})}function Pe({style:e,nodeRef:t,children:n}){return(0,M.jsxs)(`section`,{ref:t,style:Me(e,Ae),children:[(0,M.jsx)(je,{style:e}),n]})}function Fe({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,M.jsxs)(`div`,{ref:n,style:i?{...i,...Me(e)}:Me(e),children:[(0,M.jsx)(je,{style:e}),r]})}function Ie({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,M.jsx)(n,{ref:a,style:{...Ee,...m(r)},children:ze(t,e,i)})}var Le={fontFamily:ne.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function Re(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,M.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,M.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,M.jsx)(`code`,{style:Le,children:i})),t.includes(`strike`)&&(i=(0,M.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,M.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,M.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,M.jsx)(`strong`,{children:i})),n&&(i=(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`},children:i})),i}function ze(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,M.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,M.jsx)(l.Fragment,{children:ze(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,M.jsx)(`sup`,{children:r}):e.sub&&(r=(0,M.jsx)(`sub`,{children:r})),e.code&&(r=(0,M.jsx)(`code`,{style:Le,children:r})),e.strike&&(r=(0,M.jsx)(`s`,{children:r})),e.underline&&(r=(0,M.jsx)(`u`,{children:r})),e.italic&&(r=(0,M.jsx)(`em`,{children:r})),e.bold&&(r=(0,M.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,M.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href&&(r=(0,M.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`},children:r})),(0,M.jsx)(l.Fragment,{children:r},t)}):t}function Be({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,M.jsx)(`span`,{style:m(a),children:e?.length?ze(e,t):Re(t,n,r,i)})}var Ve={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16};function He({align:e=`center`,width:t,wrap:n}={}){let r=t?`${t}%`:void 0;if(e===`full`)return{width:`100%`};let i=e===`left`||e===`right`;return i&&(n??!0)?{float:e,width:r??`50%`,maxWidth:`100%`,marginTop:`4px`,marginBottom:`12px`,...e===`left`?{marginRight:`20px`,marginLeft:0}:{marginLeft:`20px`,marginRight:0}}:i?{width:r??`fit-content`,maxWidth:`100%`,...e===`left`?{marginLeft:0,marginRight:`auto`}:{marginLeft:`auto`,marginRight:0}}:{width:r??`fit-content`,maxWidth:`100%`,marginLeft:`auto`,marginRight:`auto`}}function Ue(e=[],t,n){let r=n??((e,n)=>ze(e,n,t));return e.map((t,n)=>{let i={marginTop:0,marginBottom:n===e.length-1?0:14};if(t.type===`image`){if(!t.src)return null;let e=(0,M.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,M.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...He(t)},children:[t.href?(0,M.jsx)(`a`,{href:t.href,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`},children:e}):e,t.caption&&(0,M.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return et(t.url)?(0,M.jsx)(`div`,{style:{...i,...He({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,M.jsx)(tt,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`divider`)return(0,M.jsx)(`hr`,{style:{...i,border:0,borderTop:`1px solid rgba(148, 163, 184, 0.4)`}},n);if(t.type===`table`){let e=Array.isArray(t.rows)?t.rows.filter(Array.isArray):[];if(!e.length)return null;let r=t.header!==!1,a={border:t.borders===!1?void 0:`1px solid rgba(148, 163, 184, 0.4)`,padding:`6px 10px`,textAlign:`left`,verticalAlign:`top`},o=r?e.slice(1):e,s=Array.isArray(t.widths)?t.widths:null;return(0,M.jsxs)(`table`,{style:{...i,borderCollapse:`collapse`,width:`100%`,fontSize:`inherit`,tableLayout:s?`fixed`:void 0},children:[s&&(0,M.jsx)(`colgroup`,{children:s.map((e,t)=>(0,M.jsx)(`col`,{style:{width:`${e}%`}},t))}),r&&(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e[0].map((e,t)=>(0,M.jsx)(`th`,{style:{...a,fontWeight:700},children:e},t))})}),(0,M.jsx)(`tbody`,{children:o.map((e,t)=>(0,M.jsx)(`tr`,{children:e.map((e,t)=>(0,M.jsx)(`td`,{style:a,children:e},t))},t))})]},n)}if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,M.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,M.jsx)(`blockquote`,{style:{...Ge,...i},children:r(t.parts,t.text)},n);if(Ve[t.type]){let e=t.type;return(0,M.jsx)(e,{style:{...Ee,fontSize:Ve[t.type],...i},children:r(t.parts,t.text)},n)}return(0,M.jsx)(`p`,{style:{...De,...i},children:r(t.parts,t.text)},n)})}function We({content:e,style:t,linked:n,nodeRef:r}){return(0,M.jsx)(`div`,{ref:r,style:{display:`flow-root`,...m(t)},children:Ue(e,n)})}var Ge={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function Ke({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`blockquote`,{ref:i,style:{...Ge,...m(n)},children:ze(t,e,r)})}function qe({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,M.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...m(n)},children:t.map((e,t)=>(0,M.jsx)(`li`,{style:{marginBottom:4},children:ze(e.parts,e.text)},t))})}function Je({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,M.jsx)(`p`,{ref:i,style:{...De,...m(n)},children:ze(t,e,r)})}var Ye={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function Xe({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Ye,...m(i)},children:ze(t,e,a)})}function Ze({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,M.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...Oe,...m(i)},children:ze(t,e,a)})}function Qe({src:e,alt:t,style:n,nodeRef:r}){return e?(0,M.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...m(n)}}):null}function $e({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,M.jsx)(`video`,{ref:s,src:e,poster:t||void 0,controls:n,autoPlay:r,muted:a||r,loop:i,playsInline:!0,style:{display:`block`,width:`100%`,maxWidth:`100%`,...m(o)}}):null}var et=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function tt({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=et(e);if(!c)return null;let l=new URLSearchParams({rel:`0`});return t&&l.set(`autoplay`,`1`),(n||t)&&l.set(`mute`,`1`),i||l.set(`controls`,`0`),r&&(l.set(`loop`,`1`),l.set(`playlist`,c)),Number(a)>0&&l.set(`start`,String(Math.floor(Number(a)))),(0,M.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...m(o)},children:(0,M.jsx)(`iframe`,{src:`https://www.youtube-nocookie.com/embed/${c}?${l}`,title:`YouTube video`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,border:0}})})}function nt({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,M.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...m(r)}}):null}function rt({code:e,runScripts:t=!0,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(null);return(0,l.useEffect)(()=>{i&&(i.innerHTML=e||``,t&&i.querySelectorAll(`script`).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of e.attributes)t.setAttribute(n,r);t.text=e.textContent,e.replaceWith(t)}))},[i,e,t]),(0,M.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:m(n)})}function it({height:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:e||32,flexShrink:0,alignSelf:`stretch`}})}function at({style:e,nodeRef:t}){return(0,M.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...m(e)}})}var ot={position:`absolute`,top:`50%`,transform:`translateY(-50%)`,width:36,height:36,borderRadius:`50%`,border:0,cursor:`pointer`,background:`rgba(17, 24, 39, 0.45)`,color:`#fff`,fontSize:20,lineHeight:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0},st={bottom:{inset:`auto 0 0 0`,padding:`40px 24px 20px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.55))`},top:{inset:`0 0 auto 0`,padding:`20px 24px 40px`,background:`linear-gradient(rgba(0, 0, 0, 0.55), transparent)`},middle:{inset:0,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:24,textShadow:`0 2px 12px rgba(0, 0, 0, 0.6)`}},ct=48;function lt({count:e,renderSlide:t,autoplay:n=!0,interval:r=5,height:i=320,swipe:a=!0,style:o,nodeRef:s}){let[c,u]=(0,l.useState)(0),[d,f]=(0,l.useState)(!1),[p,h]=(0,l.useState)(null),g=e?Math.min(c,e-1):0;if((0,l.useEffect)(()=>{if(!n||d||p||e<2)return;let t=setInterval(()=>u(t=>(t+1)%e),Math.max(2,Number(r)||5)*1e3);return()=>clearInterval(t)},[n,d,p,r,e]),!e)return null;let _=t=>u((t+e)%e),v=()=>{if(!p)return;let{dx:e}=p;h(null),e<-48?_(g+1):e>ct&&_(g-1)};return(0,M.jsxs)(`div`,{ref:s,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPointerDown:a&&e>1?e=>{e.pointerType===`mouse`&&e.button!==0||e.target.closest(`button`)||(e.currentTarget.setPointerCapture(e.pointerId),h({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>h(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:v,onPointerCancel:v,style:{position:`relative`,overflow:`hidden`,width:`100%`,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...m(o)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,height:i,transform:`translateX(calc(${-g*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,M.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...ot,left:12},onClick:()=>_(g-1),children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...ot,right:12},onClick:()=>_(g+1),children:`›`}),(0,M.jsx)(`div`,{style:{position:`absolute`,bottom:10,left:0,right:0,display:`flex`,justifyContent:`center`,gap:6},children:Array.from({length:e},(e,t)=>(0,M.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>_(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===g?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var ut=(e,t)=>({position:`absolute`,inset:0,backgroundImage:e?`url(${e})`:`none`,backgroundColor:t||(e?void 0:`rgba(148, 163, 184, 0.25)`),backgroundSize:`cover`,backgroundPosition:`center`});function dt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,M.jsx)(lt,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:ut(i.image)}),(i.title||i.text)&&(0,M.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...st[t]??st.bottom},children:[i.title&&(0,M.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,M.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function ft({slides:e=[],linked:t,...n}){return e.length?(0,M.jsx)(lt,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{style:ut(r.image,r.color)}),(0,M.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}function pt({images:e=[],columns:t=3,gap:n=8,showNames:r=!1,lightbox:i=!0,style:a,nodeRef:o,inert:s}){let c=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],u=Math.max(0,Number(n)||0),d=s?e=>e.preventDefault():void 0,[f,p]=(0,l.useState)(null),h=i&&!s&&f!==null&&c[f];(0,l.useEffect)(()=>{if(!h)return;let e=e=>{e.key===`Escape`&&p(null),e.key===`ArrowRight`&&p(e=>(e+1)%c.length),e.key===`ArrowLeft`&&p(e=>(e-1+c.length)%c.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,c.length]);let g=e=>{if(typeof e.name==`string`&&e.name.trim())return e.name;if(typeof e.alt==`string`&&e.alt.trim())return e.alt;try{let t=String(e.src).split(`?`)[0].split(`/`).pop();return decodeURIComponent(t??``)}catch{return``}};return(0,M.jsxs)(`div`,{ref:o,style:{columnCount:Math.min(Math.max(Number(t)||3,1),8),columnGap:u,width:`100%`,...m(a)},children:[c.map((e,t)=>{let n=(0,M.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,M.jsx)(`img`,{src:e.src,alt:e.alt??``,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),r&&g(e)&&(0,M.jsx)(`span`,{style:{position:`absolute`,insetInline:0,bottom:0,padding:`14px 10px 8px`,background:`linear-gradient(transparent, rgba(0, 0, 0, 0.65))`,color:`#fff`,fontSize:12,lineHeight:1.3,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:g(e)})]}),a=e.href?(0,M.jsx)(`a`,{href:e.href,onClick:d,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:n}):i&&!s?(0,M.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>p(t),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&p(t),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:n}):n;return(0,M.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:u,borderRadius:`inherit`,overflow:`hidden`},children:a},t)}),!c.length&&(0,M.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:`Pick images in Settings to fill the gallery`}),h&&(0,M.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>p(null),style:{position:`fixed`,inset:0,zIndex:1400,background:`rgba(0, 0, 0, 0.86)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24},children:[(0,M.jsx)(`img`,{src:c[f].src,alt:c[f].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),g(c[f])&&(0,M.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:g(c[f])}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>p(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),c.length>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),p(e=>(e-1+c.length)%c.length)},style:{position:`absolute`,left:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`‹`}),(0,M.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),p(e=>(e+1)%c.length)},style:{position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:0,color:`#fff`,fontSize:36,cursor:`pointer`,padding:12},children:`›`})]})]})]})}var mt={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},ht={background:`var(--page-bg, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.25)`,boxShadow:`0 16px 40px rgba(15, 23, 42, 0.16)`,zIndex:60};function gt({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768}){let[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(!1),[h,g]=(0,l.useState)(!1),[_,v]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u)return;let e=new ResizeObserver(()=>p(u.offsetWidth<c));return e.observe(u),()=>e.disconnect()},[u,c]);let y=s===`hamburger`||s===`auto`&&f,b=(e,t)=>(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...mt,display:`block`,...t},children:[e.label,e.desc&&(0,M.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]},e.key);return(0,M.jsxs)(`nav`,{ref:e=>{d(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...m(a)},children:[(t||e)&&(()=>{let i=(0,M.jsxs)(M.Fragment,{children:[t&&(0,M.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,M.jsx)(`span`,{style:{fontWeight:700,fontSize:18,fontFamily:`var(--page-heading-font, inherit)`},children:e})]}),a={display:`flex`,alignItems:`center`,gap:10,color:`inherit`,textDecoration:`none`};return n?(0,M.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,M.jsx)(`div`,{style:a,children:i})})(),(0,M.jsx)(`div`,{style:{flexGrow:1}}),y?(0,M.jsx)(`button`,{type:`button`,"aria-label":h?`Close menu`:`Open menu`,onClick:()=>g(!h),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:h?`✕`:`☰`}):(0,M.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:i.map(e=>{let t=e.children??[];if(!t.length)return(0,M.jsx)(`a`,{href:e.href||`#`,style:mt,children:e.label},e.key);let n=e.type===`mega`;return(0,M.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>v(e.key),onMouseLeave:()=>v(null),children:[(0,M.jsxs)(`a`,{href:e.href||`#`,style:{...mt,cursor:`pointer`},children:[e.label,` `,(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),_===e.key&&(n?(0,M.jsx)(`div`,{style:{...ht,position:`absolute`,left:0,right:0,top:`100%`,padding:24,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(170px, 1fr))`,gap:16},children:t.map(e=>b(e,{padding:`6px 8px`,borderRadius:6}))}):(0,M.jsx)(`div`,{style:{...ht,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>b(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),y&&h&&(0,M.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:i.map(e=>(0,M.jsxs)(l.Fragment,{children:[(0,M.jsx)(`a`,{href:e.href||`#`,style:{...mt,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>b(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function _t({tabs:e=[],linked:t,style:n,nodeRef:r}){let[i,a]=(0,l.useState)(0),o=e.length?Math.min(i,e.length-1):0;return e.length?(0,M.jsxs)(`div`,{ref:r,style:{width:`100%`,...m(n)},children:[(0,M.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>a(t),style:{background:`transparent`,border:0,padding:`10px 16px`,fontSize:14,fontFamily:`inherit`,color:`inherit`,cursor:`pointer`,opacity:t===o?1:.6,fontWeight:t===o?600:500,boxShadow:t===o?`inset 0 -2px 0 var(--page-accent, #111827)`:`none`},children:e.label||`Tab ${t+1}`},e.key))}),e.map((e,n)=>(0,M.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function vt({items:e=[],linked:t,multiple:n=!1,style:r,nodeRef:i}){let[a,o]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let s=e=>o(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,M.jsx)(`div`,{ref:i,style:{width:`100%`,...m(r)},children:e.map((n,r)=>{let i=a.has(n.key);return(0,M.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid rgba(148, 163, 184, 0.35)`:`none`},children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>s(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:`transparent`,border:0,padding:`14px 4px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:`inherit`,textAlign:`left`,cursor:`pointer`},children:[n.title||`Item ${r+1}`,(0,M.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:i?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,M.jsx)(`div`,{style:{display:i?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var yt={display:`flex`,flexDirection:`column`,gap:`12px`},bt={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},xt={padding:`10px 12px`,border:`1px solid #d1d5db`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`#ffffff`,color:`#111827`},St={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},Ct=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function wt(e,t){if(!e)return!0;let n=t[e.field],r=n==null||n===``?``:String(n),i=e.value??``;switch(e.op){case`eq`:return r===i;case`neq`:return r!==i;case`contains`:return r.toLowerCase().includes(i.toLowerCase());case`gt`:return Number(r)>Number(i);case`lt`:return Number(r)<Number(i);case`empty`:return r===``;case`notEmpty`:return r!==``;default:return!1}}var Tt={display:`flex`,flexDirection:`column`,gap:6},Et={font:`inherit`,fontSize:15,padding:`10px 12px`,borderRadius:8,border:`1px solid rgba(148, 163, 184, 0.55)`,background:`transparent`,color:`inherit`,width:`100%`,boxSizing:`border-box`};function Dt(e,t){let n=Array.isArray(e?.options)?e.options:[];if(!e?.parentField)return n;let r=t?.[e.parentField];return r?n.filter(e=>typeof e==`string`?!1:!e.parent||e.parent===r):[]}function Ot({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,M.jsxs)(`span`,{style:{...bt,fontSize:14},children:[e.label,e.required?` *`:``]}),o={name:e.name,required:e.required||void 0,placeholder:e.placeholder||void 0,disabled:r||void 0,style:Et,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,M.jsx)(e.variant&&e.variant!==`p`?e.variant:`p`,{style:{margin:0,color:e.color||`inherit`,fontSize:{h1:32,h2:26,h3:21,h4:18,h5:16,h6:14,p:15}[e.variant]??16,fontWeight:e.variant===`p`?400:700,lineHeight:1.35},children:e.label}):e.type===`image`?e.src?(0,M.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,M.jsx)(tt,{url:e.src,style:{width:`100%`}}):(0,M.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,M.jsxs)(`label`,{style:Tt,children:[a,e.type===`textarea`||e.multiline?(0,M.jsx)(`textarea`,{...o,rows:4,style:{...Et,resize:`vertical`}}):e.type===`select`?(0,M.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,M.jsx)(`option`,{value:``,children:e.placeholder||`—`}),Dt(e,i).map((e,t)=>(0,M.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,M.jsx)(`input`,{type:`checkbox`,name:e.name,required:e.required||void 0,disabled:r||void 0,checked:!!t,onChange:t=>n(e.name,t.target.checked),style:{width:18,height:18}}):e.type===`upload`?(0,M.jsx)(`input`,{type:`file`,name:e.name,accept:e.accept||void 0,required:e.required||void 0,disabled:r||void 0,onChange:t=>n(e.name,t.target.files?.[0]?.name??``),style:{font:`inherit`,fontSize:14}}):(0,M.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,M.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function kt({style:e,action:t,method:n,name:r,enctype:i,formSlug:a,auto:o,submitLabel:s,nodeRef:c,inert:u,children:d,linked:f,show:p}){let{tenant:h,apiUrl:g}=(0,l.useContext)(_e),[_,v]=(0,l.useState)(`form`),[y,b]=(0,l.useState)(null),[x,S]=(0,l.useState)({}),[C,w]=(0,l.useState)(0),T=u?p||`form`:_;(0,l.useEffect)(()=>{if(!o||!a)return;let e=!0;return fetch(`${g||`/api`}/forms/${encodeURIComponent(a)}`,{headers:h?{"x-tenant":h}:{}}).then(e=>e.json()).then(t=>e&&b(t?.payload&&typeof t.payload==`object`?t.payload:null)).catch(()=>e&&b(null)),()=>{e=!1}},[o,a,h,g]);let E=[{section:null,fields:[]}];for(let e of Array.isArray(y?.fields)?y.fields:[])e.type===`section`?E.push({section:e,fields:[]}):E[E.length-1].fields.push(e);let ee=E.filter(e=>e.section||e.fields.length),D=ee.filter(e=>!e.section||wt(e.section.condition,x)).map(e=>({...e,fields:e.fields.filter(e=>wt(e.condition,x))})),te=ee.length>1,ne=Math.min(C,Math.max(0,D.length-1)),re=te?D[ne]?.fields??[]:D.flatMap(e=>e.fields),ie=re.filter(e=>{let t=x[e.name];return e.required&&(t==null||t===``||t===!1)}),ae=ne>=D.length-1,oe=(e,t)=>S(n=>{let r={...n,[e]:t};for(let t of Array.isArray(y?.fields)?y.fields:[])t?.parentField===e&&delete r[t.name];return r});return(0,M.jsxs)(`div`,{ref:c,style:m(e),children:[(0,M.jsx)(`form`,{action:t||void 0,method:n||`post`,name:r||void 0,encType:i||void 0,onSubmit:async e=>{if(e.preventDefault(),!u){if(a){let t={};if(o)for(let[e,n]of Object.entries(x))n!=null&&n!==``&&(t[e]=n);else for(let[n,r]of new FormData(e.currentTarget).entries())typeof r==`string`&&(t[n]=r===`on`||r);try{let e=await fetch(`${g||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...h?{"x-tenant":h}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);v(e.ok&&n?.success!==!1?`success`:`error`)}catch{v(`error`)}return}if(!t){v(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});v(r.ok?`success`:`error`)}catch{v(`error`)}}},style:{...yt,display:T===`success`?`none`:`flex`},children:o&&a?(0,M.jsxs)(M.Fragment,{children:[te&&(0,M.jsx)(Gt,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:ne+1,style:{marginBottom:8}}),te&&D[ne]?.section?.help&&(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[ne].section.help}),re.map(e=>(0,M.jsx)(Ot,{field:e,value:x[e.name],values:x,onChange:oe,inert:u},e.name)),(0,M.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[te&&ne>0&&(0,M.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>w(ne-1),style:{...Oe,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),te&&!ae?(0,M.jsx)(`button`,{type:`button`,disabled:u||ie.length>0,onClick:()=>w(ne+1),style:{...Oe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ie.length?.5:1},children:`Next`}):(0,M.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...Oe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,M.jsx)(`div`,{style:{display:T===`success`?`block`:`none`},children:f?.success??null}),(0,M.jsx)(`div`,{style:{display:T===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var At=null,jt=null,Mt=e=>{let t=typeof e==`string`&&e.trim()?e.trim():``;if(At&&jt===t)return At;if(At&&typeof window<`u`){for(let e of[`grecaptcha`,`___grecaptcha_cfg`])try{delete window[e]}catch{window[e]=void 0}document.querySelectorAll(`script[src*="recaptcha"]`).forEach(e=>e.remove())}return jt=t,At=new Promise(e=>{if(typeof window>`u`)return;if(window.grecaptcha?.render)return e(window.grecaptcha);window.__webimRecaptchaReady=()=>e(window.grecaptcha);let n=document.createElement(`script`);n.src=`https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t?`&hl=${encodeURIComponent(t)}`:``}`,n.async=!0,document.head.appendChild(n)}),At};function Nt({siteKey:e,theme:t,size:n,hl:r,style:i,nodeRef:a,inert:o}){let s=(0,l.useContext)(_e),c=s?.settings&&typeof s.settings==`object`?s.settings[`google.recaptchaKey`]:``,u=typeof e==`string`&&e.trim()||(typeof c==`string`?c.trim():``),d=(0,l.useRef)(null);if((0,l.useEffect)(()=>{if(o||!u||!d.current)return;let e=!0;return Mt(r).then(r=>{if(!(!e||!d.current||!r?.render)){d.current.innerHTML=``;try{r.render(d.current,{sitekey:u,theme:t===`dark`?`dark`:`light`,size:n===`compact`?`compact`:`normal`})}catch{}}}),()=>{e=!1}},[o,u,t,n,r]),o){let e=t===`dark`;return(0,M.jsxs)(`div`,{ref:a,style:m(i),children:[(0,M.jsxs)(`div`,{style:{width:n===`compact`?164:302,boxSizing:`border-box`,padding:`12px 14px`,display:`flex`,alignItems:`center`,gap:12,borderRadius:4,border:`1px solid ${e?`#52565b`:`#d3d3d3`}`,background:e?`#222528`:`#f9f9f9`,color:e?`#f1f1f1`:`#282828`,fontSize:14,fontFamily:`Roboto, Arial, sans-serif`},children:[(0,M.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,M.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,M.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!u&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:11,color:`#b45309`},children:`Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it.`})]})}return u?(0,M.jsx)(`div`,{ref:a,style:m(i),children:(0,M.jsx)(`div`,{ref:d})}):null}function Pt({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,M.jsx)(`label`,{ref:r,style:{...bt,...m(n)},children:ze(t,e,i)})}function Ft({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...xt,...m(i)},...Ct(o)})}function It({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...xt,resize:`vertical`,...m(i)},...Ct(o)})}function Lt({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,M.jsxs)(`label`,{ref:o,style:{...St,...m(a)},children:[(0,M.jsx)(`input`,{type:e,name:n||void 0,value:r||void 0,required:!s&&!!i,onClick:s?e=>e.preventDefault():void 0,tabIndex:s?-1:void 0,style:{margin:0,accentColor:`var(--page-accent, #111827)`}}),t]})}function Rt({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,M.jsxs)(`select`,{ref:a,name:e||void 0,required:!o&&!!r,defaultValue:``,onMouseDown:o?e=>e.preventDefault():void 0,tabIndex:o?-1:void 0,style:{...xt,appearance:`auto`,...m(i)},children:[t!==``&&(0,M.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,M.jsx)(`option`,{value:e,children:e},t))]})}function zt({name:e,accept:t,required:n,text:r=`Choose a file…`,style:i,nodeRef:a,inert:o}){let[s,c]=(0,l.useState)(null);return(0,M.jsxs)(`label`,{ref:a,style:{...xt,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...m(i)},children:[(0,M.jsx)(`input`,{type:`file`,name:e||void 0,accept:t||void 0,required:!o&&!!n,disabled:!!o,onChange:e=>c(e.target.files?.[0]?.name??null),style:{display:`none`}}),(0,M.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function Bt({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,M.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...Oe,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...m(t)},children:e})}function Vt({cols:e=2,rows:t=1,style:n,nodeRef:r,linked:i}){let a=Math.max(1,(Number(e)||1)*(Number(t)||1));return(0,M.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...m(n)},children:Array.from({length:a},(e,t)=>(0,M.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function Ht({collection:e,limit:t=6,layout:n=`grid`,columns:r=3,imageField:i,titleField:a=`name`,textField:o,custom:s,templateId:c,paged:u,style:d,nodeRef:f}){let{tenant:p,apiUrl:h,locale:g}=(0,l.useContext)(_e),_=(0,l.useContext)(be),v=(0,l.useContext)(ve),y=v?.[e],b=u?ye(v):1,[x,S]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||y)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((b-1)*e)),r.set(`limit`,String(e))}let i=r.toString(),a=e.startsWith(`api:`)?`${h}/data/${encodeURIComponent(e.slice(4))}`:`${h}/dynamic/${encodeURIComponent(e)}${i?`?${i}`:``}`;return fetch(a,{headers:p?{"x-tenant":p}:{}}).then(e=>e.json()).then(e=>{let t=Array.isArray(e?.payload)?e.payload:Array.isArray(e?.payload?.data)?e.payload.data:[];return n&&S(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&S([])),()=>{n=!1}},[e,p,h,g,y,u,b,t]),!e)return null;let C=Math.max(1,Number(t)||6),w=u?y||e.startsWith(`api:`)?(y??x??[]).slice((b-1)*C,b*C):(x??[]).slice(0,C):(y??x??[]).slice(0,C),T=Math.min(Math.max(Number(r)||3,1),6),E=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${T}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,M.jsx)(`div`,{ref:f,style:{width:`100%`,...E,...m(d)},children:w.map(e=>(0,M.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>Te(t,e))},e.id??e?.data?.slug))}):(0,M.jsx)(`div`,{ref:f,style:{width:`100%`,...E,...m(d)},children:w.map(e=>{let t=i?Se(e?.data,i):null,r=a?we(Se(e?.data,a)):null,s=o?Se(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:we(s),u=n===`list`;return(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,M.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,M.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,M.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,M.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:Ue(c)})]})]},e.id??e?.data?.slug)})})}function Ut({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,M.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...m(n)},children:(0,M.jsx)(`ol`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,listStyle:`none`,margin:0,padding:0,fontSize:14},children:e.map((n,r)=>{let i=r===e.length-1;return(0,M.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,M.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,M.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,M.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Wt({pages:e=5,current:t=1,prevNext:n=!0,href:r=`#`,source:i,pageSize:a=6,align:o,hideEmpty:s,inert:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(_e),h=(0,l.useContext)(ve),[g,_]=(0,l.useState)(null),v=i?Number(h?.[`${i}:total`]):NaN;(0,l.useEffect)(()=>{if(!i||Number.isFinite(v))return;let e=!0,t=i.startsWith(`api:`)?`${p}/data/${encodeURIComponent(i.slice(4))}`:`${p}/dynamic/${encodeURIComponent(i)}?limit=1`;return fetch(t,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{if(!e)return;let n=t?.payload,r=Array.isArray(n)?n.length:Number(n?.total?.filtered??n?.total?.all??(Array.isArray(n?.data)?n.data.length:0));_(Number.isFinite(r)?r:0)}).catch(()=>e&&_(0)),()=>{e=!1}},[i,f,p,v]);let y=Math.max(1,Number(a)||6),b=Number.isFinite(v)?v:g;if(i&&b===null||i&&s&&!(b>0))return null;let x=Math.min(Math.max(i?Math.ceil(b/y):Number(e)||1,1),50),S=Math.min(Math.max(i?ye(h):Number(t)||1,1),x),C=e=>{if(i){if(typeof window<`u`){let t=new URLSearchParams(window.location.search);return t.set(`page`,String(e)),`?${t.toString()}`}return`?page=${e}`}return r&&r!==`#`?r.replace(`{page}`,String(e)):`#`},w=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,T=c?e=>e.preventDefault():void 0,E=e=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:36,height:36,padding:`0 8px`,borderRadius:8,fontSize:14,textDecoration:`none`,color:e?`var(--page-accent-text, #ffffff)`:`inherit`,background:e?`var(--page-accent, #111827)`:`transparent`,border:e?`1px solid transparent`:`1px solid rgba(148, 163, 184, 0.4)`});return(0,M.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:w,...m(u)},children:[n&&(0,M.jsx)(`a`,{href:S>1?C(S-1):`#`,onClick:T,"aria-label":`Previous`,style:{...E(!1),opacity:S>1?1:.4},children:`‹`}),Array.from({length:x},(e,t)=>t+1).map(e=>(0,M.jsx)(`a`,{href:C(e),onClick:T,"aria-current":e===S?`page`:void 0,style:E(e===S),children:e},e)),n&&(0,M.jsx)(`a`,{href:S<x?C(S+1):`#`,onClick:T,"aria-label":`Next`,style:{...E(!1),opacity:S<x?1:.4},children:`›`})]})}function Gt({steps:e=[],active:t=1,vertical:n=!1,style:r,nodeRef:i}){if(!e.length)return null;let a=Math.min(Math.max(Number(t)||1,1),e.length),o=e=>({width:32,height:32,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:14,fontWeight:600,flexShrink:0,color:e===`todo`?`inherit`:`var(--page-accent-text, #ffffff)`,background:e===`todo`?`transparent`:`var(--page-accent, #111827)`,border:e===`todo`?`1px solid rgba(148, 163, 184, 0.5)`:`1px solid transparent`,opacity:e===`todo`?.6:1,boxShadow:e===`active`?`0 0 0 4px rgba(99, 102, 241, 0.2)`:`none`}),s=e=>({flexGrow:1,alignSelf:`center`,background:e?`var(--page-accent, #111827)`:`rgba(148, 163, 184, 0.4)`,...n?{width:2,minHeight:24,marginLeft:15,alignSelf:`auto`}:{height:2,minWidth:24}});return(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...m(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,M.jsxs)(l.Fragment,{children:[t>0&&(0,M.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,M.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,M.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,M.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var Kt={small:{w:132,h:46,name:11.5,title:10,avatar:28},medium:{w:168,h:56,name:13,title:11,avatar:36},large:{w:210,h:70,name:15.5,title:12.5,avatar:46}},qt=e=>Kt[e]??Kt.medium;Kt.medium.w,Kt.medium.h;function Jt(e,{size:t=`medium`,horizontal:n=!1}={}){let r=qt(t),i=n?r.h:r.w,a=n?16:20,o=(n?r.w:r.h)+(n?56:48),s=Array.isArray(e)?e.filter(e=>e&&e.id):[],c=new Set(s.map(e=>e.id)),l=new Map,u=[];for(let e of s)e.parent&&c.has(e.parent)&&e.parent!==e.id?(l.has(e.parent)||l.set(e.parent,[]),l.get(e.parent).push(e)):u.push(e);let d=new Map,f=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=(l.get(e.id)??[]).reduce((e,n,r)=>e+f(n,t)+(r?a:0),0),r=Math.max(i,n);return d.set(e.id,r),r};u.forEach(e=>f(e,new Set));let p=[],m=[],h=0,g=(e,t,s,c)=>{if(c.has(e.id))return;c.add(e.id);let u=t+((d.get(e.id)??i)-i)/2,f=s*o,_=n?f:u,v=n?u:f;p.push({node:e,x:_,y:v}),h=Math.max(h,f+(n?r.w:r.h));let y=t;for(let t of l.get(e.id)??[]){let e=y+((d.get(t.id)??i)-i)/2+i/2,l=(s+1)*o;m.push(n?{from:{x:f+r.w,y:u+r.h/2},to:{x:l,y:e}}:{from:{x:u+r.w/2,y:f+r.h},to:{x:e,y:l}}),g(t,y,s+1,c),y+=(d.get(t.id)??i)+a}},_=0,v=new Set;for(let e of u)g(e,_,0,v),_+=(d.get(e.id)??i)+a;let y=Math.max(_-a,i);return{boxes:p,links:m,width:n?Math.max(h,r.w):y,height:n?y:Math.max(h,r.h),horizontal:n}}var Yt=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},Xt=e=>{let t=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e??``).trim());if(!t)return`#ffffff`;let n=t[1];n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=parseInt(n,16);return .299*(r>>16&255)+.587*(r>>8&255)+.114*(r&255)>150?`#111827`:`#ffffff`},Zt=e=>!!(e?.cv?.trim?.()||e?.photo);function Qt(e,t={}){let n=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],r=e=>Array.isArray(e)?e[0]:e,i=e=>e==null?``:we(e);return n.map(e=>{let n=e.data??{},a=r(n[t.parentField]),o=a&&typeof a==`object`?a.id??null:a||null;return{id:e.id,name:i(n[t.nameField||`name`])||i(n.name)||`Untitled`,title:t.titleField?i(n[t.titleField]):``,photo:t.photoField&&r(n[t.photoField])||``,parent:t.parentField?o:null,cv:t.cvField?i(n[t.cvField]):``,href:t.hrefField?i(n[t.hrefField]):``}})}var $t={size:36,pad:10};function en({node:e,onClose:t}){return(0,l.useEffect)(()=>{let e=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,M.jsx)(`div`,{onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":e.name,style:{position:`fixed`,inset:0,zIndex:1e3,background:`rgba(15, 23, 42, 0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16},children:(0,M.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{background:`var(--page-bg, #ffffff)`,color:`var(--page-text, #111827)`,borderRadius:14,maxWidth:420,width:`100%`,maxHeight:`80vh`,overflowY:`auto`,padding:24,position:`relative`,boxShadow:`0 24px 64px rgba(15, 23, 42, 0.35)`},children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:t,style:{position:`absolute`,top:10,right:10,width:30,height:30,border:0,borderRadius:8,background:`transparent`,color:`inherit`,fontSize:18,lineHeight:1,cursor:`pointer`,opacity:.6},children:`×`}),(0,M.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,M.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,M.jsxs)(`div`,{style:{minWidth:0},children:[(0,M.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,M.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,M.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,M.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,style:{display:`inline-block`,marginTop:6,padding:`8px 14px`,borderRadius:8,fontSize:13,fontWeight:600,textDecoration:`none`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:`Open profile ↗`})]})})}function tn({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,size:c=`medium`,horizontal:u=!1,style:d,nodeRef:f,interactive:p=!0}){let h=(0,l.useId)(),[g,_]=(0,l.useState)(null),{tenant:v,apiUrl:y}=(0,l.useContext)(_e),b=(0,l.useContext)(ve)?.[t],[x,S]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||b)return;let e=!0;return fetch(`${y}/dynamic/${encodeURIComponent(t)}`,{headers:v?{"x-tenant":v}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&S(n)}).catch(()=>e&&S([])),()=>{e=!1}},[t,v,y,b]);let C=t?Qt(b??x??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s}):e,w=qt(c),{boxes:T,links:E,width:ee,height:D}=Jt(C,{size:c,horizontal:u});if(!T.length)return!p&&t?(0,M.jsxs)(`div`,{ref:f,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...m(d)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let te=new Set(T.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,M.jsxs)(`div`,{ref:f,style:{maxWidth:`100%`,overflowX:`auto`,...m(d)},children:[(0,M.jsxs)(`svg`,{viewBox:`0 0 ${ee} ${D}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:ee,height:`auto`,margin:`0 auto`},children:[E.map((e,t)=>(0,M.jsx)(`path`,{d:u?`M ${e.from.x} ${e.from.y} H ${(e.from.x+e.to.x)/2} V ${e.to.y} H ${e.to.x}`:`M ${e.from.x} ${e.from.y} V ${(e.from.y+e.to.y)/2} H ${e.to.x} V ${e.to.y}`,fill:`none`,stroke:`rgba(148, 163, 184, 0.7)`,strokeWidth:`1.5`},t)),T.map(({node:e,x:t,y:n})=>{let r=te.has(e.id),i=!!e.color2,a=!!e.color||r||i,o=e.color||(r?`var(--page-accent, #4f46e5)`:`var(--page-bg, #ffffff)`),s=e.color?Xt(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?Xt(e.color2):s,l=p&&(Zt(e)||e.href),u=()=>Zt(e)?_(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+$t.pad+w.avatar+8:t+w.w/2,f=e.photo?`start`:`middle`,m=e.photo?Math.floor((w.w-w.avatar-26)/7):Math.floor(w.w/7.6),g=w.h/2,v=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,M.jsxs)(`g`,{onClick:l?u:void 0,style:l?{cursor:`pointer`}:void 0,role:l?`button`:void 0,"aria-label":l?`Open ${e.name||e.title}'s profile`:void 0,children:[i&&e.gradient?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`linearGradient`,{id:`${h}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,M.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,M.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:`url(#${h}-${e.id}-grad)`})]}):i?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${h}-${e.id}-box`,children:(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`})}),(0,M.jsxs)(`g`,{clipPath:`url(#${h}-${e.id}-box)`,children:[(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:g,fill:o}),(0,M.jsx)(`rect`,{x:t,y:n+g,width:w.w,height:w.h-g,fill:e.color2})]})]}):(0,M.jsx)(`rect`,{x:t,y:n,width:w.w,height:w.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`clipPath`,{id:`${h}-${e.id}`,children:(0,M.jsx)(`circle`,{cx:t+$t.pad+w.avatar/2,cy:n+w.h/2,r:w.avatar/2})}),(0,M.jsx)(`image`,{href:e.photo,x:t+$t.pad,y:n+(w.h-w.avatar)/2,width:w.avatar,height:w.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${h}-${e.id})`})]}),i&&!e.gradient?(0,M.jsxs)(M.Fragment,{children:[e.title&&(0,M.jsx)(`text`,{x:d,y:n+g/2+w.title*.35,textAnchor:f,fontSize:w.title,fontWeight:`600`,fill:s,children:Yt(e.title,m+4)}),e.name&&(0,M.jsx)(`text`,{x:d,y:n+g+g/2+w.name*.35,textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:c,children:Yt(e.name,m)})]}):(0,M.jsxs)(M.Fragment,{children:[v[0]&&(0,M.jsx)(`text`,{x:d,y:n+(v[1]?w.h*.43:w.h*.57),textAnchor:f,fontSize:w.name,fontWeight:`600`,fill:s,children:Yt(v[0],m)}),v[1]&&(0,M.jsx)(`text`,{x:d,y:n+w.h*.73,textAnchor:f,fontSize:w.title,opacity:`0.7`,fill:s,children:Yt(v[1],m+4)})]})]},e.id)})]}),g&&(0,M.jsx)(en,{node:g,onClose:()=>_(null)})]})}function nn({columns:e=[],rows:t=[],source:n,limit:r=10,striped:i=!0,bordered:a=!1,compact:o=!1,paged:s,emptyText:c,style:u,nodeRef:d}){let{tenant:f,apiUrl:p}=(0,l.useContext)(_e),h=(0,l.useContext)(ve),g=h?.[n],_=s?ye(h):1,[v,y]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!n||g)return;let e=!0,t=Math.max(1,Number(r)||10),i=s&&!n.startsWith(`api:`)?`?offset=${(_-1)*t}&limit=${t}`:``,a=n.startsWith(`api:`)?`${p}/data/${encodeURIComponent(n.slice(4))}`:`${p}/dynamic/${encodeURIComponent(n)}${i}`;return fetch(a,{headers:f?{"x-tenant":f}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];return e&&y(n)}).catch(()=>e&&y([])),()=>{e=!1}},[n,f,p,g,s,_,r]),!e.length)return null;let b=Math.max(1,Number(r)||10),x=n?s?g||n.startsWith(`api:`)?(g??v??[]).slice((_-1)*b,_*b):(v??[]).slice(0,b):(g??v??[]).slice(0,b):null,S=x?x.map(t=>e.map(e=>we(Se(t?.data,e.field)))):t,C=!!n&&!(n&&!g&&v===null)&&S.length===0,w=o?`6px 10px`:`10px 14px`,T=`1px solid rgba(148, 163, 184, 0.35)`,E=a?{border:T}:{borderBottom:T};return(0,M.jsx)(`div`,{ref:d,style:{width:`100%`,overflowX:`auto`,...m(u)},children:(0,M.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:14,...a?{border:T}:{}},children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:e.map((e,t)=>(0,M.jsx)(`th`,{style:{textAlign:`left`,fontWeight:600,padding:w,background:`rgba(148, 163, 184, 0.12)`,...E},children:e.label??e},t))})}),(0,M.jsxs)(`tbody`,{children:[C&&(0,M.jsx)(`tr`,{children:(0,M.jsx)(`td`,{colSpan:e.length,style:{padding:w,textAlign:`center`,opacity:.6,...E},children:c||`No data yet`})}),S.map((t,n)=>(0,M.jsx)(`tr`,{style:i&&n%2==1?{background:`rgba(148, 163, 184, 0.07)`}:void 0,children:e.map((e,n)=>(0,M.jsx)(`td`,{style:{padding:w,...E},children:t?.[n]??``},n))},n))]})]})})}var rn={PageRoot:Ne,Section:Pe,Container:Fe,Heading:Ie,TextBlock:Je,ButtonBlock:Ze,ImageBlock:Qe,Spacer:it,Divider:at,SliderBlock:dt,CanvasSlider:ft,TabsBlock:_t,QuickStack:Vt,CollectionList:Ht,BreadcrumbsBlock:Ut,PaginationBlock:Wt,StepperBlock:Gt,OrgChartBlock:tn,TableBlock:nn,MasonryBlock:pt,AccordionBlock:vt,NavbarBlock:gt,ListBlock:qe,TextSpan:Be,QuoteBlock:Ke,TextLink:Xe,RichTextBlock:We,RichContentBlock:We,VideoBlock:$e,YouTubeBlock:tt,IframeBlock:nt,EmbedBlock:rt,FormBlock:kt,FormLabel:Pt,FormInput:Ft,FormTextarea:It,FormCheckbox:e=>(0,M.jsx)(Lt,{kind:`checkbox`,...e}),FormRadio:e=>(0,M.jsx)(Lt,{kind:`radio`,...e}),FormSelect:Rt,FormFile:zt,FormRecaptcha:Nt,FormSubmit:Bt},an={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},on=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}}),sn=()=>{let e=(0,l.useContext)(on);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function cn({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(_e),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,[c,u]=(0,l.useState)(t??null),[d,f]=(0,l.useState)(t?`user`:n?`guest`:`idle`),p=(0,l.useRef)(!1),m=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),h=(0,l.useCallback)(()=>n?Promise.resolve(null):m(`/site/me`).then(e=>e.ok?e.json():null).then(e=>{let t=e?.payload??null;return u(t),f(t?`user`:`guest`),t}).catch(()=>(u(null),f(`guest`),null)),[m,n]),g=(0,l.useCallback)(()=>m(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{u(null),f(`guest`)}),[m]),_=(0,l.useCallback)(()=>{p.current||n||t||(p.current=!0,f(`loading`),h())},[n,t,h]),v=(0,l.useMemo)(()=>({user:c,status:d,ensure:_,refresh:h,signOut:g}),[c,d,_,h,g]);return(0,M.jsx)(on.Provider,{value:v,children:e})}function ln({when:e,children:t}){let{status:n}=sn();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function un({mode:e=`login`,redirect:t,emailLabel:n=`Email`,passwordLabel:r=`Password`,nameLabel:i=`Name`,submitLabel:a,style:o,nodeRef:s,inert:c,linked:u,show:d}){let{tenant:f,apiUrl:p,settings:h}=(0,l.useContext)(_e),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(``),[b,x]=(0,l.useState)(!1),S=e===`register`,C=c?d||`form`:g,w=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,T=async e=>{if(e.preventDefault(),c)return;let n=new FormData(e.currentTarget);x(!0),y(``);try{let e=await fetch(`${p||`/api`}/site/${S?`register`:`login`}`,{method:`post`,headers:{"content-type":`application/json`,...f?{"x-tenant":f}:{}},credentials:`same-origin`,body:JSON.stringify({email:n.get(`email`),password:n.get(`password`),...S?{name:n.get(`name`)||``}:{}})}),r=await e.json().catch(()=>null);if(!e.ok||r?.success===!1){y(r?.error?.message||`Sign-in failed`),_(`error`),x(!1);return}if(_(`success`),typeof window<`u`){let e=w(t)||w(new URLSearchParams(window.location.search).get(`next`))||w(h?.[`site.authRedirect`])||w(h?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{y(`Sign-in failed`),_(`error`),x(!1)}};return(0,M.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...m(o)},children:[(0,M.jsxs)(`form`,{onSubmit:T,style:{display:C===`form`?`grid`:`none`,gap:10},children:[S?(0,M.jsxs)(`label`,{style:{...bt,display:`grid`,gap:6},children:[i,(0,M.jsx)(`input`,{name:`name`,type:`text`,style:xt,...Ct(c)})]}):null,(0,M.jsxs)(`label`,{style:{...bt,display:`grid`,gap:6},children:[n,(0,M.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:xt,...Ct(c)})]}),(0,M.jsxs)(`label`,{style:{...bt,display:`grid`,gap:6},children:[r,(0,M.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:xt,...Ct(c)})]}),(0,M.jsx)(`button`,{type:c?`button`:`submit`,disabled:b||void 0,style:{...Oe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:b?.6:1},children:a||(S?`Create account`:`Sign in`)}),v?(0,M.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:v}):null]}),(0,M.jsx)(`div`,{style:{display:C===`success`?`block`:`none`},children:u?.success??null}),(0,M.jsx)(`div`,{style:{display:C===`error`?`block`:`none`},children:u?.error??null})]})}function dn({greeting:e=`Hi`,signOutLabel:t=`Sign out`,showEmail:n=!1,style:r,nodeRef:i,inert:a,linked:o,show:s}){let{user:c,status:l,signOut:u}=sn(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,M.jsx)(`div`,{ref:i,style:{minHeight:24,...m(r)}}):d===`user`?(0,M.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...m(r)},children:[(0,M.jsxs)(`span`,{style:{...bt,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,M.jsx)(`span`,{style:{...bt,opacity:.7},children:f.email}):null,(0,M.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...Oe,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...Ct(a),children:t})]}):(0,M.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...m(r)},children:o?.signedOut??null})}var fn=[an],pn={SiteLoginForm:un,SiteAccountMenu:dn};new Set(fn.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var mn=new Map;function hn(e){if(mn.has(e))return mn.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return mn.set(e,n),n}function gn(e){let t=e&&typeof e==`object`?e.builder_plugins:null,n=t&&typeof t==`object`?t.plugins:null;return n&&typeof n==`object`?n:{}}async function _n(e,t){let n=await hn(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var vn={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function yn({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(_e),o=gn(a?.settings)[e],s=(0,l.useRef)(null),c=(0,l.useRef)(null),u={tenant:a?.tenant??``,apiUrl:a?.apiUrl??`/api`,locale:a?.locale??``,settings:a?.settings??null},d=(0,l.useRef)(u);d.current=u;let f=JSON.stringify(n??{});return(0,l.useEffect)(()=>{let e=s.current;if(!o?.code||!e)return;let n=!0;return _n(o.code,t).then(e=>{if(!(!n||!e||!s.current)){c.current=e;try{e.mount(s.current,JSON.parse(f),d.current)}catch{c.current=null}}}).catch(()=>{}),()=>{n=!1;let t=c.current;c.current=null;try{t?.unmount?.(e)}catch{}e&&(e.innerHTML=``)}},[o?.code,t]),(0,l.useEffect)(()=>{let e=c.current,t=s.current;if(!(!e||!t))try{e.update?e.update(t,JSON.parse(f),d.current):(e.unmount?.(t),t.innerHTML=``,e.mount(t,JSON.parse(f),d.current))}catch{}},[f]),o?(0,M.jsx)(`div`,{ref:i,style:m(r),children:(0,M.jsx)(`div`,{ref:s})}):(0,M.jsxs)(`div`,{ref:i,style:{...vn,...m(r)},children:[`Plugin “`,e,`” is not installed`]})}var bn={...rn,...pn,PluginBlock:yn};function xn(e,t,n,r=new Set,i=void 0){let a=t[e];if(!a||a.hidden)return null;let o=a.type?.resolvedName,s=i?.mapProps?i.mapProps(a.props??{},o):a.props??{};if(o===`ComponentInstance`){let t=a.props?.componentId,o=n?.[t];if(!o?.template||r.has(t))return null;let s=new Set(r).add(t);return(0,M.jsx)(l.Fragment,{children:xn(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=bn[o];if(!c)return null;let u=(a.nodes??[]).map(e=>xn(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,i])=>[e,xn(i,t,n,r)])):void 0,p=(0,M.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),v(t,s))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,M.jsx)(ln,{when:s.when,children:p},e):p}var Sn=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `);function Cn({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,tenant:o,apiUrl:s,datasets:c,locale:u,direction:d,settings:f,siteUser:p}){let m=a?.js?.trim();if((0,l.useEffect)(()=>{if(!m)return;let e=document.createElement(`script`);return e.text=m,document.body.appendChild(e),()=>e.remove()},[m]),!e?.ROOT)return null;let h={lang:u||void 0,dir:he(d,u)},g=`.webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }`,_={minHeight:`100%`,display:`flex`,flexDirection:`column`},v=xn(`ROOT`,e,n),y=(0,l.useMemo)(()=>({render:(t,r)=>xn(t,e,n,void 0,{mapProps:r})}),[e,n]),b=E(e,n),x=T(e,n),S=a?.css?.trim(),C=fe(e,n).map(e=>(0,M.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:A(e)},e));if(r!==`auto`)return(0,M.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`,locale:u||``,settings:f??null},children:(0,M.jsx)(cn,{initialUser:p,children:(0,M.jsx)(ve.Provider,{value:c??null,children:(0,M.jsx)(be.Provider,{value:y,children:(0,M.jsxs)(`div`,{...h,className:`webim-page`,style:{..._,...O(t,r),...i},children:[C,(0,M.jsx)(`style`,{children:g}),b&&(0,M.jsx)(`style`,{children:b}),x&&(0,M.jsx)(`style`,{children:x}),S&&(0,M.jsx)(`style`,{children:S}),v]})})})})});let w=ae(t);return(0,M.jsx)(_e.Provider,{value:{tenant:o||``,apiUrl:s||`/api`,locale:u||``,settings:f??null},children:(0,M.jsx)(cn,{initialUser:p,children:(0,M.jsx)(ve.Provider,{value:c??null,children:(0,M.jsx)(be.Provider,{value:y,children:(0,M.jsxs)(`div`,{...h,className:`webim-page`,style:{..._,...se(t),...i},children:[(0,M.jsx)(`style`,{children:`.webim-page { ${Sn(oe(w.light))} }
|
|
14
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Sn(oe(w.dark))} } }`}),C,(0,M.jsx)(`style`,{children:g}),b&&(0,M.jsx)(`style`,{children:b}),x&&(0,M.jsx)(`style`,{children:x}),S&&(0,M.jsx)(`style`,{children:S}),v]})})})})})}function wn({bundle:e,mode:t=`auto`,style:n}){return e?.blocks?.ROOT?(0,M.jsx)(Cn,{blocks:e.blocks,theme:e.theme,components:e.components,custom:e.custom,tenant:e.tenant,apiUrl:e.apiUrl,datasets:e.datasets,locale:e.locale,direction:e.direction,settings:e.settings,mode:t,style:n}):null}function Tn({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a,mode:o=`auto`,style:s,fallback:c=null,errorFallback:u=null,onLoad:d,onError:f}){let[p,m]=(0,l.useState)({status:`loading`}),h=(0,l.useRef)({onLoad:d,onError:f});return h.current={onLoad:d,onError:f},(0,l.useEffect)(()=>{let o=!0;return m({status:`loading`}),ue({apiUrl:e,tenant:t,slug:n,locale:r,preview:i,token:a}).then(e=>{o&&(m({status:`ready`,bundle:e}),h.current.onLoad?.(e))}).catch(e=>{o&&(m({status:`error`,error:e}),h.current.onError?.(e))}),()=>{o=!1}},[e,t,n,r,i,a]),p.status===`loading`?c:p.status===`error`?typeof u==`function`?u(p.error):u:(0,M.jsx)(wn,{bundle:p.bundle,mode:o,style:s})}function En(e,t={}){let n=(0,u.createRoot)(e);return n.render((0,M.jsx)(Tn,{apiUrl:t.apiUrl||t.api,tenant:t.tenant,slug:t.slug,locale:t.locale||void 0,token:t.token||void 0,mode:t.mode||`auto`,onError:e=>console.error(`[webim-embed]`,t.slug,e)})),n}function Dn(e=document){for(let t of e.querySelectorAll(`[data-webim-page]:not([data-webim-mounted])`))t.setAttribute(`data-webim-mounted`,``),En(t,t.dataset)}var On=document.currentScript,kn=()=>{if(Dn(),On?.dataset.slug){let e=document.createElement(`div`);e.setAttribute(`data-webim-mounted`,``),On.parentElement&&On.parentElement!==document.head?On.insertAdjacentElement(`beforebegin`,e):document.body.appendChild(e),En(e,On.dataset)}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,kn,{once:!0}):kn(),window.WebimEmbed={mount:En,scan:Dn}})();
|
package/build/webim-ssr.js
CHANGED
|
@@ -713,6 +713,39 @@ function we(e = [], t, n) {
|
|
|
713
713
|
border: 0,
|
|
714
714
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
715
715
|
} }, n);
|
|
716
|
+
if (t.type === "table") {
|
|
717
|
+
let e = Array.isArray(t.rows) ? t.rows.filter(Array.isArray) : [];
|
|
718
|
+
if (!e.length) return null;
|
|
719
|
+
let r = t.header !== !1, a = {
|
|
720
|
+
border: t.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
|
|
721
|
+
padding: "6px 10px",
|
|
722
|
+
textAlign: "left",
|
|
723
|
+
verticalAlign: "top"
|
|
724
|
+
}, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null;
|
|
725
|
+
return /* @__PURE__ */ f("table", {
|
|
726
|
+
style: {
|
|
727
|
+
...i,
|
|
728
|
+
borderCollapse: "collapse",
|
|
729
|
+
width: "100%",
|
|
730
|
+
fontSize: "inherit",
|
|
731
|
+
tableLayout: s ? "fixed" : void 0
|
|
732
|
+
},
|
|
733
|
+
children: [
|
|
734
|
+
s && /* @__PURE__ */ d("colgroup", { children: s.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
735
|
+
r && /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e[0].map((e, t) => /* @__PURE__ */ d("th", {
|
|
736
|
+
style: {
|
|
737
|
+
...a,
|
|
738
|
+
fontWeight: 700
|
|
739
|
+
},
|
|
740
|
+
children: e
|
|
741
|
+
}, t)) }) }),
|
|
742
|
+
/* @__PURE__ */ d("tbody", { children: o.map((e, t) => /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("td", {
|
|
743
|
+
style: a,
|
|
744
|
+
children: e
|
|
745
|
+
}, t)) }, t)) })
|
|
746
|
+
]
|
|
747
|
+
}, n);
|
|
748
|
+
}
|
|
716
749
|
if (t.type === "ul" || t.type === "ol") {
|
|
717
750
|
let e = t.type;
|
|
718
751
|
return /* @__PURE__ */ d(e, {
|
|
@@ -1994,24 +2027,36 @@ function st({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1994
2027
|
]
|
|
1995
2028
|
});
|
|
1996
2029
|
}
|
|
1997
|
-
var
|
|
1998
|
-
|
|
1999
|
-
if (
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
|
|
2030
|
+
var Q = null, ct = null, lt = (e) => {
|
|
2031
|
+
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2032
|
+
if (Q && ct === t) return Q;
|
|
2033
|
+
if (Q && typeof window < "u") {
|
|
2034
|
+
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2035
|
+
delete window[e];
|
|
2036
|
+
} catch {
|
|
2037
|
+
window[e] = void 0;
|
|
2038
|
+
}
|
|
2039
|
+
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2040
|
+
}
|
|
2041
|
+
return ct = t, Q = new Promise((e) => {
|
|
2042
|
+
if (typeof window > "u") return;
|
|
2043
|
+
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2044
|
+
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2045
|
+
let n = document.createElement("script");
|
|
2046
|
+
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2047
|
+
}), Q;
|
|
2048
|
+
};
|
|
2049
|
+
function ut({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l }) {
|
|
2050
|
+
let u = i(H), p = u?.settings && typeof u.settings == "object" ? u.settings["google.recaptchaKey"] : "", m = typeof e == "string" && e.trim() || (typeof p == "string" ? p.trim() : ""), h = c(null);
|
|
2006
2051
|
if (a(() => {
|
|
2007
|
-
if (
|
|
2052
|
+
if (l || !m || !h.current) return;
|
|
2008
2053
|
let e = !0;
|
|
2009
|
-
return lt().then((r) => {
|
|
2010
|
-
if (!(!e || h.current || !
|
|
2011
|
-
h.current =
|
|
2054
|
+
return lt(r).then((r) => {
|
|
2055
|
+
if (!(!e || !h.current || !r?.render)) {
|
|
2056
|
+
h.current.innerHTML = "";
|
|
2012
2057
|
try {
|
|
2013
|
-
r.render(
|
|
2014
|
-
sitekey:
|
|
2058
|
+
r.render(h.current, {
|
|
2059
|
+
sitekey: m,
|
|
2015
2060
|
theme: t === "dark" ? "dark" : "light",
|
|
2016
2061
|
size: n === "compact" ? "compact" : "normal"
|
|
2017
2062
|
});
|
|
@@ -2021,15 +2066,16 @@ function ut({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
|
2021
2066
|
e = !1;
|
|
2022
2067
|
};
|
|
2023
2068
|
}, [
|
|
2024
|
-
|
|
2025
|
-
|
|
2069
|
+
l,
|
|
2070
|
+
m,
|
|
2026
2071
|
t,
|
|
2027
|
-
n
|
|
2028
|
-
|
|
2072
|
+
n,
|
|
2073
|
+
r
|
|
2074
|
+
]), l) {
|
|
2029
2075
|
let e = t === "dark";
|
|
2030
2076
|
return /* @__PURE__ */ f("div", {
|
|
2031
|
-
ref:
|
|
2032
|
-
style: C(
|
|
2077
|
+
ref: s,
|
|
2078
|
+
style: C(o),
|
|
2033
2079
|
children: [/* @__PURE__ */ f("div", {
|
|
2034
2080
|
style: {
|
|
2035
2081
|
width: n === "compact" ? 164 : 302,
|
|
@@ -2068,7 +2114,7 @@ function ut({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
|
2068
2114
|
children: "reCAPTCHA"
|
|
2069
2115
|
})
|
|
2070
2116
|
]
|
|
2071
|
-
}), !
|
|
2117
|
+
}), !m && /* @__PURE__ */ d("div", {
|
|
2072
2118
|
style: {
|
|
2073
2119
|
marginTop: 6,
|
|
2074
2120
|
fontSize: 11,
|
|
@@ -2078,10 +2124,10 @@ function ut({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
|
2078
2124
|
})]
|
|
2079
2125
|
});
|
|
2080
2126
|
}
|
|
2081
|
-
return
|
|
2082
|
-
ref:
|
|
2083
|
-
style: C(
|
|
2084
|
-
children: /* @__PURE__ */ d("div", { ref:
|
|
2127
|
+
return m ? /* @__PURE__ */ d("div", {
|
|
2128
|
+
ref: s,
|
|
2129
|
+
style: C(o),
|
|
2130
|
+
children: /* @__PURE__ */ d("div", { ref: h })
|
|
2085
2131
|
}) : null;
|
|
2086
2132
|
}
|
|
2087
2133
|
function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
@@ -3434,7 +3480,7 @@ var Xt = {
|
|
|
3434
3480
|
...Ut,
|
|
3435
3481
|
PluginBlock: Yt
|
|
3436
3482
|
};
|
|
3437
|
-
function
|
|
3483
|
+
function $(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
3438
3484
|
let o = n[e];
|
|
3439
3485
|
if (!o || o.hidden) return null;
|
|
3440
3486
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -3442,11 +3488,11 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3442
3488
|
let n = o.props?.componentId, s = r?.[n];
|
|
3443
3489
|
if (!s?.template || i.has(n)) return null;
|
|
3444
3490
|
let c = new Set(i).add(n);
|
|
3445
|
-
return /* @__PURE__ */ d(t, { children:
|
|
3491
|
+
return /* @__PURE__ */ d(t, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
3446
3492
|
}
|
|
3447
3493
|
let l = Xt[s];
|
|
3448
3494
|
if (!l) return null;
|
|
3449
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
3495
|
+
let u = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
3450
3496
|
...c,
|
|
3451
3497
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
3452
3498
|
linked: p,
|
|
@@ -3477,7 +3523,7 @@ function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3477
3523
|
minHeight: "100%",
|
|
3478
3524
|
display: "flex",
|
|
3479
3525
|
flexDirection: "column"
|
|
3480
|
-
}, w =
|
|
3526
|
+
}, w = $("ROOT", e, n), T = s(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
|
|
3481
3527
|
rel: "stylesheet",
|
|
3482
3528
|
precedence: "default",
|
|
3483
3529
|
href: _(e)
|
|
@@ -3631,40 +3677,40 @@ async function nn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
3631
3677
|
}
|
|
3632
3678
|
//#endregion
|
|
3633
3679
|
//#region src/ssr.jsx
|
|
3634
|
-
var
|
|
3680
|
+
var rn = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
3635
3681
|
"&": "&",
|
|
3636
3682
|
"<": "<",
|
|
3637
3683
|
">": ">",
|
|
3638
3684
|
"\"": """
|
|
3639
3685
|
})[e]);
|
|
3640
|
-
function
|
|
3686
|
+
function an(t, { mode: n = "auto", style: r } = {}) {
|
|
3641
3687
|
return e(/* @__PURE__ */ d($t, {
|
|
3642
3688
|
bundle: t,
|
|
3643
3689
|
mode: n,
|
|
3644
3690
|
style: r
|
|
3645
3691
|
}));
|
|
3646
3692
|
}
|
|
3647
|
-
function
|
|
3693
|
+
function on(e, { mode: t = "auto", lang: n } = {}) {
|
|
3648
3694
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
3649
3695
|
"<meta charset=\"utf-8\"/>",
|
|
3650
3696
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
3651
|
-
`<title>${
|
|
3652
|
-
r.description && `<meta name="description" content="${
|
|
3653
|
-
`<meta property="og:title" content="${
|
|
3654
|
-
r.image && `<meta property="og:image" content="${
|
|
3697
|
+
`<title>${rn(o)}</title>`,
|
|
3698
|
+
r.description && `<meta name="description" content="${rn(r.description)}"/>`,
|
|
3699
|
+
`<meta property="og:title" content="${rn(o)}"/>`,
|
|
3700
|
+
r.image && `<meta property="og:image" content="${rn(r.image)}"/>`,
|
|
3655
3701
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
3656
3702
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
3657
3703
|
].filter(Boolean).join("\n");
|
|
3658
3704
|
return `<!doctype html>
|
|
3659
|
-
<html lang="${
|
|
3705
|
+
<html lang="${rn(i)}"${a ? ` dir="${a}"` : ""}>
|
|
3660
3706
|
<head>
|
|
3661
3707
|
${c}
|
|
3662
3708
|
</head>
|
|
3663
3709
|
<body>
|
|
3664
|
-
${
|
|
3710
|
+
${an(e, { mode: t })}
|
|
3665
3711
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
3666
3712
|
</body>
|
|
3667
3713
|
</html>`;
|
|
3668
3714
|
}
|
|
3669
3715
|
//#endregion
|
|
3670
|
-
export { en as assembleBundle, nn as fetchPage,
|
|
3716
|
+
export { en as assembleBundle, nn as fetchPage, an as renderBundleHtml, on as renderPageDocument };
|