webim-adapter 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/README.md +24 -0
- package/build/webim-adapter.js +438 -300
- package/build/webim-embed.js +7 -7
- package/build/webim-ssr.js +488 -350
- package/package.json +15 -9
package/build/webim-embed.js
CHANGED
|
@@ -12,7 +12,7 @@ Error generating stack: `+e.message+`
|
|
|
12
12
|
`)}var oe=[{key:`tablet`,max:991},{key:`mobileLandscape`,max:767},{key:`mobile`,max:478}],se=e=>Object.entries(k(e)).map(([e,t])=>`${ae(e)}: ${t} !important;`).join(` `);function ce(e,t){return oe.map(({key:n,max:r})=>{let i=t?.[n]?se(t[n]):``;return i?`@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }`:``}).filter(Boolean).join(`
|
|
13
13
|
`)}function le(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=ce(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
|
|
14
14
|
`)}function ue(e,t){let n=[],r=e=>{for(let[t,r]of Object.entries(e||{})){let e=L(t,r.props);e&&n.push(e)}};r(e);for(let e of Object.values(t||{}))r(e.template?.nodes);return n.join(`
|
|
15
|
-
`)}var de=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,fe={fontFamily:de,fontStyle:`normal`,fontWeight:400,letterSpacing:`normal`,textTransform:`none`,lineHeight:1.4,textShadow:`none`},pe={light:{background:`#f2f2f2`,surface:`#f2f2f2`,border:`#d1d5db`,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`,surface:`#1e293b`,border:`rgba(226, 232, 240, 0.18)`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},me={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16},he={font:`system`,headingFont:`inherit`,headings:me,bodySize:16,light:pe.light,dark:pe.dark},ge={system:{label:`System`,value:de},inter:{label:`Inter`,value:`"Inter", ${de}`},outfit:{label:`Outfit`,value:`"Outfit", ${de}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},_e=(e,t)=>ge[e]?.value??_(e)??(typeof e==`string`&&e.trim()?`"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`:t),ve=(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 ye(e){let{light:t,dark:n,font:r,headingFont:i,headings:a,bodySize:o,...s}=e??{};return{font:r??he.font,headingFont:i??he.headingFont,headings:{...me,...a??{}},bodySize:o??16,light:ve(pe.light,s,t),dark:ve(pe.dark,n)}}function be(e){return{"--page-bg":e.background,"--page-surface":e.surface??e.background,"--page-border":e.border??pe.light.border,"--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 xe(e){let t=ye(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:_e(t.font,de),"--page-heading-font":t.headingFont===`inherit`?`inherit`:_e(t.headingFont,`inherit`),...Ce(t.headings),"--page-body-size":Se(t.bodySize,16)}}function Se(e,t){return e===``||e==null?`${t}px`:isNaN(Number(e))?String(e):`${Number(e)}px`}function Ce(e){let t={};for(let n of Object.keys(me)){let r=e?.[n]??me[n];t[`--page-${n}`]=Se(r,me[n])}return t}function we(e,t=`light`){let n=ye(e);return{...xe(e),...be(n[t]??n.light)}}function Te(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function R(e,t){return e===`light`||e===`dark`?e:t===`light`||t===`dark`?t:`auto`}function z({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:Te(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,animations:o.animations,seo:o.seo,direction:o.direction,scheme:o.scheme,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var Ee=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 De({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(Ee),c(`${l}/settings/public`,{headers:u}).then(Ee)]),p=z({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:[`TableBlock`,`OrgChartBlock`,`NavbarBlock`,`CalendarBlock`,`MasonryBlock`,`LogoCarousel`].includes(e?.type?.resolvedName)?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(Ee).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}var Oe=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),ke=e=>Oe.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,Ae=(e,t)=>e===`ltr`||e===`rtl`?e:t?ke(t):void 0,je=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})),B=e(((e,t)=>{t.exports=je()}))(),Me=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),Ne=(0,l.createContext)(null),Pe=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},Fe=()=>{if(typeof window>`u`)return{};let e={};return new URLSearchParams(window.location.search).forEach((t,n)=>{n.startsWith(`f_`)&&n.length>2&&t!==``&&(e[n.slice(2)]=t)}),e},Ie=e=>{let t={...e&&typeof e==`object`&&!Array.isArray(e)?e:{},...Fe()};return Object.fromEntries(Object.entries(t).filter(([,e])=>typeof e==`string`&&e.trim()!==``))},Le=(0,l.createContext)(null),Re=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function ze(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Be=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 Ve(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??``):typeof e==`object`&&!Array.isArray(e)&&Number.isFinite(Number(e.lat))&&Number.isFinite(Number(e.lng))?`${e.lat}, ${e.lng}`: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 He(e,t){let n=t?.data??{},r=Be(n);if(!r.length)return e;let i=RegExp(`:(${r.map(Re).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>Ve(ze(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 Ue={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},We=me,Ge=e=>`var(--page-${e}, ${me[e]??me.h2}px)`,Ke={margin:0,fontSize:`var(--page-body-size, 16px)`},qe={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},Je={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},Ye={display:`flex`,flexDirection:`column`};function Xe({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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,B.jsx)(`div`,{style:{...n,background:r}})]})}var Ze=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...k(e)}:{...t,...k(e)};function Qe({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`div`,{ref:t,style:{...Je,...k(e)},children:[(0,B.jsx)(Xe,{style:e}),n]})}function $e({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`section`,{ref:t,style:Ze(e,Ye),children:[(0,B.jsx)(Xe,{style:e}),n]})}function et({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,B.jsxs)(`div`,{ref:n,style:i?{...i,...Ze(e)}:Ze(e),children:[(0,B.jsx)(Xe,{style:e}),r]})}function tt({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,B.jsx)(n,{ref:a,style:{...Ue,fontSize:Ge(n),...k(r)},children:V(t,e,i)})}var nt={fontFamily:ge.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function rt(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,B.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,B.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,B.jsx)(`code`,{style:nt,children:i})),t.includes(`strike`)&&(i=(0,B.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,B.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,B.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,B.jsx)(`strong`,{children:i})),n?i=(0,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`,...t.includes(`nounderline`)&&{textDecoration:`none`}},children:i}):t.includes(`nounderline`)&&(i=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:i})),i}function V(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,B.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,B.jsx)(l.Fragment,{children:V(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,B.jsx)(`sup`,{children:r}):e.sub&&(r=(0,B.jsx)(`sub`,{children:r})),e.code&&(r=(0,B.jsx)(`code`,{style:nt,children:r})),e.strike&&(r=(0,B.jsx)(`s`,{children:r})),e.underline&&(r=(0,B.jsx)(`u`,{children:r})),e.italic&&(r=(0,B.jsx)(`em`,{children:r})),e.bold&&(r=(0,B.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,B.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href?r=(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`,...e.nounderline&&{textDecoration:`none`}},children:r}):e.nounderline&&(r=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:r})),(0,B.jsx)(l.Fragment,{children:r},t)}):t}function it({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,B.jsx)(`span`,{style:k(a),children:e?.length?V(e,t):rt(t,n,r,i)})}var at=[`left`,`center`,`right`,`justify`];function ot(e,t,n){let r=e&&e.cellStyles;if(!r||typeof r!=`object`||Array.isArray(r))return{};let i=r[`${t}:${n}`];return i&&typeof i==`object`&&!Array.isArray(i)?i:{}}function st(e,t){let n=e||{},r=typeof n.bold==`boolean`?n.bold:!!t;return{textAlign:at.includes(n.align)?n.align:`left`,fontWeight:r?700:400,fontStyle:n.italic?`italic`:void 0,color:typeof n.color==`string`&&n.color?n.color:void 0,backgroundColor:typeof n.bg==`string`&&n.bg?n.bg:void 0}}function ct({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 lt(e=[],t,n){let r=n??((e,n)=>V(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,B.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,B.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...ct(t)},children:[t.href?(0,B.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,B.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return bt(t.url)?(0,B.jsx)(`div`,{style:{...i,...ct({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,B.jsx)(xt,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`button`){if(!(typeof t.label==`string`&&t.label.trim()))return null;let e=Number.isFinite(Number(t.radius))?Number(t.radius):8,r=[`center`,`right`].includes(t.align)?t.align:`left`;return(0,B.jsx)(`div`,{style:{...i,textAlign:r},children:(0,B.jsx)(`table`,{role:`presentation`,cellPadding:0,cellSpacing:0,style:{borderCollapse:`separate`,display:`inline-table`},children:(0,B.jsx)(`tbody`,{children:(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{style:{backgroundColor:t.bg||`var(--page-accent, #4f46e5)`,borderRadius:e},children:(0,B.jsx)(`a`,{href:t.href||`#`,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`inline-block`,padding:`13px 24px`,color:t.color||`#ffffff`,fontSize:15,fontWeight:600,lineHeight:1.2,textDecoration:`none`,borderRadius:e},children:t.label})})})})})},n)}if(t.type===`divider`)return(0,B.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`,verticalAlign:`top`},o=r?e.slice(1):e,s=Array.isArray(t.widths)?t.widths:null,c=(e,n,r)=>({...a,...st(ot(t,e,n),r)});return(0,B.jsxs)(`table`,{style:{...i,borderCollapse:`collapse`,width:`100%`,fontSize:`inherit`,tableLayout:s?`fixed`:void 0},children:[s&&(0,B.jsx)(`colgroup`,{children:s.map((e,t)=>(0,B.jsx)(`col`,{style:{width:`${e}%`}},t))}),r&&(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:e[0].map((e,t)=>(0,B.jsx)(`th`,{style:c(0,t,!0),children:e},t))})}),(0,B.jsx)(`tbody`,{children:o.map((e,t)=>(0,B.jsx)(`tr`,{children:e.map((e,n)=>(0,B.jsx)(`td`,{style:c(r?t+1:t,n,!1),children:e},n))},t))})]},n)}if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,B.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,B.jsx)(`blockquote`,{style:{...dt,...i},children:r(t.parts,t.text)},n);if(We[t.type]){let e=t.type;return(0,B.jsx)(e,{style:{...Ue,fontSize:Ge(t.type),...i},children:r(t.parts,t.text)},n)}return(0,B.jsx)(`p`,{style:{...Ke,...i},children:r(t.parts,t.text)},n)})}function ut({content:e,style:t,linked:n,nodeRef:r}){return(0,B.jsx)(`div`,{ref:r,style:{display:`flow-root`,...k(t)},children:lt(e,n)})}var dt={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function ft({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`blockquote`,{ref:i,style:{...dt,...k(n)},children:V(t,e,r)})}function pt({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,B.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...k(n)},children:t.map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:V(e.parts,e.text)},t))})}function mt({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`p`,{ref:i,style:{...Ke,...k(n)},children:V(t,e,r)})}var ht={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function gt({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...ht,...k(i)},children:V(t,e,a)})}function _t({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...qe,...k(i)},children:V(t,e,a)})}function vt({src:e,alt:t,style:n,nodeRef:r}){return e?(0,B.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...k(n)}}):null}function yt({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,B.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%`,...k(o)}}):null}var bt=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function xt({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=bt(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,B.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...k(o)},children:(0,B.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 St({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,B.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...k(r)}}):null}function Ct({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,B.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:k(n)})}function wt({height:e,style:t,nodeRef:n}){return(0,B.jsx)(`div`,{ref:n,style:{height:e||32,flexShrink:0,alignSelf:`stretch`,...k(t)}})}function Tt({style:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...k(e)}})}function Et({style:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{flexShrink:0,...k(e)}})}var Dt={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},Ot={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)`}},kt=48;function At({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,m]=(0,l.useState)(null),h=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 g=t=>u((t+e)%e),_=()=>{if(!p)return;let{dx:e}=p;m(null),e<-48?g(h+1):e>kt&&g(h-1)};return(0,B.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),m({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>m(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:_,onPointerCancel:_,style:{position:`relative`,overflow:`hidden`,width:`100%`,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...k(o)},children:[(0,B.jsx)(`div`,{style:{display:`flex`,height:i,transform:`translateX(calc(${-h*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,B.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...Dt,left:12},onClick:()=>g(h-1),children:`‹`}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...Dt,right:12},onClick:()=>g(h+1),children:`›`}),(0,B.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,B.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>g(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===h?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var jt=(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 Mt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,B.jsx)(At,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:jt(i.image)}),(i.title||i.text)&&(0,B.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...Ot[t]??Ot.bottom},children:[i.title&&(0,B.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function Nt({slides:e=[],linked:t,...n}){return e.length?(0,B.jsx)(At,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:jt(r.image,r.color)}),(0,B.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}var Pt=256,Ft=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),It=(e,t,n)=>{let r=Pt*2**n;return{x:(Number(t)+180)/360*r,y:(.5-Ft(Number(e))/(2*Math.PI))*r}},Lt=(e,t)=>{if(e===``||e==null)return null;let n=Number(e);return Number.isFinite(n)&&Math.abs(n)<=t?n:null},Rt=e=>!!e&&Lt(e.lat,90)!==null&&Lt(e.lng,180)!==null;function zt(e,t,n=`directions`,r=``){let i=`${e},${t}`;return n===`place`?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r?`&query_place_id=`:``}`:`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`}var Bt=(e,t,n=13)=>`https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n)||13)}/${e}/${t}`;function Vt({markers:e,lat:t,lng:n,zoom:r=``,height:i=320,pinSize:a=22,pinLink:o=`directions`,link:s=!1,label:c=``,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(1200);(0,l.useEffect)(()=>{let e=p.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>h(t=>e.clientWidth&&e.clientWidth!==t?e.clientWidth:t);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let g=(Array.isArray(e)?e:[]).filter(Rt),_=Rt({lat:t,lng:n})?{lat:Lt(t,90),lng:Lt(n,180)}:g.length?{lat:g.reduce((e,t)=>e+Lt(t.lat,90),0)/g.length,lng:g.reduce((e,t)=>e+Lt(t.lng,180),0)/g.length}:null,v=Math.max(80,Number(i)||320),y=Lt(r,19)?Math.min(Math.max(Math.round(Number(r)),1),19):(()=>{if(g.length<2)return 13;for(let e=19;e>=1;e--){let t=g.map(t=>It(Lt(t.lat,90),Lt(t.lng,180),e)),n=Math.max(...t.map(e=>e.x))-Math.min(...t.map(e=>e.x)),r=Math.max(...t.map(e=>e.y))-Math.min(...t.map(e=>e.y));if(n<=m*.8&&r<=v*.7)return e}return 1})(),b={width:`100%`,...k(u)};if(!_)return(0,B.jsx)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:{...b,minHeight:80,display:`grid`,placeItems:`center`,fontSize:13,opacity:.6,border:`1px dashed var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:8},children:`Set the coordinates in Settings`});let x=It(_.lat,_.lng,y),S={x:x.x-m/2,y:x.y-v/2},C=[],w=[];for(let e=Math.floor(S.x/Pt);e<=Math.floor((S.x+m)/Pt);e++)C.push(e);for(let e=Math.floor(S.y/Pt);e<=Math.floor((S.y+v)/Pt);e++)w.push(e);let T=2**y;return(0,B.jsxs)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:b,children:[(0,B.jsxs)(`div`,{role:`img`,"aria-label":c||`Map`,style:{position:`relative`,height:v,overflow:`hidden`,borderRadius:`inherit`,background:`var(--page-surface, #e5e7eb)`},children:[w.map(e=>C.map(t=>{let n=(t%T+T)%T;return e<0||e>=T?null:(0,B.jsx)(`img`,{src:`https://tile.openstreetmap.org/${y}/${n}/${e}.png`,alt:``,width:Pt,height:Pt,loading:`lazy`,style:{position:`absolute`,left:Math.round(t*Pt-S.x),top:Math.round(e*Pt-S.y),width:Pt,height:Pt,userSelect:`none`,pointerEvents:`none`}},`${t}-${e}`)})),g.map((e,t)=>{let n=It(Lt(e.lat,90),Lt(e.lng,180),y),r=n.x-S.x,i=n.y-S.y,s=e.color||`var(--page-accent, #dc2626)`,c=o===`none`||f?null:zt(Lt(e.lat,90),Lt(e.lng,180),o,e.title);return(0,B.jsxs)(c?`a`:`span`,{href:c||void 0,target:c?`_blank`:void 0,rel:c?`noopener noreferrer`:void 0,title:c&&e.title||void 0,style:{position:`absolute`,left:r,top:i,transform:`translate(-50%, -100%)`,cursor:c?`pointer`:`default`,textDecoration:`none`,color:`inherit`},children:[e.title?(0,B.jsx)(`span`,{style:{position:`absolute`,left:`50%`,bottom:`100%`,transform:`translateX(-50%)`,marginBottom:4,padding:`3px 7px`,borderRadius:6,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.5))`,boxShadow:`0 2px 8px rgba(15, 23, 42, 0.25)`,fontSize:12,lineHeight:1.35,whiteSpace:`nowrap`},children:e.title}):null,(0,B.jsxs)(`svg`,{width:Math.max(10,Number(a)||22),height:Math.max(10,Number(a)||22),viewBox:`0 0 24 24`,fill:s,style:{display:`block`},children:[(0,B.jsx)(`path`,{d:`M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z`}),Ht[e.icon]?(0,B.jsx)(`path`,{d:Ht[e.icon],transform:`translate(12 10.5) scale(0.46) translate(-12 -12)`,fill:`none`,stroke:`#fff`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`}):(0,B.jsx)(`circle`,{cx:`12`,cy:`10.5`,r:`2.6`,fill:`#fff`})]})]},t)}),(0,B.jsx)(`a`,{href:`https://www.openstreetmap.org/copyright`,target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{position:`absolute`,right:4,bottom:3,padding:`1px 5px`,borderRadius:4,background:`rgba(255, 255, 255, 0.75)`,color:`#334155`,fontSize:10,textDecoration:`none`},children:`© OpenStreetMap`})]}),s?(0,B.jsx)(`a`,{href:Bt(_.lat,_.lng,y),target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{display:`inline-block`,marginTop:6,fontSize:12,color:`var(--page-accent, inherit)`},children:`View larger map`}):null]})}var Ht={check:`M4 12l5 5L20 6`,close:`M6 6l12 12M18 6L6 18`,plus:`M12 5v14M5 12h14`,minus:`M5 12h14`,"arrow-right":`M4 12h16M13 5l7 7-7 7`,"arrow-left":`M20 12H4M11 5l-7 7 7 7`,"arrow-up":`M12 20V4M5 11l7-7 7 7`,"arrow-down":`M12 4v16M5 13l7 7 7-7`,"chevron-right":`M9 5l7 7-7 7`,"chevron-left":`M15 5l-7 7 7 7`,"chevron-down":`M5 9l7 7 7-7`,"chevron-up":`M5 15l7-7 7 7`,menu:`M4 7h16M4 12h16M4 17h16`,star:`M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z`,heart:`M12 20s-7-4.4-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.6-7 9-7 9z`,home:`M4 11l8-7 8 7M6 10v9h12v-9`,user:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.3 3.6-5 8-5s8 1.7 8 5`,mail:`M3 6h18v12H3zM3 6l9 7 9-7`,phone:`M6 3h4l2 5-3 2a12 12 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2z`,search:`M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4.2-4.2`,clock:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2`,calendar:`M4 6h16v14H4zM4 10h16M8 3v4M16 3v4`,download:`M12 4v10M8 11l4 4 4-4M4 19h16`,upload:`M12 20V10M8 13l4-4 4 4M4 5h16`,play:`M8 5l11 7-11 7z`,pause:`M9 5v14M15 5v14`,info:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5M12 8h.01`,alert:`M12 4l9 16H3zM12 10v4M12 17h.01`,lock:`M6 11h12v9H6zM9 11V8a3 3 0 0 1 6 0v3`,chat:`M4 5h16v11H9l-5 4z`,"map-pin":`M12 21s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11zM12 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z`,camera:`M4 8h4l2-2h4l2 2h4v12H4zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z`,image:`M4 5h16v14H4zM8 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM6 17l5-5 4 4 2-2 3 3`,file:`M7 3h7l4 4v14H7zM14 3v5h4`,link:`M10 14a4 4 0 0 0 6 .5l2-2a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6-.5l-2 2a4 4 0 0 0 6 6l1-1`,external:`M14 4h6v6M20 4l-9 9M18 14v5H5V6h5`,trash:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`,edit:`M4 20h4L19 9l-4-4L4 16z`,filter:`M3 5h18l-7 8v6l-4-2v-4z`,refresh:`M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5`,globe:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18`,bell:`M6 16V11a6 6 0 1 1 12 0v5l2 3H4zM10 22h4`,tag:`M4 4h7l9 9-7 7-9-9zM8.5 8.5h.01`,cart:`M4 5h2l2 10h10l2-7H7M9 20h.01M18 20h.01`,card:`M3 6h18v12H3zM3 10h18`,shield:`M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z`,sun:`M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19`,moon:`M20 14a8 8 0 1 1-10-10 7 7 0 0 0 10 10z`,settings:`M12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM12 2l1 2.6 2.7-.6 1 2.5 2.6 1-.6 2.7L21 12l-2.3 1.8.6 2.7-2.6 1-1 2.5-2.7-.6L12 22l-1-2.6-2.7.6-1-2.5-2.6-1 .6-2.7L3 12l2.3-1.8-.6-2.7 2.6-1 1-2.5 2.7.6z`,eye:`M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,"eye-off":`M4 4l16 16M9.5 9.6A3 3 0 0 0 12 15c.8 0 1.5-.3 2.1-.8M6.6 6.7C3.9 8.3 2 12 2 12s4 7 10 7c1.9 0 3.5-.5 4.9-1.2M14.1 5.4C13.4 5.1 12.7 5 12 5`,share:`M8 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 6a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM7.8 10.8l8.4-3.6M7.8 13.2l8.4 3.6`,send:`M21 3L3 10l7 3 3 7z`,paperclip:`M20 11l-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L15 6`,video:`M3 7h11v10H3zM14 11l6-3v8l-6-3`,music:`M9 18V6l10-2v12M9 18a2.5 2.5 0 1 1-2.5-2.5H9M19 16a2.5 2.5 0 1 1-2.5-2.5H19`,mic:`M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3zM5 11a7 7 0 0 0 14 0M12 18v3`,headphones:`M4 15v-3a8 8 0 1 1 16 0v3M4 15h3v5H5a1 1 0 0 1-1-1zM20 15h-3v5h2a1 1 0 0 0 1-1z`,book:`M5 4h14v16H7a2 2 0 0 1-2-2zM7 4v14h12`,bookmark:`M7 4h10v16l-5-4-5 4z`,folder:`M4 6h5l2 2h9v10H4z`,cloud:`M7 18a4 4 0 0 1 .5-8 5.5 5.5 0 0 1 10.4 1.5A3.5 3.5 0 0 1 17.5 18z`,database:`M12 3c4.4 0 8 1.3 8 3s-3.6 3-8 3-8-1.3-8-3 3.6-3 8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3`,server:`M4 4h16v6H4zM4 14h16v6H4zM8 7h.01M8 17h.01`,code:`M9 8l-5 4 5 4M15 8l5 4-5 4`,terminal:`M4 5h16v14H4zM8 10l3 2-3 2M13 14h4`,wifi:`M5 12a10 10 0 0 1 14 0M8 15a6 6 0 0 1 8 0M12 19h.01`,battery:`M3 8h15v8H3zM21 11v2`,printer:`M7 8V4h10v4M7 16H4V8h16v8h-3M7 13h10v7H7z`,gift:`M4 10h16v10H4zM3 6h18v4H3zM12 6v14M12 6c-2 0-4-1-4-2.5S9 2 10 3s2 3 2 3zM12 6c2 0 4-1 4-2.5S15 2 14 3s-2 3-2 3z`,key:`M15 4a5 5 0 1 0-4.6 7L9 12.4V15H6.5L4 17.5V20h4l7-7A5 5 0 0 0 15 4z`,compass:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM15 9l-2 5-5 2 2-5z`,flag:`M5 21V4h13l-2 4 2 4H5`,award:`M12 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM9 13l-1 7 4-2 4 2-1-7`,chart:`M4 20V4M4 20h16M8 16v-5M12 16V8M16 16v-8`,pie:`M12 3a9 9 0 1 0 9 9h-9z`,trending:`M3 17l6-6 4 4 8-8M15 7h6v6`,dollar:`M12 3v18M16 7.5C16 6 14.2 5 12 5S8 6 8 7.5 9.5 10 12 10.5s4 1.5 4 3-1.8 2.5-4 2.5-4-1-4-2.5`,percent:`M5 19L19 5M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM16.5 14a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z`,truck:`M3 6h11v9H3zM14 9h4l3 3v3h-7zM7.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM17.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z`,package:`M12 3l8 4v10l-8 4-8-4V7zM4 7l8 4 8-4M12 11v10`,store:`M4 9h16v11H4zM4 9l1.5-5h13L20 9M9 20v-6h6v6`,building:`M5 21V4h9v17M14 9h5v12M8 8h3M8 12h3M8 16h3M17 12h.01M17 16h.01`,users:`M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 20c0-3.3 3.1-5 7-5s7 1.7 7 5M17 5a4 4 0 0 1 0 7.9M22 20c0-2.6-1.6-4.2-4-4.8`,"thumbs-up":`M7 21V10h3l3-6a2 2 0 0 1 2 2v4h4l-2 11z`,smile:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9 10h.01M15 10h.01M8.5 14.5a5 5 0 0 0 7 0`,help:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7M12 17h.01`,checkbox:`M4 4h16v16H4zM8 12l3 3 5-5`,list:`M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01`,grid:`M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z`,layers:`M12 3l9 5-9 5-9-5zM3 13l9 5 9-5`,zap:`M13 3L5 14h6l-1 7 8-11h-6z`,flame:`M12 21a6 6 0 0 0 6-6c0-4-4-6-4-10 0 0-3 1.5-3 5 0 1.5-1 2-1.5 1.5C8 10 7.5 9 7.5 9A7.5 7.5 0 0 0 6 15a6 6 0 0 0 6 6z`,droplet:`M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z`,leaf:`M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7`};function Ut({name:e=`star`,paths:t,fill:n=!1,size:r=24,stroke:i=2,color:a=``,href:o=``,target:s=``,label:c=``,style:l,nodeRef:u,inert:d}){let f=Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim()):[],p=n&&f.length>0,m=f.length?f:[Ht[e]??Ht.star],h=Math.min(Math.max(Number(r)||24,8),240),g=a===`accent`?`var(--page-accent, currentColor)`:a||`currentColor`,_=(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:h,height:h,fill:p?g:`none`,stroke:p?`none`:g,strokeWidth:p?void 0:Math.min(Math.max(Number(i)||2,.5),4),strokeLinecap:p?void 0:`round`,strokeLinejoin:p?void 0:`round`,role:c?`img`:void 0,"aria-label":c||void 0,"aria-hidden":c?void 0:`true`,style:{display:`block`},children:m.map((e,t)=>(0,B.jsx)(`path`,{d:e},t))}),v={display:`inline-flex`,lineHeight:0,...k(l)};return o?(0,B.jsx)(`a`,{ref:u,href:o,onClick:d?e=>e.preventDefault():void 0,target:s||void 0,rel:s===`_blank`?`noopener noreferrer`:void 0,style:{...v,color:`inherit`},children:_}):(0,B.jsx)(`span`,{ref:u,style:v,children:_})}function Wt(e,t={},n=0){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],i=e=>e==null?``:Ve(e),a=Math.max(0,Number(n)||0),o=[];for(let e of r){let n=e.data??e,r=ze(n,t.imageField),s=(Array.isArray(r)?r:[r]).map(e=>e&&typeof e==`object`?e.url??e.src??``:e).filter(e=>typeof e==`string`&&e.trim()),c=t.nameField?i(ze(n,t.nameField)):i(n.name),l=t.hrefField?i(ze(n,t.hrefField)):``;for(let e of s)if(o.push({src:e,name:c,alt:c,href:l}),a&&o.length>=a)return o}return o}function Gt({images:e=[],source:t=``,entry:n=``,imageField:r=``,nameField:i=``,hrefField:a=``,limit:o=0,emptyText:s=``,columns:c=3,gap:u=8,showNames:d=!1,lightbox:f=!0,style:p,nodeRef:m,inert:h}){let{tenant:g,apiUrl:_}=(0,l.useContext)(Me),v=(0,l.useContext)(Ne)?.[t],[y,b]=(0,l.useState)(null),[x,S]=(0,l.useState)(()=>new Set);(0,l.useEffect)(()=>{if(!t||v)return;let e=!0;return fetch(`${_}/dynamic/${encodeURIComponent(t)}`,{headers:g?{"x-tenant":g}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&b(n)}).catch(()=>e&&b([])),()=>{e=!1}},[t,g,_,v]);let C=v??y??[],w=n?C.filter(e=>e?.id===n||e?.data?.slug===n||e?.slug===n):C,T=Math.max(0,Number(o)||0),E=t?(()=>{let e=Wt(w,{imageField:r,nameField:i,hrefField:a},0).filter(e=>!x.has(e.src));return T?e.slice(0,T):e})():null,D=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],O=E??D,A=!!t&&!v&&y===null,j=Math.max(0,Number(u)||0),ee=h?e=>e.preventDefault():void 0,[M,N]=(0,l.useState)(null),te=f&&!h&&M!==null&&O[M];(0,l.useEffect)(()=>{if(!te)return;let e=e=>{e.key===`Escape`&&N(null),e.key===`ArrowRight`&&N(e=>(e+1)%O.length),e.key===`ArrowLeft`&&N(e=>(e-1+O.length)%O.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[te,O.length]);let P=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,B.jsxs)(`div`,{ref:m,style:{columnCount:Math.min(Math.max(Number(c)||3,1),8),columnGap:j,width:`100%`,...k(p)},children:[O.map((e,n)=>{let r=(0,B.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,B.jsx)(`img`,{src:e.src,alt:e.alt??``,onError:t?()=>S(t=>new Set(t).add(e.src)):void 0,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),d&&P(e)&&(0,B.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:P(e)})]}),i=e.href?(0,B.jsx)(`a`,{href:e.href,onClick:ee,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:r}):f&&!h?(0,B.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>N(n),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&N(n),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:r}):r;return(0,B.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:j,borderRadius:`inherit`,overflow:`hidden`},children:i},n)}),!O.length&&!A&&(0,B.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:t?s||`No images yet`:`Pick images in Settings to fill the gallery`}),te&&(0,B.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>N(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,B.jsx)(`img`,{src:O[M].src,alt:O[M].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),P(O[M])&&(0,B.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:P(O[M])}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>N(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),O.length>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),N(e=>(e-1+O.length)%O.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,B.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),N(e=>(e+1)%O.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 Kt={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},qt={background:`var(--page-surface, #f2f2f2)`,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 Jt(e,t={},n=`dropdown`){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],i=e=>Array.isArray(e)?e[0]:e,a=e=>e==null?``:Ve(e),o=r.map(e=>{let n=e.data??{},r=t.parentField?i(n[t.parentField]):null;return{key:e.id,parent:(r&&typeof r==`object`?r.id:r)||null,label:a(n[t.labelField||`name`])||a(n.name)||`Untitled`,href:t.hrefField?a(n[t.hrefField]):``,image:t.imageField&&i(n[t.imageField])||``,desc:t.descField?a(n[t.descField]):``}}),s=new Map(o.map(e=>[e.key,e])),c=e=>{let t=new Set,n=e;for(;n.parent&&s.has(n.parent)&&!t.has(n.key);)t.add(n.key),n=s.get(n.parent);return n},l=[],u=new Map;for(let e of o){if(c(e)!==e)continue;let t={key:e.key,label:e.label,href:e.href,image:e.image,children:[]};u.set(e.key,t),l.push(t)}for(let e of o){let t=c(e);t!==e&&u.get(t.key)?.children.push({key:e.key,label:e.label,href:e.href,image:e.image,desc:e.desc})}return l.map(e=>({...e,type:e.children.length?n:`link`}))}function Yt({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768,source:u=``,labelField:d=``,hrefField:f=``,imageField:p=``,descField:m=``,parentField:h=``,submenu:g=`dropdown`}){let[_,v]=(0,l.useState)(null),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(!1),[C,w]=(0,l.useState)(null),{tenant:T,apiUrl:E}=(0,l.useContext)(Me),D=(0,l.useContext)(Ne)?.[u],[O,A]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u||D)return;let e=!0;return fetch(`${E}/dynamic/${encodeURIComponent(u)}`,{headers:T?{"x-tenant":T}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&A(n)}).catch(()=>e&&A([])),()=>{e=!1}},[u,T,E,D]),(0,l.useEffect)(()=>{if(!_)return;let e=new ResizeObserver(()=>b(_.offsetWidth<c));return e.observe(_),()=>e.disconnect()},[_,c]);let j=u?Jt(D??O??[],{labelField:d,hrefField:f,imageField:p,descField:m,parentField:h},g):i,ee=s===`hamburger`||s===`auto`&&y,M=(e,t,n=!1)=>{let r=e.image?(0,B.jsx)(`img`,{src:e.image,alt:``,style:n?{width:`100%`,aspectRatio:`16 / 9`,objectFit:`cover`,borderRadius:6,display:`block`,marginBottom:8}:{width:22,height:22,objectFit:`cover`,borderRadius:4,display:`block`,flexShrink:0}}):null;return(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...Kt,display:n?`block`:`flex`,alignItems:n?void 0:`center`,gap:n?void 0:10,...t},children:[r,(0,B.jsxs)(`span`,{style:{display:`block`,minWidth:0},children:[e.label,e.desc&&(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]})]},e.key)};return(0,B.jsxs)(`nav`,{ref:e=>{v(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...k(a)},children:[(t||e)&&(()=>{let i=(0,B.jsxs)(B.Fragment,{children:[t&&(0,B.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,B.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,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,B.jsx)(`div`,{style:a,children:i})})(),(0,B.jsx)(`div`,{style:{flexGrow:1}}),ee?(0,B.jsx)(`button`,{type:`button`,"aria-label":x?`Close menu`:`Open menu`,onClick:()=>S(!x),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:x?`✕`:`☰`}):(0,B.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:j.map(e=>{let t=e.children??[];if(!t.length)return(0,B.jsx)(`a`,{href:e.href||`#`,style:Kt,children:e.label},e.key);let n=e.type===`mega`;return(0,B.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>w(e.key),onMouseLeave:()=>w(null),children:[(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...Kt,cursor:`pointer`},children:[e.label,` `,(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),C===e.key&&(n?(0,B.jsx)(`div`,{style:{...qt,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=>M(e,{padding:8,borderRadius:8},!0))}):(0,B.jsx)(`div`,{style:{...qt,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>M(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),ee&&x&&(0,B.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:j.map(e=>(0,B.jsxs)(l.Fragment,{children:[(0,B.jsx)(`a`,{href:e.href||`#`,style:{...Kt,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>M(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function Xt({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,B.jsxs)(`div`,{ref:r,style:{width:`100%`,...k(n)},children:[(0,B.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,B.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,B.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function Zt({items:e=[],linked:t,multiple:n=!1,icon:r=``,padX:i,padY:a,headerBg:o,headerColor:s,openBg:c,openColor:u,borderColor:d,style:f,nodeRef:p}){let[m,h]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let g=(e,t)=>typeof e==`string`&&e?e:t,_=(e,t)=>{let n=Number(e);return e===``||e==null||!Number.isFinite(n)?t:n},v=Ht[r],y=e=>h(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...k(f)},children:e.map((n,r)=>{let l=m.has(n.key);return(0,B.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid ${g(d,`rgba(148, 163, 184, 0.35)`)}`:`none`},children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>y(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:l?g(c,g(o,`transparent`)):g(o,`transparent`),border:0,padding:`${_(a,14)}px ${_(i,4)}px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:l?g(u,g(s,`inherit`)):g(s,`inherit`),textAlign:`left`,cursor:`pointer`,transition:`background 180ms, color 180ms`},children:[(0,B.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0},children:[v?(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0},children:(0,B.jsx)(`path`,{d:v})}):null,n.title||`Item ${r+1}`]}),(0,B.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:l?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,B.jsx)(`div`,{style:{display:l?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var Qt={display:`flex`,flexDirection:`column`,gap:`12px`},$t={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},en={padding:`10px 12px`,border:`1px solid var(--page-border, #d1d5db)`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`},tn={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},nn=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function rn(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 an={display:`flex`,flexDirection:`column`,gap:6},on={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 sn(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):[]}var cn=`g-recaptcha-response`,ln=e=>e?.type===`recaptcha`?cn:e?.name;function un({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,B.jsxs)(`span`,{style:{...$t,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:on,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,B.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,B.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`recaptcha`?(0,B.jsx)(hn,{theme:e.captchaTheme,size:e.captchaSize,inert:r,onChange:e=>n(cn,e)}):e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,B.jsx)(xt,{url:e.src,style:{width:`100%`}}):(0,B.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,B.jsxs)(`label`,{style:an,children:[a,e.type===`textarea`||e.multiline?(0,B.jsx)(`textarea`,{...o,rows:4,style:{...on,resize:`vertical`}}):e.type===`select`?(0,B.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,B.jsx)(`option`,{value:``,children:e.placeholder||`—`}),sn(e,i).map((e,t)=>(0,B.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,B.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,B.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,B.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,B.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function dn({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:m,apiUrl:h}=(0,l.useContext)(Me),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(null),[b,x]=(0,l.useState)({}),[S,C]=(0,l.useState)(0),w=u?p||`form`:g;(0,l.useEffect)(()=>{if(!o||!a)return;let e=!0;return fetch(`${h||`/api`}/forms/${encodeURIComponent(a)}`,{headers:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(t=>e&&y(t?.payload&&typeof t.payload==`object`?t.payload:null)).catch(()=>e&&y(null)),()=>{e=!1}},[o,a,m,h]);let T=[{section:null,fields:[]}];for(let e of Array.isArray(v?.fields)?v.fields:[])e.type===`section`?T.push({section:e,fields:[]}):T[T.length-1].fields.push(e);let E=T.filter(e=>e.section||e.fields.length),D=E.filter(e=>!e.section||rn(e.section.condition,b)).map(e=>({...e,fields:e.fields.filter(e=>rn(e.condition,b))})),O=E.length>1,A=Math.min(S,Math.max(0,D.length-1)),j=O?D[A]?.fields??[]:D.flatMap(e=>e.fields),ee=j.filter(e=>{let t=b[ln(e)];return e.required&&(t==null||t===``||t===!1)}),M=A>=D.length-1,N=(e,t)=>x(n=>{let r={...n,[e]:t};for(let t of Array.isArray(v?.fields)?v.fields:[])t?.parentField===e&&delete r[t.name];return r});return(0,B.jsxs)(`div`,{ref:c,style:k(e),children:[(0,B.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(b))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(`${h||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...m?{"x-tenant":m}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);_(e.ok&&n?.success!==!1?`success`:`error`)}catch{_(`error`)}return}if(!t){_(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});_(r.ok?`success`:`error`)}catch{_(`error`)}}},style:{...Qt,display:w===`success`?`none`:`flex`},children:o&&a?(0,B.jsxs)(B.Fragment,{children:[O&&(0,B.jsx)(zn,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:A+1,style:{marginBottom:8}}),O&&D[A]?.section?.help&&(0,B.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[A].section.help}),j.map(e=>(0,B.jsx)(un,{field:e,value:b[ln(e)],values:b,onChange:N,inert:u},e.name)),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[O&&A>0&&(0,B.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>C(A-1),style:{...qe,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),O&&!M?(0,B.jsx)(`button`,{type:`button`,disabled:u||ee.length>0,onClick:()=>C(A+1),style:{...qe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ee.length?.5:1},children:`Next`}):(0,B.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...qe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,B.jsx)(`div`,{style:{display:w===`success`?`block`:`none`},children:f?.success??null}),(0,B.jsx)(`div`,{style:{display:w===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var fn=null,pn=null,mn=e=>{let t=typeof e==`string`&&e.trim()?e.trim():``;if(fn&&pn===t)return fn;if(fn&&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 pn=t,fn=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)}),fn};function hn({siteKey:e,theme:t,size:n,hl:r,style:i,nodeRef:a,inert:o,onChange:s}){let c=(0,l.useContext)(Me),u=c?.settings&&typeof c.settings==`object`?c.settings[`google.recaptchaKey`]:``,d=typeof e==`string`&&e.trim()||(typeof u==`string`?u.trim():``),f=(0,l.useRef)(null),p=(0,l.useRef)(s);if(p.current=s,(0,l.useEffect)(()=>{if(o||!d||!f.current)return;let e=!0,i=t=>{e&&typeof p.current==`function`&&p.current(t)};return mn(r).then(r=>{if(!(!e||!f.current||!r?.render)){f.current.innerHTML=``,i(``);try{r.render(f.current,{sitekey:d,theme:t===`dark`?`dark`:`light`,size:n===`compact`?`compact`:`normal`,callback:e=>i(typeof e==`string`?e:``),"expired-callback":()=>i(``),"error-callback":()=>i(``)})}catch{}}}),()=>{e=!1}},[o,d,t,n,r]),o){let e=t===`dark`;return(0,B.jsxs)(`div`,{ref:a,style:k(i),children:[(0,B.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,B.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,B.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!d&&(0,B.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 d?(0,B.jsx)(`div`,{ref:a,style:k(i),children:(0,B.jsx)(`div`,{ref:f})}):null}function gn({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,B.jsx)(`label`,{ref:r,style:{...$t,...k(n)},children:V(t,e,i)})}function _n({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...en,...k(i)},...nn(o)})}function vn({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...en,resize:`vertical`,...k(i)},...nn(o)})}function yn({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,B.jsxs)(`label`,{ref:o,style:{...tn,...k(a)},children:[(0,B.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 bn({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,B.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:{...en,appearance:`auto`,...k(i)},children:[t!==``&&(0,B.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,B.jsx)(`option`,{value:e,children:e},t))]})}function xn({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,B.jsxs)(`label`,{ref:a,style:{...en,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...k(i)},children:[(0,B.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,B.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function Sn({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,B.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...qe,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...k(t)},children:e})}function Cn({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,B.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...k(n)},children:Array.from({length:a},(e,t)=>(0,B.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function wn({collection:e,limit:t=6,layout:n=`grid`,columns:r=3,imageField:i,titleField:a=`name`,textField:o,custom:s,templateId:c,paged:u,filters:d,style:f,nodeRef:p}){let{tenant:m,apiUrl:h,locale:g}=(0,l.useContext)(Me),_=(0,l.useContext)(Le),v=(0,l.useContext)(Ne),[,y]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>y(e=>e+1);return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]);let b=Ie(d),x=JSON.stringify(b),S=x!==`{}`&&!e?.startsWith?.(`api:`),C=S?null:v?.[e],w=u?Pe(v):1,[T,E]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||C)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),S&&r.set(`data_filter`,x),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((w-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:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(e=>{let t=Array.isArray(e?.payload)?e.payload:Array.isArray(e?.payload?.data)?e.payload.data:[];return n&&E(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&E([])),()=>{n=!1}},[e,m,h,g,C,u,w,t,S,x]),!e)return null;let D=Math.max(1,Number(t)||6),O=u?C||e.startsWith(`api:`)?(C??T??[]).slice((w-1)*D,w*D):(T??[]).slice(0,D):(C??T??[]).slice(0,D),A=Math.min(Math.max(Number(r)||3,1),6),j=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${A}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>(0,B.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>He(t,e))},e.id??e?.data?.slug))}):(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>{let t=i?ze(e?.data,i):null,r=a?Ve(ze(e?.data,a)):null,s=o?ze(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:Ve(s),u=n===`list`;return(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,B.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,B.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,B.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,B.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:lt(c)})]})]},e.id??e?.data?.slug)})})}function Tn({fields:e=[],buttonLabel:t=`Search`,style:n,nodeRef:r,inert:i}){let a=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&typeof e.name==`string`&&e.name):[],o=i?{}:Fe(),s={height:34,padding:`0 12px`,borderRadius:8,border:`1px solid var(--page-border, rgba(100, 116, 139, 0.4))`,background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,fontSize:13,fontFamily:`inherit`,outline:`none`,minWidth:140,flex:`0 1 auto`,boxSizing:`border-box`},c=e=>{let t=e&&typeof e==`object`?e.value:e,n=e&&typeof e==`object`?e.label??e.value:e;return{value:String(t??``),label:String(n??``)}};return(0,B.jsxs)(`form`,{ref:r,method:`get`,onSubmit:e=>{if(i){e.preventDefault();return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);for(let e of[...t.keys()])(e.startsWith(`f_`)||e===`page`)&&t.delete(e);for(let[n,r]of new FormData(e.currentTarget).entries())n.startsWith(`f_`)&&typeof r==`string`&&r.trim()!==``&&t.set(n,r);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`))},style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,width:`100%`,...k(n)},children:[a.map(e=>Array.isArray(e.options)&&e.options.length>0||e.type===`option`||e.type===`select`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...nn(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(Array.isArray(e.options)?e.options:[]).map(e=>{let t=c(e);return(0,B.jsx)(`option`,{value:t.value,children:t.label},t.value)})]},e.name):e.type===`switch`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...nn(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(0,B.jsx)(`option`,{value:`true`,children:`Yes`}),(0,B.jsx)(`option`,{value:`false`,children:`No`})]},e.name):(0,B.jsx)(`input`,{type:`text`,name:`f_${e.name}`,defaultValue:o[e.name]??``,placeholder:e.label||e.name,style:s,...nn(i)},e.name)),(0,B.jsx)(`button`,{type:`submit`,style:{...s,minWidth:0,padding:`0 18px`,border:`none`,background:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`,fontWeight:600,cursor:i?`default`:`pointer`},...nn(i),children:t})]})}function En({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,B.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...k(n)},children:(0,B.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,B.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,B.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,B.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Dn({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)(Me),m=(0,l.useContext)(Ne),[h,g]=(0,l.useState)(null),_=i?Number(m?.[`${i}:total`]):NaN;(0,l.useEffect)(()=>{if(!i||Number.isFinite(_))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));g(Number.isFinite(r)?r:0)}).catch(()=>e&&g(0)),()=>{e=!1}},[i,f,p,_]);let v=Math.max(1,Number(a)||6),y=Number.isFinite(_)?_:h;if(i&&y===null||i&&s&&!(y>0))return null;let b=Math.min(Math.max(i?Math.ceil(y/v):Number(e)||1,1),50),x=Math.min(Math.max(i?Pe(m):Number(t)||1,1),b),S=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)):`#`},C=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,w=c?e=>e.preventDefault():void 0,T=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,B.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:C,...k(u)},children:[n&&(0,B.jsx)(`a`,{href:x>1?S(x-1):`#`,onClick:w,"aria-label":`Previous`,style:{...T(!1),opacity:x>1?1:.4},children:`‹`}),Array.from({length:b},(e,t)=>t+1).map(e=>(0,B.jsx)(`a`,{href:S(e),onClick:w,"aria-current":e===x?`page`:void 0,style:T(e===x),children:e},e)),n&&(0,B.jsx)(`a`,{href:x<b?S(x+1):`#`,onClick:w,"aria-label":`Next`,style:{...T(!1),opacity:x<b?1:.4},children:`›`})]})}var On=`webim.page_mode`,kn=()=>{if(typeof window>`u`)return`auto`;try{let e=window.localStorage.getItem(On);return e===`light`||e===`dark`?e:`auto`}catch{return`auto`}},An=e=>{let t={width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`light`?(0,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,B.jsx)(`path`,{d:`M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4`})]}):e===`dark`?(0,B.jsx)(`svg`,{...t,children:(0,B.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}):(0,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`}),(0,B.jsx)(`path`,{d:`M8 21h8M12 17v4`})]})},jn={light:`Light theme`,dark:`Dark theme`,auto:`Follow the device theme`};function Mn({variant:e,showSystem:t,style:n,nodeRef:r,inert:i}){let[a,o]=(0,l.useState)(i?`auto`:kn),s=(0,l.useRef)(null),c=e=>{s.current=e,typeof r==`function`&&r(e)};(0,l.useEffect)(()=>{if(i)return;let e=s.current?.closest?.(`.webim-page`);e&&(a===`light`||a===`dark`?e.setAttribute(`data-webim-mode`,a):e.removeAttribute(`data-webim-mode`));try{a===`auto`?window.localStorage.removeItem(On):window.localStorage.setItem(On,a)}catch{}},[a,i]);let u=t===!1?[`light`,`dark`]:[`light`,`dark`,`auto`],d=u.includes(a)?a:u[0],f={appearance:`none`,border:0,margin:0,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`transparent`,color:`inherit`,font:`inherit`,cursor:i?`default`:`pointer`,borderRadius:999};if(e===`buttons`)return(0,B.jsx)(`div`,{ref:c,role:`group`,"aria-label":`Theme`,style:{display:`inline-flex`,alignItems:`center`,gap:2,padding:3,borderRadius:999,border:`1px solid rgba(148, 163, 184, 0.4)`,...k(n)},children:u.map(e=>(0,B.jsx)(`button`,{type:`button`,title:jn[e],"aria-label":jn[e],"aria-pressed":e===d,onClick:i?void 0:()=>o(e),style:{...f,width:28,height:28,color:e===d?`var(--page-accent-text, #ffffff)`:`inherit`,background:e===d?`var(--page-accent, #111827)`:`transparent`,opacity:e===d?1:.7},children:An(e)},e))});let p=u[(u.indexOf(d)+1)%u.length];return(0,B.jsx)(`button`,{ref:c,type:`button`,title:jn[d],"aria-label":`Theme: ${jn[d]} — switch to ${jn[p]}`,onClick:i?void 0:()=>o(p),style:{...f,width:36,height:36,border:`1px solid rgba(148, 163, 184, 0.4)`,...k(n)},children:An(d)})}function Nn(e){let t=e?.parentElement;for(;t&&t!==document.body;){let e=getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return window}var Pn=e=>e===window?window.scrollY:e.scrollTop,Fn={"bottom-right":e=>({right:e,bottom:e}),"bottom-left":e=>({left:e,bottom:e}),"bottom-center":e=>({left:`50%`,bottom:e,transform:`translateX(-50%)`})};function In({variant:e,label:t,position:n,offset:r,showAfter:i,smooth:a,bg:o,fg:s,style:c,nodeRef:u,inert:d,frame:f,builder:p}){let[m,h]=(0,l.useState)(!!d),[g,_]=(0,l.useState)(null),v=e=>{_(e),typeof u==`function`&&u(e)};(0,l.useEffect)(()=>{if(d){h(!0);return}if(!g)return;let e=Number(i)>=0?Number(i):300,t=()=>{let t=Nn(g),n=p&&!(t===window?document.documentElement.scrollHeight>window.innerHeight:t.scrollHeight>t.clientHeight);h(n||Pn(t)>e)};return t(),document.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,t,{capture:!0})},[d,g,i,p]);let y=()=>{if(d)return;let e=Nn(g),t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,n=a===!1||t?`auto`:`smooth`;e===window?window.scrollTo({top:0,behavior:n}):e.scrollTo({top:0,behavior:n})},b=Number(r)>=0?Number(r):24,x=e===`pill`,S=t||`Top`,C=Fn[n]?n:`bottom-right`,w=f?{position:`fixed`,zIndex:5,bottom:(f.bottom??0)+b,...C===`bottom-left`?{left:(f.left??0)+b}:null,...C===`bottom-right`?{right:(f.right??0)+b}:null,...C===`bottom-center`?{left:(f.left??0)+(f.width??0)/2,transform:`translateX(-50%)`}:null}:{position:`fixed`,zIndex:2147482e3,...Fn[C](b)};return(0,B.jsxs)(`button`,{ref:v,type:`button`,title:S,"aria-label":S,"aria-hidden":!m,tabIndex:m?0:-1,onClick:y,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:x?8:0,appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,width:x?`auto`:44,height:44,padding:x?`0 18px`:0,borderRadius:999,border:`1px solid transparent`,background:o||`var(--page-accent, #111827)`,color:s||`var(--page-accent-text, #ffffff)`,boxShadow:`0 6px 20px rgba(15, 23, 42, 0.25)`,cursor:d?`default`:`pointer`,opacity:+!!m,pointerEvents:m?`auto`:`none`,transition:`opacity 160ms ease, transform 160ms ease`,...w,...k(c),...w.transform?{transform:w.transform}:null},children:[(0,B.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M12 19V5M12 5l-7 7M12 5l7 7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),x?(0,B.jsx)(`span`,{children:S}):null]})}var Ln={facebook:{label:`Facebook`,color:`#1877f2`,d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`},instagram:{label:`Instagram`,color:`#e4405f`,d:`M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06zm0 5.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z`},x:{label:`X (Twitter)`,color:`#000000`,d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`},linkedin:{label:`LinkedIn`,color:`#0a66c2`,d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`},youtube:{label:`YouTube`,color:`#ff0000`,d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`},tiktok:{label:`TikTok`,color:`#000000`,d:`M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z`},whatsapp:{label:`WhatsApp`,color:`#25d366`,d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z`},telegram:{label:`Telegram`,color:`#26a5e4`,d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`},pinterest:{label:`Pinterest`,color:`#bd081c`,d:`M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.03-.655 2.569-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z`},github:{label:`GitHub`,color:`#181717`,d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`},discord:{label:`Discord`,color:`#5865f2`,d:`M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.058a.082.082 0 00.031.056 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.009c.12.099.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z`},email:{label:`E-mail`,color:`#64748b`,d:`M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z`},website:{label:`Website`,color:`#64748b`,d:`M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z`}};function Rn({links:e=[],variant:t,color:n,size:r,gap:i,newTab:a,style:o,nodeRef:s,inert:c}){let l=Array.isArray(e)?e.filter(e=>e&&Ln[e.network]):[];if(!l.length)return null;let u=Math.min(Math.max(Number(r)||18,10),64),d=Math.round(u*1.9),f=Number.isFinite(Number(i))?Number(i):10,p=e=>n===`accent`?`var(--page-accent, #111827)`:n===`inherit`?`currentColor`:e.color,m=c?e=>e.preventDefault():void 0;return(0,B.jsx)(`div`,{ref:s,style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:f,...k(o)},children:l.map((e,r)=>{let i=Ln[e.network],o=t!==`outline`&&t!==`plain`,s=o?n===`accent`?`var(--page-accent-text, #ffffff)`:n===`inherit`?`var(--page-bg, #ffffff)`:`#ffffff`:p(i);return(0,B.jsx)(`a`,{href:e.url||`#`,onClick:m,"aria-label":e.label||i.label,title:e.label||i.label,...a!==!1&&!c?{target:`_blank`,rel:`noopener noreferrer`}:{},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:t===`plain`?u:d,height:t===`plain`?u:d,borderRadius:`50%`,background:o?p(i):`transparent`,border:t===`outline`?`1px solid ${p(i)}`:`none`,color:`inherit`,textDecoration:`none`},children:(0,B.jsx)(`svg`,{width:u,height:u,viewBox:`0 0 24 24`,fill:s,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:i.d})})},`${e.network}-${r}`)})})}function zn({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,B.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...k(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,B.jsxs)(l.Fragment,{children:[t>0&&(0,B.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,B.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,B.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var Bn={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}},Vn=e=>Bn[e]??Bn.medium;Bn.medium.w,Bn.medium.h;var Hn=e=>String(e?.group??``).trim(),Un=e=>{let t=[],n=new Map;return e.forEach((e,r)=>{let i=Hn(e)||`#${r}`;n.has(i)||(n.set(i,[]),t.push(i)),n.get(i).push(e)}),t.flatMap(e=>n.get(e))};function Wn(e,{size:t=`medium`,horizontal:n=!1,groupTitles:r=`top`}={}){let i=Vn(t),a=n?i.h:i.w,o=n?16:20,s=(n?i.w:i.h)+(n?56:48),c=Array.isArray(e)?e.filter(e=>e&&e.id):[],l=new Set(c.map(e=>e.id)),u=new Map,d=[];for(let e of c)e.parent&&l.has(e.parent)&&e.parent!==e.id?(u.has(e.parent)||u.set(e.parent,[]),u.get(e.parent).push(e)):d.push(e);d=Un(d);for(let[e,t]of u)u.set(e,Un(t));let f=(e,t)=>o+(Hn(e)!==Hn(t)&&(Hn(e)||Hn(t))?24:0),p=new Map,m=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=u.get(e.id)??[],r=n.reduce((e,r,i)=>e+m(r,t)+(i?f(n[i-1],r):0),0),i=Math.max(a,r);return p.set(e.id,i),i};d.forEach(e=>m(e,new Set));let h=[],g=[],_=new Map,v=0,y=(e,t,r,o)=>{if(o.has(e.id))return;o.add(e.id);let c=t+((p.get(e.id)??a)-a)/2,d=r*s,m=n?d:c,b=n?c:d;h.push({node:e,x:m,y:b});let x=Hn(e);if(x){let t=`${e.parent&&l.has(e.parent)&&e.parent!==e.id?e.parent:``}|${x}`;_.has(t)||_.set(t,{title:x,color:``,members:[]});let n=_.get(t);!n.color&&e.groupColor&&(n.color=e.groupColor),n.members.push({x:m,y:b})}v=Math.max(v,d+(n?i.w:i.h));let S=t,C=u.get(e.id)??[];C.forEach((e,t)=>{t&&(S+=f(C[t-1],e));let l=S+((p.get(e.id)??a)-a)/2+a/2,u=(r+1)*s;g.push(n?{from:{x:d+i.w,y:c+i.h/2},to:{x:u,y:l}}:{from:{x:c+i.w/2,y:d+i.h},to:{x:l,y:u}}),y(e,S,r+1,o),S+=p.get(e.id)??a})},b=0,x=new Set;d.forEach((e,t)=>{t&&(b+=f(d[t-1],e)),y(e,b,0,x),b+=p.get(e.id)??a});let S=Math.max(b,a),C=r===`hidden`?0:22,w=[..._.values()].map(e=>{let t=Math.min(...e.members.map(e=>e.x))-12,n=Math.max(...e.members.map(e=>e.x))+i.w+12,a=Math.min(...e.members.map(e=>e.y))-12-(r===`bottom`?0:C),o=Math.max(...e.members.map(e=>e.y))+i.h+12+(r===`bottom`?C:0);return{x:t,y:a,width:n-t,height:o-a,title:e.title,color:e.color}}),T=n?Math.max(v,i.w):S,E=n?S:Math.max(v,i.h),D=Math.max(0,...w.map(e=>-e.x)),O=Math.max(0,...w.map(e=>-e.y));if(w.length&&(T=Math.max(T,...w.map(e=>e.x+e.width))+D,E=Math.max(E,...w.map(e=>e.y+e.height))+O,D||O)){for(let e of h)e.x+=D,e.y+=O;for(let e of g)e.from={x:e.from.x+D,y:e.from.y+O},e.to={x:e.to.x+D,y:e.to.y+O};for(let e of w)e.x+=D,e.y+=O}return{boxes:h,links:g,groups:w,width:T,height:E,horizontal:n}}var Gn=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},Kn=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`},qn=e=>!!(e?.cv?.trim?.()||e?.photo);function Jn(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?``:Ve(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]):``,group:t.groupField?i(n[t.groupField]):``}})}var Yn={size:36,pad:10};function Xn({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,B.jsx)(`div`,{onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":e.name,style:{position:`fixed`,inset:0,zIndex:1e3,background:`rgba(2, 6, 23, 0.6)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16},children:(0,B.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.35)`,borderRadius:14,maxWidth:420,width:`100%`,maxHeight:`80vh`,overflowY:`auto`,padding:24,position:`relative`,boxShadow:`0 24px 64px rgba(2, 6, 23, 0.5)`},children:[(0,B.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,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,B.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,B.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,B.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 Zn({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c,groupTitles:u=`top`,groupBg:d=``,size:f=`medium`,horizontal:p=!1,style:m,nodeRef:h,interactive:g=!0}){let _=(0,l.useId)(),[v,y]=(0,l.useState)(null),{tenant:b,apiUrl:x}=(0,l.useContext)(Me),S=(0,l.useContext)(Ne)?.[t],[C,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||S)return;let e=!0;return fetch(`${x}/dynamic/${encodeURIComponent(t)}`,{headers:b?{"x-tenant":b}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&w(n)}).catch(()=>e&&w([])),()=>{e=!1}},[t,b,x,S]);let T=t?Jn(S??C??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c}):e,E=Vn(f),{boxes:D,links:O,groups:A,width:j,height:ee}=Wn(T,{size:f,horizontal:p,groupTitles:u});if(!D.length)return!g&&t?(0,B.jsxs)(`div`,{ref:h,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...k(m)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let M=new Set(D.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,B.jsxs)(`div`,{ref:h,style:{maxWidth:`100%`,overflowX:`auto`,...k(m)},children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${j} ${ee}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:j,height:`auto`,margin:`0 auto`},children:[A.map((e,t)=>{let n=e.color||d||`rgba(148, 163, 184, 0.16)`,r=!!(e.color||d);return(0,B.jsxs)(`g`,{children:[(0,B.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:`16`,fill:n}),u!==`hidden`&&e.title&&(0,B.jsx)(`text`,{x:e.x+e.width/2,y:u===`bottom`?e.y+e.height-22*.42:e.y+22*.78,textAnchor:`middle`,fontSize:E.title+1,fontWeight:`600`,opacity:`0.55`,fill:r?Kn(e.color||d):`var(--page-text, #111827)`,children:Gn(e.title,Math.floor(e.width/7))})]},`group-${t}`)}),O.map((e,t)=>(0,B.jsx)(`path`,{d:p?`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)),D.map(({node:e,x:t,y:n})=>{let r=M.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?Kn(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?Kn(e.color2):s,l=g&&(qn(e)||e.href),u=()=>qn(e)?y(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+Yn.pad+E.avatar+8:t+E.w/2,f=e.photo?`start`:`middle`,p=e.photo?Math.floor((E.w-E.avatar-26)/7):Math.floor(E.w/7.6),m=E.h/2,h=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,B.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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`linearGradient`,{id:`${_}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,B.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,B.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:`url(#${_}-${e.id}-grad)`})]}):i?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}-box`,children:(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`})}),(0,B.jsxs)(`g`,{clipPath:`url(#${_}-${e.id}-box)`,children:[(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:m,fill:o}),(0,B.jsx)(`rect`,{x:t,y:n+m,width:E.w,height:E.h-m,fill:e.color2})]})]}):(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}`,children:(0,B.jsx)(`circle`,{cx:t+Yn.pad+E.avatar/2,cy:n+E.h/2,r:E.avatar/2})}),(0,B.jsx)(`image`,{href:e.photo,x:t+Yn.pad,y:n+(E.h-E.avatar)/2,width:E.avatar,height:E.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${_}-${e.id})`})]}),i&&!e.gradient?(0,B.jsxs)(B.Fragment,{children:[e.title&&(0,B.jsx)(`text`,{x:d,y:n+m/2+E.title*.35,textAnchor:f,fontSize:E.title,fontWeight:`600`,fill:s,children:Gn(e.title,p+4)}),e.name&&(0,B.jsx)(`text`,{x:d,y:n+m+m/2+E.name*.35,textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:c,children:Gn(e.name,p)})]}):(0,B.jsxs)(B.Fragment,{children:[h[0]&&(0,B.jsx)(`text`,{x:d,y:n+(h[1]?E.h*.43:E.h*.57),textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:s,children:Gn(h[0],p)}),h[1]&&(0,B.jsx)(`text`,{x:d,y:n+E.h*.73,textAnchor:f,fontSize:E.title,opacity:`0.7`,fill:s,children:Gn(h[1],p+4)})]})]},e.id)})]}),v&&(0,B.jsx)(Xn,{node:v,onClose:()=>y(null)})]})}function Qn({value:e,onCommit:t,style:n,hint:r}){let[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!i||!o.current)return;let e=o.current,t=document.createRange();e.focus(),t.selectNodeContents(e),t.collapse(!1);let n=window.getSelection();n.removeAllRanges(),n.addRange(t)},[i]),(0,B.jsx)(`span`,{ref:o,contentEditable:i,suppressContentEditableWarning:!0,title:i?void 0:r||`Double-click to edit`,onDoubleClick:()=>a(!0),onBlur:i?e=>{a(!1),t(e.currentTarget.textContent)}:void 0,onKeyDown:i?t=>{t.stopPropagation(),t.key===`Escape`&&(t.currentTarget.textContent=e??``,t.currentTarget.blur()),t.key===`Enter`&&(t.preventDefault(),t.currentTarget.blur())}:void 0,style:{display:`block`,minHeight:`1em`,outline:`none`,cursor:i?`text`:`inherit`,...n},children:e??``})}var $n=360,er=`
|
|
15
|
+
`)}var de=`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,fe={fontFamily:de,fontStyle:`normal`,fontWeight:400,letterSpacing:`normal`,textTransform:`none`,lineHeight:1.4,textShadow:`none`},pe={light:{background:`#f2f2f2`,surface:`#f2f2f2`,border:`#d1d5db`,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`,surface:`#1e293b`,border:`rgba(226, 232, 240, 0.18)`,text:`#e2e8f0`,accent:`#6366f1`,accentText:`#ffffff`,primary:{light:`#a5b4fc`,main:`#6366f1`,dark:`#4338ca`,contrastText:`#ffffff`},secondary:{light:`#5eead4`,main:`#14b8a6`,dark:`#0f766e`,contrastText:`#052e2b`}}},me={h1:40,h2:32,h3:26,h4:22,h5:19,h6:16},he={font:`system`,headingFont:`inherit`,headings:me,bodySize:16,light:pe.light,dark:pe.dark},ge={system:{label:`System`,value:de},inter:{label:`Inter`,value:`"Inter", ${de}`},outfit:{label:`Outfit`,value:`"Outfit", ${de}`},serif:{label:`Serif`,value:`Georgia, "Times New Roman", serif`},mono:{label:`Mono`,value:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}},_e=(e,t)=>ge[e]?.value??_(e)??(typeof e==`string`&&e.trim()?`"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`:t),ve=(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 ye(e){let{light:t,dark:n,font:r,headingFont:i,headings:a,bodySize:o,...s}=e??{};return{font:r??he.font,headingFont:i??he.headingFont,headings:{...me,...a??{}},bodySize:o??16,light:ve(pe.light,s,t),dark:ve(pe.dark,n)}}function be(e){return{"--page-bg":e.background,"--page-surface":e.surface??e.background,"--page-border":e.border??pe.light.border,"--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 xe(e){let t=ye(e);return{backgroundColor:`var(--page-bg)`,color:`var(--page-text)`,fontFamily:_e(t.font,de),"--page-heading-font":t.headingFont===`inherit`?`inherit`:_e(t.headingFont,`inherit`),...Ce(t.headings),"--page-body-size":Se(t.bodySize,16)}}function Se(e,t){return e===``||e==null?`${t}px`:isNaN(Number(e))?String(e):`${Number(e)}px`}function Ce(e){let t={};for(let n of Object.keys(me)){let r=e?.[n]??me[n];t[`--page-${n}`]=Se(r,me[n])}return t}function we(e,t=`light`){let n=ye(e);return{...xe(e),...be(n[t]??n.light)}}function Te(e,t){return e?.themeRef&&t?.[e.themeRef]||e?.theme}function R(e,t){return e===`light`||e===`dark`?e:t===`light`||t===`dark`?t:`auto`}function z({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:Te(o,a.builder_themes?.themes),components:a.builder_components?.components??{},custom:o.custom,animations:o.animations,seo:o.seo,direction:o.direction,scheme:o.scheme,locale:i||a.locales?.default,locales:a.locales,tenant:n??``,apiUrl:r??``,settings:a}}var Ee=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 De({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(Ee),c(`${l}/settings/public`,{headers:u}).then(Ee)]),p=z({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:[`TableBlock`,`OrgChartBlock`,`NavbarBlock`,`CalendarBlock`,`MasonryBlock`,`LogoCarousel`].includes(e?.type?.resolvedName)?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(Ee).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}var Oe=new Set([`ar`,`he`,`fa`,`ur`,`ps`,`sd`,`ug`,`yi`,`dv`,`ckb`]),ke=e=>Oe.has(String(e||``).toLowerCase().split(/[-_]/)[0])?`rtl`:`ltr`,Ae=(e,t)=>e===`ltr`||e===`rtl`?e:t?ke(t):void 0,je=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})),B=e(((e,t)=>{t.exports=je()}))(),Me=(0,l.createContext)({tenant:``,apiUrl:`/api`,locale:``,settings:null}),Ne=(0,l.createContext)(null),Pe=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},Fe=()=>{if(typeof window>`u`)return{};let e={};return new URLSearchParams(window.location.search).forEach((t,n)=>{n.startsWith(`f_`)&&n.length>2&&t!==``&&(e[n.slice(2)]=t)}),e},Ie=e=>{let t={...e&&typeof e==`object`&&!Array.isArray(e)?e:{},...Fe()};return Object.fromEntries(Object.entries(t).filter(([,e])=>typeof e==`string`&&e.trim()!==``))},Le=(0,l.createContext)(null),Re=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function ze(e,t){if(t)return t.includes(`.`)?t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e):e?.[t]}var Be=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 Ve(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??``):typeof e==`object`&&!Array.isArray(e)&&Number.isFinite(Number(e.lat))&&Number.isFinite(Number(e.lng))?`${e.lat}, ${e.lng}`: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 He(e,t){let n=t?.data??{},r=Be(n);if(!r.length)return e;let i=RegExp(`:(${r.map(Re).sort((e,t)=>t.length-e.length).join(`|`)})`,`g`),a=e=>typeof e==`string`?e.replace(i,(e,t)=>Ve(ze(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 Ue={margin:0,fontWeight:700,lineHeight:1.2,fontFamily:`var(--page-heading-font, inherit)`},We=me,Ge=e=>`var(--page-${e}, ${me[e]??me.h2}px)`,Ke={margin:0,fontSize:`var(--page-body-size, 16px)`},qe={display:`inline-block`,textDecoration:`none`,cursor:`pointer`,backgroundColor:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`},Je={flexGrow:1,display:`flex`,flexDirection:`column`,position:`relative`},Ye={display:`flex`,flexDirection:`column`};function Xe({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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`video`,{src:t,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{...n,objectFit:`cover`}}),r&&(0,B.jsx)(`div`,{style:{...n,background:r}})]})}var Ze=(e,t)=>e?.backgroundVideo?{position:`relative`,...t,...k(e)}:{...t,...k(e)};function Qe({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`div`,{ref:t,style:{...Je,...k(e)},children:[(0,B.jsx)(Xe,{style:e}),n]})}function $e({style:e,nodeRef:t,children:n}){return(0,B.jsxs)(`section`,{ref:t,style:Ze(e,Ye),children:[(0,B.jsx)(Xe,{style:e}),n]})}function et({style:e,freeLayout:t,nodeRef:n,children:r}){let i=t?{position:`relative`,minHeight:240}:null;return(0,B.jsxs)(`div`,{ref:n,style:i?{...i,...Ze(e)}:Ze(e),children:[(0,B.jsx)(Xe,{style:e}),r]})}function tt({text:e,parts:t,tag:n=`h2`,style:r,linked:i,nodeRef:a}){return(0,B.jsx)(n,{ref:a,style:{...Ue,fontSize:Ge(n),...k(r)},children:V(t,e,i)})}var nt={fontFamily:ge.mono.value,background:`rgba(148, 163, 184, 0.18)`,padding:`1px 5px`,borderRadius:4,fontSize:`0.9em`};function rt(e,t=[],n,r){let i=e;return t.includes(`sup`)?i=(0,B.jsx)(`sup`,{children:i}):t.includes(`sub`)&&(i=(0,B.jsx)(`sub`,{children:i})),t.includes(`code`)&&(i=(0,B.jsx)(`code`,{style:nt,children:i})),t.includes(`strike`)&&(i=(0,B.jsx)(`s`,{children:i})),t.includes(`underline`)&&(i=(0,B.jsx)(`u`,{children:i})),t.includes(`italic`)&&(i=(0,B.jsx)(`em`,{children:i})),t.includes(`bold`)&&(i=(0,B.jsx)(`strong`,{children:i})),n?i=(0,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{color:`inherit`,...t.includes(`nounderline`)&&{textDecoration:`none`}},children:i}):t.includes(`nounderline`)&&(i=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:i})),i}function V(e,t,n){return e?.length?e.map((e,t)=>{if(e.slot)return(0,B.jsx)(l.Fragment,{children:n?.[e.slot]??null},t);if(e.parts)return(0,B.jsx)(l.Fragment,{children:V(e.parts,``,n)},t);let r=e.text;return e.sup?r=(0,B.jsx)(`sup`,{children:r}):e.sub&&(r=(0,B.jsx)(`sub`,{children:r})),e.code&&(r=(0,B.jsx)(`code`,{style:nt,children:r})),e.strike&&(r=(0,B.jsx)(`s`,{children:r})),e.underline&&(r=(0,B.jsx)(`u`,{children:r})),e.italic&&(r=(0,B.jsx)(`em`,{children:r})),e.bold&&(r=(0,B.jsx)(`strong`,{children:r})),(e.color||e.background)&&(r=(0,B.jsx)(`span`,{style:{...e.color&&{color:e.color},...e.background&&{backgroundColor:e.background}},children:r})),e.href?r=(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{color:e.color??`inherit`,...e.nounderline&&{textDecoration:`none`}},children:r}):e.nounderline&&(r=(0,B.jsx)(`span`,{style:{textDecoration:`none`},children:r})),(0,B.jsx)(l.Fragment,{children:r},t)}):t}function it({parts:e,text:t,marks:n,href:r,target:i,style:a}){return(0,B.jsx)(`span`,{style:k(a),children:e?.length?V(e,t):rt(t,n,r,i)})}var at=[`left`,`center`,`right`,`justify`];function ot(e,t,n){let r=e&&e.cellStyles;if(!r||typeof r!=`object`||Array.isArray(r))return{};let i=r[`${t}:${n}`];return i&&typeof i==`object`&&!Array.isArray(i)?i:{}}function st(e,t){let n=e||{},r=typeof n.bold==`boolean`?n.bold:!!t;return{textAlign:at.includes(n.align)?n.align:`left`,fontWeight:r?700:400,fontStyle:n.italic?`italic`:void 0,color:typeof n.color==`string`&&n.color?n.color:void 0,backgroundColor:typeof n.bg==`string`&&n.bg?n.bg:void 0}}function ct({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 lt(e=[],t,n){let r=n??((e,n)=>V(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,B.jsx)(`img`,{src:t.src,alt:t.alt||``,style:{width:`100%`,display:`block`,borderRadius:6}});return(0,B.jsxs)(`figure`,{style:{marginLeft:0,marginRight:0,...i,...ct(t)},children:[t.href?(0,B.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,B.jsx)(`figcaption`,{style:{fontSize:13,opacity:.65,marginTop:6,textAlign:`center`},children:t.caption})]},n)}if(t.type===`video`)return bt(t.url)?(0,B.jsx)(`div`,{style:{...i,...ct({align:t.align,wrap:t.wrap,width:t.width??100})},children:(0,B.jsx)(xt,{url:t.url,autoplay:t.autoplay,muted:t.muted,loop:t.loop,controls:t.controls??!0,start:t.start})},n):null;if(t.type===`button`){if(!(typeof t.label==`string`&&t.label.trim()))return null;let e=Number.isFinite(Number(t.radius))?Number(t.radius):8,r=[`center`,`right`].includes(t.align)?t.align:`left`;return(0,B.jsx)(`div`,{style:{...i,textAlign:r},children:(0,B.jsx)(`table`,{role:`presentation`,cellPadding:0,cellSpacing:0,style:{borderCollapse:`separate`,display:`inline-table`},children:(0,B.jsx)(`tbody`,{children:(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{style:{backgroundColor:t.bg||`var(--page-accent, #4f46e5)`,borderRadius:e},children:(0,B.jsx)(`a`,{href:t.href||`#`,target:t.target||void 0,rel:t.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`inline-block`,padding:`13px 24px`,color:t.color||`#ffffff`,fontSize:15,fontWeight:600,lineHeight:1.2,textDecoration:`none`,borderRadius:e},children:t.label})})})})})},n)}if(t.type===`divider`)return(0,B.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`,verticalAlign:`top`},o=r?e.slice(1):e,s=Array.isArray(t.widths)?t.widths:null,c=(e,n,r)=>({...a,...st(ot(t,e,n),r)});return(0,B.jsxs)(`table`,{style:{...i,borderCollapse:`collapse`,width:`100%`,fontSize:`inherit`,tableLayout:s?`fixed`:void 0},children:[s&&(0,B.jsx)(`colgroup`,{children:s.map((e,t)=>(0,B.jsx)(`col`,{style:{width:`${e}%`}},t))}),r&&(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:e[0].map((e,t)=>(0,B.jsx)(`th`,{style:c(0,t,!0),children:e},t))})}),(0,B.jsx)(`tbody`,{children:o.map((e,t)=>(0,B.jsx)(`tr`,{children:e.map((e,n)=>(0,B.jsx)(`td`,{style:c(r?t+1:t,n,!1),children:e},n))},t))})]},n)}if(t.type===`ul`||t.type===`ol`){let e=t.type;return(0,B.jsx)(e,{style:{...i,paddingLeft:24},children:(t.items??[]).map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:r(e.parts,e.text)},t))},n)}if(t.type===`quote`)return(0,B.jsx)(`blockquote`,{style:{...dt,...i},children:r(t.parts,t.text)},n);if(We[t.type]){let e=t.type;return(0,B.jsx)(e,{style:{...Ue,fontSize:Ge(t.type),...i},children:r(t.parts,t.text)},n)}return(0,B.jsx)(`p`,{style:{...Ke,...i},children:r(t.parts,t.text)},n)})}function ut({content:e,style:t,linked:n,nodeRef:r}){return(0,B.jsx)(`div`,{ref:r,style:{display:`flow-root`,...k(t)},children:lt(e,n)})}var dt={margin:0,padding:`8px 0 8px 20px`,borderLeft:`4px solid var(--page-accent, rgba(148, 163, 184, 0.6))`};function ft({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`blockquote`,{ref:i,style:{...dt,...k(n)},children:V(t,e,r)})}function pt({ordered:e,items:t=[],style:n,nodeRef:r}){return(0,B.jsx)(e?`ol`:`ul`,{ref:r,style:{margin:0,paddingLeft:24,...k(n)},children:t.map((e,t)=>(0,B.jsx)(`li`,{style:{marginBottom:4},children:V(e.parts,e.text)},t))})}function mt({text:e,parts:t,style:n,linked:r,nodeRef:i}){return(0,B.jsx)(`p`,{ref:i,style:{...Ke,...k(n)},children:V(t,e,r)})}var ht={color:`var(--page-accent, inherit)`,textDecoration:`underline`,textUnderlineOffset:3,cursor:`pointer`};function gt({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...ht,...k(i)},children:V(t,e,a)})}function _t({text:e,parts:t,href:n,target:r,style:i,linked:a,nodeRef:o}){return(0,B.jsx)(`a`,{ref:o,href:n||`#`,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:{...qe,...k(i)},children:V(t,e,a)})}function vt({src:e,alt:t,style:n,nodeRef:r}){return e?(0,B.jsx)(`img`,{ref:r,src:e,alt:t||``,style:{display:`block`,maxWidth:`100%`,...k(n)}}):null}function yt({src:e,poster:t,controls:n=!0,autoplay:r=!1,loop:i=!1,muted:a=!1,style:o,nodeRef:s}){return e?(0,B.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%`,...k(o)}}):null}var bt=(e=``)=>(e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/)||e.match(/^([\w-]{11})$/))?.[1];function xt({url:e,autoplay:t=!1,muted:n=!1,loop:r=!1,controls:i=!0,start:a,style:o,nodeRef:s}){let c=bt(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,B.jsx)(`div`,{ref:s,style:{position:`relative`,width:`100%`,paddingTop:`56.25%`,...k(o)},children:(0,B.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 St({src:e,title:t,allowFullscreen:n=!0,style:r,nodeRef:i}){return e?(0,B.jsx)(`iframe`,{ref:i,src:e,title:t||`Embedded frame`,loading:`lazy`,allowFullScreen:n,style:{display:`block`,width:`100%`,height:300,border:0,...k(r)}}):null}function Ct({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,B.jsx)(`div`,{ref:e=>{a(e),r&&r(e)},style:k(n)})}function wt({height:e,style:t,nodeRef:n}){return(0,B.jsx)(`div`,{ref:n,style:{height:e||32,flexShrink:0,alignSelf:`stretch`,...k(t)}})}function Tt({style:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{height:1,alignSelf:`stretch`,flexShrink:0,...k(e)}})}function Et({style:e,nodeRef:t}){return(0,B.jsx)(`div`,{ref:t,style:{flexShrink:0,...k(e)}})}var Dt={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},Ot={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)`}},kt=48;function At({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,m]=(0,l.useState)(null),h=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 g=t=>u((t+e)%e),_=()=>{if(!p)return;let{dx:e}=p;m(null),e<-48?g(h+1):e>kt&&g(h-1)};return(0,B.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),m({startX:e.clientX,dx:0}))}:void 0,onPointerMove:p?e=>m(t=>t&&{...t,dx:e.clientX-t.startX}):void 0,onPointerUp:_,onPointerCancel:_,style:{position:`relative`,overflow:`hidden`,width:`100%`,height:i,touchAction:`pan-y`,userSelect:p?`none`:void 0,cursor:p?`grabbing`:void 0,...k(o)},children:[(0,B.jsx)(`div`,{style:{display:`flex`,height:`100%`,transform:`translateX(calc(${-h*100}% + ${p?.dx??0}px))`,transition:p?`none`:`transform 450ms ease`},children:Array.from({length:e},(e,n)=>(0,B.jsx)(`div`,{style:{position:`relative`,width:`100%`,flexShrink:0,overflow:`hidden`},children:t(n)},n))}),e>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous slide`,style:{...Dt,left:12},onClick:()=>g(h-1),children:`‹`}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Next slide`,style:{...Dt,right:12},onClick:()=>g(h+1),children:`›`}),(0,B.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,B.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,onClick:()=>g(t),style:{width:8,height:8,borderRadius:`50%`,border:0,padding:0,cursor:`pointer`,background:t===h?`#ffffff`:`rgba(255, 255, 255, 0.45)`}},t))})]})]})}var jt=(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 Mt({slides:e=[],captionPosition:t=`bottom`,captionAlign:n=`left`,...r}){return e.length?(0,B.jsx)(At,{...r,count:e.length,renderSlide:r=>{let i=e[r];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:jt(i.image)}),(i.title||i.text)&&(0,B.jsxs)(`div`,{style:{position:`absolute`,color:`#fff`,textAlign:n,...Ot[t]??Ot.bottom},children:[i.title&&(0,B.jsx)(`div`,{style:{fontSize:22,fontWeight:700},children:i.title}),i.text&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.9,marginTop:4},children:i.text})]})]})}}):null}function Nt({slides:e=[],linked:t,...n}){return e.length?(0,B.jsx)(At,{...n,count:e.length,renderSlide:n=>{let r=e[n];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{style:jt(r.image,r.color)}),(0,B.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`},children:t?.[r.key]??null})]})}}):null}var Pt=256,Ft=e=>Math.log(Math.tan(Math.PI/4+Math.max(-85,Math.min(85,e))*Math.PI/360)),It=(e,t,n)=>{let r=Pt*2**n;return{x:(Number(t)+180)/360*r,y:(.5-Ft(Number(e))/(2*Math.PI))*r}},Lt=(e,t)=>{if(e===``||e==null)return null;let n=Number(e);return Number.isFinite(n)&&Math.abs(n)<=t?n:null},Rt=e=>!!e&&Lt(e.lat,90)!==null&&Lt(e.lng,180)!==null;function zt(e,t,n=`directions`,r=``){let i=`${e},${t}`;return n===`place`?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r?`&query_place_id=`:``}`:`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`}var Bt=(e,t,n=13)=>`https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n)||13)}/${e}/${t}`;function Vt({markers:e,lat:t,lng:n,zoom:r=``,height:i=320,pinSize:a=22,pinLink:o=`directions`,link:s=!1,label:c=``,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(1200);(0,l.useEffect)(()=>{let e=p.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>h(t=>e.clientWidth&&e.clientWidth!==t?e.clientWidth:t);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let g=(Array.isArray(e)?e:[]).filter(Rt),_=Rt({lat:t,lng:n})?{lat:Lt(t,90),lng:Lt(n,180)}:g.length?{lat:g.reduce((e,t)=>e+Lt(t.lat,90),0)/g.length,lng:g.reduce((e,t)=>e+Lt(t.lng,180),0)/g.length}:null,v=Math.max(80,Number(i)||320),y=Lt(r,19)?Math.min(Math.max(Math.round(Number(r)),1),19):(()=>{if(g.length<2)return 13;for(let e=19;e>=1;e--){let t=g.map(t=>It(Lt(t.lat,90),Lt(t.lng,180),e)),n=Math.max(...t.map(e=>e.x))-Math.min(...t.map(e=>e.x)),r=Math.max(...t.map(e=>e.y))-Math.min(...t.map(e=>e.y));if(n<=m*.8&&r<=v*.7)return e}return 1})(),b={width:`100%`,...k(u)};if(!_)return(0,B.jsx)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:{...b,minHeight:80,display:`grid`,placeItems:`center`,fontSize:13,opacity:.6,border:`1px dashed var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:8},children:`Set the coordinates in Settings`});let x=It(_.lat,_.lng,y),S={x:x.x-m/2,y:x.y-v/2},C=[],w=[];for(let e=Math.floor(S.x/Pt);e<=Math.floor((S.x+m)/Pt);e++)C.push(e);for(let e=Math.floor(S.y/Pt);e<=Math.floor((S.y+v)/Pt);e++)w.push(e);let T=2**y;return(0,B.jsxs)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:b,children:[(0,B.jsxs)(`div`,{role:`img`,"aria-label":c||`Map`,style:{position:`relative`,height:v,overflow:`hidden`,borderRadius:`inherit`,background:`var(--page-surface, #e5e7eb)`},children:[w.map(e=>C.map(t=>{let n=(t%T+T)%T;return e<0||e>=T?null:(0,B.jsx)(`img`,{src:`https://tile.openstreetmap.org/${y}/${n}/${e}.png`,alt:``,width:Pt,height:Pt,loading:`lazy`,style:{position:`absolute`,left:Math.round(t*Pt-S.x),top:Math.round(e*Pt-S.y),width:Pt,height:Pt,userSelect:`none`,pointerEvents:`none`}},`${t}-${e}`)})),g.map((e,t)=>{let n=It(Lt(e.lat,90),Lt(e.lng,180),y),r=n.x-S.x,i=n.y-S.y,s=e.color||`var(--page-accent, #dc2626)`,c=o===`none`||f?null:zt(Lt(e.lat,90),Lt(e.lng,180),o,e.title);return(0,B.jsxs)(c?`a`:`span`,{href:c||void 0,target:c?`_blank`:void 0,rel:c?`noopener noreferrer`:void 0,title:c&&e.title||void 0,style:{position:`absolute`,left:r,top:i,transform:`translate(-50%, -100%)`,cursor:c?`pointer`:`default`,textDecoration:`none`,color:`inherit`},children:[e.title?(0,B.jsx)(`span`,{style:{position:`absolute`,left:`50%`,bottom:`100%`,transform:`translateX(-50%)`,marginBottom:4,padding:`3px 7px`,borderRadius:6,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.5))`,boxShadow:`0 2px 8px rgba(15, 23, 42, 0.25)`,fontSize:12,lineHeight:1.35,whiteSpace:`nowrap`},children:e.title}):null,(0,B.jsxs)(`svg`,{width:Math.max(10,Number(a)||22),height:Math.max(10,Number(a)||22),viewBox:`0 0 24 24`,fill:s,style:{display:`block`},children:[(0,B.jsx)(`path`,{d:`M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z`}),Ht[e.icon]?(0,B.jsx)(`path`,{d:Ht[e.icon],transform:`translate(12 10.5) scale(0.46) translate(-12 -12)`,fill:`none`,stroke:`#fff`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`}):(0,B.jsx)(`circle`,{cx:`12`,cy:`10.5`,r:`2.6`,fill:`#fff`})]})]},t)}),(0,B.jsx)(`a`,{href:`https://www.openstreetmap.org/copyright`,target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{position:`absolute`,right:4,bottom:3,padding:`1px 5px`,borderRadius:4,background:`rgba(255, 255, 255, 0.75)`,color:`#334155`,fontSize:10,textDecoration:`none`},children:`© OpenStreetMap`})]}),s?(0,B.jsx)(`a`,{href:Bt(_.lat,_.lng,y),target:`_blank`,rel:`noopener noreferrer`,onClick:f?e=>e.preventDefault():void 0,style:{display:`inline-block`,marginTop:6,fontSize:12,color:`var(--page-accent, inherit)`},children:`View larger map`}):null]})}var Ht={check:`M4 12l5 5L20 6`,close:`M6 6l12 12M18 6L6 18`,plus:`M12 5v14M5 12h14`,minus:`M5 12h14`,"arrow-right":`M4 12h16M13 5l7 7-7 7`,"arrow-left":`M20 12H4M11 5l-7 7 7 7`,"arrow-up":`M12 20V4M5 11l7-7 7 7`,"arrow-down":`M12 4v16M5 13l7 7 7-7`,"chevron-right":`M9 5l7 7-7 7`,"chevron-left":`M15 5l-7 7 7 7`,"chevron-down":`M5 9l7 7 7-7`,"chevron-up":`M5 15l7-7 7 7`,menu:`M4 7h16M4 12h16M4 17h16`,star:`M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z`,heart:`M12 20s-7-4.4-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.6-7 9-7 9z`,home:`M4 11l8-7 8 7M6 10v9h12v-9`,user:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.3 3.6-5 8-5s8 1.7 8 5`,mail:`M3 6h18v12H3zM3 6l9 7 9-7`,phone:`M6 3h4l2 5-3 2a12 12 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2z`,search:`M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4.2-4.2`,clock:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2`,calendar:`M4 6h16v14H4zM4 10h16M8 3v4M16 3v4`,download:`M12 4v10M8 11l4 4 4-4M4 19h16`,upload:`M12 20V10M8 13l4-4 4 4M4 5h16`,play:`M8 5l11 7-11 7z`,pause:`M9 5v14M15 5v14`,info:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5M12 8h.01`,alert:`M12 4l9 16H3zM12 10v4M12 17h.01`,lock:`M6 11h12v9H6zM9 11V8a3 3 0 0 1 6 0v3`,chat:`M4 5h16v11H9l-5 4z`,"map-pin":`M12 21s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11zM12 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z`,camera:`M4 8h4l2-2h4l2 2h4v12H4zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z`,image:`M4 5h16v14H4zM8 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM6 17l5-5 4 4 2-2 3 3`,file:`M7 3h7l4 4v14H7zM14 3v5h4`,link:`M10 14a4 4 0 0 0 6 .5l2-2a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6-.5l-2 2a4 4 0 0 0 6 6l1-1`,external:`M14 4h6v6M20 4l-9 9M18 14v5H5V6h5`,trash:`M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13`,edit:`M4 20h4L19 9l-4-4L4 16z`,filter:`M3 5h18l-7 8v6l-4-2v-4z`,refresh:`M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5`,globe:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18`,bell:`M6 16V11a6 6 0 1 1 12 0v5l2 3H4zM10 22h4`,tag:`M4 4h7l9 9-7 7-9-9zM8.5 8.5h.01`,cart:`M4 5h2l2 10h10l2-7H7M9 20h.01M18 20h.01`,card:`M3 6h18v12H3zM3 10h18`,shield:`M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z`,sun:`M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19`,moon:`M20 14a8 8 0 1 1-10-10 7 7 0 0 0 10 10z`,settings:`M12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM12 2l1 2.6 2.7-.6 1 2.5 2.6 1-.6 2.7L21 12l-2.3 1.8.6 2.7-2.6 1-1 2.5-2.7-.6L12 22l-1-2.6-2.7.6-1-2.5-2.6-1 .6-2.7L3 12l2.3-1.8-.6-2.7 2.6-1 1-2.5 2.7.6z`,eye:`M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,"eye-off":`M4 4l16 16M9.5 9.6A3 3 0 0 0 12 15c.8 0 1.5-.3 2.1-.8M6.6 6.7C3.9 8.3 2 12 2 12s4 7 10 7c1.9 0 3.5-.5 4.9-1.2M14.1 5.4C13.4 5.1 12.7 5 12 5`,share:`M8 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 6a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM7.8 10.8l8.4-3.6M7.8 13.2l8.4 3.6`,send:`M21 3L3 10l7 3 3 7z`,paperclip:`M20 11l-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L15 6`,video:`M3 7h11v10H3zM14 11l6-3v8l-6-3`,music:`M9 18V6l10-2v12M9 18a2.5 2.5 0 1 1-2.5-2.5H9M19 16a2.5 2.5 0 1 1-2.5-2.5H19`,mic:`M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3zM5 11a7 7 0 0 0 14 0M12 18v3`,headphones:`M4 15v-3a8 8 0 1 1 16 0v3M4 15h3v5H5a1 1 0 0 1-1-1zM20 15h-3v5h2a1 1 0 0 0 1-1z`,book:`M5 4h14v16H7a2 2 0 0 1-2-2zM7 4v14h12`,bookmark:`M7 4h10v16l-5-4-5 4z`,folder:`M4 6h5l2 2h9v10H4z`,cloud:`M7 18a4 4 0 0 1 .5-8 5.5 5.5 0 0 1 10.4 1.5A3.5 3.5 0 0 1 17.5 18z`,database:`M12 3c4.4 0 8 1.3 8 3s-3.6 3-8 3-8-1.3-8-3 3.6-3 8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3`,server:`M4 4h16v6H4zM4 14h16v6H4zM8 7h.01M8 17h.01`,code:`M9 8l-5 4 5 4M15 8l5 4-5 4`,terminal:`M4 5h16v14H4zM8 10l3 2-3 2M13 14h4`,wifi:`M5 12a10 10 0 0 1 14 0M8 15a6 6 0 0 1 8 0M12 19h.01`,battery:`M3 8h15v8H3zM21 11v2`,printer:`M7 8V4h10v4M7 16H4V8h16v8h-3M7 13h10v7H7z`,gift:`M4 10h16v10H4zM3 6h18v4H3zM12 6v14M12 6c-2 0-4-1-4-2.5S9 2 10 3s2 3 2 3zM12 6c2 0 4-1 4-2.5S15 2 14 3s-2 3-2 3z`,key:`M15 4a5 5 0 1 0-4.6 7L9 12.4V15H6.5L4 17.5V20h4l7-7A5 5 0 0 0 15 4z`,compass:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM15 9l-2 5-5 2 2-5z`,flag:`M5 21V4h13l-2 4 2 4H5`,award:`M12 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM9 13l-1 7 4-2 4 2-1-7`,chart:`M4 20V4M4 20h16M8 16v-5M12 16V8M16 16v-8`,pie:`M12 3a9 9 0 1 0 9 9h-9z`,trending:`M3 17l6-6 4 4 8-8M15 7h6v6`,dollar:`M12 3v18M16 7.5C16 6 14.2 5 12 5S8 6 8 7.5 9.5 10 12 10.5s4 1.5 4 3-1.8 2.5-4 2.5-4-1-4-2.5`,percent:`M5 19L19 5M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM16.5 14a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z`,truck:`M3 6h11v9H3zM14 9h4l3 3v3h-7zM7.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM17.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z`,package:`M12 3l8 4v10l-8 4-8-4V7zM4 7l8 4 8-4M12 11v10`,store:`M4 9h16v11H4zM4 9l1.5-5h13L20 9M9 20v-6h6v6`,building:`M5 21V4h9v17M14 9h5v12M8 8h3M8 12h3M8 16h3M17 12h.01M17 16h.01`,users:`M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 20c0-3.3 3.1-5 7-5s7 1.7 7 5M17 5a4 4 0 0 1 0 7.9M22 20c0-2.6-1.6-4.2-4-4.8`,"thumbs-up":`M7 21V10h3l3-6a2 2 0 0 1 2 2v4h4l-2 11z`,smile:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9 10h.01M15 10h.01M8.5 14.5a5 5 0 0 0 7 0`,help:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7M12 17h.01`,checkbox:`M4 4h16v16H4zM8 12l3 3 5-5`,list:`M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01`,grid:`M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z`,layers:`M12 3l9 5-9 5-9-5zM3 13l9 5 9-5`,zap:`M13 3L5 14h6l-1 7 8-11h-6z`,flame:`M12 21a6 6 0 0 0 6-6c0-4-4-6-4-10 0 0-3 1.5-3 5 0 1.5-1 2-1.5 1.5C8 10 7.5 9 7.5 9A7.5 7.5 0 0 0 6 15a6 6 0 0 0 6 6z`,droplet:`M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z`,leaf:`M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7`};function Ut({name:e=`star`,paths:t,fill:n=!1,size:r=24,stroke:i=2,color:a=``,href:o=``,target:s=``,label:c=``,style:l,nodeRef:u,inert:d}){let f=Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim()):[],p=n&&f.length>0,m=f.length?f:[Ht[e]??Ht.star],h=Math.min(Math.max(Number(r)||24,8),240),g=a===`accent`?`var(--page-accent, currentColor)`:a||`currentColor`,_=(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:h,height:h,fill:p?g:`none`,stroke:p?`none`:g,strokeWidth:p?void 0:Math.min(Math.max(Number(i)||2,.5),4),strokeLinecap:p?void 0:`round`,strokeLinejoin:p?void 0:`round`,role:c?`img`:void 0,"aria-label":c||void 0,"aria-hidden":c?void 0:`true`,style:{display:`block`},children:m.map((e,t)=>(0,B.jsx)(`path`,{d:e},t))}),v={display:`inline-flex`,lineHeight:0,...k(l)};return o?(0,B.jsx)(`a`,{ref:u,href:o,onClick:d?e=>e.preventDefault():void 0,target:s||void 0,rel:s===`_blank`?`noopener noreferrer`:void 0,style:{...v,color:`inherit`},children:_}):(0,B.jsx)(`span`,{ref:u,style:v,children:_})}function Wt(e,t={},n=0){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],i=e=>e==null?``:Ve(e),a=Math.max(0,Number(n)||0),o=[];for(let e of r){let n=e.data??e,r=ze(n,t.imageField),s=(Array.isArray(r)?r:[r]).map(e=>e&&typeof e==`object`?e.url??e.src??``:e).filter(e=>typeof e==`string`&&e.trim()),c=t.nameField?i(ze(n,t.nameField)):i(n.name),l=t.hrefField?i(ze(n,t.hrefField)):``;for(let e of s)if(o.push({src:e,name:c,alt:c,href:l}),a&&o.length>=a)return o}return o}function Gt({images:e=[],source:t=``,entry:n=``,imageField:r=``,nameField:i=``,hrefField:a=``,limit:o=0,emptyText:s=``,columns:c=3,gap:u=8,showNames:d=!1,lightbox:f=!0,style:p,nodeRef:m,inert:h}){let{tenant:g,apiUrl:_}=(0,l.useContext)(Me),v=(0,l.useContext)(Ne)?.[t],[y,b]=(0,l.useState)(null),[x,S]=(0,l.useState)(()=>new Set);(0,l.useEffect)(()=>{if(!t||v)return;let e=!0;return fetch(`${_}/dynamic/${encodeURIComponent(t)}`,{headers:g?{"x-tenant":g}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&b(n)}).catch(()=>e&&b([])),()=>{e=!1}},[t,g,_,v]);let C=v??y??[],w=n?C.filter(e=>e?.id===n||e?.data?.slug===n||e?.slug===n):C,T=Math.max(0,Number(o)||0),E=t?(()=>{let e=Wt(w,{imageField:r,nameField:i,hrefField:a},0).filter(e=>!x.has(e.src));return T?e.slice(0,T):e})():null,D=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.src):[],O=E??D,A=!!t&&!v&&y===null,j=Math.max(0,Number(u)||0),ee=h?e=>e.preventDefault():void 0,[M,N]=(0,l.useState)(null),te=f&&!h&&M!==null&&O[M];(0,l.useEffect)(()=>{if(!te)return;let e=e=>{e.key===`Escape`&&N(null),e.key===`ArrowRight`&&N(e=>(e+1)%O.length),e.key===`ArrowLeft`&&N(e=>(e-1+O.length)%O.length)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[te,O.length]);let P=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,B.jsxs)(`div`,{ref:m,style:{columnCount:Math.min(Math.max(Number(c)||3,1),8),columnGap:j,width:`100%`,...k(p)},children:[O.map((e,n)=>{let r=(0,B.jsxs)(`span`,{style:{position:`relative`,display:`block`,borderRadius:`inherit`,overflow:`hidden`},children:[(0,B.jsx)(`img`,{src:e.src,alt:e.alt??``,onError:t?()=>S(t=>new Set(t).add(e.src)):void 0,style:{width:`100%`,display:`block`,borderRadius:`inherit`}}),d&&P(e)&&(0,B.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:P(e)})]}),i=e.href?(0,B.jsx)(`a`,{href:e.href,onClick:ee,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:{display:`block`,borderRadius:`inherit`},children:r}):f&&!h?(0,B.jsx)(`span`,{role:`button`,tabIndex:0,onClick:()=>N(n),onKeyDown:e=>(e.key===`Enter`||e.key===` `)&&N(n),style:{display:`block`,borderRadius:`inherit`,cursor:`zoom-in`},children:r}):r;return(0,B.jsx)(`div`,{style:{breakInside:`avoid`,marginBottom:j,borderRadius:`inherit`,overflow:`hidden`},children:i},n)}),!O.length&&!A&&(0,B.jsx)(`div`,{style:{padding:`24px 12px`,fontSize:13,opacity:.55,textAlign:`center`,columnSpan:`all`},children:t?s||`No images yet`:`Pick images in Settings to fill the gallery`}),te&&(0,B.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,onClick:()=>N(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,B.jsx)(`img`,{src:O[M].src,alt:O[M].alt??``,onClick:e=>e.stopPropagation(),style:{maxWidth:`92vw`,maxHeight:`84vh`,borderRadius:8,boxShadow:`0 12px 48px rgba(0,0,0,0.5)`}}),P(O[M])&&(0,B.jsx)(`div`,{style:{color:`#fff`,fontSize:14,marginTop:12,opacity:.85},children:P(O[M])}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>N(null),style:{position:`absolute`,top:16,right:20,background:`transparent`,border:0,color:`#fff`,fontSize:28,lineHeight:1,cursor:`pointer`},children:`×`}),O.length>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`Previous`,onClick:e=>{e.stopPropagation(),N(e=>(e-1+O.length)%O.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,B.jsx)(`button`,{type:`button`,"aria-label":`Next`,onClick:e=>{e.stopPropagation(),N(e=>(e+1)%O.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 Kt={color:`inherit`,textDecoration:`none`,fontSize:14,opacity:.85},qt={background:`var(--page-surface, #f2f2f2)`,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 Jt(e,t={},n=`dropdown`){let r=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&e.id):[],i=e=>Array.isArray(e)?e[0]:e,a=e=>e==null?``:Ve(e),o=r.map(e=>{let n=e.data??{},r=t.parentField?i(n[t.parentField]):null;return{key:e.id,parent:(r&&typeof r==`object`?r.id:r)||null,label:a(n[t.labelField||`name`])||a(n.name)||`Untitled`,href:t.hrefField?a(n[t.hrefField]):``,image:t.imageField&&i(n[t.imageField])||``,desc:t.descField?a(n[t.descField]):``}}),s=new Map(o.map(e=>[e.key,e])),c=e=>{let t=new Set,n=e;for(;n.parent&&s.has(n.parent)&&!t.has(n.key);)t.add(n.key),n=s.get(n.parent);return n},l=[],u=new Map;for(let e of o){if(c(e)!==e)continue;let t={key:e.key,label:e.label,href:e.href,image:e.image,children:[]};u.set(e.key,t),l.push(t)}for(let e of o){let t=c(e);t!==e&&u.get(t.key)?.children.push({key:e.key,label:e.label,href:e.href,image:e.image,desc:e.desc})}return l.map(e=>({...e,type:e.children.length?n:`link`}))}function Yt({brand:e,logo:t,brandHref:n,brandTarget:r,links:i=[],style:a,nodeRef:o,menu:s=`auto`,breakpoint:c=768,source:u=``,labelField:d=``,hrefField:f=``,imageField:p=``,descField:m=``,parentField:h=``,submenu:g=`dropdown`}){let[_,v]=(0,l.useState)(null),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(!1),[C,w]=(0,l.useState)(null),{tenant:T,apiUrl:E}=(0,l.useContext)(Me),D=(0,l.useContext)(Ne)?.[u],[O,A]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!u||D)return;let e=!0;return fetch(`${E}/dynamic/${encodeURIComponent(u)}`,{headers:T?{"x-tenant":T}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&A(n)}).catch(()=>e&&A([])),()=>{e=!1}},[u,T,E,D]),(0,l.useEffect)(()=>{if(!_)return;let e=new ResizeObserver(()=>b(_.offsetWidth<c));return e.observe(_),()=>e.disconnect()},[_,c]);let j=u?Jt(D??O??[],{labelField:d,hrefField:f,imageField:p,descField:m,parentField:h},g):i,ee=s===`hamburger`||s===`auto`&&y,M=(e,t,n=!1)=>{let r=e.image?(0,B.jsx)(`img`,{src:e.image,alt:``,style:n?{width:`100%`,aspectRatio:`16 / 9`,objectFit:`cover`,borderRadius:6,display:`block`,marginBottom:8}:{width:22,height:22,objectFit:`cover`,borderRadius:4,display:`block`,flexShrink:0}}):null;return(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...Kt,display:n?`block`:`flex`,alignItems:n?void 0:`center`,gap:n?void 0:10,...t},children:[r,(0,B.jsxs)(`span`,{style:{display:`block`,minWidth:0},children:[e.label,e.desc&&(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6,marginTop:2},children:e.desc})]})]},e.key)};return(0,B.jsxs)(`nav`,{ref:e=>{v(e),o&&o(e)},style:{display:`flex`,alignItems:`center`,gap:24,flexWrap:`wrap`,padding:`14px 24px`,width:`100%`,position:`relative`,...k(a)},children:[(t||e)&&(()=>{let i=(0,B.jsxs)(B.Fragment,{children:[t&&(0,B.jsx)(`img`,{src:t,alt:e||`Logo`,style:{height:28,display:`block`}}),e&&(0,B.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,B.jsx)(`a`,{href:n,target:r||void 0,rel:r===`_blank`?`noopener noreferrer`:void 0,style:a,children:i}):(0,B.jsx)(`div`,{style:a,children:i})})(),(0,B.jsx)(`div`,{style:{flexGrow:1}}),ee?(0,B.jsx)(`button`,{type:`button`,"aria-label":x?`Close menu`:`Open menu`,onClick:()=>S(!x),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:4},children:x?`✕`:`☰`}):(0,B.jsx)(`div`,{style:{display:`flex`,gap:20,alignItems:`center`,flexWrap:`wrap`},children:j.map(e=>{let t=e.children??[];if(!t.length)return(0,B.jsx)(`a`,{href:e.href||`#`,style:Kt,children:e.label},e.key);let n=e.type===`mega`;return(0,B.jsxs)(`span`,{style:{position:n?`static`:`relative`,display:`inline-flex`},onMouseEnter:()=>w(e.key),onMouseLeave:()=>w(null),children:[(0,B.jsxs)(`a`,{href:e.href||`#`,style:{...Kt,cursor:`pointer`},children:[e.label,` `,(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6},children:`▼`})]}),C===e.key&&(n?(0,B.jsx)(`div`,{style:{...qt,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=>M(e,{padding:8,borderRadius:8},!0))}):(0,B.jsx)(`div`,{style:{...qt,position:`absolute`,top:`100%`,left:0,minWidth:190,borderRadius:8,padding:8,display:`flex`,flexDirection:`column`},children:t.map(e=>M(e,{padding:`8px 12px`,borderRadius:6}))}))]},e.key)})}),ee&&x&&(0,B.jsx)(`div`,{style:{flexBasis:`100%`,width:`100%`,display:`flex`,flexDirection:`column`,paddingTop:10},children:j.map(e=>(0,B.jsxs)(l.Fragment,{children:[(0,B.jsx)(`a`,{href:e.href||`#`,style:{...Kt,padding:`10px 4px`,fontWeight:(e.children??[]).length?600:400,opacity:1},children:e.label}),(e.children??[]).map(e=>M(e,{padding:`8px 4px 8px 22px`}))]},e.key))})]})}function Xt({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,B.jsxs)(`div`,{ref:r,style:{width:`100%`,...k(n)},children:[(0,B.jsx)(`div`,{style:{display:`flex`,gap:4,borderBottom:`1px solid rgba(148, 163, 184, 0.35)`},children:e.map((e,t)=>(0,B.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,B.jsx)(`div`,{style:{display:n===o?`flex`:`none`,flexDirection:`column`},children:t?.[e.key]??null},e.key))]}):null}function Zt({items:e=[],linked:t,multiple:n=!1,icon:r=``,padX:i,padY:a,headerBg:o,headerColor:s,openBg:c,openColor:u,borderColor:d,style:f,nodeRef:p}){let[m,h]=(0,l.useState)(()=>new Set(e.length?[e[0].key]:[]));if(!e.length)return null;let g=(e,t)=>typeof e==`string`&&e?e:t,_=(e,t)=>{let n=Number(e);return e===``||e==null||!Number.isFinite(n)?t:n},v=Ht[r],y=e=>h(t=>{let r=new Set(n?t:[]);return t.has(e)?r.delete(e):r.add(e),r});return(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...k(f)},children:e.map((n,r)=>{let l=m.has(n.key);return(0,B.jsxs)(`div`,{style:{borderBottom:r<e.length-1?`1px solid ${g(d,`rgba(148, 163, 184, 0.35)`)}`:`none`},children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>y(n.key),style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,background:l?g(c,g(o,`transparent`)):g(o,`transparent`),border:0,padding:`${_(a,14)}px ${_(i,4)}px`,fontSize:15,fontWeight:600,fontFamily:`inherit`,color:l?g(u,g(s,`inherit`)):g(s,`inherit`),textAlign:`left`,cursor:`pointer`,transition:`background 180ms, color 180ms`},children:[(0,B.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:10,minWidth:0},children:[v?(0,B.jsx)(`svg`,{viewBox:`0 0 24 24`,width:16,height:16,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0},children:(0,B.jsx)(`path`,{d:v})}):null,n.title||`Item ${r+1}`]}),(0,B.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:12,opacity:.6,transform:l?`rotate(180deg)`:`none`,transition:`transform 180ms`},children:`▼`})]}),(0,B.jsx)(`div`,{style:{display:l?`flex`:`none`,flexDirection:`column`},children:t?.[n.key]??null})]},n.key)})})}var Qt={display:`flex`,flexDirection:`column`,gap:`12px`},$t={fontSize:`14px`,fontWeight:500,color:`var(--page-text, #111827)`},en={padding:`10px 12px`,border:`1px solid var(--page-border, #d1d5db)`,borderRadius:`6px`,fontSize:`14px`,fontFamily:`inherit`,width:`100%`,boxSizing:`border-box`,backgroundColor:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`},tn={display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`14px`,color:`var(--page-text, #111827)`},nn=e=>e?{readOnly:!0,tabIndex:-1,onMouseDown:e=>e.preventDefault()}:{};function rn(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 an={display:`flex`,flexDirection:`column`,gap:6},on={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 sn(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):[]}var cn=`g-recaptcha-response`,ln=e=>e?.type===`recaptcha`?cn:e?.name;function un({field:e,value:t,onChange:n,inert:r,values:i}){let a=(0,B.jsxs)(`span`,{style:{...$t,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:on,value:t??``,onChange:t=>n(e.name,t.target.value)};return e.type===`display`?(0,B.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,B.jsx)(`img`,{src:e.src,alt:e.label??``,style:{width:`100%`,borderRadius:8,display:`block`}}):null:e.type===`recaptcha`?(0,B.jsx)(hn,{theme:e.captchaTheme,size:e.captchaSize,inert:r,onChange:e=>n(cn,e)}):e.type===`video`?e.src?/youtube\.com|youtu\.be|vimeo\.com/i.test(e.src)?(0,B.jsx)(xt,{url:e.src,style:{width:`100%`}}):(0,B.jsx)(`video`,{src:e.src,controls:!0,style:{width:`100%`,borderRadius:8,display:`block`}}):null:(0,B.jsxs)(`label`,{style:an,children:[a,e.type===`textarea`||e.multiline?(0,B.jsx)(`textarea`,{...o,rows:4,style:{...on,resize:`vertical`}}):e.type===`select`?(0,B.jsxs)(`select`,{...o,disabled:o.disabled||!!e.parentField&&!i?.[e.parentField],children:[(0,B.jsx)(`option`,{value:``,children:e.placeholder||`—`}),sn(e,i).map((e,t)=>(0,B.jsx)(`option`,{value:typeof e==`string`?e:e.value,children:typeof e==`string`?e:e.label??e.value},t))]}):e.type===`checkbox`?(0,B.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,B.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,B.jsx)(`input`,{...o,type:{email:`email`,number:`number`,date:`date`,datetime:`datetime-local`,phone:`tel`,link:`url`}[e.type]??`text`}),e.help&&(0,B.jsx)(`span`,{style:{fontSize:12,opacity:.65},children:e.help})]})}function dn({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:m,apiUrl:h}=(0,l.useContext)(Me),[g,_]=(0,l.useState)(`form`),[v,y]=(0,l.useState)(null),[b,x]=(0,l.useState)({}),[S,C]=(0,l.useState)(0),w=u?p||`form`:g;(0,l.useEffect)(()=>{if(!o||!a)return;let e=!0;return fetch(`${h||`/api`}/forms/${encodeURIComponent(a)}`,{headers:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(t=>e&&y(t?.payload&&typeof t.payload==`object`?t.payload:null)).catch(()=>e&&y(null)),()=>{e=!1}},[o,a,m,h]);let T=[{section:null,fields:[]}];for(let e of Array.isArray(v?.fields)?v.fields:[])e.type===`section`?T.push({section:e,fields:[]}):T[T.length-1].fields.push(e);let E=T.filter(e=>e.section||e.fields.length),D=E.filter(e=>!e.section||rn(e.section.condition,b)).map(e=>({...e,fields:e.fields.filter(e=>rn(e.condition,b))})),O=E.length>1,A=Math.min(S,Math.max(0,D.length-1)),j=O?D[A]?.fields??[]:D.flatMap(e=>e.fields),ee=j.filter(e=>{let t=b[ln(e)];return e.required&&(t==null||t===``||t===!1)}),M=A>=D.length-1,N=(e,t)=>x(n=>{let r={...n,[e]:t};for(let t of Array.isArray(v?.fields)?v.fields:[])t?.parentField===e&&delete r[t.name];return r});return(0,B.jsxs)(`div`,{ref:c,style:k(e),children:[(0,B.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(b))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(`${h||`/api`}/forms/${a}/submit`,{method:`post`,headers:{"content-type":`application/json`,...m?{"x-tenant":m}:{}},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);_(e.ok&&n?.success!==!1?`success`:`error`)}catch{_(`error`)}return}if(!t){_(`success`);return}try{let r=await fetch(t,{method:n||`post`,body:new FormData(e.currentTarget)});_(r.ok?`success`:`error`)}catch{_(`error`)}}},style:{...Qt,display:w===`success`?`none`:`flex`},children:o&&a?(0,B.jsxs)(B.Fragment,{children:[O&&(0,B.jsx)(zn,{steps:D.map(e=>({label:e.section?.label??`Start`})),active:A+1,style:{marginBottom:8}}),O&&D[A]?.section?.help&&(0,B.jsx)(`p`,{style:{margin:0,fontSize:14,opacity:.7},children:D[A].section.help}),j.map(e=>(0,B.jsx)(un,{field:e,value:b[ln(e)],values:b,onChange:N,inert:u},e.name)),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`,marginTop:4},children:[O&&A>0&&(0,B.jsx)(`button`,{type:`button`,disabled:u||void 0,onClick:()=>C(A-1),style:{...qe,background:`transparent`,color:`inherit`,border:0,padding:`10px 16px`,cursor:`pointer`},children:`Back`}),O&&!M?(0,B.jsx)(`button`,{type:`button`,disabled:u||ee.length>0,onClick:()=>C(A+1),style:{...qe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:ee.length?.5:1},children:`Next`}):(0,B.jsx)(`button`,{type:`submit`,disabled:u||void 0,style:{...qe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`},children:s||`Submit`})]})]}):d}),(0,B.jsx)(`div`,{style:{display:w===`success`?`block`:`none`},children:f?.success??null}),(0,B.jsx)(`div`,{style:{display:w===`error`?`block`:`none`,marginTop:12},children:f?.error??null})]})}var fn=null,pn=null,mn=e=>{let t=typeof e==`string`&&e.trim()?e.trim():``;if(fn&&pn===t)return fn;if(fn&&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 pn=t,fn=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)}),fn};function hn({siteKey:e,theme:t,size:n,hl:r,style:i,nodeRef:a,inert:o,onChange:s}){let c=(0,l.useContext)(Me),u=c?.settings&&typeof c.settings==`object`?c.settings[`google.recaptchaKey`]:``,d=typeof e==`string`&&e.trim()||(typeof u==`string`?u.trim():``),f=(0,l.useRef)(null),p=(0,l.useRef)(s);if(p.current=s,(0,l.useEffect)(()=>{if(o||!d||!f.current)return;let e=!0,i=t=>{e&&typeof p.current==`function`&&p.current(t)};return mn(r).then(r=>{if(!(!e||!f.current||!r?.render)){f.current.innerHTML=``,i(``);try{r.render(f.current,{sitekey:d,theme:t===`dark`?`dark`:`light`,size:n===`compact`?`compact`:`normal`,callback:e=>i(typeof e==`string`?e:``),"expired-callback":()=>i(``),"error-callback":()=>i(``)})}catch{}}}),()=>{e=!1}},[o,d,t,n,r]),o){let e=t===`dark`;return(0,B.jsxs)(`div`,{ref:a,style:k(i),children:[(0,B.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,B.jsx)(`span`,{style:{width:24,height:24,flexShrink:0,borderRadius:3,border:`2px solid ${e?`#8a8f94`:`#c1c1c1`}`,background:e?`#2f3337`:`#fff`}}),(0,B.jsx)(`span`,{style:{flexGrow:1},children:`I'm not a robot`}),(0,B.jsx)(`span`,{style:{fontSize:9,opacity:.6,textAlign:`center`,lineHeight:1.3},children:`reCAPTCHA`})]}),!d&&(0,B.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 d?(0,B.jsx)(`div`,{ref:a,style:k(i),children:(0,B.jsx)(`div`,{ref:f})}):null}function gn({text:e,parts:t,style:n,nodeRef:r,linked:i}){return(0,B.jsx)(`label`,{ref:r,style:{...$t,...k(n)},children:V(t,e,i)})}function _n({type:e=`text`,name:t,placeholder:n,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`input`,{ref:a,type:e,name:t||void 0,placeholder:n,required:!o&&!!r,style:{...en,...k(i)},...nn(o)})}function vn({name:e,placeholder:t,rows:n=4,required:r,style:i,nodeRef:a,inert:o}){return(0,B.jsx)(`textarea`,{ref:a,name:e||void 0,placeholder:t,rows:n,required:!o&&!!r,style:{...en,resize:`vertical`,...k(i)},...nn(o)})}function yn({kind:e=`checkbox`,label:t,name:n,value:r,required:i,style:a,nodeRef:o,inert:s}){return(0,B.jsxs)(`label`,{ref:o,style:{...tn,...k(a)},children:[(0,B.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 bn({name:e,placeholder:t,options:n=[],required:r,style:i,nodeRef:a,inert:o}){return(0,B.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:{...en,appearance:`auto`,...k(i)},children:[t!==``&&(0,B.jsx)(`option`,{value:``,disabled:!0,children:t??`Select…`}),n.map((e,t)=>(0,B.jsx)(`option`,{value:e,children:e},t))]})}function xn({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,B.jsxs)(`label`,{ref:a,style:{...en,display:`flex`,alignItems:`center`,gap:`8px`,cursor:o?`default`:`pointer`,borderStyle:`dashed`,color:s?`#111827`:`#6b7280`,...k(i)},children:[(0,B.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,B.jsx)(`span`,{"aria-hidden":!0,children:`📎`}),s??r]})}function Sn({text:e=`Submit`,style:t,nodeRef:n,inert:r}){return(0,B.jsx)(`button`,{ref:n,type:r?`button`:`submit`,style:{...qe,border:0,cursor:`pointer`,alignSelf:`flex-start`,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,lineHeight:1.4,fontFamily:`inherit`,...k(t)},children:e})}function Cn({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,B.jsx)(`div`,{ref:r,style:{display:`grid`,gridTemplateColumns:`repeat(${Math.max(1,Number(e)||1)}, minmax(0, 1fr))`,gap:16,width:`100%`,...k(n)},children:Array.from({length:a},(e,t)=>(0,B.jsx)(`div`,{style:{minWidth:0},children:i?.[`cell-${t}`]??null},t))})}function wn({collection:e,limit:t=6,layout:n=`grid`,columns:r=3,imageField:i,titleField:a=`name`,textField:o,custom:s,templateId:c,paged:u,filters:d,style:f,nodeRef:p}){let{tenant:m,apiUrl:h,locale:g}=(0,l.useContext)(Me),_=(0,l.useContext)(Le),v=(0,l.useContext)(Ne),[,y]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>y(e=>e+1);return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]);let b=Ie(d),x=JSON.stringify(b),S=x!==`{}`&&!e?.startsWith?.(`api:`),C=S?null:v?.[e],w=u?Pe(v):1,[T,E]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!e||C)return;let n=!0,r=new URLSearchParams;if(g&&r.set(`locale`,g),S&&r.set(`data_filter`,x),u&&!e.startsWith(`api:`)){let e=Math.max(1,Number(t)||6);r.set(`offset`,String((w-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:m?{"x-tenant":m}:{}}).then(e=>e.json()).then(e=>{let t=Array.isArray(e?.payload)?e.payload:Array.isArray(e?.payload?.data)?e.payload.data:[];return n&&E(t.filter(e=>e&&typeof e==`object`))}).catch(()=>n&&E([])),()=>{n=!1}},[e,m,h,g,C,u,w,t,S,x]),!e)return null;let D=Math.max(1,Number(t)||6),O=u?C||e.startsWith(`api:`)?(C??T??[]).slice((w-1)*D,w*D):(T??[]).slice(0,D):(C??T??[]).slice(0,D),A=Math.min(Math.max(Number(r)||3,1),6),j=n===`list`?{display:`flex`,flexDirection:`column`,gap:20}:{display:`grid`,gridTemplateColumns:`repeat(${A}, minmax(0, 1fr))`,gap:24};return s&&c&&_?.render?(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>(0,B.jsx)(`div`,{style:{minWidth:0},children:_.render(c,t=>He(t,e))},e.id??e?.data?.slug))}):(0,B.jsx)(`div`,{ref:p,style:{width:`100%`,...j,...k(f)},children:O.map(e=>{let t=i?ze(e?.data,i):null,r=a?Ve(ze(e?.data,a)):null,s=o?ze(e?.data,o):null,c=Array.isArray(s)?s:null,l=c||s==null?null:Ve(s),u=n===`list`;return(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:u?`row`:`column`,gap:u?20:12,alignItems:u?`center`:`stretch`,minWidth:0},children:[t&&(0,B.jsx)(`img`,{src:t,alt:r??``,style:{width:u?160:`100%`,aspectRatio:`3 / 2`,objectFit:`cover`,borderRadius:10,flexShrink:0,display:`block`}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[r&&(0,B.jsx)(`h3`,{style:{margin:0,fontSize:18,fontWeight:700},children:r}),l&&(0,B.jsx)(`p`,{style:{margin:`6px 0 0`,fontSize:14,lineHeight:1.55,opacity:.75},children:l}),c&&(0,B.jsx)(`div`,{style:{marginTop:6,fontSize:14,lineHeight:1.55,opacity:.85},children:lt(c)})]})]},e.id??e?.data?.slug)})})}function Tn({fields:e=[],buttonLabel:t=`Search`,style:n,nodeRef:r,inert:i}){let a=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&typeof e.name==`string`&&e.name):[],o=i?{}:Fe(),s={height:34,padding:`0 12px`,borderRadius:8,border:`1px solid var(--page-border, rgba(100, 116, 139, 0.4))`,background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,fontSize:13,fontFamily:`inherit`,outline:`none`,minWidth:140,flex:`0 1 auto`,boxSizing:`border-box`},c=e=>{let t=e&&typeof e==`object`?e.value:e,n=e&&typeof e==`object`?e.label??e.value:e;return{value:String(t??``),label:String(n??``)}};return(0,B.jsxs)(`form`,{ref:r,method:`get`,onSubmit:e=>{if(i){e.preventDefault();return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);for(let e of[...t.keys()])(e.startsWith(`f_`)||e===`page`)&&t.delete(e);for(let[n,r]of new FormData(e.currentTarget).entries())n.startsWith(`f_`)&&typeof r==`string`&&r.trim()!==``&&t.set(n,r);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`))},style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,width:`100%`,...k(n)},children:[a.map(e=>Array.isArray(e.options)&&e.options.length>0||e.type===`option`||e.type===`select`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...nn(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(Array.isArray(e.options)?e.options:[]).map(e=>{let t=c(e);return(0,B.jsx)(`option`,{value:t.value,children:t.label},t.value)})]},e.name):e.type===`switch`?(0,B.jsxs)(`select`,{name:`f_${e.name}`,defaultValue:o[e.name]??``,style:s,...nn(i),children:[(0,B.jsx)(`option`,{value:``,children:e.label||e.name}),(0,B.jsx)(`option`,{value:`true`,children:`Yes`}),(0,B.jsx)(`option`,{value:`false`,children:`No`})]},e.name):(0,B.jsx)(`input`,{type:`text`,name:`f_${e.name}`,defaultValue:o[e.name]??``,placeholder:e.label||e.name,style:s,...nn(i)},e.name)),(0,B.jsx)(`button`,{type:`submit`,style:{...s,minWidth:0,padding:`0 18px`,border:`none`,background:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`,fontWeight:600,cursor:i?`default`:`pointer`},...nn(i),children:t})]})}function En({items:e=[],separator:t=`/`,style:n,nodeRef:r}){return e.length?(0,B.jsx)(`nav`,{ref:r,"aria-label":`Breadcrumb`,style:{...k(n)},children:(0,B.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,B.jsxs)(`li`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},"aria-hidden":!0,children:t}),i||!n.href?(0,B.jsx)(`span`,{style:{fontWeight:i?600:400,opacity:i?1:.7},"aria-current":i?`page`:void 0,children:n.label}):(0,B.jsx)(`a`,{href:n.href,style:{color:`inherit`,opacity:.7,textDecoration:`none`},children:n.label})]},r)})})}):null}function Dn({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)(Me),m=(0,l.useContext)(Ne),[h,g]=(0,l.useState)(null),_=i?Number(m?.[`${i}:total`]):NaN;(0,l.useEffect)(()=>{if(!i||Number.isFinite(_))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));g(Number.isFinite(r)?r:0)}).catch(()=>e&&g(0)),()=>{e=!1}},[i,f,p,_]);let v=Math.max(1,Number(a)||6),y=Number.isFinite(_)?_:h;if(i&&y===null||i&&s&&!(y>0))return null;let b=Math.min(Math.max(i?Math.ceil(y/v):Number(e)||1,1),50),x=Math.min(Math.max(i?Pe(m):Number(t)||1,1),b),S=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)):`#`},C=o===`center`?`center`:o===`right`?`flex-end`:`flex-start`,w=c?e=>e.preventDefault():void 0,T=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,B.jsxs)(`nav`,{ref:d,"aria-label":`Pagination`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`,justifyContent:C,...k(u)},children:[n&&(0,B.jsx)(`a`,{href:x>1?S(x-1):`#`,onClick:w,"aria-label":`Previous`,style:{...T(!1),opacity:x>1?1:.4},children:`‹`}),Array.from({length:b},(e,t)=>t+1).map(e=>(0,B.jsx)(`a`,{href:S(e),onClick:w,"aria-current":e===x?`page`:void 0,style:T(e===x),children:e},e)),n&&(0,B.jsx)(`a`,{href:x<b?S(x+1):`#`,onClick:w,"aria-label":`Next`,style:{...T(!1),opacity:x<b?1:.4},children:`›`})]})}var On=`webim.page_mode`,kn=()=>{if(typeof window>`u`)return`auto`;try{let e=window.localStorage.getItem(On);return e===`light`||e===`dark`?e:`auto`}catch{return`auto`}},An=e=>{let t={width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`light`?(0,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,B.jsx)(`path`,{d:`M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4`})]}):e===`dark`?(0,B.jsx)(`svg`,{...t,children:(0,B.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})}):(0,B.jsxs)(`svg`,{...t,children:[(0,B.jsx)(`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`}),(0,B.jsx)(`path`,{d:`M8 21h8M12 17v4`})]})},jn={light:`Light theme`,dark:`Dark theme`,auto:`Follow the device theme`};function Mn({variant:e,showSystem:t,style:n,nodeRef:r,inert:i}){let[a,o]=(0,l.useState)(i?`auto`:kn),s=(0,l.useRef)(null),c=e=>{s.current=e,typeof r==`function`&&r(e)};(0,l.useEffect)(()=>{if(i)return;let e=s.current?.closest?.(`.webim-page`);e&&(a===`light`||a===`dark`?e.setAttribute(`data-webim-mode`,a):e.removeAttribute(`data-webim-mode`));try{a===`auto`?window.localStorage.removeItem(On):window.localStorage.setItem(On,a)}catch{}},[a,i]);let u=t===!1?[`light`,`dark`]:[`light`,`dark`,`auto`],d=u.includes(a)?a:u[0],f={appearance:`none`,border:0,margin:0,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`transparent`,color:`inherit`,font:`inherit`,cursor:i?`default`:`pointer`,borderRadius:999};if(e===`buttons`)return(0,B.jsx)(`div`,{ref:c,role:`group`,"aria-label":`Theme`,style:{display:`inline-flex`,alignItems:`center`,gap:2,padding:3,borderRadius:999,border:`1px solid rgba(148, 163, 184, 0.4)`,...k(n)},children:u.map(e=>(0,B.jsx)(`button`,{type:`button`,title:jn[e],"aria-label":jn[e],"aria-pressed":e===d,onClick:i?void 0:()=>o(e),style:{...f,width:28,height:28,color:e===d?`var(--page-accent-text, #ffffff)`:`inherit`,background:e===d?`var(--page-accent, #111827)`:`transparent`,opacity:e===d?1:.7},children:An(e)},e))});let p=u[(u.indexOf(d)+1)%u.length];return(0,B.jsx)(`button`,{ref:c,type:`button`,title:jn[d],"aria-label":`Theme: ${jn[d]} — switch to ${jn[p]}`,onClick:i?void 0:()=>o(p),style:{...f,width:36,height:36,border:`1px solid rgba(148, 163, 184, 0.4)`,...k(n)},children:An(d)})}function Nn(e){let t=e?.parentElement;for(;t&&t!==document.body;){let e=getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return window}var Pn=e=>e===window?window.scrollY:e.scrollTop,Fn={"bottom-right":e=>({right:e,bottom:e}),"bottom-left":e=>({left:e,bottom:e}),"bottom-center":e=>({left:`50%`,bottom:e,transform:`translateX(-50%)`})};function In({variant:e,label:t,position:n,offset:r,showAfter:i,smooth:a,bg:o,fg:s,style:c,nodeRef:u,inert:d,frame:f,builder:p}){let[m,h]=(0,l.useState)(!!d),[g,_]=(0,l.useState)(null),v=e=>{_(e),typeof u==`function`&&u(e)};(0,l.useEffect)(()=>{if(d){h(!0);return}if(!g)return;let e=Number(i)>=0?Number(i):300,t=()=>{let t=Nn(g),n=p&&!(t===window?document.documentElement.scrollHeight>window.innerHeight:t.scrollHeight>t.clientHeight);h(n||Pn(t)>e)};return t(),document.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,t,{capture:!0})},[d,g,i,p]);let y=()=>{if(d)return;let e=Nn(g),t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,n=a===!1||t?`auto`:`smooth`;e===window?window.scrollTo({top:0,behavior:n}):e.scrollTo({top:0,behavior:n})},b=Number(r)>=0?Number(r):24,x=e===`pill`,S=t||`Top`,C=Fn[n]?n:`bottom-right`,w=f?{position:`fixed`,zIndex:5,bottom:(f.bottom??0)+b,...C===`bottom-left`?{left:(f.left??0)+b}:null,...C===`bottom-right`?{right:(f.right??0)+b}:null,...C===`bottom-center`?{left:(f.left??0)+(f.width??0)/2,transform:`translateX(-50%)`}:null}:{position:`fixed`,zIndex:2147482e3,...Fn[C](b)};return(0,B.jsxs)(`button`,{ref:v,type:`button`,title:S,"aria-label":S,"aria-hidden":!m,tabIndex:m?0:-1,onClick:y,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:x?8:0,appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,width:x?`auto`:44,height:44,padding:x?`0 18px`:0,borderRadius:999,border:`1px solid transparent`,background:o||`var(--page-accent, #111827)`,color:s||`var(--page-accent-text, #ffffff)`,boxShadow:`0 6px 20px rgba(15, 23, 42, 0.25)`,cursor:d?`default`:`pointer`,opacity:+!!m,pointerEvents:m?`auto`:`none`,transition:`opacity 160ms ease, transform 160ms ease`,...w,...k(c),...w.transform?{transform:w.transform}:null},children:[(0,B.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M12 19V5M12 5l-7 7M12 5l7 7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),x?(0,B.jsx)(`span`,{children:S}):null]})}var Ln={facebook:{label:`Facebook`,color:`#1877f2`,d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`},instagram:{label:`Instagram`,color:`#e4405f`,d:`M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06zm0 5.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z`},x:{label:`X (Twitter)`,color:`#000000`,d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`},linkedin:{label:`LinkedIn`,color:`#0a66c2`,d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`},youtube:{label:`YouTube`,color:`#ff0000`,d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`},tiktok:{label:`TikTok`,color:`#000000`,d:`M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z`},whatsapp:{label:`WhatsApp`,color:`#25d366`,d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z`},telegram:{label:`Telegram`,color:`#26a5e4`,d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`},pinterest:{label:`Pinterest`,color:`#bd081c`,d:`M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.03-.655 2.569-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z`},github:{label:`GitHub`,color:`#181717`,d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`},discord:{label:`Discord`,color:`#5865f2`,d:`M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.865-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.058a.082.082 0 00.031.056 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.873-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.009c.12.099.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z`},email:{label:`E-mail`,color:`#64748b`,d:`M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z`},website:{label:`Website`,color:`#64748b`,d:`M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z`}};function Rn({links:e=[],variant:t,color:n,size:r,gap:i,newTab:a,style:o,nodeRef:s,inert:c}){let l=Array.isArray(e)?e.filter(e=>e&&Ln[e.network]):[];if(!l.length)return null;let u=Math.min(Math.max(Number(r)||18,10),64),d=Math.round(u*1.9),f=Number.isFinite(Number(i))?Number(i):10,p=e=>n===`accent`?`var(--page-accent, #111827)`:n===`inherit`?`currentColor`:e.color,m=c?e=>e.preventDefault():void 0;return(0,B.jsx)(`div`,{ref:s,style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:f,...k(o)},children:l.map((e,r)=>{let i=Ln[e.network],o=t!==`outline`&&t!==`plain`,s=o?n===`accent`?`var(--page-accent-text, #ffffff)`:n===`inherit`?`var(--page-bg, #ffffff)`:`#ffffff`:p(i);return(0,B.jsx)(`a`,{href:e.url||`#`,onClick:m,"aria-label":e.label||i.label,title:e.label||i.label,...a!==!1&&!c?{target:`_blank`,rel:`noopener noreferrer`}:{},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:t===`plain`?u:d,height:t===`plain`?u:d,borderRadius:`50%`,background:o?p(i):`transparent`,border:t===`outline`?`1px solid ${p(i)}`:`none`,color:`inherit`,textDecoration:`none`},children:(0,B.jsx)(`svg`,{width:u,height:u,viewBox:`0 0 24 24`,fill:s,"aria-hidden":!0,children:(0,B.jsx)(`path`,{d:i.d})})},`${e.network}-${r}`)})})}function zn({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,B.jsx)(`div`,{ref:i,style:{display:`flex`,flexDirection:n?`column`:`row`,alignItems:n?`stretch`:`flex-start`,gap:n?4:8,...k(r)},children:e.map((e,t)=>{let r=t+1,i=r<a?`done`:r===a?`active`:`todo`;return(0,B.jsxs)(l.Fragment,{children:[t>0&&(0,B.jsx)(`div`,{style:s(r<=a),"aria-hidden":!0}),(0,B.jsxs)(`div`,{style:{display:`flex`,flexDirection:n?`row`:`column`,alignItems:`center`,gap:8,minWidth:0,textAlign:n?`left`:`center`},children:[(0,B.jsx)(`div`,{style:o(i),children:i===`done`?`✓`:r}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:13,fontWeight:i===`active`?700:500,opacity:i===`todo`?.6:1},children:e.label}),e.description&&(0,B.jsx)(`div`,{style:{fontSize:12,opacity:.6},children:e.description})]})]})]},t)})})}var Bn={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}},Vn=e=>Bn[e]??Bn.medium;Bn.medium.w,Bn.medium.h;var Hn=e=>String(e?.group??``).trim(),Un=e=>{let t=[],n=new Map;return e.forEach((e,r)=>{let i=Hn(e)||`#${r}`;n.has(i)||(n.set(i,[]),t.push(i)),n.get(i).push(e)}),t.flatMap(e=>n.get(e))};function Wn(e,{size:t=`medium`,horizontal:n=!1,groupTitles:r=`top`}={}){let i=Vn(t),a=n?i.h:i.w,o=n?16:20,s=(n?i.w:i.h)+(n?56:48),c=Array.isArray(e)?e.filter(e=>e&&e.id):[],l=new Set(c.map(e=>e.id)),u=new Map,d=[];for(let e of c)e.parent&&l.has(e.parent)&&e.parent!==e.id?(u.has(e.parent)||u.set(e.parent,[]),u.get(e.parent).push(e)):d.push(e);d=Un(d);for(let[e,t]of u)u.set(e,Un(t));let f=(e,t)=>o+(Hn(e)!==Hn(t)&&(Hn(e)||Hn(t))?24:0),p=new Map,m=(e,t)=>{if(t.has(e.id))return 0;t.add(e.id);let n=u.get(e.id)??[],r=n.reduce((e,r,i)=>e+m(r,t)+(i?f(n[i-1],r):0),0),i=Math.max(a,r);return p.set(e.id,i),i};d.forEach(e=>m(e,new Set));let h=[],g=[],_=new Map,v=0,y=(e,t,r,o)=>{if(o.has(e.id))return;o.add(e.id);let c=t+((p.get(e.id)??a)-a)/2,d=r*s,m=n?d:c,b=n?c:d;h.push({node:e,x:m,y:b});let x=Hn(e);if(x){let t=`${e.parent&&l.has(e.parent)&&e.parent!==e.id?e.parent:``}|${x}`;_.has(t)||_.set(t,{title:x,color:``,members:[]});let n=_.get(t);!n.color&&e.groupColor&&(n.color=e.groupColor),n.members.push({x:m,y:b})}v=Math.max(v,d+(n?i.w:i.h));let S=t,C=u.get(e.id)??[];C.forEach((e,t)=>{t&&(S+=f(C[t-1],e));let l=S+((p.get(e.id)??a)-a)/2+a/2,u=(r+1)*s;g.push(n?{from:{x:d+i.w,y:c+i.h/2},to:{x:u,y:l}}:{from:{x:c+i.w/2,y:d+i.h},to:{x:l,y:u}}),y(e,S,r+1,o),S+=p.get(e.id)??a})},b=0,x=new Set;d.forEach((e,t)=>{t&&(b+=f(d[t-1],e)),y(e,b,0,x),b+=p.get(e.id)??a});let S=Math.max(b,a),C=r===`hidden`?0:22,w=[..._.values()].map(e=>{let t=Math.min(...e.members.map(e=>e.x))-12,n=Math.max(...e.members.map(e=>e.x))+i.w+12,a=Math.min(...e.members.map(e=>e.y))-12-(r===`bottom`?0:C),o=Math.max(...e.members.map(e=>e.y))+i.h+12+(r===`bottom`?C:0);return{x:t,y:a,width:n-t,height:o-a,title:e.title,color:e.color}}),T=n?Math.max(v,i.w):S,E=n?S:Math.max(v,i.h),D=Math.max(0,...w.map(e=>-e.x)),O=Math.max(0,...w.map(e=>-e.y));if(w.length&&(T=Math.max(T,...w.map(e=>e.x+e.width))+D,E=Math.max(E,...w.map(e=>e.y+e.height))+O,D||O)){for(let e of h)e.x+=D,e.y+=O;for(let e of g)e.from={x:e.from.x+D,y:e.from.y+O},e.to={x:e.to.x+D,y:e.to.y+O};for(let e of w)e.x+=D,e.y+=O}return{boxes:h,links:g,groups:w,width:T,height:E,horizontal:n}}var Gn=(e,t)=>{let n=String(e??``);return n.length>t?`${n.slice(0,t-1)}…`:n},Kn=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`},qn=e=>!!(e?.cv?.trim?.()||e?.photo);function Jn(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?``:Ve(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]):``,group:t.groupField?i(n[t.groupField]):``}})}var Yn={size:36,pad:10};function Xn({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,B.jsx)(`div`,{onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":e.name,style:{position:`fixed`,inset:0,zIndex:1e3,background:`rgba(2, 6, 23, 0.6)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16},children:(0,B.jsxs)(`div`,{onClick:e=>e.stopPropagation(),style:{background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid rgba(148, 163, 184, 0.35)`,borderRadius:14,maxWidth:420,width:`100%`,maxHeight:`80vh`,overflowY:`auto`,padding:24,position:`relative`,boxShadow:`0 24px 64px rgba(2, 6, 23, 0.5)`},children:[(0,B.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,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:e.cv?14:0},children:[e.photo&&(0,B.jsx)(`img`,{src:e.photo,alt:``,style:{width:72,height:72,borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}),(0,B.jsxs)(`div`,{style:{minWidth:0},children:[(0,B.jsx)(`div`,{style:{fontSize:18,fontWeight:700},children:e.name}),e.title&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65},children:e.title})]})]}),e.cv&&String(e.cv).split(/\n+/).map((e,t)=>(0,B.jsx)(`p`,{style:{fontSize:14,lineHeight:1.6,margin:`0 0 10px`},children:e},t)),e.href&&(0,B.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 Zn({nodes:e=[],source:t,nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c,groupTitles:u=`top`,groupBg:d=``,size:f=`medium`,horizontal:p=!1,style:m,nodeRef:h,interactive:g=!0}){let _=(0,l.useId)(),[v,y]=(0,l.useState)(null),{tenant:b,apiUrl:x}=(0,l.useContext)(Me),S=(0,l.useContext)(Ne)?.[t],[C,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!t||S)return;let e=!0;return fetch(`${x}/dynamic/${encodeURIComponent(t)}`,{headers:b?{"x-tenant":b}:{}}).then(e=>e.json()).then(t=>{let n=Array.isArray(t?.payload)?t.payload:Array.isArray(t?.payload?.data)?t.payload.data:[];e&&w(n)}).catch(()=>e&&w([])),()=>{e=!1}},[t,b,x,S]);let T=t?Jn(S??C??[],{nameField:n,titleField:r,photoField:i,parentField:a,cvField:o,hrefField:s,groupField:c}):e,E=Vn(f),{boxes:D,links:O,groups:A,width:j,height:ee}=Wn(T,{size:f,horizontal:p,groupTitles:u});if(!D.length)return!g&&t?(0,B.jsxs)(`div`,{ref:h,style:{padding:18,border:`1px dashed rgba(148, 163, 184, 0.6)`,borderRadius:10,fontSize:13,opacity:.7,textAlign:`center`,...k(m)},children:[`Org Chart — no published entries in “`,t,`” yet`]}):null;let M=new Set(D.filter(e=>e.node.parent==null||e.node.parent===``).map(e=>e.node.id));return(0,B.jsxs)(`div`,{ref:h,style:{maxWidth:`100%`,overflowX:`auto`,...k(m)},children:[(0,B.jsxs)(`svg`,{viewBox:`0 0 ${j} ${ee}`,role:`img`,"aria-label":`Organization chart`,style:{display:`block`,width:`100%`,maxWidth:j,height:`auto`,margin:`0 auto`},children:[A.map((e,t)=>{let n=e.color||d||`rgba(148, 163, 184, 0.16)`,r=!!(e.color||d);return(0,B.jsxs)(`g`,{children:[(0,B.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:`16`,fill:n}),u!==`hidden`&&e.title&&(0,B.jsx)(`text`,{x:e.x+e.width/2,y:u===`bottom`?e.y+e.height-22*.42:e.y+22*.78,textAnchor:`middle`,fontSize:E.title+1,fontWeight:`600`,opacity:`0.55`,fill:r?Kn(e.color||d):`var(--page-text, #111827)`,children:Gn(e.title,Math.floor(e.width/7))})]},`group-${t}`)}),O.map((e,t)=>(0,B.jsx)(`path`,{d:p?`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)),D.map(({node:e,x:t,y:n})=>{let r=M.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?Kn(e.color):r?`var(--page-accent-text, #ffffff)`:`var(--page-text, #111827)`,c=i?Kn(e.color2):s,l=g&&(qn(e)||e.href),u=()=>qn(e)?y(e):window.open(e.href,`_blank`,`noreferrer`),d=e.photo?t+Yn.pad+E.avatar+8:t+E.w/2,f=e.photo?`start`:`middle`,p=e.photo?Math.floor((E.w-E.avatar-26)/7):Math.floor(E.w/7.6),m=E.h/2,h=[e.name,e.title].map(e=>String(e??``).trim()).filter(Boolean);return(0,B.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,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`linearGradient`,{id:`${_}-${e.id}-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,B.jsx)(`stop`,{offset:`0%`,stopColor:e.color||`var(--page-accent, #4f46e5)`}),(0,B.jsx)(`stop`,{offset:`100%`,stopColor:e.color2})]}),(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:`url(#${_}-${e.id}-grad)`})]}):i?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}-box`,children:(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`})}),(0,B.jsxs)(`g`,{clipPath:`url(#${_}-${e.id}-box)`,children:[(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:m,fill:o}),(0,B.jsx)(`rect`,{x:t,y:n+m,width:E.w,height:E.h-m,fill:e.color2})]})]}):(0,B.jsx)(`rect`,{x:t,y:n,width:E.w,height:E.h,rx:`10`,fill:o,stroke:a?`none`:`var(--page-accent, #4f46e5)`,strokeWidth:a?0:1.5}),e.photo&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`clipPath`,{id:`${_}-${e.id}`,children:(0,B.jsx)(`circle`,{cx:t+Yn.pad+E.avatar/2,cy:n+E.h/2,r:E.avatar/2})}),(0,B.jsx)(`image`,{href:e.photo,x:t+Yn.pad,y:n+(E.h-E.avatar)/2,width:E.avatar,height:E.avatar,preserveAspectRatio:`xMidYMid slice`,clipPath:`url(#${_}-${e.id})`})]}),i&&!e.gradient?(0,B.jsxs)(B.Fragment,{children:[e.title&&(0,B.jsx)(`text`,{x:d,y:n+m/2+E.title*.35,textAnchor:f,fontSize:E.title,fontWeight:`600`,fill:s,children:Gn(e.title,p+4)}),e.name&&(0,B.jsx)(`text`,{x:d,y:n+m+m/2+E.name*.35,textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:c,children:Gn(e.name,p)})]}):(0,B.jsxs)(B.Fragment,{children:[h[0]&&(0,B.jsx)(`text`,{x:d,y:n+(h[1]?E.h*.43:E.h*.57),textAnchor:f,fontSize:E.name,fontWeight:`600`,fill:s,children:Gn(h[0],p)}),h[1]&&(0,B.jsx)(`text`,{x:d,y:n+E.h*.73,textAnchor:f,fontSize:E.title,opacity:`0.7`,fill:s,children:Gn(h[1],p+4)})]})]},e.id)})]}),v&&(0,B.jsx)(Xn,{node:v,onClose:()=>y(null)})]})}function Qn({value:e,onCommit:t,style:n,hint:r}){let[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!i||!o.current)return;let e=o.current,t=document.createRange();e.focus(),t.selectNodeContents(e),t.collapse(!1);let n=window.getSelection();n.removeAllRanges(),n.addRange(t)},[i]),(0,B.jsx)(`span`,{ref:o,contentEditable:i,suppressContentEditableWarning:!0,title:i?void 0:r||`Double-click to edit`,onDoubleClick:()=>a(!0),onBlur:i?e=>{a(!1),t(e.currentTarget.textContent)}:void 0,onKeyDown:i?t=>{t.stopPropagation(),t.key===`Escape`&&(t.currentTarget.textContent=e??``,t.currentTarget.blur()),t.key===`Enter`&&(t.preventDefault(),t.currentTarget.blur())}:void 0,style:{display:`block`,minHeight:`1em`,outline:`none`,cursor:i?`text`:`inherit`,...n},children:e??``})}var $n=360,er=`
|
|
16
16
|
.wb-tedit-btn {
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
border-radius: 4px;
|
|
@@ -83,12 +83,12 @@ Error generating stack: `+e.message+`
|
|
|
83
83
|
color: inherit; background: var(--page-surface, #f2f2f2);
|
|
84
84
|
border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
|
|
85
85
|
}
|
|
86
|
-
`}),_e?(0,B.jsxs)(`div`,{style:{position:`relative`,width:me*he,maxWidth:`100%`,margin:`0 auto`},children:[Ee?De(-1):null,(0,B.jsx)(`div`,{style:{overflow:`hidden`},children:Te}),Ee?De(1):null]}):(0,B.jsxs)(B.Fragment,{children:[Ee?De(-1):null,Te,Ee?De(1):null]}),(0,B.jsx)(hr,{running:ye,every:ce+le,slide:le,step:be?-1:1,index:M,total:ge,home:xe,setIndex:N,setAnimate:P})]})}function hr({running:e,every:t,slide:n,step:r,index:i,total:a,home:o,setIndex:s,setAnimate:c}){(0,l.useEffect)(()=>{if(!e)return;let n=setInterval(()=>{c(!0),s(e=>e+r)},t);return()=>clearInterval(n)},[e,t,r,s,c]),(0,l.useEffect)(()=>{c(!1),s(o)},[o,s,c]);let u=r>0?i>=a:i<=0;return(0,l.useEffect)(()=>{if(!u||i===o)return;let e=setTimeout(()=>{c(!1),s(o)},n);return()=>clearTimeout(e)},[u,i,n,o,s,c]),null}var gr={small:380,medium:560,large:820,full:`100%`};function _r({dialogId:e=``,trigger:t=`button`,triggerLabel:n=`Open`,openOn:r=`trigger`,delay:i=0,size:a=`medium`,title:o=``,showClose:s=!0,backdropClose:c=!0,position:u=`center`,actions:d=[],showCloseAction:f=!1,closeLabel:p=`Close`,actionsAlign:m=`right`,linked:h,style:g,nodeRef:_,inert:v=!1}){let[y,b]=(0,l.useState)(!1),x=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(v||!e)return;let t=t=>{t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`)&&(t.preventDefault(),b(!0))};return document.addEventListener(`click`,t),()=>document.removeEventListener(`click`,t)},[v,e]),(0,l.useEffect)(()=>{if(v||r!==`load`)return;let e=setTimeout(()=>b(!0),Math.max(0,Number(i)||0)*1e3);return()=>clearTimeout(e)},[v,r,i]),(0,l.useEffect)(()=>{if(v||!y)return;let e=e=>e.key===`Escape`&&b(!1);document.addEventListener(`keydown`,e);let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,x.current?.focus?.(),()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=t}},[v,y]);let S=gr[a]??gr.medium,C=e=>{let t={padding:`9px 16px`,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,textDecoration:`none`,display:`inline-block`,...{primary:{background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`,border:`1px solid transparent`},outline:{background:`transparent`,color:`inherit`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},text:{background:`transparent`,color:`inherit`,border:`1px solid transparent`},danger:{background:`#dc2626`,color:`#ffffff`,border:`1px solid transparent`}}[e.variant??`primary`]??{}};return e.href&&!v?(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:t,children:e.label},e.key):(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!1),style:t,children:e.label},e.key)},w=Array.isArray(d)?d:[],T=w.filter(e=>e.side===`left`),E=w.filter(e=>e.side!==`left`),D=f===!0?C({key:`__close`,label:p||`Close`,variant:`outline`}):null,O=T.length||E.length||D?(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`14px 20px`,borderTop:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,justifyContent:T.length?`space-between`:m===`left`?`flex-start`:m===`center`?`center`:`flex-end`},children:[T.length>0&&(0,B.jsx)(`div`,{style:{display:`flex`,gap:8},children:T.map(C)}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[D,E.map(C)]})]}):null,A=(0,B.jsxs)(`div`,{ref:x,role:`dialog`,"aria-modal":v?void 0:`true`,"aria-label":o||void 0,tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:typeof S==`number`?`min(${S}px, 100%)`:S,maxHeight:v?void 0:`85vh`,overflowY:v?void 0:`auto`,borderRadius:12,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,boxShadow:v?`none`:`0 24px 64px rgba(15, 23, 42, 0.35)`,outline:`none`,...k(g)},children:[(o||s!==!1)&&(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`16px 20px`,borderBottom:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{fontWeight:700,fontSize:17,flexGrow:1,fontFamily:`var(--page-heading-font, inherit)`},children:o}),s!==!1&&(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>!v&&b(!1),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:2,opacity:.7},children:`✕`})]}),(0,B.jsx)(`div`,{style:{padding:20},children:h?.content}),O]});return(0,B.jsxs)(`div`,{ref:_,id:e||void 0,style:v?void 0:{display:`contents`},children:[t===`button`&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!0),style:{padding:`10px 18px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:15,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:n}),v?(0,B.jsx)(`div`,{style:{marginTop:t===`button`?12:0},children:A}):y&&(0,B.jsx)(`div`,{onClick:c===!1?void 0:()=>b(!1),style:{position:`fixed`,inset:0,zIndex:2147483e3,display:`flex`,alignItems:u===`top`?`flex-start`:`center`,justifyContent:`center`,padding:20,paddingTop:u===`top`?`8vh`:20,background:`rgba(15, 23, 42, 0.55)`,backdropFilter:`blur(2px)`},children:A})]})}var vr={PageRoot:Qe,CalendarBlock:dr,LogoCarousel:mr,DialogBlock:_r,Section:$e,Container:et,Heading:tt,TextBlock:mt,ButtonBlock:_t,ImageBlock:vt,Spacer:wt,Divider:Tt,BoxBlock:Et,SliderBlock:Mt,CanvasSlider:Nt,TabsBlock:Xt,QuickStack:Cn,CollectionList:wn,CollectionSearch:Tn,BreadcrumbsBlock:En,PaginationBlock:Dn,StepperBlock:zn,SocialLinksBlock:Rn,ThemeModeBlock:Mn,ScrollTopBlock:In,OrgChartBlock:Zn,TableBlock:rr,IconBlock:Ut,MapBlock:Vt,MasonryBlock:Gt,AccordionBlock:Zt,NavbarBlock:Yt,ListBlock:pt,TextSpan:it,QuoteBlock:ft,TextLink:gt,RichTextBlock:ut,RichContentBlock:ut,VideoBlock:yt,YouTubeBlock:xt,IframeBlock:St,EmbedBlock:Ct,FormBlock:dn,FormLabel:gn,FormInput:_n,FormTextarea:vn,FormCheckbox:e=>(0,B.jsx)(yn,{kind:`checkbox`,...e}),FormRadio:e=>(0,B.jsx)(yn,{kind:`radio`,...e}),FormSelect:bn,FormFile:xn,FormRecaptcha:hn,FormSubmit:Sn},yr={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},br=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}});function xr(e,t){return t?/^https?:\/\//i.test(t)?t:`${e.replace(/\/+$/,``)}${t.startsWith(`/`)?t:`/${t}`}`:``}function Sr(e){let t=e&&typeof e==`object`?e[`site.session`]:null,n=t&&typeof t==`object`&&!Array.isArray(t)?t:{},r=e=>typeof e==`string`?e.trim():``,i=r(n.url),a=r(n.mePath),o=r(n.logoutPath);return{mode:n.mode===`custom`||n.mode===`off`?n.mode:`system`,url:i,mePath:a,logoutPath:o,meUrl:xr(i,a),logoutUrl:xr(i,o),loginPage:r(n.loginPage),userPath:r(n.userPath),auth:n.auth===`bearer`?`bearer`:`cookies`,tokenKey:r(n.tokenKey)||`webim_session_token`}}function Cr(e,t){if(!t)return e??null;let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`)return null;n=n[e]}return n??null}function wr(e){try{return window.localStorage.getItem(e)||``}catch{return``}}function Tr(e){try{window.localStorage.removeItem(e)}catch{}}var Er=()=>{let e=(0,l.useContext)(br);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function Dr({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(Me),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,c=(0,l.useMemo)(()=>Sr(a?.settings),[a?.settings]),[u,d]=(0,l.useState)(t??null),[f,p]=(0,l.useState)(t?`user`:n?`guest`:`idle`),m=(0,l.useRef)(!1),h=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),g=(0,l.useCallback)(e=>(d(e),p(e?`user`:`guest`),e),[]),_=(0,l.useCallback)(()=>{if(n)return Promise.resolve(null);if(c.mode===`off`)return Promise.resolve(g(null));if(c.mode===`custom`){let e=c.auth===`bearer`?wr(c.tokenKey):``;return!c.meUrl||c.auth===`bearer`&&!e?Promise.resolve(g(null)):fetch(c.meUrl,{...c.auth===`bearer`?{headers:{authorization:`Bearer ${e}`}}:{credentials:`include`}}).then(e=>e.ok?e.json():null).then(e=>{let t=Cr(e,c.userPath);return g(t&&typeof t==`object`?t:null)}).catch(()=>g(null))}return h(`/site/me`).then(e=>e.ok?e.json():null).then(e=>g(e?.payload??null)).catch(()=>g(null))},[h,c,n,g]),v=(0,l.useCallback)(()=>{if(c.mode===`off`)return g(null),Promise.resolve();if(c.mode===`custom`){let e=c.auth===`bearer`?wr(c.tokenKey):``;return(c.logoutUrl?fetch(c.logoutUrl,{method:`post`,...c.auth===`bearer`?{headers:e?{authorization:`Bearer ${e}`}:{}}:{credentials:`include`}}).catch(()=>{}):Promise.resolve()).then(()=>{c.auth===`bearer`&&Tr(c.tokenKey),g(null)})}return h(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{g(null)})},[h,c,g]),y=(0,l.useCallback)(()=>{m.current||n||t||(m.current=!0,p(`loading`),_())},[n,t,_]),b=(0,l.useMemo)(()=>({user:u,status:f,ensure:y,refresh:_,signOut:v}),[u,f,y,_,v]);return(0,l.useEffect)(()=>{n||typeof window>`u`||(window.webim={...window.webim,user:u,status:f,loginUrl:c.loginPage||null,requireUser:()=>m.current||t?Promise.resolve(u):_(),refresh:_,signOut:v},window.dispatchEvent(new CustomEvent(`webim:session`,{detail:{user:u,status:f}})))},[n,u,f,t,c.loginPage,_,v]),(0,B.jsx)(br.Provider,{value:b,children:e})}function Or({when:e,children:t}){let{status:n}=Er();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function kr({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:m}=(0,l.useContext)(Me),[h,g]=(0,l.useState)(`form`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(!1),x=e===`register`,S=c?d||`form`:h,C=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,w=async e=>{if(e.preventDefault(),c)return;let n=new FormData(e.currentTarget);b(!0),v(``);try{let e=await fetch(`${p||`/api`}/site/${x?`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`),...x?{name:n.get(`name`)||``}:{}})}),r=await e.json().catch(()=>null);if(!e.ok||r?.success===!1){v(r?.error?.message||`Sign-in failed`),g(`error`),b(!1);return}if(g(`success`),typeof window<`u`){let e=C(t)||C(new URLSearchParams(window.location.search).get(`next`))||C(m?.[`site.authRedirect`])||C(m?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{v(`Sign-in failed`),g(`error`),b(!1)}};return(0,B.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...k(o)},children:[(0,B.jsxs)(`form`,{onSubmit:w,style:{display:S===`form`?`grid`:`none`,gap:10},children:[x?(0,B.jsxs)(`label`,{style:{...$t,display:`grid`,gap:6},children:[i,(0,B.jsx)(`input`,{name:`name`,type:`text`,style:en,...nn(c)})]}):null,(0,B.jsxs)(`label`,{style:{...$t,display:`grid`,gap:6},children:[n,(0,B.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:en,...nn(c)})]}),(0,B.jsxs)(`label`,{style:{...$t,display:`grid`,gap:6},children:[r,(0,B.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:en,...nn(c)})]}),(0,B.jsx)(`button`,{type:c?`button`:`submit`,disabled:y||void 0,style:{...qe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:y?.6:1},children:a||(x?`Create account`:`Sign in`)}),_?(0,B.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:_}):null]}),(0,B.jsx)(`div`,{style:{display:S===`success`?`block`:`none`},children:u?.success??null}),(0,B.jsx)(`div`,{style:{display:S===`error`?`block`:`none`},children:u?.error??null})]})}function Ar({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}=Er(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,B.jsx)(`div`,{ref:i,style:{minHeight:24,...k(r)}}):d===`user`?(0,B.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:[(0,B.jsxs)(`span`,{style:{...$t,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,B.jsx)(`span`,{style:{...$t,opacity:.7},children:f.email}):null,(0,B.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...qe,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...nn(a),children:t})]}):(0,B.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:o?.signedOut??null})}var jr={id:`consent`,label:`Cookie consent`,category:`Apps`,keys:[`CookieConsent`],ssr:`shell`,settings:[]},Mr=`webim.cookie_consent`;function Nr(){try{let e=window.localStorage.getItem(Mr),t=e?JSON.parse(e):null;return t?.choice===`accepted`||t?.choice===`declined`?t.choice:``}catch{return``}}function Pr(e){try{document.querySelectorAll(`.webim-page`).forEach(t=>t.setAttribute(`data-webim-consent`,e))}catch{}}function Fr(e){try{window.localStorage.setItem(Mr,JSON.stringify({choice:e,at:new Date().toISOString()}))}catch{}Pr(e);try{window.dispatchEvent(new CustomEvent(`webim:consent`,{detail:{choice:e}}))}catch{}}var Ir={bottom:{left:0,right:0,bottom:0},top:{left:0,right:0,top:0},"bottom-left":{left:16,bottom:16,maxWidth:400},"bottom-right":{right:16,bottom:16,maxWidth:400}};function Lr({message:e,acceptLabel:t,rejectLabel:n,showReject:r,linkLabel:i,linkHref:a,position:o,linked:s,style:c,nodeRef:u,inert:d}){let[f,p]=(0,l.useState)(!!d),[m,h]=(0,l.useState)(null),g=e=>{h(e),typeof u==`function`&&u(e)};if((0,l.useEffect)(()=>{if(d)return;let e=Nr();e?Pr(e):p(!0)},[d,m]),!f)return null;let _=e=>()=>{d||(Fr(e),p(!1))},v=Ir[o]??Ir.bottom,y={appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,padding:`8px 16px`,borderRadius:8,cursor:d?`default`:`pointer`,whiteSpace:`nowrap`};return(0,B.jsxs)(`div`,{ref:g,role:`region`,"aria-label":`Cookie consent`,style:{...d?{position:`relative`}:{position:`fixed`,zIndex:2147483e3,...v},display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:12,padding:16,background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:o===`bottom`||o===`top`?0:12,boxShadow:`0 8px 30px rgba(15, 23, 42, 0.18)`,fontSize:14,lineHeight:1.5,...k(c)},children:[(0,B.jsxs)(`div`,{style:{flex:`1 1 260px`,minWidth:0},children:[s?.content??(e||`We use cookies to run this site and to understand how it is used.`),i&&a?(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`a`,{href:a,onClick:d?e=>e.preventDefault():void 0,style:{color:`var(--page-accent, inherit)`,textDecoration:`underline`},children:i})]}):null]}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8,flexShrink:0},children:[r===!1?null:(0,B.jsx)(`button`,{type:`button`,onClick:_(`declined`),style:{...y,background:`transparent`,color:`inherit`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.6))`},children:n||`Decline`}),(0,B.jsx)(`button`,{type:`button`,onClick:_(`accepted`),style:{...y,background:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`,border:`1px solid transparent`},children:t||`Accept`})]})]})}var Rr={id:`language`,label:`Language`,category:`Apps`,keys:[`SiteLanguagePicker`],ssr:`prefetch`,settings:[`locales`]},zr={id:`search`,label:`Search`,category:`Apps`,keys:[`SiteSearch`],ssr:`prefetch`,settings:[]},Br=50,Vr=2e3;function Hr(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`q`)??``}function Ur(e,t){let n=e?.data??{},r=[];for(let e of Object.values(n)){let t=e==null?``:Ve(e);if(t&&r.push(t),r.join(` `).length>Vr)break}return r.join(` `).slice(0,Vr).toLocaleLowerCase(t||void 0)}function Wr({placeholder:e=`Search…`,buttonLabel:t=`Search`,showButton:n=!0,live:r=!1,layout:i=`inline`,includePages:a=!0,collections:o=[],limit:s=10,emptyText:c=`Nothing found`,hint:u=``,style:d,nodeRef:f,inert:p=!1,sample:m=!1}){let{tenant:h,apiUrl:g,locale:_}=(0,l.useContext)(Me),[v,y]=(0,l.useState)(()=>Hr()),[b,x]=(0,l.useState)(()=>Hr()),[S,C]=(0,l.useState)(null),[w,T]=(0,l.useState)(!1),E=(0,l.useRef)(null),D=i===`popup`;(0,l.useEffect)(()=>{let e=()=>{let e=Hr();y(e),x(e)};return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]),(0,l.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>{y(b),b.trim()&&T(!0)},200);return()=>clearTimeout(e)},[r,b]),(0,l.useEffect)(()=>{if(!D)return;let e=e=>{E.current&&!E.current.contains(e.target)&&T(!1)},t=e=>e.key===`Escape`&&T(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[D]),(0,l.useEffect)(()=>{let e=!0,t=h?{"x-tenant":h}:{},n=e=>fetch(`${g}${e}`,{headers:t}).then(e=>e.json()).then(e=>e?.payload).catch(()=>null),r=[a?n(`/site/pages`).then(e=>({kind:`page`,rows:Array.isArray(e)?e:[]})):null,...(Array.isArray(o)?o:[]).filter(Boolean).map(e=>n(`/dynamic/${encodeURIComponent(e)}?all=1${_?`&locale=${encodeURIComponent(_)}`:``}`).then(t=>({kind:`entry`,slug:e,rows:Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[]})))].filter(Boolean);return Promise.all(r).then(t=>e&&C(t)),()=>{e=!1}},[g,h,_,a,JSON.stringify(o)]);let O=v.trim().toLocaleLowerCase(_||void 0),A=[];if(O&&S)for(let e of S)if(e.kind===`page`)for(let t of e.rows){if(t?.access&&t.access!==`public`)continue;let e=String(t?.title??``);`${e} ${t?.slug??``}`.toLocaleLowerCase(_||void 0).includes(O)&&A.push({key:`page:${t.slug}`,title:e||t.slug,url:`/${t.slug}`,kind:`page`})}else for(let t of e.rows){if(!Ur(t,_).includes(O))continue;let n=t?.data??{},r=Ve(n.name)||`Untitled`,i=Ve(n.slug);A.push({key:`entry:${t.id}`,title:r,url:i?`/${e.slug}/${i}`:`/${e.slug}`,kind:`entry`})}let j=A.slice(0,Math.min(Math.max(1,s),Br)),ee=e=>{if(p){e.preventDefault(),y(b),T(!0);return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);b.trim()?t.set(`q`,b.trim()):t.delete(`q`),t.delete(`page`);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`)),T(!0)},M=m&&!O?[{key:`sample-1`,title:`About us`,url:`/about`,kind:`page`},{key:`sample-2`,title:`Spring collection`,url:`/blog/spring`,kind:`entry`}]:null,N=M??j,te=!M&&O&&S&&!j.length,P=!D||w&&(N.length>0||te),F=N.length>0&&(0,B.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:2},children:N.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`a`,{href:p?void 0:e.url,style:{display:`block`,padding:`10px 12px`,borderRadius:6,color:`inherit`,textDecoration:`none`,border:D?0:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{display:`block`,fontWeight:600},children:e.title}),(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6},children:e.url})]})},e.key))});return(0,B.jsx)(`div`,{ref:f,style:{width:`100%`,...k(d)},children:(0,B.jsxs)(`div`,{ref:E,style:{position:`relative`},children:[(0,B.jsxs)(`form`,{method:`get`,onSubmit:ee,style:{display:`flex`,gap:8,alignItems:`center`},children:[(0,B.jsx)(`input`,{type:`search`,name:`q`,value:b,placeholder:e,onChange:e=>x(e.target.value),onFocus:()=>O&&T(!0),style:{...en,flexGrow:1,minWidth:0}}),n!==!1&&(0,B.jsx)(`button`,{type:`submit`,style:{padding:`10px 16px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:t})]}),u&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65,marginTop:6},children:u}),P&&(0,B.jsxs)(`div`,{style:D?{position:`absolute`,top:`100%`,left:0,right:0,zIndex:30,marginTop:6,padding:6,maxHeight:320,overflowY:`auto`,borderRadius:8,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,background:`var(--page-surface, #f2f2f2)`,boxShadow:`0 12px 32px rgba(15, 23, 42, 0.18)`}:{marginTop:14},children:[F,te&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.65,padding:D?`10px 12px`:0},children:c})]})]})})}function Gr(e){let t=e?.locales,n=[typeof t?.default==`string`&&t.default.trim()?t.default.trim():``,...Array.isArray(t?.enabled)?t.enabled:[]].filter(e=>typeof e==`string`&&e.trim());return[...new Set(n.map(e=>e.trim()))]}var Kr=e=>e&&e.charAt(0).toUpperCase()+e.slice(1);function qr(e,t){let n=String(e??``).toUpperCase();if(t===`code`)return n;let r=``;try{r=Kr(new Intl.DisplayNames([e],{type:`language`}).of(e)??``)}catch{}return!r||r.toUpperCase()===n?n:t===`both`?`${n} — ${r}`:r}function Jr(e,t){let n=t?``:`?locale=${encodeURIComponent(e)}`;if(typeof window>`u`)return n||`?`;try{let n=new URL(window.location.href);return t?n.searchParams.delete(`locale`):n.searchParams.set(`locale`,e),n.searchParams.delete(`page`),`${n.pathname}${n.search}${n.hash}`}catch{return n||`/`}}function Yr({variant:e,display:t,separator:n,label:r,style:i,nodeRef:a,inert:o}){let s=(0,l.useContext)(Me),c=Gr(s?.settings),u=c[0]??``,d=c.includes(s?.locale)?s.locale:u,f={display:`inline-flex`,alignItems:`center`,gap:8,...k(i)};if(c.length<2)return o?(0,B.jsx)(`div`,{ref:a,style:{...f,padding:`8px 12px`,border:`1px dashed rgba(100, 116, 139, 0.45)`,borderRadius:6,color:`rgba(100, 116, 139, 0.8)`,fontSize:12},children:`Add site languages in Settings → Languages`}):null;let p=r?(0,B.jsx)(`span`,{style:{opacity:.7},children:r}):null;return e===`inline`?(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,c.map((e,r)=>(0,B.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},children:n??`·`}),(0,B.jsx)(`a`,{href:Jr(e,e===u),hrefLang:e,"aria-current":e===d?`true`:void 0,onClick:o?e=>e.preventDefault():void 0,style:{color:e===d?`var(--page-accent, inherit)`:`inherit`,fontWeight:e===d?600:400,textDecoration:`none`,cursor:o?`default`:`pointer`},children:qr(e,t)})]},e))]}):(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,(0,B.jsx)(`select`,{"aria-label":r||`Language`,value:d,onChange:o?void 0:e=>{let t=e.target.value;window.location.assign(Jr(t,t===u))},onKeyDown:o?e=>e.preventDefault():void 0,style:{font:`inherit`,color:`inherit`,background:`var(--page-surface, transparent)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:6,padding:`4px 8px`,cursor:o?`default`:`pointer`},children:c.map(e=>(0,B.jsx)(`option`,{value:e,children:qr(e,t)},e))})]})}var Xr=[yr,Rr,jr,zr],Zr={SiteLoginForm:kr,SiteAccountMenu:Ar,SiteLanguagePicker:Yr,CookieConsent:Lr,SiteSearch:Wr};new Set(Xr.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var Qr=`0.185.1`,$r=`4.3.1`,ei=`https://cdn.jsdelivr.net/npm`,ti=`${ei}/three@${Qr}/build/three.module.js`,ni=`${ei}/@google/model-viewer@${$r}/dist/model-viewer.min.js`,ri=e=>import(e),ii=new Map;function ai(e){if(ii.has(e))return ii.get(e);if(typeof window>`u`)return new Promise(()=>{});let t=ri(e).catch(t=>{throw ii.delete(e),t});return ii.set(e,t),t}var oi=()=>ai(ti);function si(){return typeof window<`u`&&window.customElements?.get(`model-viewer`)?Promise.resolve(null):ai(ni)}var ci=()=>typeof window<`u`&&!!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,li=(e=2)=>Math.min(typeof window>`u`?1:window.devicePixelRatio||1,e);function ui(e,t){let n=0,r=0,i=0,a=!0,o=e=>{n=requestAnimationFrame(o),i||=e;let a=r?(e-r)/1e3:0;r=e,t(a,(e-i)/1e3)},s=()=>{n&&cancelAnimationFrame(n),n=0,r=0},c=()=>{let e=a&&document.visibilityState!==`hidden`;e&&!n?n=requestAnimationFrame(o):!e&&n&&s()};t(0,0);let l=typeof IntersectionObserver>`u`?null:new IntersectionObserver(e=>{a=e.some(e=>e.isIntersecting),c()},{rootMargin:`120px`});return l&&e&&l.observe(e),document.addEventListener(`visibilitychange`,c),c(),()=>{s(),l?.disconnect(),document.removeEventListener(`visibilitychange`,c)}}function di(e,t,n={}){let r={radius:n.distance??4,polar:n.polar??Math.PI/2.4,azimuth:n.azimuth??.6,target:n.target??{x:0,y:0,z:0}},i={...r},a=n.minDistance??.4,o=n.maxDistance??200,s=n.damping??.12,c=.05,l=null,u=e=>{e.button!==void 0&&e.button!==0||(l={x:e.clientX,y:e.clientY,id:e.pointerId},t.setPointerCapture?.(e.pointerId))},d=e=>{if(!l||e.pointerId!==l.id)return;let t=e.clientX-l.x,n=e.clientY-l.y;l={...l,x:e.clientX,y:e.clientY},i.azimuth-=t*.006,i.polar=Math.max(c,Math.min(Math.PI-c,i.polar-n*.006)),e.preventDefault()},f=e=>{l&&e.pointerId===l.id&&t.releasePointerCapture?.(e.pointerId),l=null},p=e=>{n.enableZoom!==!1&&(e.preventDefault(),i.radius=Math.max(a,Math.min(o,i.radius*(1+Math.sign(e.deltaY)*.12))))};return t.addEventListener(`pointerdown`,u),t.addEventListener(`pointermove`,d),t.addEventListener(`pointerup`,f),t.addEventListener(`pointercancel`,f),t.addEventListener(`wheel`,p,{passive:!1}),{update:()=>{r.radius+=(i.radius-r.radius)*s,r.polar+=(i.polar-r.polar)*s,r.azimuth+=(i.azimuth-r.azimuth)*s;let t=Math.sin(r.polar);e.position.set(r.target.x+r.radius*t*Math.sin(r.azimuth),r.target.y+r.radius*Math.cos(r.polar),r.target.z+r.radius*t*Math.cos(r.azimuth)),e.lookAt(r.target.x,r.target.y,r.target.z)},dragging:()=>!!l,autoSpin:(e,t)=>{!l&&e&&(i.azimuth+=e*t)},frame:(e,t)=>{i.radius=Math.max(a,Math.min(o,e)),r.radius=i.radius,t&&(r.target={...t},i.target={...t})},dispose:()=>{t.removeEventListener(`pointerdown`,u),t.removeEventListener(`pointermove`,d),t.removeEventListener(`pointerup`,f),t.removeEventListener(`pointercancel`,f),t.removeEventListener(`wheel`,p)}}}var fi=(e,t)=>Number.isFinite(Number(e))&&Number(e)>0?Number(e):t,pi=(e,t)=>(Number.isFinite(Number(e))?Number(e):t)/100,mi=e=>(Number.isFinite(Number(e))?Number(e):0)*Math.PI/180;function hi({label:e,note:t,height:n,nodeRef:r,style:i}){return(0,B.jsxs)(`div`,{ref:r,style:{...k(i),minHeight:fi(n,320),display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,border:`1px dashed rgba(148,163,184,.55)`,borderRadius:10,background:`rgba(148,163,184,.08)`,...fe,color:`rgba(100,116,139,.95)`,fontSize:13,textAlign:`center`,padding:16},children:[(0,B.jsx)(`div`,{style:{fontWeight:600},children:e}),t?(0,B.jsx)(`div`,{style:{fontSize:11,opacity:.8,maxWidth:320},children:t}):null]})}function gi({src:e,poster:t,alt:n,height:r,bg:i,autoRotate:a,rotateDelay:o,cameraControls:s,ar:c,exposure:u,shadow:d,fieldOfView:f,environment:p,style:m,nodeRef:h,inert:g}){let[_,v]=(0,l.useState)(typeof window<`u`&&!!window.customElements?.get(`model-viewer`)),[y,b]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(_||!e)return;let t=!0;return si().then(()=>t&&v(!0),()=>t&&b(!0)),()=>{t=!1}},[_,e]);let x={...k(m),display:`block`,width:`100%`,minHeight:fi(r,360),height:fi(r,360),backgroundColor:i||`transparent`,borderRadius:k(m).borderRadius??void 0};if(!e)return g?(0,B.jsx)(hi,{nodeRef:h,style:m,height:r,label:`3D Model`,note:`Pick a .glb or .gltf file in the Settings panel.`}):(0,B.jsx)(`div`,{ref:h,style:x});if(y)return(0,B.jsx)(`div`,{ref:h,style:{...x,display:`flex`,alignItems:`center`,justifyContent:`center`},children:t?(0,B.jsx)(`img`,{src:t,alt:n||``,style:{maxWidth:`100%`,maxHeight:`100%`}}):null});let S=e=>e?``:void 0,C=a!==!1;return(0,B.jsx)(`model-viewer`,{ref:h,src:e,alt:n||`A 3D model`,poster:t||void 0,style:x,"camera-controls":S(!g&&s!==!1),"auto-rotate":S(C&&!ci()),"auto-rotate-delay":C?String(fi(o,0)):void 0,"rotation-per-second":`18deg`,ar:S(!g&&c===!0),"ar-modes":`webxr scene-viewer quick-look`,"shadow-intensity":String(pi(d,100)),exposure:String(pi(u,100)),"field-of-view":f?`${Number(f)}deg`:void 0,"environment-image":p&&p!==`neutral`?p:`neutral`,"interaction-prompt":g?`none`:void 0,loading:`lazy`,"touch-action":`pan-y`,children:t?(0,B.jsx)(`img`,{slot:`poster`,src:t,alt:n||``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):null})}var _i=[`attribute vec2 p;`,`void main() { gl_Position = vec4(p, 0.0, 1.0); }`].join(`
|
|
87
|
-
`),
|
|
88
|
-
`),
|
|
86
|
+
`}),_e?(0,B.jsxs)(`div`,{style:{position:`relative`,width:me*he,maxWidth:`100%`,margin:`0 auto`},children:[Ee?De(-1):null,(0,B.jsx)(`div`,{style:{overflow:`hidden`},children:Te}),Ee?De(1):null]}):(0,B.jsxs)(B.Fragment,{children:[Ee?De(-1):null,Te,Ee?De(1):null]}),(0,B.jsx)(hr,{running:ye,every:ce+le,slide:le,step:be?-1:1,index:M,total:ge,home:xe,setIndex:N,setAnimate:P})]})}function hr({running:e,every:t,slide:n,step:r,index:i,total:a,home:o,setIndex:s,setAnimate:c}){(0,l.useEffect)(()=>{if(!e)return;let n=setInterval(()=>{c(!0),s(e=>e+r)},t);return()=>clearInterval(n)},[e,t,r,s,c]),(0,l.useEffect)(()=>{c(!1),s(o)},[o,s,c]);let u=r>0?i>=a:i<=0;return(0,l.useEffect)(()=>{if(!u||i===o)return;let e=setTimeout(()=>{c(!1),s(o)},n);return()=>clearTimeout(e)},[u,i,n,o,s,c]),null}var gr={small:380,medium:560,large:820,full:`100%`};function _r({dialogId:e=``,trigger:t=`button`,triggerLabel:n=`Open`,openOn:r=`trigger`,delay:i=0,size:a=`medium`,title:o=``,showClose:s=!0,backdropClose:c=!0,position:u=`center`,actions:d=[],showCloseAction:f=!1,closeLabel:p=`Close`,actionsAlign:m=`right`,linked:h,style:g,nodeRef:_,inert:v=!1}){let[y,b]=(0,l.useState)(!1),x=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(v||!e)return;let t=t=>{t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`)&&(t.preventDefault(),b(!0))};return document.addEventListener(`click`,t),()=>document.removeEventListener(`click`,t)},[v,e]),(0,l.useEffect)(()=>{if(v||r!==`load`)return;let e=setTimeout(()=>b(!0),Math.max(0,Number(i)||0)*1e3);return()=>clearTimeout(e)},[v,r,i]),(0,l.useEffect)(()=>{if(v||!y)return;let e=e=>e.key===`Escape`&&b(!1);document.addEventListener(`keydown`,e);let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,x.current?.focus?.(),()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=t}},[v,y]);let S=gr[a]??gr.medium,C=e=>{let t={padding:`9px 16px`,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,textDecoration:`none`,display:`inline-block`,...{primary:{background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`,border:`1px solid transparent`},outline:{background:`transparent`,color:`inherit`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},text:{background:`transparent`,color:`inherit`,border:`1px solid transparent`},danger:{background:`#dc2626`,color:`#ffffff`,border:`1px solid transparent`}}[e.variant??`primary`]??{}};return e.href&&!v?(0,B.jsx)(`a`,{href:e.href,target:e.target||void 0,rel:e.target===`_blank`?`noopener noreferrer`:void 0,style:t,children:e.label},e.key):(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!1),style:t,children:e.label},e.key)},w=Array.isArray(d)?d:[],T=w.filter(e=>e.side===`left`),E=w.filter(e=>e.side!==`left`),D=f===!0?C({key:`__close`,label:p||`Close`,variant:`outline`}):null,O=T.length||E.length||D?(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`14px 20px`,borderTop:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,justifyContent:T.length?`space-between`:m===`left`?`flex-start`:m===`center`?`center`:`flex-end`},children:[T.length>0&&(0,B.jsx)(`div`,{style:{display:`flex`,gap:8},children:T.map(C)}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[D,E.map(C)]})]}):null,A=(0,B.jsxs)(`div`,{ref:x,role:`dialog`,"aria-modal":v?void 0:`true`,"aria-label":o||void 0,tabIndex:-1,onClick:e=>e.stopPropagation(),style:{width:typeof S==`number`?`min(${S}px, 100%)`:S,maxHeight:v?void 0:`85vh`,overflowY:v?void 0:`auto`,borderRadius:12,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,boxShadow:v?`none`:`0 24px 64px rgba(15, 23, 42, 0.35)`,outline:`none`,...k(g)},children:[(o||s!==!1)&&(0,B.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`16px 20px`,borderBottom:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{fontWeight:700,fontSize:17,flexGrow:1,fontFamily:`var(--page-heading-font, inherit)`},children:o}),s!==!1&&(0,B.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>!v&&b(!1),style:{background:`transparent`,border:0,color:`inherit`,cursor:`pointer`,fontSize:20,lineHeight:1,padding:2,opacity:.7},children:`✕`})]}),(0,B.jsx)(`div`,{style:{padding:20},children:h?.content}),O]});return(0,B.jsxs)(`div`,{ref:_,id:e||void 0,style:v?void 0:{display:`contents`},children:[t===`button`&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>!v&&b(!0),style:{padding:`10px 18px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:15,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:n}),v?(0,B.jsx)(`div`,{style:{marginTop:t===`button`?12:0},children:A}):y&&(0,B.jsx)(`div`,{onClick:c===!1?void 0:()=>b(!1),style:{position:`fixed`,inset:0,zIndex:2147483e3,display:`flex`,alignItems:u===`top`?`flex-start`:`center`,justifyContent:`center`,padding:20,paddingTop:u===`top`?`8vh`:20,background:`rgba(15, 23, 42, 0.55)`,backdropFilter:`blur(2px)`},children:A})]})}function vr({dropdownId:e=``,trigger:t=`button`,triggerLabel:n=`Menu`,openOn:r=`hover`,align:i=`left`,panelWidth:a=``,offset:o=8,editorOpen:s=!0,linked:c,style:u,nodeRef:d,inert:f=!1}){let[p,m]=(0,l.useState)(!1),h=(0,l.useRef)(null),g=(0,l.useRef)(null),_=r!==`click`,v=()=>{g.current&&clearTimeout(g.current),g.current=null},y=()=>{v(),g.current=setTimeout(()=>m(!1),160)};(0,l.useEffect)(()=>{if(f||!e)return;let t=`[data-webim-toggle="${e}"]`,n=e=>{e.target.closest?.(t)&&(e.preventDefault(),v(),m(e=>!e))},r=e=>{e.target.closest?.(t)&&(v(),m(!0))},i=e=>{let n=e.target.closest?.(t);!n||e.relatedTarget&&n.contains(e.relatedTarget)||y()};return document.addEventListener(`click`,n),_&&(document.addEventListener(`mouseover`,r),document.addEventListener(`mouseout`,i)),()=>{document.removeEventListener(`click`,n),document.removeEventListener(`mouseover`,r),document.removeEventListener(`mouseout`,i)}},[f,e,_]),(0,l.useEffect)(()=>{if(f||!p)return;let t=t=>{h.current?.contains(t.target)||e&&t.target.closest?.(`[data-webim-toggle="${e}"]`)||m(!1)},n=e=>e.key===`Escape`&&m(!1);return document.addEventListener(`mousedown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`mousedown`,t),document.removeEventListener(`keydown`,n)}},[f,p,e]),(0,l.useEffect)(()=>v,[]);let b=Number(a)>0?Number(a):null,x=f?s!==!1:p,S=(0,B.jsx)(`div`,{style:{position:`absolute`,top:`calc(100% + ${Number(o)||0}px)`,...i===`right`?{right:0}:i===`center`?{left:`50%`,transform:`translateX(-50%)`}:{left:0},zIndex:60,display:x?`block`:`none`,minWidth:b??240,width:b??void 0,maxWidth:`92vw`,padding:14,borderRadius:10,background:`var(--page-surface, #ffffff)`,color:`var(--page-text, inherit)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,boxShadow:`0 16px 44px rgba(15, 23, 42, 0.22)`,...k(u)},children:c?.content??null});return(0,B.jsxs)(`div`,{ref:e=>{h.current=e,d&&d(e)},id:e||void 0,onMouseEnter:!f&&_?()=>{v(),m(!0)}:void 0,onMouseLeave:!f&&_?y:void 0,style:{position:`relative`,display:`inline-block`},children:[t!==`none`&&(0,B.jsxs)(`button`,{type:`button`,"aria-haspopup":`true`,"aria-expanded":f?void 0:p,onClick:()=>!f&&m(e=>!e),style:{padding:`9px 16px`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,borderRadius:6,cursor:`pointer`,fontSize:15,fontFamily:`inherit`,background:`var(--page-surface, transparent)`,color:`inherit`,display:`inline-flex`,alignItems:`center`,gap:6},children:[n,(0,B.jsx)(`span`,{"aria-hidden":`true`,style:{fontSize:10,opacity:.7},children:`▾`})]}),S]})}var yr={PageRoot:Qe,CalendarBlock:dr,LogoCarousel:mr,DialogBlock:_r,DropdownBlock:vr,Section:$e,Container:et,Heading:tt,TextBlock:mt,ButtonBlock:_t,ImageBlock:vt,Spacer:wt,Divider:Tt,BoxBlock:Et,SliderBlock:Mt,CanvasSlider:Nt,TabsBlock:Xt,QuickStack:Cn,CollectionList:wn,CollectionSearch:Tn,BreadcrumbsBlock:En,PaginationBlock:Dn,StepperBlock:zn,SocialLinksBlock:Rn,ThemeModeBlock:Mn,ScrollTopBlock:In,OrgChartBlock:Zn,TableBlock:rr,IconBlock:Ut,MapBlock:Vt,MasonryBlock:Gt,AccordionBlock:Zt,NavbarBlock:Yt,ListBlock:pt,TextSpan:it,QuoteBlock:ft,TextLink:gt,RichTextBlock:ut,RichContentBlock:ut,VideoBlock:yt,YouTubeBlock:xt,IframeBlock:St,EmbedBlock:Ct,FormBlock:dn,FormLabel:gn,FormInput:_n,FormTextarea:vn,FormCheckbox:e=>(0,B.jsx)(yn,{kind:`checkbox`,...e}),FormRadio:e=>(0,B.jsx)(yn,{kind:`radio`,...e}),FormSelect:bn,FormFile:xn,FormRecaptcha:hn,FormSubmit:Sn},br={id:`auth`,label:`Accounts`,category:`Apps`,keys:[`SiteLoginForm`,`SiteAccountMenu`],ssr:`shell`,settings:[`site.authRedirect`]},xr=(0,l.createContext)({user:null,status:`idle`,ensure:()=>{},refresh:()=>{},signOut:()=>{}});function Sr(e,t){return t?/^https?:\/\//i.test(t)?t:`${e.replace(/\/+$/,``)}${t.startsWith(`/`)?t:`/${t}`}`:``}function Cr(e){let t=e&&typeof e==`object`?e[`site.session`]:null,n=t&&typeof t==`object`&&!Array.isArray(t)?t:{},r=e=>typeof e==`string`?e.trim():``,i=r(n.url),a=r(n.mePath),o=r(n.logoutPath);return{mode:n.mode===`custom`||n.mode===`off`?n.mode:`system`,url:i,mePath:a,logoutPath:o,meUrl:Sr(i,a),logoutUrl:Sr(i,o),loginPage:r(n.loginPage),userPath:r(n.userPath),auth:n.auth===`bearer`?`bearer`:`cookies`,tokenKey:r(n.tokenKey)||`webim_session_token`}}function wr(e,t){if(!t)return e??null;let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`)return null;n=n[e]}return n??null}function Tr(e){try{return window.localStorage.getItem(e)||``}catch{return``}}function Er(e){try{window.localStorage.removeItem(e)}catch{}}var Dr=()=>{let e=(0,l.useContext)(xr);return(0,l.useEffect)(()=>{e.ensure()},[e]),e};function Or({children:e,initialUser:t,disabled:n,apiUrl:r,tenant:i}){let a=(0,l.useContext)(Me),o=r||a?.apiUrl||`/api`,s=i||a?.tenant||``,c=(0,l.useMemo)(()=>Cr(a?.settings),[a?.settings]),[u,d]=(0,l.useState)(t??null),[f,p]=(0,l.useState)(t?`user`:n?`guest`:`idle`),m=(0,l.useRef)(!1),h=(0,l.useCallback)((e,t)=>fetch(`${o}${e}`,{...t,credentials:`include`,headers:{"content-type":`application/json`,...s?{"x-tenant":s}:{},...t?.headers}}),[o,s]),g=(0,l.useCallback)(e=>(d(e),p(e?`user`:`guest`),e),[]),_=(0,l.useCallback)(()=>{if(n)return Promise.resolve(null);if(c.mode===`off`)return Promise.resolve(g(null));if(c.mode===`custom`){let e=c.auth===`bearer`?Tr(c.tokenKey):``;return!c.meUrl||c.auth===`bearer`&&!e?Promise.resolve(g(null)):fetch(c.meUrl,{...c.auth===`bearer`?{headers:{authorization:`Bearer ${e}`}}:{credentials:`include`}}).then(e=>e.ok?e.json():null).then(e=>{let t=wr(e,c.userPath);return g(t&&typeof t==`object`?t:null)}).catch(()=>g(null))}return h(`/site/me`).then(e=>e.ok?e.json():null).then(e=>g(e?.payload??null)).catch(()=>g(null))},[h,c,n,g]),v=(0,l.useCallback)(()=>{if(c.mode===`off`)return g(null),Promise.resolve();if(c.mode===`custom`){let e=c.auth===`bearer`?Tr(c.tokenKey):``;return(c.logoutUrl?fetch(c.logoutUrl,{method:`post`,...c.auth===`bearer`?{headers:e?{authorization:`Bearer ${e}`}:{}}:{credentials:`include`}}).catch(()=>{}):Promise.resolve()).then(()=>{c.auth===`bearer`&&Er(c.tokenKey),g(null)})}return h(`/site/logout`,{method:`post`}).catch(()=>{}).then(()=>{g(null)})},[h,c,g]),y=(0,l.useCallback)(()=>{m.current||n||t||(m.current=!0,p(`loading`),_())},[n,t,_]),b=(0,l.useMemo)(()=>({user:u,status:f,ensure:y,refresh:_,signOut:v}),[u,f,y,_,v]);return(0,l.useEffect)(()=>{n||typeof window>`u`||(window.webim={...window.webim,user:u,status:f,loginUrl:c.loginPage||null,requireUser:()=>m.current||t?Promise.resolve(u):_(),refresh:_,signOut:v},window.dispatchEvent(new CustomEvent(`webim:session`,{detail:{user:u,status:f}})))},[n,u,f,t,c.loginPage,_,v]),(0,B.jsx)(xr.Provider,{value:b,children:e})}function kr({when:e,children:t}){let{status:n}=Dr();return!e||e===`always`?t:n===`idle`||n===`loading`?null:e===`user`==(n===`user`)?t:null}function Ar({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:m}=(0,l.useContext)(Me),[h,g]=(0,l.useState)(`form`),[_,v]=(0,l.useState)(``),[y,b]=(0,l.useState)(!1),x=e===`register`,S=c?d||`form`:h,C=e=>typeof e==`string`&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:``,w=async e=>{if(e.preventDefault(),c)return;let n=new FormData(e.currentTarget);b(!0),v(``);try{let e=await fetch(`${p||`/api`}/site/${x?`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`),...x?{name:n.get(`name`)||``}:{}})}),r=await e.json().catch(()=>null);if(!e.ok||r?.success===!1){v(r?.error?.message||`Sign-in failed`),g(`error`),b(!1);return}if(g(`success`),typeof window<`u`){let e=C(t)||C(new URLSearchParams(window.location.search).get(`next`))||C(m?.[`site.authRedirect`])||C(m?.[`apps.auth.redirect`])||`/`;window.location.assign(e)}}catch{v(`Sign-in failed`),g(`error`),b(!1)}};return(0,B.jsxs)(`div`,{ref:s,style:{display:`grid`,gap:12,maxWidth:360,...k(o)},children:[(0,B.jsxs)(`form`,{onSubmit:w,style:{display:S===`form`?`grid`:`none`,gap:10},children:[x?(0,B.jsxs)(`label`,{style:{...$t,display:`grid`,gap:6},children:[i,(0,B.jsx)(`input`,{name:`name`,type:`text`,style:en,...nn(c)})]}):null,(0,B.jsxs)(`label`,{style:{...$t,display:`grid`,gap:6},children:[n,(0,B.jsx)(`input`,{name:`email`,type:`email`,required:!c,style:en,...nn(c)})]}),(0,B.jsxs)(`label`,{style:{...$t,display:`grid`,gap:6},children:[r,(0,B.jsx)(`input`,{name:`password`,type:`password`,required:!c,style:en,...nn(c)})]}),(0,B.jsx)(`button`,{type:c?`button`:`submit`,disabled:y||void 0,style:{...qe,border:0,padding:`10px 22px`,borderRadius:8,fontSize:15,fontWeight:600,cursor:`pointer`,opacity:y?.6:1},children:a||(x?`Create account`:`Sign in`)}),_?(0,B.jsx)(`p`,{style:{margin:0,fontSize:14,color:`#dc2626`},children:_}):null]}),(0,B.jsx)(`div`,{style:{display:S===`success`?`block`:`none`},children:u?.success??null}),(0,B.jsx)(`div`,{style:{display:S===`error`?`block`:`none`},children:u?.error??null})]})}function jr({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}=Dr(),d=a?s||`user`:l,f=a?{name:`Ada Lovelace`,email:`ada@example.com`}:c;return d===`loading`?(0,B.jsx)(`div`,{ref:i,style:{minHeight:24,...k(r)}}):d===`user`?(0,B.jsxs)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:[(0,B.jsxs)(`span`,{style:{...$t,fontWeight:600},children:[e,` `,f?.name||f?.email||``]}),n&&f?.email?(0,B.jsx)(`span`,{style:{...$t,opacity:.7},children:f.email}):null,(0,B.jsx)(`button`,{type:`button`,onClick:a?void 0:u,style:{...qe,border:0,padding:`8px 16px`,borderRadius:8,fontSize:14,cursor:a?`default`:`pointer`},...nn(a),children:t})]}):(0,B.jsx)(`div`,{ref:i,style:{display:`flex`,alignItems:`center`,gap:10,...k(r)},children:o?.signedOut??null})}var Mr={id:`consent`,label:`Cookie consent`,category:`Apps`,keys:[`CookieConsent`],ssr:`shell`,settings:[]},Nr=`webim.cookie_consent`;function Pr(){try{let e=window.localStorage.getItem(Nr),t=e?JSON.parse(e):null;return t?.choice===`accepted`||t?.choice===`declined`?t.choice:``}catch{return``}}function Fr(e){try{document.querySelectorAll(`.webim-page`).forEach(t=>t.setAttribute(`data-webim-consent`,e))}catch{}}function Ir(e){try{window.localStorage.setItem(Nr,JSON.stringify({choice:e,at:new Date().toISOString()}))}catch{}Fr(e);try{window.dispatchEvent(new CustomEvent(`webim:consent`,{detail:{choice:e}}))}catch{}}var Lr={bottom:{left:0,right:0,bottom:0},top:{left:0,right:0,top:0},"bottom-left":{left:16,bottom:16,maxWidth:400},"bottom-right":{right:16,bottom:16,maxWidth:400}};function Rr({message:e,acceptLabel:t,rejectLabel:n,showReject:r,linkLabel:i,linkHref:a,position:o,linked:s,style:c,nodeRef:u,inert:d}){let[f,p]=(0,l.useState)(!!d),[m,h]=(0,l.useState)(null),g=e=>{h(e),typeof u==`function`&&u(e)};if((0,l.useEffect)(()=>{if(d)return;let e=Pr();e?Fr(e):p(!0)},[d,m]),!f)return null;let _=e=>()=>{d||(Ir(e),p(!1))},v=Lr[o]??Lr.bottom,y={appearance:`none`,font:`inherit`,fontSize:14,fontWeight:600,padding:`8px 16px`,borderRadius:8,cursor:d?`default`:`pointer`,whiteSpace:`nowrap`};return(0,B.jsxs)(`div`,{ref:g,role:`region`,"aria-label":`Cookie consent`,style:{...d?{position:`relative`}:{position:`fixed`,zIndex:2147483e3,...v},display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:12,padding:16,background:`var(--page-surface, #f2f2f2)`,color:`var(--page-text, #111827)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:o===`bottom`||o===`top`?0:12,boxShadow:`0 8px 30px rgba(15, 23, 42, 0.18)`,fontSize:14,lineHeight:1.5,...k(c)},children:[(0,B.jsxs)(`div`,{style:{flex:`1 1 260px`,minWidth:0},children:[s?.content??(e||`We use cookies to run this site and to understand how it is used.`),i&&a?(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`a`,{href:a,onClick:d?e=>e.preventDefault():void 0,style:{color:`var(--page-accent, inherit)`,textDecoration:`underline`},children:i})]}):null]}),(0,B.jsxs)(`div`,{style:{display:`flex`,gap:8,flexShrink:0},children:[r===!1?null:(0,B.jsx)(`button`,{type:`button`,onClick:_(`declined`),style:{...y,background:`transparent`,color:`inherit`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.6))`},children:n||`Decline`}),(0,B.jsx)(`button`,{type:`button`,onClick:_(`accepted`),style:{...y,background:`var(--page-accent, #111827)`,color:`var(--page-accent-text, #ffffff)`,border:`1px solid transparent`},children:t||`Accept`})]})]})}var zr={id:`language`,label:`Language`,category:`Apps`,keys:[`SiteLanguagePicker`],ssr:`prefetch`,settings:[`locales`]},Br={id:`search`,label:`Search`,category:`Apps`,keys:[`SiteSearch`],ssr:`prefetch`,settings:[]},Vr=50,Hr=2e3;function Ur(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`q`)??``}function Wr(e,t){let n=e?.data??{},r=[];for(let e of Object.values(n)){let t=e==null?``:Ve(e);if(t&&r.push(t),r.join(` `).length>Hr)break}return r.join(` `).slice(0,Hr).toLocaleLowerCase(t||void 0)}function Gr({placeholder:e=`Search…`,buttonLabel:t=`Search`,showButton:n=!0,live:r=!1,layout:i=`inline`,includePages:a=!0,collections:o=[],limit:s=10,emptyText:c=`Nothing found`,hint:u=``,style:d,nodeRef:f,inert:p=!1,sample:m=!1}){let{tenant:h,apiUrl:g,locale:_}=(0,l.useContext)(Me),[v,y]=(0,l.useState)(()=>Ur()),[b,x]=(0,l.useState)(()=>Ur()),[S,C]=(0,l.useState)(null),[w,T]=(0,l.useState)(!1),E=(0,l.useRef)(null),D=i===`popup`;(0,l.useEffect)(()=>{let e=()=>{let e=Ur();y(e),x(e)};return window.addEventListener(`popstate`,e),window.addEventListener(`webim:urlchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`webim:urlchange`,e)}},[]),(0,l.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>{y(b),b.trim()&&T(!0)},200);return()=>clearTimeout(e)},[r,b]),(0,l.useEffect)(()=>{if(!D)return;let e=e=>{E.current&&!E.current.contains(e.target)&&T(!1)},t=e=>e.key===`Escape`&&T(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[D]),(0,l.useEffect)(()=>{let e=!0,t=h?{"x-tenant":h}:{},n=e=>fetch(`${g}${e}`,{headers:t}).then(e=>e.json()).then(e=>e?.payload).catch(()=>null),r=[a?n(`/site/pages`).then(e=>({kind:`page`,rows:Array.isArray(e)?e:[]})):null,...(Array.isArray(o)?o:[]).filter(Boolean).map(e=>n(`/dynamic/${encodeURIComponent(e)}?all=1${_?`&locale=${encodeURIComponent(_)}`:``}`).then(t=>({kind:`entry`,slug:e,rows:Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[]})))].filter(Boolean);return Promise.all(r).then(t=>e&&C(t)),()=>{e=!1}},[g,h,_,a,JSON.stringify(o)]);let O=v.trim().toLocaleLowerCase(_||void 0),A=[];if(O&&S)for(let e of S)if(e.kind===`page`)for(let t of e.rows){if(t?.access&&t.access!==`public`)continue;let e=String(t?.title??``);`${e} ${t?.slug??``}`.toLocaleLowerCase(_||void 0).includes(O)&&A.push({key:`page:${t.slug}`,title:e||t.slug,url:`/${t.slug}`,kind:`page`})}else for(let t of e.rows){if(!Wr(t,_).includes(O))continue;let n=t?.data??{},r=Ve(n.name)||`Untitled`,i=Ve(n.slug);A.push({key:`entry:${t.id}`,title:r,url:i?`/${e.slug}/${i}`:`/${e.slug}`,kind:`entry`})}let j=A.slice(0,Math.min(Math.max(1,s),Vr)),ee=e=>{if(p){e.preventDefault(),y(b),T(!0);return}if(typeof window>`u`||!window.history?.pushState)return;e.preventDefault();let t=new URLSearchParams(window.location.search);b.trim()?t.set(`q`,b.trim()):t.delete(`q`),t.delete(`page`);let n=t.toString();window.history.pushState({},``,`${window.location.pathname}${n?`?${n}`:``}`),window.dispatchEvent(new Event(`webim:urlchange`)),T(!0)},M=m&&!O?[{key:`sample-1`,title:`About us`,url:`/about`,kind:`page`},{key:`sample-2`,title:`Spring collection`,url:`/blog/spring`,kind:`entry`}]:null,N=M??j,te=!M&&O&&S&&!j.length,P=!D||w&&(N.length>0||te),F=N.length>0&&(0,B.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:2},children:N.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`a`,{href:p?void 0:e.url,style:{display:`block`,padding:`10px 12px`,borderRadius:6,color:`inherit`,textDecoration:`none`,border:D?0:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`},children:[(0,B.jsx)(`span`,{style:{display:`block`,fontWeight:600},children:e.title}),(0,B.jsx)(`span`,{style:{display:`block`,fontSize:12,opacity:.6},children:e.url})]})},e.key))});return(0,B.jsx)(`div`,{ref:f,style:{width:`100%`,...k(d)},children:(0,B.jsxs)(`div`,{ref:E,style:{position:`relative`},children:[(0,B.jsxs)(`form`,{method:`get`,onSubmit:ee,style:{display:`flex`,gap:8,alignItems:`center`},children:[(0,B.jsx)(`input`,{type:`search`,name:`q`,value:b,placeholder:e,onChange:e=>x(e.target.value),onFocus:()=>O&&T(!0),style:{...en,flexGrow:1,minWidth:0}}),n!==!1&&(0,B.jsx)(`button`,{type:`submit`,style:{padding:`10px 16px`,border:0,borderRadius:6,cursor:`pointer`,fontSize:14,fontFamily:`inherit`,background:`var(--page-accent, #4f46e5)`,color:`var(--page-accent-text, #ffffff)`},children:t})]}),u&&(0,B.jsx)(`div`,{style:{fontSize:13,opacity:.65,marginTop:6},children:u}),P&&(0,B.jsxs)(`div`,{style:D?{position:`absolute`,top:`100%`,left:0,right:0,zIndex:30,marginTop:6,padding:6,maxHeight:320,overflowY:`auto`,borderRadius:8,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.35))`,background:`var(--page-surface, #f2f2f2)`,boxShadow:`0 12px 32px rgba(15, 23, 42, 0.18)`}:{marginTop:14},children:[F,te&&(0,B.jsx)(`div`,{style:{fontSize:14,opacity:.65,padding:D?`10px 12px`:0},children:c})]})]})})}function Kr(e){let t=e?.locales,n=[typeof t?.default==`string`&&t.default.trim()?t.default.trim():``,...Array.isArray(t?.enabled)?t.enabled:[]].filter(e=>typeof e==`string`&&e.trim());return[...new Set(n.map(e=>e.trim()))]}var qr=e=>e&&e.charAt(0).toUpperCase()+e.slice(1);function Jr(e,t){let n=String(e??``).toUpperCase();if(t===`code`)return n;let r=``;try{r=qr(new Intl.DisplayNames([e],{type:`language`}).of(e)??``)}catch{}return!r||r.toUpperCase()===n?n:t===`both`?`${n} — ${r}`:r}function Yr(e,t){let n=t?``:`?locale=${encodeURIComponent(e)}`;if(typeof window>`u`)return n||`?`;try{let n=new URL(window.location.href);return t?n.searchParams.delete(`locale`):n.searchParams.set(`locale`,e),n.searchParams.delete(`page`),`${n.pathname}${n.search}${n.hash}`}catch{return n||`/`}}function Xr({variant:e,display:t,separator:n,label:r,style:i,nodeRef:a,inert:o}){let s=(0,l.useContext)(Me),c=Kr(s?.settings),u=c[0]??``,d=c.includes(s?.locale)?s.locale:u,f={display:`inline-flex`,alignItems:`center`,gap:8,...k(i)};if(c.length<2)return o?(0,B.jsx)(`div`,{ref:a,style:{...f,padding:`8px 12px`,border:`1px dashed rgba(100, 116, 139, 0.45)`,borderRadius:6,color:`rgba(100, 116, 139, 0.8)`,fontSize:12},children:`Add site languages in Settings → Languages`}):null;let p=r?(0,B.jsx)(`span`,{style:{opacity:.7},children:r}):null;return e===`inline`?(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,c.map((e,r)=>(0,B.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8},children:[r>0&&(0,B.jsx)(`span`,{style:{opacity:.4},children:n??`·`}),(0,B.jsx)(`a`,{href:Yr(e,e===u),hrefLang:e,"aria-current":e===d?`true`:void 0,onClick:o?e=>e.preventDefault():void 0,style:{color:e===d?`var(--page-accent, inherit)`:`inherit`,fontWeight:e===d?600:400,textDecoration:`none`,cursor:o?`default`:`pointer`},children:Jr(e,t)})]},e))]}):(0,B.jsxs)(`div`,{ref:a,style:f,children:[p,(0,B.jsx)(`select`,{"aria-label":r||`Language`,value:d,onChange:o?void 0:e=>{let t=e.target.value;window.location.assign(Yr(t,t===u))},onKeyDown:o?e=>e.preventDefault():void 0,style:{font:`inherit`,color:`inherit`,background:`var(--page-surface, transparent)`,border:`1px solid var(--page-border, rgba(148, 163, 184, 0.4))`,borderRadius:6,padding:`4px 8px`,cursor:o?`default`:`pointer`},children:c.map(e=>(0,B.jsx)(`option`,{value:e,children:Jr(e,t)},e))})]})}var Zr=[br,zr,Mr,Br],Qr={SiteLoginForm:Ar,SiteAccountMenu:jr,SiteLanguagePicker:Xr,CookieConsent:Rr,SiteSearch:Gr};new Set(Zr.filter(e=>e.ssr===`shell`).flatMap(e=>e.keys));var $r=`0.185.1`,ei=`4.2.0`,ti=`https://cdn.jsdelivr.net/npm`,ni=`${ti}/three@${$r}/+esm`,ri=`${ti}/@google/model-viewer@${ei}/dist/model-viewer.min.js`,ii=e=>import(e),ai=new Map;function oi(e){if(ai.has(e))return ai.get(e);if(typeof window>`u`)return new Promise(()=>{});let t=ii(e).catch(t=>{throw ai.delete(e),t});return ai.set(e,t),t}var si=()=>oi(ni),ci=e=>oi(`${ti}/three@${$r}/examples/jsm/${e}/+esm`);function li(){return typeof window<`u`&&window.customElements?.get(`model-viewer`)?Promise.resolve(null):oi(ri)}var ui=()=>typeof window<`u`&&!!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,di=(e=2)=>Math.min(typeof window>`u`?1:window.devicePixelRatio||1,e);function fi(e,t){let n=0,r=0,i=0,a=!0,o=e=>{n=requestAnimationFrame(o),i||=e;let a=r?(e-r)/1e3:0;r=e,t(a,(e-i)/1e3)},s=()=>{n&&cancelAnimationFrame(n),n=0,r=0},c=()=>{let e=a&&document.visibilityState!==`hidden`;e&&!n?n=requestAnimationFrame(o):!e&&n&&s()};t(0,0);let l=typeof IntersectionObserver>`u`?null:new IntersectionObserver(e=>{a=e.some(e=>e.isIntersecting),c()},{rootMargin:`120px`});return l&&e&&l.observe(e),document.addEventListener(`visibilitychange`,c),c(),()=>{s(),l?.disconnect(),document.removeEventListener(`visibilitychange`,c)}}function pi(e,t,n={}){let r={radius:n.distance??4,polar:n.polar??Math.PI/2.4,azimuth:n.azimuth??.6,target:n.target??{x:0,y:0,z:0}},i={...r},a=n.minDistance??.4,o=n.maxDistance??200,s=n.damping??.12,c=.05,l=null,u=e=>{e.button!==void 0&&e.button!==0||(l={x:e.clientX,y:e.clientY,id:e.pointerId},t.setPointerCapture?.(e.pointerId))},d=e=>{if(!l||e.pointerId!==l.id)return;let t=e.clientX-l.x,n=e.clientY-l.y;l={...l,x:e.clientX,y:e.clientY},i.azimuth-=t*.006,i.polar=Math.max(c,Math.min(Math.PI-c,i.polar-n*.006)),e.preventDefault()},f=e=>{l&&e.pointerId===l.id&&t.releasePointerCapture?.(e.pointerId),l=null},p=e=>{n.enableZoom!==!1&&(e.preventDefault(),i.radius=Math.max(a,Math.min(o,i.radius*(1+Math.sign(e.deltaY)*.12))))};return t.addEventListener(`pointerdown`,u),t.addEventListener(`pointermove`,d),t.addEventListener(`pointerup`,f),t.addEventListener(`pointercancel`,f),t.addEventListener(`wheel`,p,{passive:!1}),{update:()=>{r.radius+=(i.radius-r.radius)*s,r.polar+=(i.polar-r.polar)*s,r.azimuth+=(i.azimuth-r.azimuth)*s;let t=Math.sin(r.polar);e.position.set(r.target.x+r.radius*t*Math.sin(r.azimuth),r.target.y+r.radius*Math.cos(r.polar),r.target.z+r.radius*t*Math.cos(r.azimuth)),e.lookAt(r.target.x,r.target.y,r.target.z)},dragging:()=>!!l,autoSpin:(e,t)=>{!l&&e&&(i.azimuth+=e*t)},frame:(e,t)=>{i.radius=Math.max(a,Math.min(o,e)),r.radius=i.radius,t&&(r.target={...t},i.target={...t})},dispose:()=>{t.removeEventListener(`pointerdown`,u),t.removeEventListener(`pointermove`,d),t.removeEventListener(`pointerup`,f),t.removeEventListener(`pointercancel`,f),t.removeEventListener(`wheel`,p)}}}var mi=(e,t)=>Number.isFinite(Number(e))&&Number(e)>0?Number(e):t,hi=(e,t)=>(Number.isFinite(Number(e))?Number(e):t)/100,gi=e=>(Number.isFinite(Number(e))?Number(e):0)*Math.PI/180,_i=e=>typeof e==`string`&&!!e.trim();function vi({label:e,note:t,height:n,nodeRef:r,style:i}){return(0,B.jsxs)(`div`,{ref:r,style:{...k(i),minHeight:mi(n,320),display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,border:`1px dashed rgba(148,163,184,.55)`,borderRadius:10,background:`rgba(148,163,184,.08)`,...fe,color:`rgba(100,116,139,.95)`,fontSize:13,textAlign:`center`,padding:16},children:[(0,B.jsx)(`div`,{style:{fontWeight:600},children:e}),t?(0,B.jsx)(`div`,{style:{fontSize:11,opacity:.8,maxWidth:320},children:t}):null]})}function yi({src:e,poster:t,alt:n,height:r,bg:i,autoRotate:a,rotateDelay:o,cameraControls:s,ar:c,exposure:u,shadow:d,fieldOfView:f,environment:p,style:m,nodeRef:h,inert:g}){let[_,v]=(0,l.useState)(typeof window<`u`&&!!window.customElements?.get(`model-viewer`)),[y,b]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(_||!e)return;let t=!0;return li().then(()=>t&&v(!0),()=>t&&b(!0)),()=>{t=!1}},[_,e]);let x={display:`block`,width:`100%`,minHeight:mi(r,360),height:mi(r,360),backgroundColor:i||`transparent`,...k(m)};if(!e)return g?(0,B.jsx)(vi,{nodeRef:h,style:m,height:r,label:`3D Model`,note:`Pick a .glb or .gltf file in the Settings panel.`}):(0,B.jsx)(`div`,{ref:h,style:x});if(y)return(0,B.jsx)(`div`,{ref:h,style:{...x,display:`flex`,alignItems:`center`,justifyContent:`center`},children:t?(0,B.jsx)(`img`,{src:t,alt:n||``,style:{maxWidth:`100%`,maxHeight:`100%`}}):null});let S=e=>e?``:void 0,C=a!==!1;return(0,B.jsx)(`model-viewer`,{ref:h,src:e,alt:n||`A 3D model`,poster:t||void 0,style:x,"camera-controls":S(!g&&s!==!1),"auto-rotate":S(C&&!ui()),"auto-rotate-delay":C?String(mi(o,0)):void 0,"rotation-per-second":`18deg`,ar:S(!g&&c===!0),"ar-modes":`webxr scene-viewer quick-look`,"shadow-intensity":String(hi(d,100)),exposure:String(hi(u,100)),"field-of-view":f?`${Number(f)}deg`:void 0,"environment-image":p&&p!==`neutral`?p:`neutral`,"interaction-prompt":g?`none`:void 0,loading:`lazy`,"touch-action":`pan-y`,children:t?(0,B.jsx)(`img`,{slot:`poster`,src:t,alt:n||``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):null})}var bi=[`attribute vec2 p;`,`void main() { gl_Position = vec4(p, 0.0, 1.0); }`].join(`
|
|
87
|
+
`),xi=[`precision highp float;`,`uniform vec2 u_res;`,`uniform float u_time;`,`uniform vec2 u_mouse;`,`uniform vec3 u_a;`,`uniform vec3 u_b;`,`uniform vec3 u_c;`,`uniform float u_scale;`,``,`float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }`,`float noise(vec2 p){`,` vec2 i = floor(p); vec2 f = fract(p);`,` vec2 u = f * f * (3.0 - 2.0 * f);`,` return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x),`,` mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x), u.y);`,`}`,`float fbm(vec2 p){`,` float v = 0.0; float a = 0.5;`,` for (int i = 0; i < 5; i++) { v += a * noise(p); p *= 2.02; a *= 0.5; }`,` return v;`,`}`,``].join(`
|
|
88
|
+
`),Si={gradient:[`void main(){`,` vec2 uv = gl_FragCoord.xy / u_res;`,` vec2 sp = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);`,` float t = u_time * 0.25;`,` float d1 = length(sp - vec2(sin(t) * 0.4, cos(t * 0.8) * 0.3) - u_mouse * 0.25);`,` float d2 = length(sp + vec2(cos(t * 1.1) * 0.45, sin(t * 0.7) * 0.35));`,` vec3 col = mix(u_a, u_b, smoothstep(0.0, 1.0, d1 * u_scale));`,` col = mix(col, u_c, smoothstep(0.0, 1.2, d2 * u_scale) * 0.65);`,` gl_FragColor = vec4(col, 1.0);`,`}`].join(`
|
|
89
89
|
`),waves:[`void main(){`,` vec2 uv = gl_FragCoord.xy / u_res;`,` float t = u_time * 0.5;`,` float y = uv.y * u_scale;`,` float w = sin((uv.x * 6.0) + t) * 0.08 + sin((uv.x * 11.0) - (t * 1.3)) * 0.05;`,` float band = smoothstep(0.0, 1.0, y + w + (u_mouse.y * 0.1));`,` vec3 col = mix(u_a, u_b, band);`,` col += u_c * (0.12 * smoothstep(0.02, 0.0, abs(y + w - 0.5)));`,` gl_FragColor = vec4(col, 1.0);`,`}`].join(`
|
|
90
90
|
`),plasma:[`void main(){`,` vec2 uv = gl_FragCoord.xy / u_res;`,` vec2 p = (uv - 0.5) * u_scale * 3.0 + u_mouse * 0.3;`,` float t = u_time * 0.2;`,` float n = fbm(p + vec2(fbm(p + t), fbm(p - t)));`,` vec3 col = mix(u_a, u_b, smoothstep(0.25, 0.75, n));`,` col = mix(col, u_c, smoothstep(0.6, 0.95, n));`,` gl_FragColor = vec4(col, 1.0);`,`}`].join(`
|
|
91
91
|
`),grid:[`void main(){`,` vec2 uv = gl_FragCoord.xy / u_res;`,` vec2 sp = (gl_FragCoord.xy - 0.5 * u_res) / min(u_res.x, u_res.y);`,` float t = u_time * 0.15;`,` vec2 g = sp * (8.0 * u_scale);`,` g.y += t;`,` vec2 f = abs(fract(g) - 0.5);`,` float line = smoothstep(0.48, 0.5, max(f.x, f.y));`,` float glow = 1.0 - smoothstep(0.0, 0.9, length(sp - u_mouse * 0.4));`,` vec3 col = mix(u_a, u_b, line);`,` col += u_c * glow * 0.35;`,` gl_FragColor = vec4(col, 1.0);`,`}`].join(`
|
|
92
|
-
`)};function bi(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(String(e??``).trim());if(!n)return t;let r=parseInt(n[1],16);return[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255]}function xi(e,t,n){let r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),Error(t||`Shader failed to compile`)}return r}function Si({preset:e,code:t,colorA:n,colorB:r,colorC:i,speed:a,scale:o,height:s,interactive:c,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),m=(0,l.useRef)(null),[h,g]=(0,l.useState)(``),_=typeof t==`string`&&t.trim()?t:yi[e]??yi.gradient,v=String(n??``),y=String(r??``),b=String(i??``),x=pi(a,100),S=Math.max(.05,pi(o,100));return(0,l.useEffect)(()=>{let e=p.current,t=m.current;if(!e||!t)return;let n=e.getContext(`webgl`,{antialias:!0,alpha:!0,premultipliedAlpha:!1});if(!n){g(`WebGL is not available in this browser`);return}let r=null;try{let e=xi(n,n.VERTEX_SHADER,_i),t=xi(n,n.FRAGMENT_SHADER,vi+_);if(r=n.createProgram(),n.attachShader(r,e),n.attachShader(r,t),n.linkProgram(r),!n.getProgramParameter(r,n.LINK_STATUS))throw Error(n.getProgramInfoLog(r)||`Link failed`);g(``)}catch(e){g(e?.message||`Shader failed to compile`);return}n.useProgram(r);let i=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),n.STATIC_DRAW);let a=n.getAttribLocation(r,`p`);n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,0,0);let o=e=>n.getUniformLocation(r,e),s={res:o(`u_res`),time:o(`u_time`),mouse:o(`u_mouse`),a:o(`u_a`),b:o(`u_b`),c:o(`u_c`),scale:o(`u_scale`)},l={x:0,y:0},u=t=>{let n=e.getBoundingClientRect();!n.width||!n.height||(l.x=((t.clientX-n.left)/n.width-.5)*2,l.y=(.5-(t.clientY-n.top)/n.height)*2)};c!==!1&&t.addEventListener(`pointermove`,u);let d=()=>{let r=li(),i=Math.max(1,Math.round(t.clientWidth*r)),a=Math.max(1,Math.round(t.clientHeight*r));(e.width!==i||e.height!==a)&&(e.width=i,e.height=a,n.viewport(0,0,i,a))},f=typeof ResizeObserver>`u`?null:new ResizeObserver(d);f?.observe(t),d();let h=ci(),C={a:bi(v,[.35,.4,.95]),b:bi(y,[.05,.06,.16]),c:bi(b,[.95,.35,.6])},w={};return w.stop=ui(t,(t,r)=>{d(),n.uniform2f(s.res,e.width,e.height),n.uniform1f(s.time,(h?0:r)*x),n.uniform2f(s.mouse,l.x,l.y),n.uniform3fv(s.a,C.a),n.uniform3fv(s.b,C.b),n.uniform3fv(s.c,C.c),n.uniform1f(s.scale,S),n.drawArrays(n.TRIANGLES,0,3),h&&w.stop?.()}),()=>{w.stop?.(),f?.disconnect(),t.removeEventListener(`pointermove`,u),n.deleteProgram(r),n.deleteBuffer(i),n.getExtension(`WEBGL_lose_context`)?.loseContext()}},[_,v,y,b,x,S,c]),(0,B.jsxs)(`div`,{ref:e=>{m.current=e,typeof d==`function`&&d(e)},style:{...k(u),position:k(u).position??`relative`,minHeight:fi(s,320),overflow:`hidden`},children:[(0,B.jsx)(`canvas`,{ref:p,style:{display:`block`,width:`100%`,height:`100%`,position:`absolute`,inset:0}}),h&&f?(0,B.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:12,background:`rgba(15,23,42,.75)`,...fe,color:`#fecaca`,fontSize:11,whiteSpace:`pre-wrap`,overflow:`auto`},children:h}):null]})}function Ci(e,t){let n=new e.Scene,r=new e.BoxGeometry;r.deleteAttribute(`uv`);let i=new e.Mesh(r,new e.MeshBasicMaterial({side:e.BackSide,color:6710886}));i.scale.setScalar(12),n.add(i);let a=(t,i,a,o,s,c,l,u)=>{let d=new e.Mesh(r,new e.MeshBasicMaterial);d.material.color.setHex(t),d.material.color.multiplyScalar(i),d.position.set(a,o,s),d.scale.set(c,l,u),n.add(d)};a(16777215,4,0,6,0,10,.5,10),a(16777215,1.4,-6,1,2,.4,6,6),a(16777215,1,6,1,-2,.4,6,6);let o=new e.PMREMGenerator(t),s=o.fromScene(n,.04);return o.dispose(),r.dispose(),n.traverse(e=>e.material?.dispose?.()),s.texture}var wi={box:e=>new e.BoxGeometry(1,1,1,1,1,1),sphere:e=>new e.SphereGeometry(.62,48,32),torus:e=>new e.TorusGeometry(.5,.2,24,64),knot:e=>new e.TorusKnotGeometry(.44,.15,128,24),cone:e=>new e.ConeGeometry(.55,1.1,48),cylinder:e=>new e.CylinderGeometry(.45,.45,1.1,48),plane:e=>new e.PlaneGeometry(1.4,1.4),capsule:e=>new e.CapsuleGeometry(.35,.6,8,32)},Ti=(e,t)=>Number.isFinite(Number(e))?Number(e):t;function Ei({objects:e,background:t,cameraDistance:n,fov:r,autoRotate:i,spinSpeed:a,controls:o,ground:s,height:c,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(!1),g=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],_=JSON.stringify(g),v=i!==!1&&!ci(),y=o!==!1&&!f;return(0,l.useEffect)(()=>{let e=p.current;if(!e)return;let i=!0,o=null;return oi().then(c=>{if(!i||!e)return;let l=new c.WebGLRenderer({antialias:!0,alpha:!t});l.setPixelRatio(li()),l.shadowMap.enabled=s!==!1,l.shadowMap.type=c.PCFSoftShadowMap,l.outputColorSpace=c.SRGBColorSpace,l.toneMapping=c.ACESFilmicToneMapping,l.domElement.style.display=`block`,l.domElement.style.width=`100%`,l.domElement.style.height=`100%`,e.appendChild(l.domElement);let u=new c.Scene;t&&(u.background=new c.Color(t)),u.environment=Ci(c,l);let d=new c.PerspectiveCamera(Ti(r,45),1,.1,400),f=di(d,l.domElement,{distance:Ti(n,5),enableZoom:y}),p=new c.DirectionalLight(16777215,2.2);p.position.set(4,7,5),p.castShadow=s!==!1,p.shadow.mapSize.set(1024,1024),p.shadow.camera.near=.5,p.shadow.camera.far=30,u.add(p,new c.AmbientLight(16777215,.35));let m=[],h=new c.Group;for(let e of g){let t=(wi[e.shape]??wi.box)(c),n=new c.MeshStandardMaterial({color:/^#?[0-9a-f]{6}$/i.test(String(e.color??``))?e.color:`#6366f1`,metalness:Math.min(1,Math.max(0,pi(e.metalness,10))),roughness:Math.min(1,Math.max(0,pi(e.roughness,35))),transparent:pi(e.opacity,100)<1,opacity:Math.min(1,Math.max(0,pi(e.opacity,100))),flatShading:e.flat===!0,wireframe:e.wireframe===!0,side:e.shape===`plane`?c.DoubleSide:c.FrontSide}),r=new c.Mesh(t,n),i=Ti(e.scale,1);r.position.set(Ti(e.x,0),Ti(e.y,0),Ti(e.z,0)),r.rotation.set(Ti(e.rx,0)*Math.PI/180,Ti(e.ry,0)*Math.PI/180,Ti(e.rz,0)*Math.PI/180),r.scale.setScalar(i>0?i:1),r.castShadow=!0,r.receiveShadow=!0,r.userData.spin=mi(e.spin),h.add(r),m.push(t,n)}u.add(h);let _=null;if(s!==!1){let e=new c.ShadowMaterial({opacity:.22}),t=new c.PlaneGeometry(60,60);_=new c.Mesh(t,e),_.rotation.x=-Math.PI/2,_.position.y=Ti(s===!0?0:s,-.85),_.receiveShadow=!0,u.add(_),m.push(t,e)}let b=()=>{let t=Math.max(1,e.clientWidth),n=Math.max(1,e.clientHeight);l.setSize(t,n,!1),d.aspect=t/n,d.updateProjectionMatrix()},x=typeof ResizeObserver>`u`?null:new ResizeObserver(b);x?.observe(e),b();let S=mi(Number.isFinite(Number(a))?a:20),C=ui(e,e=>{f.autoSpin(v?S:0,e),f.update();for(let t of h.children)t.userData.spin&&(t.rotation.y+=t.userData.spin*e);l.render(u,d)});o=()=>{C(),x?.disconnect(),f.dispose();for(let e of m)e.dispose?.();u.environment?.dispose?.(),l.dispose(),l.domElement.remove()}},()=>{i&&h(!0)}),()=>{i=!1,o?.()}},[_,t,n,r,v,a,y,s]),m&&f?(0,B.jsx)(hi,{nodeRef:d,style:u,height:c,label:`3D Scene`,note:`The 3D engine could not be loaded. Check the connection and try again.`}):(0,B.jsx)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:{...k(u),minHeight:fi(c,380),height:fi(c,380),overflow:`hidden`,touchAction:y?`pan-y`:void 0}})}function Di({code:e,height:t,background:n,style:r,nodeRef:i,inert:a}){let o=(0,l.useRef)(null),[s,c]=(0,l.useState)(``);return(0,l.useEffect)(()=>{let t=o.current;if(a||!t||typeof e!=`string`||!e.trim())return;let r=!0,i=null;return oi().then(a=>{if(!r||!t)return;let o=new a.WebGLRenderer({antialias:!0,alpha:!n});o.setPixelRatio(li()),o.outputColorSpace=a.SRGBColorSpace,o.domElement.style.display=`block`,o.domElement.style.width=`100%`,o.domElement.style.height=`100%`,t.appendChild(o.domElement);let s=new a.Scene;n&&(s.background=new a.Color(n));let l=new a.PerspectiveCamera(45,1,.1,1e3);l.position.set(0,1.2,4);let u=null;try{u=Function(`ctx`,`"use strict";\n${e}`)({THREE:a,scene:s,camera:l,renderer:o,canvas:o.domElement,host:t})}catch(e){c(e?.message||String(e))}let d=()=>{let e=Math.max(1,t.clientWidth),n=Math.max(1,t.clientHeight);o.setSize(e,n,!1),l.aspect=e/n,l.updateProjectionMatrix()},f=typeof ResizeObserver>`u`?null:new ResizeObserver(d);f?.observe(t),d();let p=!1,m=ui(t,(e,t)=>{if(!p&&typeof u?.frame==`function`)try{u.frame(e,t)}catch(e){p=!0,c(e?.message||String(e))}o.render(s,l)});i=()=>{m(),f?.disconnect();try{u?.dispose?.()}catch{}o.dispose(),o.domElement.remove()}}),()=>{r=!1,i?.()}},[e,a,n]),a?(0,B.jsx)(hi,{nodeRef:i,style:r,height:t,label:`three.js`,note:typeof e==`string`&&e.trim()?`Custom scene code runs in Preview and on the published page.`:`Open the code editor in the Settings panel to write your scene.`}):(0,B.jsx)(`div`,{ref:e=>{o.current=e,typeof i==`function`&&i(e)},style:{...k(r),minHeight:fi(t,380),height:fi(t,380),overflow:`hidden`,position:`relative`,touchAction:`pan-y`},children:s?(0,B.jsx)(`div`,{style:{position:`absolute`,left:8,top:8,right:8,padding:`6px 8px`,borderRadius:6,background:`rgba(127,29,29,.85)`,...fe,color:`#fee2e2`,fontSize:11},children:s}):null})}var Oi={ModelViewerBlock:gi,ShaderBlock:Si,SceneBlock:Ei,ThreeCanvasBlock:Di},ki=new Map;function Ai(e){if(ki.has(e))return ki.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return ki.set(e,n),n}function H(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 U(e,t){let n=await Ai(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var ji={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function Mi({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(Me),o=H(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 U(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,B.jsx)(`div`,{ref:i,style:k(r),children:(0,B.jsx)(`div`,{ref:s})}):(0,B.jsxs)(`div`,{ref:i,style:{...ji,...k(r)},children:[`Plugin “`,e,`” is not installed`]})}var Ni={...vr,...Zr,...Oi,PluginBlock:Mi};function Pi(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,B.jsx)(l.Fragment,{children:Pi(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=Ni[o];if(!c)return null;let u=(a.nodes??[]).map(e=>Pi(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,a])=>[e,Pi(a,t,n,r,i)])):void 0,p=(0,B.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),ie(t,s),re(t,i?.events===!1?[]:s.events))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,B.jsx)(Or,{when:s.when,children:p},e):p}var Fi=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `),Ii=e=>`.webim-page[data-webim-mode="light"] { ${Object.entries(be(e.light)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }
|
|
93
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(be(e.dark)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }`;function
|
|
94
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
92
|
+
`)};function Ci(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(String(e??``).trim());if(!n)return t;let r=parseInt(n[1],16);return[(r>>16&255)/255,(r>>8&255)/255,(r&255)/255]}function wi(e,t,n){let r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),Error(t||`Shader failed to compile`)}return r}function Ti({preset:e,code:t,colorA:n,colorB:r,colorC:i,speed:a,scale:o,height:s,interactive:c,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),m=(0,l.useRef)(null),h=(0,l.useRef)(null),[g,_]=(0,l.useState)(``);(0,l.useEffect)(()=>()=>{let e=h.current;h.current=null,e?.getExtension(`WEBGL_lose_context`)?.loseContext()},[]);let v=typeof t==`string`&&t.trim()?t:Si[e]??Si.gradient,y=String(n??``),b=String(r??``),x=String(i??``),S=hi(a,100),C=Math.max(.05,hi(o,100));return(0,l.useEffect)(()=>{let e=p.current,t=m.current;if(!e||!t)return;let n=h.current??=e.getContext(`webgl`,{antialias:!0,alpha:!0,premultipliedAlpha:!1});if(!n){_(`WebGL is not available in this browser`);return}let r=null;try{let e=wi(n,n.VERTEX_SHADER,bi),t=wi(n,n.FRAGMENT_SHADER,xi+v);if(r=n.createProgram(),n.attachShader(r,e),n.attachShader(r,t),n.linkProgram(r),!n.getProgramParameter(r,n.LINK_STATUS))throw Error(n.getProgramInfoLog(r)||`Link failed`);_(``)}catch(e){_(e?.message||`Shader failed to compile`);return}n.useProgram(r);let i=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),n.STATIC_DRAW);let a=n.getAttribLocation(r,`p`);n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,0,0);let o=e=>n.getUniformLocation(r,e),s={res:o(`u_res`),time:o(`u_time`),mouse:o(`u_mouse`),a:o(`u_a`),b:o(`u_b`),c:o(`u_c`),scale:o(`u_scale`)},l={x:0,y:0},u=t=>{let n=e.getBoundingClientRect();!n.width||!n.height||(l.x=((t.clientX-n.left)/n.width-.5)*2,l.y=(.5-(t.clientY-n.top)/n.height)*2)};c!==!1&&t.addEventListener(`pointermove`,u);let d=()=>{let r=di(),i=Math.max(1,Math.round(t.clientWidth*r)),a=Math.max(1,Math.round(t.clientHeight*r));(e.width!==i||e.height!==a)&&(e.width=i,e.height=a,n.viewport(0,0,i,a))},f=typeof ResizeObserver>`u`?null:new ResizeObserver(d);f?.observe(t),d();let g=ui(),w={a:Ci(y,[.35,.4,.95]),b:Ci(b,[.05,.06,.16]),c:Ci(x,[.95,.35,.6])},T={};return T.stop=fi(t,(t,r)=>{d(),n.uniform2f(s.res,e.width,e.height),n.uniform1f(s.time,(g?0:r)*S),n.uniform2f(s.mouse,l.x,l.y),n.uniform3fv(s.a,w.a),n.uniform3fv(s.b,w.b),n.uniform3fv(s.c,w.c),n.uniform1f(s.scale,C),n.drawArrays(n.TRIANGLES,0,3),g&&T.stop?.()}),()=>{T.stop?.(),f?.disconnect(),t.removeEventListener(`pointermove`,u),n.deleteProgram(r),n.deleteBuffer(i)}},[v,y,b,x,S,C,c]),(0,B.jsxs)(`div`,{ref:e=>{m.current=e,typeof d==`function`&&d(e)},style:{position:`relative`,minHeight:mi(s,320),overflow:`hidden`,...k(u)},children:[(0,B.jsx)(`canvas`,{ref:p,style:{display:`block`,width:`100%`,height:`100%`,position:`absolute`,inset:0}}),g&&f?(0,B.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:12,background:`rgba(15,23,42,.75)`,...fe,color:`#fecaca`,fontSize:11,whiteSpace:`pre-wrap`,overflow:`auto`},children:g}):null]})}function Ei(e,t){let n=new e.Scene,r=new e.BoxGeometry;r.deleteAttribute(`uv`);let i=new e.Mesh(r,new e.MeshBasicMaterial({side:e.BackSide,color:6710886}));i.scale.setScalar(12),n.add(i);let a=(t,i,a,o,s,c,l,u)=>{let d=new e.Mesh(r,new e.MeshBasicMaterial);d.material.color.setHex(t),d.material.color.multiplyScalar(i),d.position.set(a,o,s),d.scale.set(c,l,u),n.add(d)};a(16777215,4,0,6,0,10,.5,10),a(16777215,1.4,-6,1,2,.4,6,6),a(16777215,1,6,1,-2,.4,6,6);let o=new e.PMREMGenerator(t),s=o.fromScene(n,.04);return o.dispose(),r.dispose(),n.traverse(e=>e.material?.dispose?.()),s.texture}var Di=new Map;function Oi(e){if(Di.has(e))return Di.get(e);let t=ci(`loaders/GLTFLoader.js`).then(t=>new Promise((n,r)=>{new t.GLTFLoader().load(e,e=>n(e.scene),void 0,r)})).catch(t=>{throw Di.delete(e),t});return Di.set(e,t),t}function ki(e,t){let n=new e.Box3().setFromObject(t);if(n.isEmpty())return t;let r=n.getSize(new e.Vector3),i=n.getCenter(new e.Vector3),a=Math.max(r.x,r.y,r.z)||1,o=new e.Group;return t.position.sub(i),t.scale.multiplyScalar(1/a),t.position.multiplyScalar(1/a),o.add(t),o}var Ai={box:e=>new e.BoxGeometry(1,1,1,1,1,1),sphere:e=>new e.SphereGeometry(.62,48,32),torus:e=>new e.TorusGeometry(.5,.2,24,64),knot:e=>new e.TorusKnotGeometry(.44,.15,128,24),cone:e=>new e.ConeGeometry(.55,1.1,48),cylinder:e=>new e.CylinderGeometry(.45,.45,1.1,48),plane:e=>new e.PlaneGeometry(1.4,1.4),capsule:e=>new e.CapsuleGeometry(.35,.6,8,32)},H=(e,t)=>Number.isFinite(Number(e))?Number(e):t;function U({objects:e,background:t,cameraDistance:n,fov:r,autoRotate:i,spinSpeed:a,controls:o,ground:s,height:c,style:u,nodeRef:d,inert:f}){let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(!1),g=Array.isArray(e)?e.filter(e=>e&&typeof e==`object`):[],_=JSON.stringify(g),v=i!==!1&&!ui(),y=o!==!1&&!f;return(0,l.useEffect)(()=>{let e=p.current;if(!e)return;let i=!0,o=null;return si().then(c=>{if(!i||!e)return;let l=new c.WebGLRenderer({antialias:!0,alpha:!t});l.setPixelRatio(di()),l.shadowMap.enabled=s!==!1,l.shadowMap.type=c.PCFSoftShadowMap,l.outputColorSpace=c.SRGBColorSpace,l.toneMapping=c.ACESFilmicToneMapping,l.domElement.style.display=`block`,l.domElement.style.width=`100%`,l.domElement.style.height=`100%`,e.appendChild(l.domElement);let u=new c.Scene;t&&(u.background=new c.Color(t)),u.environment=Ei(c,l);let d=new c.PerspectiveCamera(H(r,45),1,.1,400),f=pi(d,l.domElement,{distance:H(n,5),enableZoom:y}),p=new c.DirectionalLight(16777215,2.2);p.position.set(4,7,5),p.castShadow=s!==!1,p.shadow.mapSize.set(1024,1024),p.shadow.camera.near=.5,p.shadow.camera.far=30,u.add(p,new c.AmbientLight(16777215,.35));let m=[],h=new c.Group,_=(e,t)=>{let n=H(t.scale,1);e.position.set(H(t.x,0),H(t.y,0),H(t.z,0)),e.rotation.set(gi(t.rx),gi(t.ry),gi(t.rz)),e.scale.setScalar(n>0?n:1),e.userData.spin=gi(t.spin)};for(let e of g){if(e.shape===`model`){if(!_i(e.src))continue;let t=new c.Group;_(t,e),h.add(t),Oi(e.src).then(e=>{if(!i)return;let n=ki(c,e.clone(!0));n.traverse(e=>{e.isMesh&&(e.castShadow=!0,e.receiveShadow=!0)}),t.add(n)},()=>{});continue}let t=(Ai[e.shape]??Ai.box)(c),n=new c.MeshStandardMaterial({color:/^#?[0-9a-f]{6}$/i.test(String(e.color??``))?e.color:`#6366f1`,metalness:Math.min(1,Math.max(0,hi(e.metalness,10))),roughness:Math.min(1,Math.max(0,hi(e.roughness,35))),transparent:hi(e.opacity,100)<1,opacity:Math.min(1,Math.max(0,hi(e.opacity,100))),flatShading:e.flat===!0,wireframe:e.wireframe===!0,side:e.shape===`plane`?c.DoubleSide:c.FrontSide}),r=new c.Mesh(t,n);_(r,e),r.castShadow=!0,r.receiveShadow=!0,h.add(r),m.push(t,n)}u.add(h);let b=null;if(s!==!1){let e=new c.ShadowMaterial({opacity:.22}),t=new c.PlaneGeometry(60,60);b=new c.Mesh(t,e),b.rotation.x=-Math.PI/2,b.position.y=H(s===!0?0:s,-.85),b.receiveShadow=!0,u.add(b),m.push(t,e)}let x=()=>{let t=Math.max(1,e.clientWidth),n=Math.max(1,e.clientHeight);l.setSize(t,n,!1),d.aspect=t/n,d.updateProjectionMatrix()},S=typeof ResizeObserver>`u`?null:new ResizeObserver(x);S?.observe(e),x();let C=gi(Number.isFinite(Number(a))?a:20),w=fi(e,e=>{f.autoSpin(v?C:0,e),f.update();for(let t of h.children)t.userData.spin&&(t.rotation.y+=t.userData.spin*e);l.render(u,d)});o=()=>{w(),S?.disconnect(),f.dispose();for(let e of m)e.dispose?.();u.environment?.dispose?.(),l.dispose(),l.domElement.remove()}},()=>{i&&h(!0)}),()=>{i=!1,o?.()}},[_,t,n,r,v,a,y,s]),m&&f?(0,B.jsx)(vi,{nodeRef:d,style:u,height:c,label:`3D Scene`,note:`The 3D engine could not be loaded. Check the connection and try again.`}):(0,B.jsx)(`div`,{ref:e=>{p.current=e,typeof d==`function`&&d(e)},style:{minHeight:mi(c,380),height:mi(c,380),overflow:`hidden`,touchAction:y?`pan-y`:void 0,...k(u)}})}function ji({code:e,height:t,background:n,style:r,nodeRef:i,inert:a}){let o=(0,l.useRef)(null),[s,c]=(0,l.useState)(``);return(0,l.useEffect)(()=>{let t=o.current;if(a||!t||typeof e!=`string`||!e.trim())return;let r=!0,i=null;return si().then(a=>{if(!r||!t)return;let o=new a.WebGLRenderer({antialias:!0,alpha:!n});o.setPixelRatio(di()),o.outputColorSpace=a.SRGBColorSpace,o.domElement.style.display=`block`,o.domElement.style.width=`100%`,o.domElement.style.height=`100%`,t.appendChild(o.domElement);let s=new a.Scene;n&&(s.background=new a.Color(n));let l=new a.PerspectiveCamera(45,1,.1,1e3);l.position.set(0,1.2,4);let u=null;try{u=Function(`ctx`,`"use strict";\n${e}`)({THREE:a,scene:s,camera:l,renderer:o,canvas:o.domElement,host:t})}catch(e){c(e?.message||String(e))}let d=()=>{let e=Math.max(1,t.clientWidth),n=Math.max(1,t.clientHeight);o.setSize(e,n,!1),l.aspect=e/n,l.updateProjectionMatrix()},f=typeof ResizeObserver>`u`?null:new ResizeObserver(d);f?.observe(t),d();let p=!1,m=fi(t,(e,t)=>{if(!p&&typeof u?.frame==`function`)try{u.frame(e,t)}catch(e){p=!0,c(e?.message||String(e))}o.render(s,l)});i=()=>{m(),f?.disconnect();try{u?.dispose?.()}catch{}o.dispose(),o.domElement.remove()}}),()=>{r=!1,i?.()}},[e,a,n]),a?(0,B.jsx)(vi,{nodeRef:i,style:r,height:t,label:`three.js`,note:typeof e==`string`&&e.trim()?`Custom scene code runs in Preview and on the published page.`:`Open the code editor in the Settings panel to write your scene.`}):(0,B.jsx)(`div`,{ref:e=>{o.current=e,typeof i==`function`&&i(e)},style:{minHeight:mi(t,380),height:mi(t,380),overflow:`hidden`,position:`relative`,touchAction:`pan-y`,...k(r)},children:s?(0,B.jsx)(`div`,{style:{position:`absolute`,left:8,top:8,right:8,padding:`6px 8px`,borderRadius:6,background:`rgba(127,29,29,.85)`,...fe,color:`#fee2e2`,fontSize:11},children:s}):null})}var Mi={ModelViewerBlock:yi,ShaderBlock:Ti,SceneBlock:U,ThreeCanvasBlock:ji},Ni=new Map;function Pi(e){if(Ni.has(e))return Ni.get(e);let t=URL.createObjectURL(new Blob([e],{type:`text/javascript`})),n=import(t).finally(()=>URL.revokeObjectURL(t));return Ni.set(e,n),n}function Fi(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 Ii(e,t){let n=await Pi(e);return(Array.isArray(n?.default?.blocks)?n.default.blocks:[]).find(e=>e?.id===t&&typeof e.mount==`function`)??null}var Li={padding:`10px 12px`,border:`1px dashed rgba(148, 163, 184, 0.5)`,borderRadius:8,fontSize:12,opacity:.6};function Ri({pluginId:e,blockId:t,props:n,style:r,nodeRef:i}){let a=(0,l.useContext)(Me),o=Fi(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 Ii(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,B.jsx)(`div`,{ref:i,style:k(r),children:(0,B.jsx)(`div`,{ref:s})}):(0,B.jsxs)(`div`,{ref:i,style:{...Li,...k(r)},children:[`Plugin “`,e,`” is not installed`]})}var zi={...yr,...Qr,...Mi,PluginBlock:Ri};function Bi(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,B.jsx)(l.Fragment,{children:Bi(o.template.rootId,o.template.nodes,n,s,i)},e)}let c=zi[o];if(!c)return null;let u=(a.nodes??[]).map(e=>Bi(e,t,n,r,i)).filter(Boolean),d=Object.entries(a.linkedNodes??{}),f=d.length?Object.fromEntries(d.map(([e,a])=>[e,Bi(a,t,n,r,i)])):void 0,p=(0,B.jsx)(c,{...s,...o===`CollectionList`?{templateId:a.linkedNodes?.card}:null,linked:f,nodeRef:t=>{t&&(t.setAttribute(`data-wb`,e),ie(t,s),re(t,i?.events===!1?[]:s.events))},children:u.length?u:void 0},e);return s.when&&s.when!==`always`?(0,B.jsx)(kr,{when:s.when,children:p},e):p}var Vi=e=>Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(` `),Hi=e=>`.webim-page[data-webim-mode="light"] { ${Object.entries(be(e.light)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }
|
|
93
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(be(e.dark)).map(([e,t])=>`${e}: ${t} !important;`).join(` `)} }`;function Ui({blocks:e,theme:t,components:n,mode:r=`auto`,style:i,custom:a,animations:o,tenant:s,apiUrl:c,datasets:u,locale:d,direction:f,settings:p,siteUser:m}){let g=a?.js?.trim();if((0,l.useEffect)(()=>{if(!g)return;let e=document.createElement(`script`);return e.text=g,document.body.appendChild(e),()=>e.remove()},[g]),!e?.ROOT)return null;let _={lang:d||void 0,dir:Ae(f,d)},y=`.webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }`,b={minHeight:`100%`,display:`flex`,flexDirection:`column`},x=Bi(`ROOT`,e,n),S=(0,l.useMemo)(()=>({render:(t,r)=>Bi(t,e,n,void 0,{mapProps:r})}),[e,n]),C=ue(e,n),w=le(e,n),E=a?.css?.trim(),D=T(o),O=ye(t),k=[O.font,O.headingFont].filter(e=>typeof e==`string`&&e.trim()&&e!==`inherit`&&!ge[e]),A=[...new Set([...v(e,n),...k])].map(e=>(0,B.jsx)(`link`,{rel:`stylesheet`,precedence:`default`,href:h(e)},e)),j=Hi(O);return r===`auto`?(0,B.jsx)(Me.Provider,{value:{tenant:s||``,apiUrl:c||`/api`,locale:d||``,settings:p??null},children:(0,B.jsx)(Or,{initialUser:m,children:(0,B.jsx)(Ne.Provider,{value:u??null,children:(0,B.jsx)(Le.Provider,{value:S,children:(0,B.jsxs)(`div`,{..._,className:`webim-page`,style:{...b,...xe(t),...i},children:[(0,B.jsx)(`style`,{children:`.webim-page { ${Vi(be(O.light))} }
|
|
94
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Vi(be(O.dark))} } }`}),(0,B.jsx)(`style`,{children:j}),A,(0,B.jsx)(`style`,{children:y}),C&&(0,B.jsx)(`style`,{children:C}),w&&(0,B.jsx)(`style`,{children:w}),E&&(0,B.jsx)(`style`,{children:E}),x]})})})})}):(0,B.jsx)(Me.Provider,{value:{tenant:s||``,apiUrl:c||`/api`,locale:d||``,settings:p??null},children:(0,B.jsx)(Or,{initialUser:m,children:(0,B.jsx)(Ne.Provider,{value:u??null,children:(0,B.jsx)(Le.Provider,{value:S,children:(0,B.jsxs)(`div`,{..._,className:`webim-page`,style:{...b,...we(t,r),...i},children:[A,(0,B.jsx)(`style`,{children:j}),(0,B.jsx)(`style`,{children:y}),C&&(0,B.jsx)(`style`,{children:C}),w&&(0,B.jsx)(`style`,{children:w}),D&&(0,B.jsx)(`style`,{children:D}),D&&(0,B.jsx)(`style`,{children:D}),E&&(0,B.jsx)(`style`,{children:E}),x]})})})})})}function Wi({bundle:e,mode:t=`auto`,style:n}){return e?.blocks?.ROOT?(0,B.jsx)(Ui,{blocks:e.blocks,theme:e.theme,components:e.components,custom:e.custom,animations:e.animations,tenant:e.tenant,apiUrl:e.apiUrl,datasets:e.datasets,locale:e.locale,direction:e.direction,settings:e.settings,mode:R(t,e.scheme),style:n}):null}function Gi({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`}),De({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,B.jsx)(Wi,{bundle:p.bundle,mode:o,style:s})}function Ki(e,t={}){let n=(0,u.createRoot)(e);return n.render((0,B.jsx)(Gi,{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 qi(e=document){for(let t of e.querySelectorAll(`[data-webim-page]:not([data-webim-mounted])`))t.setAttribute(`data-webim-mounted`,``),Ki(t,t.dataset)}var Ji=document.currentScript,Yi=()=>{if(qi(),Ji?.dataset.slug){let e=document.createElement(`div`);e.setAttribute(`data-webim-mounted`,``),Ji.parentElement&&Ji.parentElement!==document.head?Ji.insertAdjacentElement(`beforebegin`,e):document.body.appendChild(e),Ki(e,Ji.dataset)}};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Yi,{once:!0}):Yi(),window.WebimEmbed={mount:Ki,scan:qi}})();
|