@cntrl-site/components 1.0.118-alpha.1 → 1.0.118-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,669 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),N=require("./scalingValue-CSHYgTZl.js"),Rn=require("./buildColorVars-CE2D5cQV.js"),On=require("./useScopedStyles-Bf6yohVQ.js"),Hn=require("./useLightboxScrollLock-Hf16Eq4g.js"),gt=require("./textStylesToCss-CNN3zZTV.js"),Bo=require("./loadSvgMaskUrl-DfF7ay6h.js"),w=300,h=300,Fn=8/1440,V=.004,In=50,jn=1440,I=In/jn;function Mn(o){if(o==="default"||o==="compact"||o==="open")return o;if(o==="onScroll")return"compact"}function _n(o){return o==="center"||o==="right"?o:"left"}function Wn(o){return o==="left"||o==="right"?o:"center"}function En(o,t,e){const n=N.scalingValue(t,e);return o==="center"?`translateX(calc(-50% + ${n}))`:`translateX(${n})`}function Un(o,t){if(o&&typeof o=="object"){if(t&&typeof o[t]=="string")return o[t];for(const e in o)if(typeof o[e]=="string")return o[e];return}return o}function Io(o,t){const e=(Un(o,t)??"always").trim().toLowerCase().replace(/[_-]+/g," ");return e==="open only"||e==="openonly"?"open only":e==="default only"||e==="defaultonly"?"default only":e==="open and compact"||e==="openandcompact"?"open and compact":e==="default and open"||e==="defaultandopen"?"default and open":e==="default and compact"||e==="defaultandcompact"?"default and compact":"always"}function Vn(o,t,e){switch(Io(o.showIn,e)){case"open only":return!1;case"default only":return t==="default";case"open and compact":return t==="compact";case"default and compact":return!0;case"default and open":return t==="default";default:return!0}}function Gn(o,t){switch(Io(o.showIn,t)){case"default only":case"default and compact":return!1;default:return!0}}function Ct(o,t){return!Array.isArray(o)||o.length===0?!0:o.some(e=>Io(e==null?void 0:e.showIn,t)!=="default only")}function Dn(o){return(o==null?void 0:o.find(t=>t.slug===""))??(o==null?void 0:o[0])}function Xn(o,t){const e=o?t==null?void 0:t.find(n=>n.id===o):Dn(t);return!o&&!e?"":e?e.slug===""?"/":`/${e.slug}`:o.startsWith("/")||o.startsWith("#")||/^[a-z][a-z\d+\-.]*:/i.test(o)?o:t?`/${o}`:o}function pt(o){const t=(o??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function Oo(o){const t=o.link;if(t&&typeof t=="object"){const n=pt(t.target)?"_blank":void 0;if(t.type==="url")return{type:"url",value:t.value??t.url??"",target:n};if(t.type==="anchor")return{type:"anchor",value:t.value??"",target:n};if(t.type==="page")return{type:"page",value:t.value??"",target:n,anchor:t.anchor};if(t.type==="file")return{type:"file",value:t.value??""};if(typeof t.url=="string")return{type:"url",value:t.url,target:n,download:typeof t.download=="string"?t.download:void 0}}const e=pt(o.openIn)?"_blank":void 0;return o.mode==="url"?{type:"url",value:o.url??"",target:e}:{type:"page",value:o.page??"",target:e,anchor:o.anchor}}function Yn(o){return/^[a-z][a-z\d+\-.]*:/i.test(o)||o.startsWith("/")||o.startsWith("#")?o:`https://${o}`}function Ho(o,t){const e=o.label||"Link",n=Oo(o);if(n.type==="url")return{label:e,href:n.value,target:n.target,download:n.download};if(n.type==="file")return{label:e,href:n.value?"#":"",target:"_blank"};if(n.type==="anchor"){const v=n.value.replace(/^#/,"");return{label:e,href:v?`#${v}`:"",target:n.target}}const r=Xn(n.value,t),c=(n.anchor??"").replace(/^#/,""),g=c?r?`${r}#${c}`:`#${c}`:r;return{label:e,href:g,target:n.target}}const H=24,O=H*.125,Tt=H*.125,Ro=(H-(3*O+2*Tt))/2,vt=O+Tt;function qn({className:o,lineClassName:t}){return l.jsxs("svg",{className:o,viewBox:`0 0 ${H} ${H}`,"aria-hidden":"true",children:[l.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:Ro,width:H,height:O,rx:O/2}),l.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:Ro+vt,width:H,height:O,rx:O/2}),l.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:Ro+2*vt,width:H,height:O,rx:O/2})]})}function Kn(o,t,e,n){return t!==void 0&&t<(o??.01)?`${e} ${n}`:e}function Zn(o,t,e,n){const r=o??.01;return t===void 0||t>=r?{}:{[`--${e}-text-leading-gap`]:N.scalingValue((r-t)/2,n)}}const Nt=.004;let eo;function Jn(){return eo!==void 0?eo:typeof document>"u"?(eo=null,null):(eo=document.createElement("canvas").getContext("2d"),eo)}function Qn(o){const t=getComputedStyle(o),e=parseFloat(t.fontSize)||0;if(e<=0)return 0;const n=Jn();if(!n)return 0;n.font=`${t.fontStyle} ${t.fontWeight} ${e}px ${t.fontFamily}`;const r=n.measureText("H"),c=r.actualBoundingBoxAscent>0?r.actualBoundingBoxAscent:0,g=Math.max(0,r.actualBoundingBoxDescent||0),v=r.fontBoundingBoxAscent||0,f=r.fontBoundingBoxDescent||0;return c<=0||v<=0&&f<=0?0:(f-g-(v-c))/2/e}function ht(o,t){const[e,n]=s.useState(0);return s.useLayoutEffect(()=>{const r=o.current;if(!r)return;const c=()=>{const f=Qn(r);n(x=>Math.abs(x-f)<Nt?x:f)};c();const g=document.fonts;g.ready.then(c).catch(()=>{}),g.addEventListener("loadingdone",c);const v=new ResizeObserver(c);return v.observe(r),()=>{g.removeEventListener("loadingdone",c),v.disconnect()}},[o,t]),e}function ut(o){if(!(Math.abs(o)<Nt))return`translateY(${o}em)`}function $t(o){var t,e;return[o.fontFamily??"",((t=o.fontSettings)==null?void 0:t.fontWeight)??400,((e=o.fontSettings)==null?void 0:e.fontStyle)??"normal",o.fontSize??"",o.lineHeight??""].join("\0")}function mt(o){return{fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontStyle:o.fontStyle,fontSize:o.fontSize,lineHeight:o.lineHeight,position:"absolute",top:0,left:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap"}}function xt(o,t={}){return{fontFamily:o.fontFamily??t.fontFamily,fontSettings:o.fontSettings??t.fontSettings,fontSize:o.fontSize??t.fontSize,lineHeight:o.lineHeight??t.lineHeight,letterSpacing:o.letterSpacing??t.letterSpacing??0,wordSpacing:o.wordSpacing??t.wordSpacing??0,textAlign:o.textAlign??t.textAlign??"left",textAppearance:o.textAppearance??t.textAppearance}}function kt(o,t,e){var r,c;const n={fontSettings:{fontFamily:t.fontFamily,fontWeight:((r=t.fontSettings)==null?void 0:r.fontWeight)??400,fontStyle:((c=t.fontSettings)==null?void 0:c.fontStyle)??"normal"},fontSize:t.fontSize??.01,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing??0,wordSpacing:t.wordSpacing??0,textAlign:t.textAlign,textAppearance:t.textAppearance,color:""};return{css:{...gt.omitTextColors(gt.textStylesToCss(n,e)),...Zn(t.fontSize,t.lineHeight,o,e)},className:Kn(t.fontSize,t.lineHeight,`${o}-link-text`,`${o}-text-tight-leading`)}}function bt(o){const t=o.split(/\r?\n/);return t.length===1?o:t.map((e,n)=>l.jsxs(s.Fragment,{children:[e,n<t.length-1?l.jsx("br",{}):null]},n))}function St(o,t,e,n){const r=Math.max(0,e-n),c=o+t;if(c<=r||c<=0)return{start:o,end:t};const g=r/c;return{start:o*g,end:t*g}}function At(o){const e=Math.max(I,o.fontSize??I),{start:n,end:r}=St(o.textPaddingTop,o.textPaddingBottom,1,e),{start:c,end:g}=St(o.textPaddingLeft,o.textPaddingRight,1,I);return{effectivePaddingLeft:c,effectivePaddingRight:g,effectivePaddingTop:n,effectivePaddingBottom:r,panelSize:1}}function Pn(o){if(o==="center"||o==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,e]=o.split("-");return{horizontalAlign:t,verticalAlign:e}}function oa(o){return o.position?Pn(o.position):{horizontalAlign:o.horizontalAlign??"left",verticalAlign:o.verticalAlign??"top"}}function ta(o,t){return o.textPaddingLeft!==t.textPaddingLeft||o.textPaddingRight!==t.textPaddingRight||o.textPaddingTop!==t.textPaddingTop||o.textPaddingBottom!==t.textPaddingBottom}const ea=[["onScrollIconColor","compactIconColor"],["onScrollLinkColor","compactLinkColor"],["onScrollLogoColor","compactLogoColor"],["onScrollBackgroundColor","compactBackgroundColor"],["onScrollPanelColor","compactBackgroundColor"],["onScrollLogoMaxWidth","compactLogoMaxWidth"],["onScrollLogoMaxHeight","compactLogoMaxHeight"],["onScrollLogoPosition","compactLogoPosition"],["onScrollPanelHeight","compactPanelHeight"],["onScrollIconSize","compactIconSize"],["onScrollNavTextWidth","compactNavTextWidth"],["onScrollNavGap","compactNavGap"],["onScrollNavPaddingLeft","compactNavPaddingLeft"],["onScrollNavPaddingRight","compactNavPaddingRight"],["onScrollFontFamily","compactFontFamily"],["onScrollFontSettings","compactFontSettings"],["onScrollFontSize","compactFontSize"],["onScrollLineHeight","compactLineHeight"],["onScrollLetterSpacing","compactLetterSpacing"],["onScrollWordSpacing","compactWordSpacing"],["onScrollTextAlign","compactTextAlign"],["onScrollTextAppearance","compactTextAppearance"]];function zt(o){var r,c;const t=o,e={};for(const[g,v]of ea)o[v]!==void 0||t[g]===void 0||(e[v]=t[g]);const n=t.stateOverrides;return n&&(n.onScroll!==void 0||n["onScroll-hover"]!==void 0)&&(e.stateOverrides={...o.stateOverrides},n.onScroll!==void 0&&((r=o.stateOverrides)==null?void 0:r.compact)===void 0&&(e.stateOverrides.compact=n.onScroll),n["onScroll-hover"]!==void 0&&((c=o.stateOverrides)==null?void 0:c["compact-hover"])===void 0&&(e.stateOverrides["compact-hover"]=n["onScroll-hover"])),Object.keys(e).length===0?o:{...o,...e}}function yt(o){var r,c,g,v,f,x,L,A,S,a,$,z,G,D,X,R;o=zt(o);const t=o,e={};if(o.backgroundColor===void 0&&t.panelColor!==void 0&&(e.backgroundColor=t.panelColor),o.openFontFamily===void 0&&o.fontFamily!==void 0&&(e.openFontFamily=o.fontFamily),o.openFontSettings===void 0&&o.fontSettings!==void 0&&(e.openFontSettings=o.fontSettings),o.openFontSize===void 0&&o.fontSize!==void 0&&(e.openFontSize=o.fontSize),o.openLineHeight===void 0&&o.lineHeight!==void 0&&(e.openLineHeight=o.lineHeight),o.openLetterSpacing===void 0&&o.letterSpacing!==void 0&&(e.openLetterSpacing=o.letterSpacing),o.openWordSpacing===void 0&&o.wordSpacing!==void 0&&(e.openWordSpacing=o.wordSpacing),o.openTextAlign===void 0&&o.textAlign!==void 0&&(e.openTextAlign=o.textAlign),o.openTextAppearance===void 0&&o.textAppearance!==void 0&&(e.openTextAppearance=o.textAppearance),o.openLinkColor===void 0){const p=((c=(r=o.stateOverrides)==null?void 0:r.open)==null?void 0:c.openLinkColor)??((v=(g=o.stateOverrides)==null?void 0:g.open)==null?void 0:v.linkColor)??o.linkColor;p!==void 0&&(e.openLinkColor=p)}if(o.compactIconColor===void 0){const p=((x=(f=o.stateOverrides)==null?void 0:f.compact)==null?void 0:x.iconColor)??o.iconColor;p!==void 0&&(e.compactIconColor=p)}if(o.compactLinkColor===void 0){const p=((A=(L=o.stateOverrides)==null?void 0:L.compact)==null?void 0:A.linkColor)??o.linkColor;p!==void 0&&(e.compactLinkColor=p)}if(o.compactLogoColor===void 0){const p=((a=(S=o.stateOverrides)==null?void 0:S.compact)==null?void 0:a.logoColor)??o.logoColor;p!==void 0&&(e.compactLogoColor=p)}if(o.openLogoColor===void 0){const p=((z=($=o.stateOverrides)==null?void 0:$.open)==null?void 0:z.logoColor)??o.logoColor;p!==void 0&&(e.openLogoColor=p)}if(o.compactBackgroundColor===void 0){const p=((D=(G=o.stateOverrides)==null?void 0:G.compact)==null?void 0:D.backgroundColor)??((R=(X=t.stateOverrides)==null?void 0:X.compact)==null?void 0:R.panelColor)??t.compactPanelColor??t.onScrollPanelColor??o.backgroundColor??e.backgroundColor;p!==void 0&&(e.compactBackgroundColor=p)}o.logoMaxHeight===void 0&&o.logoMaxWidth!==void 0&&(e.logoMaxHeight=o.logoMaxWidth),o.compactLogoMaxHeight===void 0&&o.compactLogoMaxWidth!==void 0&&(e.compactLogoMaxHeight=o.compactLogoMaxWidth);const n=(p,Y)=>{if(o[p]!==void 0)return;const q=o[Y];q!==void 0&&(e[p]=q)};return n("compactLogoMaxHeight","logoMaxHeight"),n("compactLogoPosition","logoPosition"),n("compactPanelHeight","panelHeight"),n("compactShowIcon","showIcon"),n("compactIconSize","iconSize"),n("compactNavTextWidth","navTextWidth"),n("compactNavTextPosition","navTextPosition"),n("compactNavTextOffset","navTextOffset"),n("compactNavGap","navGap"),n("compactNavPaddingLeft","navPaddingLeft"),n("compactNavPaddingRight","navPaddingRight"),n("compactFontFamily","fontFamily"),n("compactFontSettings","fontSettings"),n("compactFontSize","fontSize"),n("compactLineHeight","lineHeight"),n("compactLetterSpacing","letterSpacing"),n("compactWordSpacing","wordSpacing"),n("compactTextAlign","textAlign"),n("compactTextAppearance","textAppearance"),Object.keys(e).length===0?o:{...o,...e}}function Bt(o,t){const e=At({textPaddingLeft:o.textPaddingLeft??0,textPaddingRight:o.textPaddingRight??0,textPaddingTop:o.textPaddingTop??0,textPaddingBottom:o.textPaddingBottom??0,fontSize:o.openFontSize??o.fontSize??t.openFontSize??t.fontSize}),n={};return(o.textPaddingLeft??0)!==e.effectivePaddingLeft&&(n.textPaddingLeft=e.effectivePaddingLeft),(o.textPaddingRight??0)!==e.effectivePaddingRight&&(n.textPaddingRight=e.effectivePaddingRight),(o.textPaddingTop??0)!==e.effectivePaddingTop&&(n.textPaddingTop=e.effectivePaddingTop),(o.textPaddingBottom??0)!==e.effectivePaddingBottom&&(n.textPaddingBottom=e.effectivePaddingBottom),Object.keys(n).length===0?o:{...o,...n}}function na(o,t){return{paddingLeft:N.scalingValue(o.effectivePaddingLeft,t),paddingRight:N.scalingValue(o.effectivePaddingRight,t),paddingTop:N.scalingValue(o.effectivePaddingTop,t),paddingBottom:N.scalingValue(o.effectivePaddingBottom,t)}}function aa(o,t,e,n){const r=Math.max(I,e??I),c=Math.max(t.effectivePaddingTop,V),g=Math.max(t.effectivePaddingBottom,V),v=Math.max(0,t.panelSize-t.effectivePaddingBottom-r),f=Math.max(0,t.panelSize-t.effectivePaddingTop-r),x=Math.max(t.effectivePaddingLeft,V),L=Math.max(t.effectivePaddingRight,V),A=Math.max(0,t.panelSize-t.effectivePaddingRight-I),S=Math.max(0,t.panelSize-t.effectivePaddingLeft-I);return l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-controls":"textPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-max-fraction":String(v),className:`${o}-control-anchor`,style:{top:0,left:0,width:"100%",height:n(c)}}),l.jsx("div",{"data-controls":"textPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(f),className:`${o}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:n(g)}}),l.jsx("div",{"data-controls":"textPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(A),className:`${o}-control-anchor`,style:{top:0,left:0,width:n(x),height:"100%"}}),l.jsx("div",{"data-controls":"textPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(S),className:`${o}-control-anchor`,style:{top:0,right:0,width:n(L),height:"100%"}})]})}const ra={iconColor:"icon-color",closeButtonColor:"close-button-color",linkColor:"link-color",openLinkColor:"menu-link-color",compactIconColor:"compact-icon-color",compactLinkColor:"compact-link-color",compactLogoColor:"compact-logo-color",compactBackgroundColor:"compact-background-color",openLogoColor:"open-logo-color",menuBackgroundColor:"menu-background-color",overlayColor:"overlay-color",backgroundColor:"background-color",logoColor:"logo-color"},ia=["hover","open"],ca={top:"flex-start",center:"center",bottom:"flex-end"},la={left:"flex-start",center:"center",right:"flex-end"};function sa(o){return`
2
- .${o}-root {
3
- position: relative;
4
- display: block;
5
- box-sizing: border-box;
6
- overflow: hidden;
7
- flex-shrink: 0;
8
- line-height: 0;
9
- font-size: 0;
10
- }
11
- .${o}-nav-links-inner {
12
- display: flex;
13
- align-items: center;
14
- height: 100%;
15
- flex-shrink: 0;
16
- pointer-events: none;
17
- }
18
- .${o}-toggle {
19
- display: block;
20
- box-sizing: border-box;
21
- width: 100%;
22
- height: 100%;
23
- min-width: 0;
24
- min-height: 0;
25
- margin: 0;
26
- padding: 0;
27
- border: 0;
28
- background: none;
29
- cursor: pointer;
30
- color: var(--${o}-icon-color);
31
- transition: color ${w}ms ease;
32
- line-height: 0;
33
- font-size: 0;
34
- -webkit-appearance: none;
35
- appearance: none;
36
- }
37
- .${o}-toggle:focus,
38
- .${o}-toggle:focus-visible {
39
- outline: none;
40
- }
41
- .${o}-icon {
42
- display: block;
43
- width: 100%;
44
- height: 100%;
45
- overflow: visible;
46
- }
47
- .${o}-icon-line {
48
- fill: currentColor;
49
- transform-box: fill-box;
50
- transform-origin: center;
51
- transition: transform ${w}ms ease, opacity ${w}ms ease;
52
- }
53
- .${o}-root.${o}-open .${o}-icon-line-top {
54
- transform: translateY(200%) rotate(45deg);
55
- }
56
- .${o}-root.${o}-open .${o}-icon-line-mid {
57
- opacity: 0;
58
- }
59
- .${o}-root.${o}-open .${o}-icon-line-bot {
60
- transform: translateY(-200%) rotate(-45deg);
61
- }
62
- .${o}-root.${o}-open .${o}-toggle {
63
- color: var(--${o}-close-button-color);
64
- }
65
- @media (hover: hover) and (pointer: fine) {
66
- .${o}-interactive .${o}-toggle:hover {
67
- color: var(--${o}-hover-icon-color, var(--${o}-icon-color));
68
- }
69
- }
70
- .${o}-interactive .${o}-toggle:active {
71
- color: var(--${o}-hover-icon-color, var(--${o}-icon-color));
72
- }
73
- .${o}-interactive .${o}-toggle:focus-visible,
74
- .${o}-root.${o}-state-hover .${o}-toggle {
75
- color: var(--${o}-hover-icon-color, var(--${o}-icon-color));
76
- }
77
- .${o}-lightbox {
78
- position: fixed;
79
- inset: 0;
80
- z-index: 2;
81
- pointer-events: none;
82
- overscroll-behavior: none;
83
- overflow: hidden;
84
- }
85
- .${o}-lightbox-editor {
86
- inset: auto;
87
- top: var(--cntrl-article-top, 0);
88
- left: var(--cntrl-article-left, 0);
89
- width: var(--cntrl-article-width, 100vw) !important;
90
- height: var(--cntrl-viewport-height, 100vh) !important;
91
- }
92
- .${o}-lightbox-edit-mode {
93
- z-index: 1;
94
- }
95
- .${o}-lightbox.${o}-lightbox-active {
96
- pointer-events: auto;
97
- }
98
- .${o}-backdrop {
99
- position: absolute;
100
- inset: 0;
101
- border: none;
102
- padding: 0;
103
- margin: 0;
104
- background-color: var(--${o}-overlay-color);
105
- opacity: 0;
106
- transition: opacity ${w}ms ease, background-color ${w}ms ease;
107
- }
108
- .${o}-lightbox.${o}-lightbox-active .${o}-backdrop {
109
- opacity: 1;
110
- }
111
- .${o}-backdrop-clickable {
112
- cursor: pointer;
113
- }
114
- .${o}-panel {
115
- position: absolute;
116
- box-sizing: border-box;
117
- display: flex;
118
- flex-direction: column;
119
- overflow-y: auto;
120
- background-color: var(--${o}-menu-background-color);
121
- transition: transform ${w}ms ease, opacity ${w}ms ease, background-color ${w}ms ease;
122
- box-shadow: 0 0 24px rgba(0, 0, 0, 0.12);
123
- }
124
- .${o}-full-lightbox .${o}-panel {
125
- pointer-events: none;
126
- box-shadow: none;
127
- }
128
- .${o}-full-lightbox .${o}-panel.${o}-panel-blocking {
129
- pointer-events: auto;
130
- }
131
- .${o}-safari-tint {
132
- position: fixed;
133
- top: 0;
134
- left: 0;
135
- width: 0;
136
- height: 0;
137
- pointer-events: none;
138
- background-color: var(--${o}-menu-background-color);
139
- opacity: 0;
140
- }
141
- .${o}-full-lightbox .${o}-link,
142
- .${o}-full-lightbox .${o}-gap-control {
143
- pointer-events: auto;
144
- }
145
- .${o}-effect-fade .${o}-panel,
146
- .${o}-effect-left .${o}-panel,
147
- .${o}-effect-top .${o}-panel,
148
- .${o}-effect-right .${o}-panel,
149
- .${o}-effect-bottom .${o}-panel {
150
- top: 0;
151
- left: 0;
152
- width: 100%;
153
- height: 100%;
154
- max-width: 100%;
155
- max-height: 100%;
156
- }
157
- .${o}-effect-fade .${o}-panel {
158
- opacity: 0;
159
- transform: none;
160
- }
161
- .${o}-effect-fade.${o}-lightbox-active .${o}-panel {
162
- opacity: 1;
163
- }
164
- .${o}-effect-left .${o}-panel {
165
- transform: translateX(-100%);
166
- }
167
- .${o}-effect-left.${o}-lightbox-active .${o}-panel {
168
- transform: translateX(0);
169
- }
170
- .${o}-effect-right .${o}-panel {
171
- left: auto;
172
- right: 0;
173
- transform: translateX(100%);
174
- }
175
- .${o}-effect-right.${o}-lightbox-active .${o}-panel {
176
- transform: translateX(0);
177
- }
178
- .${o}-effect-top .${o}-panel {
179
- transform: translateY(-100%);
180
- }
181
- .${o}-effect-top.${o}-lightbox-active .${o}-panel {
182
- transform: translateY(0);
183
- }
184
- .${o}-effect-bottom .${o}-panel {
185
- top: auto;
186
- bottom: 0;
187
- transform: translateY(100%);
188
- }
189
- .${o}-effect-bottom.${o}-lightbox-active .${o}-panel {
190
- transform: translateY(0);
191
- }
192
- .${o}-effect-fade .${o}-link,
193
- .${o}-effect-left .${o}-link,
194
- .${o}-effect-top .${o}-link,
195
- .${o}-effect-right .${o}-link,
196
- .${o}-effect-bottom .${o}-link {
197
- width: fit-content;
198
- max-width: 100%;
199
- }
200
- .${o}-control-anchor {
201
- position: absolute;
202
- pointer-events: none;
203
- z-index: 2;
204
- }
205
- .${o}-gap-control {
206
- position: relative;
207
- flex-shrink: 0;
208
- width: 100%;
209
- z-index: 2;
210
- }
211
- .${o}-gap-control::before {
212
- content: "";
213
- position: absolute;
214
- top: 0;
215
- left: 0;
216
- width: 100%;
217
- height: 100%;
218
- min-height: 20px;
219
- pointer-events: auto;
220
- z-index: 10;
221
- }
222
- .${o}-link {
223
- display: block;
224
- width: 100%;
225
- color: var(--${o}-menu-link-color);
226
- text-decoration: none;
227
- cursor: default;
228
- transition: color 200ms ease;
229
- }
230
- .${o}-link-text-box {
231
- position: relative;
232
- display: flex;
233
- flex-direction: column;
234
- flex-shrink: 0;
235
- min-width: 0;
236
- box-sizing: border-box;
237
- }
238
- .${o}-link-text-inner {
239
- display: flex;
240
- flex-direction: column;
241
- flex-shrink: 0;
242
- box-sizing: border-box;
243
- outline: 1px solid #FF5C02;
244
- }
245
- .${o}-link-text-inner-hidden {
246
- display: flex;
247
- flex-direction: column;
248
- flex-shrink: 0;
249
- box-sizing: border-box;
250
- }
251
- .${o}-link-text {
252
- display: block;
253
- width: 100%;
254
- white-space: pre-wrap;
255
- overflow-wrap: anywhere;
256
- word-break: break-word;
257
- }
258
- .${o}-text-tight-leading {
259
- display: block;
260
- flex-shrink: 0;
261
- padding-top: var(--${o}-text-leading-gap, 0);
262
- padding-bottom: var(--${o}-text-leading-gap, 0);
263
- }
264
- .${o}-interactive .${o}-has-href {
265
- cursor: pointer;
266
- }
267
- @media (hover: hover) and (pointer: fine) {
268
- .${o}-interactive .${o}-has-href:hover {
269
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
270
- outline: none;
271
- }
272
- .${o}-interactive .${o}-lightbox .${o}-has-href:hover {
273
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
274
- outline: none;
275
- }
276
- .${o}-interactive .${o}-has-href:hover .${o}-link-text {
277
- color: inherit;
278
- }
279
- }
280
- .${o}-interactive .${o}-has-href:active {
281
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
282
- outline: none;
283
- }
284
- .${o}-interactive .${o}-lightbox .${o}-has-href:active {
285
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
286
- outline: none;
287
- }
288
- .${o}-interactive .${o}-has-href:active .${o}-link-text {
289
- color: inherit;
290
- }
291
- .${o}-interactive .${o}-has-href:focus-visible,
292
- .${o}-lightbox.${o}-state-hover .${o}-has-href {
293
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
294
- outline: none;
295
- }
296
- .${o}-interactive .${o}-lightbox .${o}-has-href:focus-visible,
297
- .${o}-lightbox.${o}-state-hover .${o}-link.${o}-has-href {
298
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
299
- outline: none;
300
- }
301
- .${o}-interactive .${o}-has-href:focus-visible .${o}-link-text,
302
- .${o}-lightbox.${o}-state-hover .${o}-has-href .${o}-link-text {
303
- color: inherit;
304
- }
305
- .${o}-editor .${o}-toggle {
306
- cursor: default;
307
- pointer-events: none;
308
- }
309
- .${o}-nav-slide {
310
- position: relative;
311
- transform: translateY(var(--cntrl-nav-slide, 0%));
312
- transition: transform 320ms ease;
313
- }
314
- .${o}-nav-bar {
315
- position: relative;
316
- display: flex;
317
- align-items: center;
318
- box-sizing: border-box;
319
- width: 100%;
320
- height: 100%;
321
- background-color: var(--${o}-background-color);
322
- padding-left: var(--${o}-nav-padding-x, 0);
323
- padding-right: var(--${o}-nav-padding-x, 0);
324
- gap: var(--${o}-nav-inner-gap, 0);
325
- }
326
- .${o}-nav-logo {
327
- position: absolute;
328
- top: 0;
329
- z-index: 1;
330
- display: flex;
331
- flex-shrink: 0;
332
- align-items: center;
333
- height: 100%;
334
- min-width: 0;
335
- pointer-events: auto;
336
- }
337
- .${o}-nav-logo-left {
338
- left: 0;
339
- right: auto;
340
- transform: none;
341
- }
342
- .${o}-nav-logo-center {
343
- left: 50%;
344
- right: auto;
345
- transform: translateX(-50%);
346
- }
347
- .${o}-nav-logo-right {
348
- left: auto;
349
- right: 0;
350
- transform: none;
351
- }
352
- .${o}-nav-logo-link {
353
- display: flex;
354
- align-items: center;
355
- height: 100%;
356
- color: inherit;
357
- text-decoration: none;
358
- cursor: pointer;
359
- }
360
- .${o}-nav-logo-inner {
361
- position: relative;
362
- flex-shrink: 0;
363
- width: auto;
364
- max-height: 100%;
365
- }
366
- .${o}-nav-logo-img {
367
- display: block;
368
- width: auto;
369
- height: 100%;
370
- max-height: 100%;
371
- object-fit: contain;
372
- }
373
- .${o}-nav-logo-tinted .${o}-nav-logo-img {
374
- opacity: 0;
375
- }
376
- .${o}-nav-logo-tint {
377
- display: none;
378
- }
379
- .${o}-nav-logo-tinted .${o}-nav-logo-tint {
380
- display: block;
381
- position: absolute;
382
- inset: 0;
383
- background-color: var(--${o}-logo-color);
384
- -webkit-mask: var(--${o}-logo-image) no-repeat center / contain;
385
- mask: var(--${o}-logo-image) no-repeat center / contain;
386
- -webkit-mask-source-type: alpha;
387
- mask-mode: alpha;
388
- pointer-events: none;
389
- transition: background-color 200ms ease;
390
- }
391
- .${o}-root.${o}-state-compact .${o}-nav-logo-tinted .${o}-nav-logo-tint {
392
- background-color: var(--${o}-compact-logo-color);
393
- }
394
- .${o}-root.${o}-state-open .${o}-nav-logo-tinted .${o}-nav-logo-tint {
395
- background-color: var(--${o}-open-logo-color, var(--${o}-logo-color));
396
- }
397
- @media (hover: hover) and (pointer: fine) {
398
- .${o}-interactive .${o}-nav-logo:hover .${o}-nav-logo-tint {
399
- background-color: var(--${o}-hover-logo-color, var(--${o}-logo-color));
400
- }
401
- .${o}-interactive.${o}-state-compact .${o}-nav-logo:hover .${o}-nav-logo-tint {
402
- background-color: var(--${o}-compact-hover-compact-logo-color, var(--${o}-compact-logo-color));
403
- }
404
- .${o}-interactive.${o}-state-open .${o}-nav-logo:hover .${o}-nav-logo-tint {
405
- background-color: var(--${o}-open-hover-open-logo-color, var(--${o}-open-logo-color, var(--${o}-logo-color)));
406
- }
407
- }
408
- .${o}-interactive .${o}-nav-logo:active .${o}-nav-logo-tint {
409
- background-color: var(--${o}-hover-logo-color, var(--${o}-logo-color));
410
- }
411
- .${o}-interactive.${o}-state-compact .${o}-nav-logo:active .${o}-nav-logo-tint {
412
- background-color: var(--${o}-compact-hover-compact-logo-color, var(--${o}-compact-logo-color));
413
- }
414
- .${o}-interactive.${o}-state-open .${o}-nav-logo:active .${o}-nav-logo-tint {
415
- background-color: var(--${o}-open-hover-open-logo-color, var(--${o}-open-logo-color, var(--${o}-logo-color)));
416
- }
417
- .${o}-root.${o}-state-hover .${o}-nav-logo-tinted .${o}-nav-logo-tint {
418
- background-color: var(--${o}-hover-logo-color, var(--${o}-logo-color));
419
- }
420
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-nav-logo-tinted .${o}-nav-logo-tint {
421
- background-color: var(--${o}-compact-hover-compact-logo-color, var(--${o}-compact-logo-color));
422
- }
423
- .${o}-root.${o}-state-open.${o}-state-hover .${o}-nav-logo-tinted .${o}-nav-logo-tint {
424
- background-color: var(--${o}-open-hover-open-logo-color, var(--${o}-open-logo-color, var(--${o}-logo-color)));
425
- }
426
- .${o}-nav-links {
427
- position: absolute;
428
- top: 0;
429
- height: 100%;
430
- display: flex;
431
- align-items: center;
432
- min-width: 0;
433
- flex-shrink: 0;
434
- pointer-events: none;
435
- z-index: 0;
436
- }
437
- .${o}-nav-links-left {
438
- left: 0;
439
- right: auto;
440
- }
441
- .${o}-nav-links-center {
442
- left: 50%;
443
- right: auto;
444
- }
445
- .${o}-nav-links-right {
446
- left: auto;
447
- right: 0;
448
- }
449
- .${o}-nav-links .${o}-nav-link,
450
- .${o}-nav-links .${o}-gap-control {
451
- pointer-events: auto;
452
- }
453
- .${o}-nav-gap-control {
454
- flex-shrink: 0;
455
- }
456
- .${o}-nav-links .${o}-gap-control {
457
- position: relative;
458
- width: auto;
459
- height: 100%;
460
- min-height: 20px;
461
- z-index: 2;
462
- }
463
- .${o}-nav-links .${o}-gap-control::before {
464
- width: 100%;
465
- height: 100%;
466
- min-width: 20px;
467
- min-height: 20px;
468
- }
469
- .${o}-nav-link {
470
- display: inline-flex;
471
- align-items: center;
472
- flex-shrink: 0;
473
- color: var(--${o}-link-color);
474
- text-decoration: none;
475
- cursor: default;
476
- transition: color 200ms ease;
477
- }
478
- @media (hover: hover) and (pointer: fine) {
479
- .${o}-interactive .${o}-nav-link.${o}-has-href:hover {
480
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
481
- outline: none;
482
- }
483
- .${o}-interactive.${o}-state-compact .${o}-nav-link.${o}-has-href:hover {
484
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
485
- }
486
- }
487
- .${o}-interactive .${o}-nav-link.${o}-has-href:active {
488
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
489
- outline: none;
490
- }
491
- .${o}-interactive.${o}-state-compact .${o}-nav-link.${o}-has-href:active {
492
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
493
- }
494
- .${o}-interactive .${o}-nav-link.${o}-has-href:focus-visible,
495
- .${o}-root.${o}-state-hover .${o}-nav-link.${o}-has-href {
496
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
497
- outline: none;
498
- }
499
- .${o}-interactive.${o}-state-compact .${o}-nav-link.${o}-has-href:focus-visible,
500
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-nav-link.${o}-has-href {
501
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
502
- }
503
- .${o}-root.${o}-state-compact .${o}-nav-bar {
504
- background-color: var(--${o}-compact-background-color);
505
- }
506
- .${o}-root.${o}-state-compact .${o}-toggle {
507
- color: var(--${o}-compact-icon-color);
508
- }
509
- @media (hover: hover) and (pointer: fine) {
510
- .${o}-interactive.${o}-state-compact .${o}-toggle:hover {
511
- color: var(--${o}-compact-hover-compact-icon-color, var(--${o}-compact-icon-color));
512
- }
513
- }
514
- .${o}-interactive.${o}-state-compact .${o}-toggle:active {
515
- color: var(--${o}-compact-hover-compact-icon-color, var(--${o}-compact-icon-color));
516
- }
517
- .${o}-interactive.${o}-state-compact .${o}-toggle:focus-visible,
518
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-toggle {
519
- color: var(--${o}-compact-hover-compact-icon-color, var(--${o}-compact-icon-color));
520
- }
521
- .${o}-root.${o}-state-compact .${o}-nav-link {
522
- color: var(--${o}-compact-link-color);
523
- }
524
- .${o}-lightbox.${o}-state-compact .${o}-panel {
525
- background-color: var(--${o}-compact-menu-background-color, var(--${o}-menu-background-color));
526
- }
527
- .${o}-lightbox.${o}-state-compact .${o}-safari-tint {
528
- background-color: var(--${o}-compact-menu-background-color, var(--${o}-menu-background-color));
529
- }
530
- .${o}-lightbox.${o}-state-compact .${o}-backdrop {
531
- background-color: var(--${o}-compact-overlay-color, var(--${o}-overlay-color));
532
- }
533
- @media (hover: hover) and (pointer: fine) {
534
- .${o}-interactive .${o}-has-href:hover {
535
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
536
- }
537
- }
538
- .${o}-interactive .${o}-has-href:active {
539
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
540
- }
541
- .${o}-interactive .${o}-has-href:focus-visible,
542
- .${o}-lightbox.${o}-state-hover .${o}-has-href,
543
- .${o}-root.${o}-state-hover .${o}-has-href {
544
- color: var(--${o}-hover-link-color, var(--${o}-link-color));
545
- }
546
- .${o}-root.${o}-state-compact.${o}-state-hover .${o}-has-href {
547
- color: var(--${o}-compact-hover-compact-link-color, var(--${o}-compact-link-color));
548
- }
549
- .${o}-root.${o}-state-open .${o}-toggle {
550
- color: var(--${o}-close-button-color);
551
- }
552
- @media (hover: hover) and (pointer: fine) {
553
- .${o}-interactive.${o}-state-open .${o}-toggle:hover {
554
- color: var(--${o}-open-hover-close-button-color, var(--${o}-close-button-color));
555
- }
556
- }
557
- .${o}-interactive.${o}-state-open .${o}-toggle:active {
558
- color: var(--${o}-open-hover-close-button-color, var(--${o}-close-button-color));
559
- }
560
- .${o}-interactive.${o}-state-open .${o}-toggle:focus-visible,
561
- .${o}-root.${o}-state-open.${o}-state-hover .${o}-toggle {
562
- color: var(--${o}-open-hover-close-button-color, var(--${o}-close-button-color));
563
- }
564
- .${o}-lightbox .${o}-link {
565
- color: var(--${o}-menu-link-color);
566
- }
567
- .${o}-lightbox.${o}-state-open .${o}-panel {
568
- background-color: var(--${o}-open-menu-background-color, var(--${o}-menu-background-color));
569
- }
570
- .${o}-lightbox.${o}-state-open .${o}-safari-tint {
571
- background-color: var(--${o}-open-menu-background-color, var(--${o}-menu-background-color));
572
- }
573
- .${o}-lightbox.${o}-state-open .${o}-backdrop {
574
- background-color: var(--${o}-open-overlay-color, var(--${o}-overlay-color));
575
- }
576
- .${o}-lightbox.${o}-state-open.${o}-state-hover .${o}-has-href,
577
- .${o}-root.${o}-state-open.${o}-state-hover .${o}-has-href {
578
- color: var(--${o}-open-hover-menu-link-color, var(--${o}-menu-link-color));
579
- }
580
- .${o}-nav-toggle-wrap {
581
- position: absolute;
582
- top: 0;
583
- height: 100%;
584
- display: flex;
585
- flex-direction: row;
586
- flex-shrink: 0;
587
- align-items: center;
588
- z-index: 3;
589
- pointer-events: auto;
590
- transform: translateY(var(--cntrl-nav-slide, 0%));
591
- transition: transform 320ms ease;
592
- }
593
- .${o}-nav-toggle-wrap-right {
594
- right: 0;
595
- left: auto;
596
- }
597
- .${o}-nav-toggle-wrap-left {
598
- left: 0;
599
- right: auto;
600
- }
601
- .${o}-nav-padding-left,
602
- .${o}-nav-padding-right {
603
- position: relative;
604
- flex-shrink: 0;
605
- height: 100%;
606
- }
607
- .${o}-nav-toggle-wrap .${o}-root {
608
- line-height: 0;
609
- font-size: 0;
610
- }
611
- .${o}-nav-state-anim {
612
- transition: margin-top ${h}ms ease;
613
- }
614
- .${o}-nav-state-anim .${o}-nav-bar {
615
- transition:
616
- background-color ${w}ms ease,
617
- height ${h}ms ease,
618
- min-height ${h}ms ease,
619
- padding ${h}ms ease,
620
- gap ${h}ms ease;
621
- }
622
- .${o}-nav-state-anim .${o}-nav-logo,
623
- .${o}-nav-state-anim .${o}-nav-toggle-wrap,
624
- .${o}-nav-state-anim .${o}-nav-links {
625
- transition:
626
- left ${h}ms ease,
627
- right ${h}ms ease,
628
- transform ${h}ms ease;
629
- }
630
- .${o}-nav-state-anim .${o}-nav-logo-inner,
631
- .${o}-nav-state-anim .${o}-nav-padding-left,
632
- .${o}-nav-state-anim .${o}-nav-padding-right,
633
- .${o}-nav-state-anim .${o}-nav-gap-control,
634
- .${o}-nav-state-anim .${o}-link-text-box {
635
- transition:
636
- width ${h}ms ease,
637
- height ${h}ms ease;
638
- }
639
- .${o}-nav-state-anim .${o}-nav-logo-tint {
640
- transition:
641
- background-color ${h}ms ease;
642
- }
643
- .${o}-nav-state-anim .${o}-nav-toggle-wrap .${o}-root {
644
- transition:
645
- width ${h}ms ease,
646
- height ${h}ms ease,
647
- min-width ${h}ms ease,
648
- min-height ${h}ms ease,
649
- max-width ${h}ms ease,
650
- max-height ${h}ms ease;
651
- }
652
- .${o}-nav-state-anim .${o}-icon-line {
653
- transition:
654
- transform ${w}ms ease,
655
- opacity ${w}ms ease;
656
- }
657
- .${o}-nav-state-anim .${o}-nav-link,
658
- .${o}-nav-state-anim .${o}-link,
659
- .${o}-nav-state-anim .${o}-link-text,
660
- .${o}-nav-state-anim .${o}-text-tight-leading {
661
- transition:
662
- color 200ms ease,
663
- font-size ${h}ms ease,
664
- line-height ${h}ms ease,
665
- letter-spacing ${h}ms ease,
666
- word-spacing ${h}ms ease,
667
- padding ${h}ms ease;
668
- }
669
- `}function Fo(o){return o?!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("blob:")&&!o.startsWith("data:"):!1}function da(o,t){var n;const e=(n=o.logo)==null?void 0:n.icon;return!o.logo||Fo(e)||!t?o:{...o,logo:{...o.logo,icon:t}}}function fa(o){return`url("${o.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function ga(o){const t=o.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function pa(o){const t=ga(o),[e,n]=s.useState(!1);return s.useEffect(()=>{if(t||!o.startsWith("blob:")){n(!1);return}let r=!1;return fetch(o).then(c=>c.blob()).then(async c=>{if(r)return;if(c.type.includes("svg")){n(!0);return}if(c.type.startsWith("image/")&&!c.type.includes("svg")){n(!1);return}const g=await c.text();r||n(/<svg[\s>]/i.test(g.trim()))}).catch(()=>{r||n(!1)}),()=>{r=!0}},[t,o]),t||e}function va(o,t){const[e,n]=s.useState(Bo.isInlineMaskUrl(o)?o:null);return s.useEffect(()=>{if(!t||!o){n(null);return}if(Bo.isInlineMaskUrl(o)){n(o);return}let r=!1;return Bo.loadSvgMaskUrl(o).then(c=>{r||n(c)}).catch(()=>{r||n(null)}),()=>{r=!0}},[t,o]),t?e:null}function ha(o){const t=o.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(o.slice(t+1))}catch{return o.slice(t+1)}}function ua(o){if(!o||o.startsWith("#"))return!0;try{return new URL(o,window.location.href).pathname===window.location.pathname}catch{return!1}}function Rt(o){if(!o)return null;const t=document.getElementById(o),e=document.querySelector(`[data-section-id="${CSS.escape(o)}"]`),n=t??e;return n instanceof HTMLElement?n:null}function $a(o,t){fetch(o).then(e=>{if(!e.ok)throw new Error(`Could not download ${o}: ${e.status}`);return e.blob()}).then(e=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t||decodeURIComponent(o.split("?")[0].split("/").pop()??""),document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),0)}).catch(()=>{window.location.assign(o)})}function wt(o){const t=Rt(o);return t?(t.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function ma(o,t,e={}){const{isEditor:n,isPreviewMode:r,item:c,pages:g,onLinkNavigate:v}=e,f=e.runAfterClose??(a=>a()),x=o.currentTarget.getAttribute("href")??"",L=ha(x),A=o.currentTarget.target==="_blank";if(c&&v){o.preventDefault(),o.stopPropagation();const a=Ho(c,g),$=Oo(c),z={mode:$.type==="url"||$.type==="file"?$.type:"page",href:a.href||x,page:$.type==="page"?$.value:void 0,url:$.type==="url"?$.value:void 0,file:$.type==="file"?$.value:void 0,anchor:$.type==="anchor"?$.value.replace(/^#/,""):($.anchor??"").replace(/^#/,""),target:a.target};z.target==="_blank"?v(z):f(()=>v(z)),t();return}if(n){o.preventDefault(),f(()=>wt(L)),t();return}const S=c?Oo(c).download:void 0;if(S!==void 0&&x&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&!o.altKey){o.preventDefault(),$a(x,S),t();return}!A&&L&&ua(x)&&Rt(L)&&(o.preventDefault(),f(()=>wt(L))),t()}const xa=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function ka(o){let t=o;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return o}function ba(o){const t={},e=ka(o);if(!e)return t;const n=getComputedStyle(e);for(const r of xa){const c=n.getPropertyValue(r).trim();c&&(t[r]=c)}return t}function Lt(o,t,e,n,r){return l.jsx("span",{className:`${o}-link-text-box`,style:{width:r(e),maxWidth:"100%"},children:l.jsx("span",{className:n?`${o}-link-text-inner`:`${o}-link-text-inner-hidden`,style:{width:"100%"},children:t})})}function Sa({settings:o,isEditor:t,isEditMode:e,isPreviewMode:n,activeEvent:r,currentState:c,isSwitchClone:g=!1,unavailableStates:v=[],layoutId:f,pages:x,onLinkNavigate:L,onUpdateSettings:A,onOpenChange:S}){var dt,ft;const{prefix:a}=On.useScopedStyles(),$=s.useRef(null),z=s.useRef(null),G=s.useRef(null),D=s.useRef(null),X=s.useRef(null),R=s.useRef(0),p=s.useRef(null),Y=s.useRef(null),q=s.useRef(f),Ot=s.useMemo(()=>sa(a),[a]),[Ht,K]=s.useState(!1),[j,vo]=s.useState(!1),[jo,no]=s.useState(!1),F=Mn(c),Ft=s.useMemo(()=>new Set(v),[v]),ho=i=>!!(i&&Ft.has(i)),Mo=Ct(o.link,f),It=!!(t&&!n&&F==="open"&&!ho("open")),u=Mo&&(It||!(t&&!n)&&Ht),uo=!!(t&&!n),Z=u&&!uo;Hn.useLightboxScrollLock(Z),s.useEffect(()=>{if(!u||!uo)return;const i=document.documentElement,d=i.style.overflow;return i.style.overflow="hidden",()=>{i.style.overflow=d}},[u,uo]);const jt=!ho("compact")&&!ho("onScroll"),Mt=!t||!!n&&!e,ao=r&&r!=="default"?r:void 0,C=jt&&F==="compact"?"compact":"default",[_o,_t]=s.useState(C),[$o,Wo]=s.useState(!1),Eo=!e;C!==_o&&(_t(C),Eo&&Wo(!0));const Wt=zt(o),{logo:M,logoLink:Uo="",logoMaxHeight:Et=120/1440,logoPosition:Ut="left",panelHeight:Vo=60/1440,backgroundColor:Vt="#b3b3b3",logoColor:Gt="#000000",position:Dt,horizontalAlign:Xt,verticalAlign:Yt,iconColor:qt="#000000",showIcon:Kt="on",iconSize:Zt=16/1440,linkColor:Jt="#000000",openLinkColor:Qt="#000000",compactIconColor:Pt="#000000",compactLinkColor:oe="#000000",compactLogoColor:te="#000000",compactBackgroundColor:ee="#ffffff",compactLogoMaxHeight:ne=120/1440,compactLogoPosition:ae,compactPanelHeight:re=60/1440,compactShowIcon:ie="on",compactIconSize:ce=16/1440,compactNavTextWidth:le,compactNavTextPosition:se,compactNavTextOffset:de,compactNavGap:fe,compactNavPaddingLeft:ge=10/1440,compactNavPaddingRight:pe=10/1440,compactFontFamily:ve,compactFontSettings:he,compactFontSize:ue,compactLineHeight:$e,compactLetterSpacing:me=0,compactWordSpacing:xe=0,compactTextAlign:ke="left",compactTextAppearance:be,openLogoColor:Se="#000000",menuBackgroundColor:Go="#ffffff",overlayColor:ye="rgba(0, 0, 0, 0.45)",closeButtonColor:we="#000000",effect:mo="fade",openPanelSize:Do=100,textWidth:Xo=280/1440,navTextWidth:Le,navTextPosition:Ce="center",navTextOffset:Te=0,gap:Yo=0,navGap:Ne,navPaddingLeft:Ae=10/1440,navPaddingRight:ze=10/1440,textPaddingLeft:qo=10/1440,textPaddingRight:Ko=10/1440,textPaddingTop:Zo=10/1440,textPaddingBottom:Jo=10/1440,fontFamily:Be,fontSettings:Re,fontSize:Oe,lineHeight:He,letterSpacing:Fe=0,wordSpacing:Ie=0,textAlign:je="left",textAppearance:Me,openFontFamily:_e,openFontSettings:We,openFontSize:Ee,openLineHeight:Ue,openLetterSpacing:Ve,openWordSpacing:Ge,openTextAlign:De,openTextAppearance:Xe,stateOverrides:Qo,link:Po}=Wt,{horizontalAlign:Ye,verticalAlign:qe}=oa({position:Dt,horizontalAlign:Xt,verticalAlign:Yt}),k=C==="compact",Ke=k?ne:Et,ro=_n(k?ae:Ut),io=k?re:Vo,xo=k?ce:Zt,Ze=k?le:Le,ot=Wn(k?se:Ce),Je=(k?de:Te)??0,Qe=k?fe:Ne,tt=k?ge:Ae,et=k?pe:ze,Pe=Ze??Xo,on=u||Mo&&(k?ie:Kt)!=="off",ko=Rn.buildColorVars(a,{iconColor:qt,closeButtonColor:we,linkColor:Jt,openLinkColor:Qt,compactIconColor:Pt,compactLinkColor:oe,compactLogoColor:te,compactBackgroundColor:ee,openLogoColor:Se,menuBackgroundColor:Go,overlayColor:ye,backgroundColor:Vt,logoColor:Gt},ra,ia,Qo),bo=xt(k?{fontFamily:ve,fontSettings:he,fontSize:ue,lineHeight:$e,letterSpacing:me,wordSpacing:xe,textAlign:ke,textAppearance:be}:{fontFamily:Be,fontSettings:Re,fontSize:Oe,lineHeight:He,letterSpacing:Fe,wordSpacing:Ie,textAlign:je,textAppearance:Me}),J=xt({fontFamily:_e,fontSettings:We,fontSize:Ee,lineHeight:Ue,letterSpacing:Ve,wordSpacing:Ge,textAlign:De,textAppearance:Xe},bo),So=kt(a,bo,t),yo=kt(a,J,t),tn=ht(G,$t(bo)),en=ht(D,$t(J)),nn={...yo.css,whiteSpace:"pre-wrap",transform:ut(en)},an=yo.className,B=i=>N.scalingValue(i,t),rn=Qe??Yo,cn=Math.max(tt,V),ln=Math.max(et,V),sn=Math.max(0,1-xo),dn=Math.max(0,1-xo),co=e??!1,lo=co&&!u,nt=s.useMemo(()=>At({textPaddingLeft:qo,textPaddingRight:Ko,textPaddingTop:Zo,textPaddingBottom:Jo,fontSize:J.fontSize}),[qo,Ko,Zo,Jo,J.fontSize]),at=i=>{const d=l.jsx("span",{className:an,style:nn,children:bt(i)});return Lt(a,d,Xo,co,B)},fn=mo==="left"||mo==="right"?{width:`${Do}%`}:{height:`${Do}%`},gn={...na(nt,t),...fn,alignItems:la[Ye],justifyContent:ca[qe]},Q=s.useRef(o),so=s.useRef(f),wo=s.useRef(null);Fo((dt=o.logo)==null?void 0:dt.icon)&&(wo.current=o.logo.icon),s.useEffect(()=>{var E;if(!A||!t){Q.current=o,so.current=f;return}const i=(E=o.logo)==null?void 0:E.icon;if(o.logo&&!Fo(i)&&!wo.current){Q.current=o,so.current=f;return}const d=U=>{A(da(U,wo.current))};if(so.current!==f){Q.current=o,so.current=f;const U=yt(o);U!==o&&d(U);return}const m=yt(o),b=Q.current,y=b!==o,T=y?Bt(m,b):m;Q.current=o;const to=m!==o,W=y&&ta(m,T);!to&&!W||d(T)},[o,A,t,f]);const _=N.scalingValue(xo,t),pn={width:_,height:_,minWidth:_,minHeight:_,maxWidth:_,maxHeight:_},vn={...So.css,textDecoration:"none",transform:ut(tn)},hn=So.className,rt=(M==null?void 0:M.mode)!=="Off",P=(M==null?void 0:M.icon)??"",un=pa(P),oo=va(P,un),fo=!!oo,$n=B(Math.min(Ke,io)),mn=!!(rt&&P&&ro==="right"),Lo=Uo.trim()?{link:{type:"url",value:Yn(Uo.trim()),target:"self"}}:null,Co=mn?"left":"right",it=Array.isArray(Po)?Po:[],To=[C!=="default"?`${a}-state-${C}`:"",u||F==="open"?`${a}-state-open`:"",ao&&ao!==C&&ao!==F?`${a}-state-${ao}`:""].filter(Boolean).join(" "),xn=t&&!n?`${a}-editor`:"",ct=Mt?`${a}-interactive`:"",kn=Eo&&(C!==_o||$o)?`${a}-nav-state-anim`:"",bn=u?`${a}-open`:"",Sn=s.useMemo(()=>ba($.current),[j,u,f]),No=()=>{K(!1)},Ao=!t||n,yn=i=>{if(Z){Y.current=i;return}i()};s.useEffect(()=>{if(u)return;const i=Y.current;Y.current=null,i==null||i()},[u]);const zo=(i,d)=>{ma(i,No,{isEditor:t,isPreviewMode:n,item:d,pages:x,onLinkNavigate:L,runAfterClose:yn})},wn=()=>{t&&!n||K(i=>!i)},Ln=i=>{i.pointerType==="touch"&&i.currentTarget.blur()},go=()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)};s.useEffect(()=>{if(!$o)return;const i=window.setTimeout(()=>{Wo(!1)},h);return()=>window.clearTimeout(i)},[$o,C]),s.useEffect(()=>{if(u){go(),vo(!0);return}return R.current+=1,no(!1),go(),p.current=window.setTimeout(()=>{p.current=null,vo(!1)},w),go},[u]),s.useLayoutEffect(()=>{q.current!==f&&(q.current=f,R.current+=1,go(),K(!1),no(!1),vo(!1))},[f]),s.useLayoutEffect(()=>{var m;if(!j||!u)return;const i=R.current+1;R.current=i,no(!1),(m=z.current)==null||m.offsetHeight;const d=requestAnimationFrame(()=>{R.current===i&&no(!0)});return()=>{cancelAnimationFrame(d)}},[j,u]),s.useLayoutEffect(()=>{if(!Z||!j)return;const i=X.current;if(!i)return;const d=getComputedStyle(i).backgroundColor;if(!d)return;const m=document.documentElement,{body:b}=document,y=m.style.backgroundColor,T=b.style.backgroundColor;return m.style.backgroundColor=d,b.style.backgroundColor=d,()=>{m.style.backgroundColor=y,b.style.backgroundColor=T}},[Z,j,To,Go,Qo]),s.useEffect(()=>{S==null||S(u)},[u,S]),s.useEffect(()=>{if(!u)return;const i=d=>{d.key==="Escape"&&(t&&n||No())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[u,t,n]),s.useEffect(()=>{t&&!n&&F!=="open"&&K(!1)},[t,n,F]),s.useEffect(()=>{n&&K(!1)},[n]);const lt=co&&u,Cn=i=>it.filter(d=>Gn(d,f)).map((d,m)=>{const{label:b,href:y,target:T,download:to}=Ho(d,x),W=y?l.jsx("a",{href:y,target:T,rel:T==="_blank"?"noopener noreferrer":void 0,download:to,className:`${i} ${a}-has-href`,onClick:E=>zo(E,d),children:at(b)}):l.jsx("span",{className:i,children:at(b)});return l.jsxs(s.Fragment,{children:[m>0&&l.jsx("div",{"data-controls":lt?"gap":void 0,"data-controls-axis":"y",className:lt?`${a}-gap-control`:void 0,style:{height:B(Yo)}}),W]},m)}),Tn=j?l.jsxs("div",{ref:z,"data-selection":"none",className:[`${a}-lightbox`,`${a}-full-lightbox ${a}-effect-${mo}`,jo?`${a}-lightbox-active`:"",`${a}-lightbox-editor`,e?`${a}-lightbox-edit-mode`:"",ct,To].filter(Boolean).join(" "),style:{...ko,...Sn},"aria-hidden":!jo,children:[l.jsx("div",{className:[`${a}-backdrop`,Ao?`${a}-backdrop-clickable`:""].filter(Boolean).join(" "),"aria-hidden":"true",onClick:Ao?No:void 0}),l.jsxs("nav",{className:[`${a}-panel`,Ao?`${a}-panel-blocking`:""].filter(Boolean).join(" "),style:gn,"aria-label":"Menu","data-lightbox-scrollable":"",children:[co&&aa(a,nt,J.fontSize,B),Cn(`${a}-link`)]}),Z?l.jsx("div",{ref:X,className:`${a}-safari-tint`,"aria-hidden":"true"}):null]}):null,Nn=()=>l.jsx("button",{type:"button",className:`${a}-toggle`,onClick:wn,onPointerUp:Ln,"aria-expanded":u,"aria-label":u?"Close menu":"Open menu",children:l.jsx(qn,{className:`${a}-icon`,lineClassName:`${a}-icon-line`})}),po=i=>{const d=i==="left",m=d?tt:et,b=d?cn:ln,y=d?sn:dn,T=k?d?"compactNavPaddingLeft":"compactNavPaddingRight":d?"navPaddingLeft":"navPaddingRight";return l.jsx("div",{className:d?`${a}-nav-padding-left`:`${a}-nav-padding-right`,style:{width:B(m),flexShrink:0},children:lo?l.jsx("div",{"data-controls":T,"data-controls-axis":"x","data-controls-variant":"column-padding",...d?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(y),className:`${a}-control-anchor`,style:{top:0,[d?"left":"right"]:0,width:B(b),height:"100%"}}):null})},An=(i,d)=>{const{label:m,href:b,target:y,download:T}=Ho(i,x),to=l.jsx("span",{className:hn,style:vn,children:bt(m)}),W=Lt(a,to,Pe,lo,B),E=b?l.jsx("a",{href:b,target:y,rel:y==="_blank"?"noopener noreferrer":void 0,download:T,className:`${a}-nav-link ${a}-has-href`,onClick:U=>zo(U,i),children:W}):l.jsx("span",{className:`${a}-nav-link`,children:W});return l.jsxs(s.Fragment,{children:[d>0&&l.jsx("div",{"data-controls":lo?k?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:lo?`${a}-gap-control ${a}-nav-gap-control`:`${a}-nav-gap-control}`,style:{width:B(rn),flexShrink:0}}),E]},d)},st=l.jsxs("div",{className:`${a}-nav-logo-inner${fo?` ${a}-nav-logo-tinted`:""}`,style:{height:$n,...fo&&oo?{[`--${a}-logo-image`]:fa(oo)}:{}},children:[l.jsx("img",{src:fo&&oo?oo:P,alt:"",className:`${a}-nav-logo-img`}),fo?l.jsx("span",{className:`${a}-nav-logo-tint`,"aria-hidden":"true"}):null]}),zn={...ko,height:N.scalingValue(io,t),minHeight:N.scalingValue(io,t),[`--${a}-panel-height`]:N.scalingValue(io,t)},Bn=g&&C==="default"&&F!=="open"&&!n?B(Vo+Fn):"0px";return l.jsxs("div",{ref:$,className:`${a}-root ${To} ${xn} ${ct} ${kn}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Bn,...ko},children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Ot}}),l.jsx("span",{ref:G,"aria-hidden":!0,style:mt(So.css),children:"H"}),l.jsx("span",{ref:D,"aria-hidden":!0,style:mt(yo.css),children:"H"}),l.jsx("div",{className:`${a}-nav-slide`,children:l.jsxs("div",{className:`${a}-nav-bar`,style:zn,children:[rt&&P?l.jsxs("div",{className:`${a}-nav-logo ${a}-nav-logo-${ro}`,children:[ro==="left"?po("left"):null,Lo?l.jsx("a",{href:(ft=Lo.link)==null?void 0:ft.value,className:`${a}-nav-logo-link`,"aria-label":"Home",onClick:i=>zo(i,Lo),children:st}):st,ro==="right"?po("right"):null]}):null,l.jsx("nav",{className:`${a}-nav-links ${a}-nav-links-${ot}`,style:{transform:En(ot,Je,t)},"aria-label":"Navigation",children:l.jsx("div",{className:`${a}-nav-links-inner`,children:it.filter(i=>Vn(i,C,f)).map((i,d)=>An(i,d))})})]})}),Tn,l.jsxs("div",{className:`${a}-nav-toggle-wrap ${a}-nav-toggle-wrap-${Co}`,children:[Co==="left"?po("left"):null,on?l.jsx("div",{className:`${a}-root ${bn}`.trim(),style:pn,children:Nn()}):null,Co==="right"?po("right"):null]})]})}exports.Burger=Sa;exports.applyBurgerSettingsChange=Bt;exports.isBurgerOpenMenuAvailable=Ct;