@griddo/core 10.2.20 → 10.2.22
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/README.md +15 -19
- package/dist/autotypes.cjs.js.map +1 -1
- package/dist/autotypes.js.map +1 -1
- package/dist/components/GriddoImageExp/GriddoImageExp.stories.d.ts +13 -2
- package/dist/components/GriddoImageExp/index.d.ts +2 -42
- package/dist/components/GriddoImageExp/types.d.ts +55 -0
- package/dist/components/GriddoImageExp/utils.d.ts +97 -0
- package/dist/hooks/useGriddoImageExp.d.ts +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/api-response-fields/index.d.ts +22 -30
- package/dist/types/core/index.d.ts +3 -2
- package/dist/types/schemas/DamDefaults.d.ts +2 -0
- package/package.json +4 -3
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Source } from "./types";
|
|
2
|
+
import { Core, Fields } from "../..";
|
|
3
|
+
import { GriddoDamDefaults, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../../types/core";
|
|
4
|
+
interface GetGriddoArtDirectionImage {
|
|
5
|
+
sources: Array<Source>;
|
|
6
|
+
width?: string;
|
|
7
|
+
height?: string;
|
|
8
|
+
widths?: Array<string>;
|
|
9
|
+
griddoDamDefaults?: GriddoDamDefaults;
|
|
10
|
+
crop?: Core.ImageCropType;
|
|
11
|
+
formats?: Array<"avif" | "webp">;
|
|
12
|
+
quality?: number;
|
|
13
|
+
position?: Core.ImagePosition;
|
|
14
|
+
transforms?: Core.ImageTransform;
|
|
15
|
+
loading?: Core.ImageLoading;
|
|
16
|
+
decoding?: Core.ImageDecoding;
|
|
17
|
+
imageField?: Fields.Image;
|
|
18
|
+
sizes?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function getGriddoArtDirectionImageSources(props: GetGriddoArtDirectionImage): {
|
|
21
|
+
jpeg: {
|
|
22
|
+
type: string;
|
|
23
|
+
srcSet: string[] | undefined;
|
|
24
|
+
sizes: string | undefined;
|
|
25
|
+
media: string | undefined;
|
|
26
|
+
width: string;
|
|
27
|
+
height: string;
|
|
28
|
+
src: string;
|
|
29
|
+
}[];
|
|
30
|
+
webp: {
|
|
31
|
+
type: string;
|
|
32
|
+
srcSet: string[] | undefined;
|
|
33
|
+
sizes: string | undefined;
|
|
34
|
+
media: string | undefined;
|
|
35
|
+
width: string;
|
|
36
|
+
height: string;
|
|
37
|
+
src: string;
|
|
38
|
+
}[];
|
|
39
|
+
avif: {
|
|
40
|
+
type: string;
|
|
41
|
+
srcSet: string[] | undefined;
|
|
42
|
+
sizes: string | undefined;
|
|
43
|
+
media: string | undefined;
|
|
44
|
+
width: string;
|
|
45
|
+
height: string;
|
|
46
|
+
src: string;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
export interface GenerateImageChunkPropsExperimental {
|
|
50
|
+
srcSet?: Array<string>;
|
|
51
|
+
srcSetURL?: Array<string>;
|
|
52
|
+
format: ImageFormats;
|
|
53
|
+
}
|
|
54
|
+
export interface UseGriddoImagePropsExperimental extends Omit<ImageConfigExperimental, "formats"> {
|
|
55
|
+
url?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ImageConfigExperimental {
|
|
58
|
+
blurCSSTransition?: string;
|
|
59
|
+
blurSize?: string;
|
|
60
|
+
crop?: ImageCropType;
|
|
61
|
+
decoding?: ImageDecoding;
|
|
62
|
+
domain?: string;
|
|
63
|
+
format?: ImageFormats;
|
|
64
|
+
formats?: Array<ImageFormats>;
|
|
65
|
+
height?: string;
|
|
66
|
+
loading?: ImageLoading;
|
|
67
|
+
position?: ImagePosition;
|
|
68
|
+
quality?: number;
|
|
69
|
+
transforms?: ImageTransform;
|
|
70
|
+
width?: string;
|
|
71
|
+
sizes?: string;
|
|
72
|
+
widths?: Array<string>;
|
|
73
|
+
ratio?: number;
|
|
74
|
+
}
|
|
75
|
+
export type MIMETypesExperimental = "image/avif" | "image/gif" | "image/jpeg" | "image/png" | "image/svg+xml" | "image/webp";
|
|
76
|
+
export interface ImageChunkExperimental {
|
|
77
|
+
type: MIMETypesExperimental;
|
|
78
|
+
srcSet?: Array<string>;
|
|
79
|
+
srcSetURL?: Array<string>;
|
|
80
|
+
}
|
|
81
|
+
export interface UseGriddoImageReturnExperimental {
|
|
82
|
+
type?: string;
|
|
83
|
+
srcSet?: Array<string>;
|
|
84
|
+
srcSetURL?: Array<string>;
|
|
85
|
+
src?: string;
|
|
86
|
+
sizes?: string;
|
|
87
|
+
webpFallback?: ImageChunkExperimental;
|
|
88
|
+
jpg?: ImageChunkExperimental;
|
|
89
|
+
jpeg?: ImageChunkExperimental;
|
|
90
|
+
webp?: ImageChunkExperimental;
|
|
91
|
+
avif?: ImageChunkExperimental;
|
|
92
|
+
png?: ImageChunkExperimental;
|
|
93
|
+
gif?: ImageChunkExperimental;
|
|
94
|
+
svg?: ImageChunkExperimental;
|
|
95
|
+
}
|
|
96
|
+
declare function removeCSSUnits(value: string): number;
|
|
97
|
+
export { getGriddoArtDirectionImageSources as getGriddoArtDirectionImage, removeCSSUnits, };
|
|
@@ -18,7 +18,7 @@ export interface ImageConfigExperimental {
|
|
|
18
18
|
decoding?: ImageDecoding;
|
|
19
19
|
domain?: string;
|
|
20
20
|
format?: ImageFormats;
|
|
21
|
-
formats?: Array<ImageFormats
|
|
21
|
+
formats?: Array<Extract<ImageFormats, "webp" | "avif">>;
|
|
22
22
|
height?: string;
|
|
23
23
|
loading?: ImageLoading;
|
|
24
24
|
position?: ImagePosition;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { CloudinaryBackgroundImage, CloudinaryImage, Component, GriddoBackgroundImage, GriddoImage, GriddoImageExp, GriddoLink, LdJson, Link, Page, Preview } from "./components";
|
|
2
2
|
import { CloudinaryImageProps } from "./components/CloudinaryImage";
|
|
3
3
|
import { ComponentProps } from "./components/Component";
|
|
4
|
-
import {
|
|
5
|
-
import { GriddoImagePropsExperimental, GriddoImageCommonPropsExperimental, GriddoImageGifExperimental, GriddoImageJpgWebpAvifExperimental, GriddoImageSvgExperimental } from "./components/GriddoImageExp";
|
|
4
|
+
import { GriddoImageCommonProps, GriddoImageGif, GriddoImageJpgWebpAvif, GriddoImageProps, GriddoImageSvg } from "./components/GriddoImage";
|
|
6
5
|
import { GriddoLinkProps, HLocation, LinkGetProps, WindowLocation } from "./components/GriddoLink";
|
|
7
6
|
import { ModulePreviewProps } from "./components/ModulePreview";
|
|
8
7
|
import { PageProps } from "./components/Page";
|
|
@@ -10,18 +9,19 @@ import { PreviewProps } from "./components/Preview";
|
|
|
10
9
|
import { PageContext, PageProvider, SessionContext, SessionProvider, SiteContext, SiteProvider } from "./contexts";
|
|
11
10
|
import { SiteProviderProps } from "./contexts/Site";
|
|
12
11
|
import { getComponent } from "./functions";
|
|
12
|
+
import { GriddoAlertRegisterProps, griddoAlertRegister } from "./functions/alerts";
|
|
13
13
|
import { createCategoryContentTypeSchema, createComponentSchema, createDamDefaultsSchema, createDataPackCategorySchema, createDataPackSchema, createFooterSchema, createHeaderSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createModuleSchema, createPageContentTypeSchema, createSimpleContentTypeSchema, createTemplateSchema, createThemesSchema, createTranslationsSchema } from "./functions/create-schemas";
|
|
14
|
-
import { griddoAlertRegister, GriddoAlertRegisterProps } from "./functions/alerts";
|
|
15
14
|
import { getLang, getSiteID, getToken } from "./functions/utils";
|
|
16
|
-
import {
|
|
15
|
+
import { formatLocaleDate, useContentType, useContentTypeNavigation, useDataFilters, useGlobalTheme, useGriddoImage, useGriddoImageExp, useI18n, useImage, useIsClient, useIsFirstRender, useLink, useList, useListWithDefaultStaticPage, useLocaleDate, useNavigation, usePage, useReferenceFieldData, useSSR, useScript, useSession, useSite, useSitemap, useTheme, useThemeColors, useThemeFont, useThemePrimitives } from "./hooks";
|
|
17
16
|
import { UseDataFilterSetUrlAction, UseDataFiltersReturn, UseDataFiltersSetQueryProps, UseDataFiltersState } from "./hooks/useDataFilters";
|
|
18
17
|
import { GenerateImageChunkProps, ImageChunk, ImageConfig, UseGriddoImageProps, UseGriddoImageReturn } from "./hooks/useGriddoImage";
|
|
19
18
|
import { GenerateImageChunkPropsExperimental, ImageChunkExperimental, ImageConfigExperimental, UseGriddoImagePropsExperimental, UseGriddoImageReturnExperimental } from "./hooks/useGriddoImageExp";
|
|
20
19
|
import { UseI18nProps } from "./hooks/useI18n";
|
|
21
20
|
import { CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryResponsiveImageProps, UseImageProps } from "./hooks/useImage";
|
|
22
21
|
import { UseListSetQueryProps, UseListSetUrlAction } from "./hooks/useList";
|
|
23
|
-
import {
|
|
22
|
+
import { FiltersDataApiQueryResponseProps, HTMLHeadingTag, Hideable, ListApiQueryResponseProps, PickRename, Pretty, SetQueryProps } from "./types/global";
|
|
24
23
|
import { NonEmptyArray } from "./types/utilities";
|
|
24
|
+
import { GriddoImageCommonPropsExperimental, GriddoImageGifExperimental, GriddoImageJpgWebpAvifExperimental, GriddoImagePropsExperimental, GriddoImageSvgExperimental } from "./components/GriddoImageExp/types";
|
|
25
25
|
import * as Fields from "./types/api-response-fields";
|
|
26
26
|
import * as Core from "./types/core";
|
|
27
27
|
import * as PageContentTypeFields from "./types/schema-fields/page-content-type-fields";
|
|
@@ -29,4 +29,4 @@ import * as SimpleContentTypeFields from "./types/schema-fields/simple-content-t
|
|
|
29
29
|
import * as UIFields from "./types/schema-fields/ui-fields";
|
|
30
30
|
import * as Schema from "./types/schemas";
|
|
31
31
|
import * as Theme from "./types/theme";
|
|
32
|
-
export {
|
|
32
|
+
export { CloudinaryBackgroundImage, CloudinaryImage, CloudinaryImageCrop, CloudinaryImageFormat, CloudinaryImageProps, CloudinaryResponsiveImageProps, Component, ComponentProps, Core, Fields, FiltersDataApiQueryResponseProps, GenerateImageChunkProps, GenerateImageChunkPropsExperimental, GriddoAlertRegisterProps, GriddoBackgroundImage, GriddoImage, GriddoImageCommonProps, GriddoImageCommonPropsExperimental, GriddoImageExp, GriddoImageGif, GriddoImageGifExperimental, GriddoImageJpgWebpAvif, GriddoImageJpgWebpAvifExperimental, GriddoImageProps, GriddoImagePropsExperimental, GriddoImageSvg, GriddoImageSvgExperimental, GriddoLink, GriddoLinkProps, HLocation, HTMLHeadingTag, Hideable, ImageChunk, ImageChunkExperimental, ImageConfig, ImageConfigExperimental, LdJson, Link, LinkGetProps, ListApiQueryResponseProps, ModulePreviewProps, NonEmptyArray, Page, PageContentTypeFields, PageContext, PageProps, PageProvider, PickRename, Pretty, Preview, PreviewProps, Schema, SessionContext, SessionProvider, SetQueryProps, SimpleContentTypeFields, SiteContext, SiteProvider, SiteProviderProps, Theme, UIFields, UseDataFilterSetUrlAction, UseDataFiltersReturn, UseDataFiltersSetQueryProps, UseDataFiltersState, UseGriddoImageProps, UseGriddoImagePropsExperimental, UseGriddoImageReturn, UseGriddoImageReturnExperimental, UseI18nProps, UseImageProps, UseListSetQueryProps, UseListSetUrlAction, WindowLocation, createCategoryContentTypeSchema, createComponentSchema, createDamDefaultsSchema, createDataPackCategorySchema, createDataPackSchema, createFooterSchema, createHeaderSchema, createLanguagesSchema, createMenuSchema, createModuleCategoriesSchema, createModuleSchema, createPageContentTypeSchema, createSimpleContentTypeSchema, createTemplateSchema, createThemesSchema, createTranslationsSchema, formatLocaleDate, getComponent, getLang, getSiteID, getToken, griddoAlertRegister, useContentType, useContentTypeNavigation, useDataFilters, useReferenceFieldData as useDistributorData, useGlobalTheme, useGriddoImage, useGriddoImageExp, useI18n, useImage, useIsClient, useIsFirstRender, useLink, useList, useListWithDefaultStaticPage, useLocaleDate, useNavigation, usePage, useReferenceFieldData, useSSR, useScript, useSession, useSite, useSitemap, useTheme, useThemeColors, useThemeFont, useThemePrimitives, };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import t from"react";function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function r(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function l(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}var i={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function o(e){return null==e?void 0:e.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]}function a(e){return Object.fromEntries(Object.entries(e).filter((e=>e[1])))}function l(e){var t;const{damId:r,imageConfig:i}=e,l=n(e,["damId","imageConfig"]),s=(c=i,d=l,Object.assign(Object.assign({},a(c)),a(d)));var c,d;const u=s.crop?`c/${s.crop}`:"",g=s.quality?`q/${s.quality}`:"",p=s.format?`f/${s.format}`:"",f=`${u}/${g}/${s.width?`w/${o(s.width)}`:""}/${s.height?`h/${o(s.height)}`:""}/${s.position?`p/${s.position}`:""}/${(null===(t=s.transforms)||void 0===t?void 0:t.length)?`t/${s.transforms}`:""}/${p}`;return function(e){const[t,n]=e.split(/(^https?:\/\/|^\/\/)/).filter(Boolean);return`${t}${null==n?void 0:n.replace(/\/\/+/g,"/").replace(/\/$/,"")}`}(`${i.domain}/${f}/${r}`)}function s(e){return e&&"string"==typeof e?e.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:e}function c(e){if(e&&"string"==typeof e){return e.split("/").filter(Boolean).slice(-1)[0]}return e}const d=()=>Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,8);function u(e){return e.global}function g(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return 1===n.length?n[0]:n}const p=e=>{const t={},n=e=>{e.forEach((e=>{e.values.forEach((({cssVar:e,value:n})=>{t[e]=n}))}))};return Array.isArray(e)?n(e):Object.values(e).forEach((e=>{n(e)})),t},f=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{values:e.values.map((e=>([...e.value.matchAll(/var\((.*?)\)/g)].forEach((n=>{n.length>=2&&(e.value=e.value.replace(n[0],t[n[1]]))})),Object.assign({},e)))).filter((({value:e})=>CSS.supports("color",e)))}))).filter((e=>e.values.length)),m=e=>{const t=(e=>{let t=Object.assign({},p(e.primitives));return"subthemes"in e&&e.subthemes&&e.subthemes.forEach((e=>{t=Object.assign(Object.assign({},t),p(e.primitives))})),t})(e);if(Array.isArray(e.primitives))return f(e.primitives,t);const{common:n,light:r,dark:i}=e.primitives;return{common:n&&f(n,t),light:f(r,t),dark:f(i,t)}},v=(e,t)=>e.filter((e=>Array.isArray(t)?t.includes(e.id):e.id===t)),h=(e,t)=>{if(Array.isArray(e.primitives))return v(e.primitives,t);const{common:n,light:r,dark:i}=e.primitives;return{common:n&&v(n,t),light:v(r,t),dark:v(i,t)}},b=e=>{if(Array.isArray(e.primitives))return e.primitives.length;const{common:t,light:n,dark:r}=e.primitives;return(null==t?void 0:t.length)||n.length||r.length},y=(e,t,n)=>{const r=void 0===n;return e.map((e=>Object.assign(Object.assign({},e),{primitives:r?m(e):h(e,n),subthemes:"subthemes"in e&&e.subthemes&&e.subthemes.map((e=>Object.assign(Object.assign({},e),{primitives:r?m(e):h(e,n)}))).filter((e=>b(e)&&(!t||e.id===t)))||[]}))).filter((e=>b(e)||e.subthemes.length))},j=(e,t,n)=>y(e,n,t),O=(e,t)=>y(e,t);function S(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return O(n,null==t?void 0:t.subtheme)}function w(e,t){const n=[],{global:r,primitive:i,subtheme:o}=t;if(r&&n.push(e.global),t.theme){const r=e.themes.find((e=>e.id===t.theme));r&&n.push(r)}else n.push(...e.themes);return j(n,i,o)}function $(e,t){return w(e,Object.assign(Object.assign({},t),{primitive:["fontFamily","fontSize"]}))}const E=e.createContext({translations:{}});function x(t){const{children:n,translations:r}=t;return e.createElement(E.Provider,{value:{translations:r}},n)}const k={linkComponent:function(t){const{children:r}=t,i=n(t,["children"]);return e.createElement("a",Object.assign({"data-griddo":"link"},i),r)},navigate:()=>null},L=e.createContext(k);function I(t){const{children:r}=t,i=n(t,["children"]),o=Object.assign(Object.assign({},k),i);return e.createElement(L.Provider,{value:o},r)}const _=e.createContext({});function C(t){const{children:r}=t,i=n(t,["children"]),o=e.useContext(L),a=null==o?void 0:o.translations;return e.createElement(_.Provider,{value:Object.assign({},i)},e.createElement(x,{translations:a},r))}function U(){var t,n;const r=e.useContext(_);if(!r)return console.warn("Griddo: You forgot to put <PageProvider>."),{};const i=null===(t=r.pageLanguages)||void 0===t?void 0:t.filter((e=>e.isLive)),o=null===(n=r.pageLanguages)||void 0===n?void 0:n.find((e=>e.languageId===r.languageId)),a=null==o?void 0:o.locale,l=null==o?void 0:o.locale.replace("_","-");return Object.assign(Object.assign({},r),{pageLanguages:i,locale:a,ISOLocale:l})}const z="undefined"!=typeof window;function P(e,t){return(null==t?void 0:t.startsWith(`${e}#`))?`#${t.split("#")[1]}`:t}function R(){const e=localStorage.getItem("persist:app");if(!e||!z)return null;const t=JSON.parse(e);let{token:n}=t;n=JSON.parse(n);return{Authorization:`bearer ${n}`}}function q(){var e;const t=localStorage.getItem("persist:root");if(!z||!t)return 1;const n=JSON.parse(t);let{sites:r}=n;r=JSON.parse(r);return null===(e=r.currentSiteInfo)||void 0===e?void 0:e.id}function N(){const e=localStorage.getItem("langID");return!(!z||!e)&&parseInt(e)}function A({obj:e,searchKey:t,resultsBuffer:n=[],unique:r=!0}={}){if(!e)return[];const i=n;return Object.keys(e).forEach((n=>{const r=e[n];n===t&&"object"!=typeof r?i.push(r):"object"==typeof r&&r&&A({obj:r,searchKey:t,resultsBuffer:i})})),r?[...new Set(i)]:i}function T({baseUrl:e,params:t}){const n=Object.keys(t).map((e=>function(e){return Array.isArray(e)&&e.length>0||"number"==typeof e||"string"==typeof e&&!!e}(t[e])?`${e}/${t[e]}`:"")).join("/");return`${e}${r=n,r.split("/").filter(Boolean).join("/")}`;var r}function D(e,t){const n=t||N();return{method:"POST",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:null==n?void 0:n.toString()},R()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(e)}}function F(e){return!!e&&e.every((e=>"number"==typeof e))}function M(e){return Array.isArray(e)&&F(e)}function B(e){return Array.isArray(e)&&!F(e)}function H(e){return!M(e)&&!B(e)}function G(e){if(!e)return;const t=e?e.reduce(((e,t)=>{const{source:n,id:r}=t;return e[n]||(e[n]=[]),e[n].push(r),e}),{}):{};return Object.keys(t).map((e=>`${e}:${t[e]}`)).join(";")}function V(e){return null==e?void 0:e.join(",")}function J(e){const t=[];for(const n in e){e[n].items.forEach((e=>{t.push({id:e.id,label:e.label,source:n})}))}return G(t)}function W(e){return!!e&&["or","and"].includes(e.toLowerCase())}function K(e){return"boolean"==typeof e?e?"simple":"off":"off"===e||"simple"===e||"full"===e?e:"off"}function Y(t){const[n,r]=e.useState(null),{order:i,quantity:o,source:a,mode:l,fixed:s,filter:c,allLanguages:d,preferenceLanguage:u,fullRelations:g=!1,filterOperator:p="OR",globalOperator:f="AND",site:m,lang:v}=t||{},{apiUrl:h}=U();return e.useEffect((()=>{const e=!!(v||N()),t=m||q()||"global",n=`${h}/site/${t}/distributor`,b=D("auto"===l?{mode:l,order:i,quantity:o,source:a,filter:c,fullRelations:g,allLanguages:d,preferenceLanguage:u,filterOperator:p,globalOperator:f}:{mode:l,fixed:s,fullRelations:g},v);e&&fetch(n,b).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,i,o,s,c,a,g,d,u,p,f,m,v]),n}function Z({data:e,queriedData:t}){return e&&Y(e)||t}function Q(t){const[n,r]=e.useState({previous:[],next:[],error:void 0}),{apiUrl:i,canonicalSite:o,structuredDataContent:a}=U(),{order:l="recent-asc",quantity:s=1,fullRelations:c=!1,referenceId:d=(null==a?void 0:a.id)}=t||{};return e.useEffect((()=>{const e=!!N(),t=q()||o||"global",n=`${i}/site/${t}/distributor`,a=D({mode:"navigation",order:l,quantity:s,fullRelations:c,referenceId:d});e&&fetch(n,a).then((e=>e.json())).then((e=>r(e))).catch((e=>{console.error("Error:",e)}))}),[l,s,c,d]),n}function X(t){const[n,r]=e.useState(),[i,o]=e.useState(!0),[a,l]=e.useState(!1),[s,c]=e.useState(!0),[d,u]=e.useState({});return e.useEffect((()=>{t&&(o(!0),fetch(t).then((e=>{if(c(!1),200!==e.status)throw o(!1),l(!0),u({code:e.status,msg:e.statusText}),new Error(e.statusText);return e.json()})).then((e=>{r(e)})).finally((()=>{o(!1),l(!1)})).catch((()=>{l(!0)})))}),[t]),{data:n,isLoading:i,isError:a,isFirstFetch:s,msg:d}}const ee=e.createContext(null);function te(t){return e.createElement(ee.Provider,{value:{isNavigation:!0}},t.children)}const ne=t.createContext([{},()=>null]),re=e=>{const{children:n}=e,r=ie();return t.createElement(ne.Provider,{value:r},n)},ie=()=>{const[e,n]=t.useState({});return[e,e=>n((t=>Object.assign(Object.assign({},t),e)))]},oe=()=>e.useContext(L);function ae(){const{publicApiUrl:t,siteId:n,renderer:r}=oe(),{languageId:i}=U(),[o,a]=e.useState(),l="editor"===r;const{isError:s,isLoading:c,msg:d,data:u,isFirstFetch:g}=X(null==o?void 0:o.queryUrl);return[{query:u,isLoading:c,isError:s,msg:d,isFirstFetch:g},function({apiUrl:e=`${t}`,cached:r,data:o,lang:s=i,site:c=n}){if(!o)return;const d=l?(new Date).valueOf():r,u=T({baseUrl:`${e}/filters/${`${o.source||o.fixed}/`}`,params:{site:c,lang:s,related:(g=o.related,"number"==typeof g?g:M(g)?V(g):B(g)?G(g):H(g)?J(g):void 0),allLanguages:o.allLanguages?"on":"off",filterOperator:o.filterOperator,globalOperator:o.globalOperator,cached:d,order:o.order}});var g;a({queryUrl:u})}]}const le={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},se={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function ce(t){var{url:r}=t,i=n(t,["url"]);if(!r)return{};const a=e.useContext(L),d=(null==a?void 0:a.griddoDamDefaults)||{},u=s(r),g=c(r),p=Object.assign(Object.assign(Object.assign(Object.assign({},se),d),i),{format:"jpeg",domain:u});void 0===p.responsive&&(p.responsive=[{width:p.width,height:p.height,quality:p.quality,crop:p.crop,position:p.position,transforms:p.transforms}]);const f=p.responsive.map((({width:e,height:t,quality:n,crop:r,position:i,transforms:a})=>`${l({damId:g,imageConfig:p,quality:n,crop:r,width:e,height:t,position:i,transforms:a})} ${e?`${o(e)}w`:""}`.trim())),m=function(e){const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(p.responsive.reverse()).map(((e,t)=>p.responsive&&t<p.responsive.length-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`)).join(", "),v=f.map((e=>null==e?void 0:e.split(" ")[0])),h=p.responsive[0],b=`${l(Object.assign({damId:g,imageConfig:p},h))}`;return{type:(null==p?void 0:p.format)?le[null==p?void 0:p.format]:le.jpeg,srcSet:f,srcSetURL:v,src:b,sizes:m,webpFallback:de({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:de({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:de({srcSet:f,srcSetURL:v,format:"webp"}),avif:de({srcSet:f,srcSetURL:v,format:"avif"}),png:de({srcSet:f,srcSetURL:v,format:"png"}),gif:de({srcSet:f,srcSetURL:v,format:"gif"}),svg:de({srcSet:f,srcSetURL:v,format:"svg"})}}function de({srcSet:e,srcSetURL:t,format:n}){return{type:le[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}const ue={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},ge={quality:75,crop:"cover",loading:"lazy",decoding:"auto",formats:["webp"]};function pe(e){var t,{url:r}=e,i=n(e,["url"]);if(!r)return{};const{griddoDamDefaults:a}=oe(),d=s(r),u=c(r),g=Object.assign(Object.assign(Object.assign(Object.assign({},ge),a),i),{domain:d,format:"jpeg"}),p=me((null==i?void 0:i.width)||"1x")/me((null==i?void 0:i.height)||"1px"),f=Array.isArray(g.widths)&&g.widths.length||void 0!==g.widths?null===(t=g.widths)||void 0===t?void 0:t.map((e=>{const t=l({damId:u,imageConfig:g,width:e,height:g.height?`${Math.round(me(e)/p)}px`:void 0}),n=e?`${o(e)}w`:"";return g.width?`${t} ${n}`.trim():""})):[l({damId:u,imageConfig:g,width:g.width,height:g.height?`${Math.round(me(g.width||"1px")/p)}px`:void 0})],m=null==f?void 0:f.map((e=>null==e?void 0:e.split(" ")[0])),v=`${l({damId:u,imageConfig:g})}`;return{type:(null==g?void 0:g.format)?ue[null==g?void 0:g.format]:ue.jpeg,srcSet:f,srcSetURL:m,src:v,webpFallback:fe({srcSet:f,srcSetURL:m,format:"jpeg"}),jpeg:fe({srcSet:f,srcSetURL:m,format:"jpeg"}),webp:fe({srcSet:f,srcSetURL:m,format:"webp"}),avif:fe({srcSet:f,srcSetURL:m,format:"avif"}),png:fe({srcSet:f,srcSetURL:m,format:"png"}),gif:fe({srcSet:f,srcSetURL:m,format:"gif"}),svg:fe({srcSet:f,srcSetURL:m,format:"svg"})}}function fe({srcSet:e,srcSetURL:t,format:n}){return{type:ue[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}function me(e){const t=e.match(/^-?\d*\.?\d+/);return t?parseFloat(t[0]):0}function ve(t){const n=null==t?void 0:t.locale,r=e.useContext(E),{siteLangs:i}=oe(),{languageId:o}=U(),a=null==r?void 0:r.translations;a||console.warn("Griddo: <SiteProvider> needs to have the prop translations"),void 0===i&&console.warn("Griddo: <SiteProvider> needs to have the prop siteLangs set with the site languages"),o||console.warn("Griddo: <PageProvider> needs to have the prop languageId set with the page language id"),function(e,t){return!!(null==e?void 0:e.find((e=>e.id===t)))}(i,o)||console.warn(`Griddo: languageId ${o} doesn't exist in this site`),void 0===n||function(e,t){return!!(null==e?void 0:e.find((e=>(null==e?void 0:e.locale)===t)))}(i,n)||console.warn(`Griddo: locale ${n} doesn't exist in this site`);const l=n||function(e,t){var n;return null===(n=null==e?void 0:e.find((e=>e.id===t)))||void 0===n?void 0:n.locale}(i,o),s=a&&l?a[l]:void 0;return l&&o||console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{getTranslation:(e,t="")=>s&&s[e]?s[e]:t,getNestedTranslation:(e,t="")=>s&&function(e,t){const n=null==e?void 0:e.split(".").reduce(((e,t)=>e[t]?e[t]:""),t);return n}(e,s)||t}}const he={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function be(e){var t,r,{publicId:i}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=oe(),c=Object.assign(Object.assign(Object.assign({},he),s),a),d=`${c.domain}/${l}/${c.uploadFolder}`,u=`${ye({root:d,imageConfig:Object.assign(Object.assign({},c),{quality:20,width:"512"})})}/${c.fallback404ImageId}`,g=null===(t=null==c?void 0:c.responsive)||void 0===t?void 0:t.map((({width:e,height:t,quality:n,crop:r})=>`${ye({root:d,imageConfig:Object.assign({quality:n,crop:r,width:e,height:t},c)})}/${i} ${o(e)}w`)),p=function(e){if(!e)return[];const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(null===(r=null==c?void 0:c.responsive)||void 0===r?void 0:r.reverse()).map(((e,t)=>{var n;return c.responsive&&t<(null===(n=null==c?void 0:c.responsive)||void 0===n?void 0:n.length)-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`})).join(", "),f=null==g?void 0:g.map((e=>e.split(" ")[0])),m=(null==c?void 0:c.responsive)&&(null==c?void 0:c.responsive[0])||[];return{src:`${ye(Object.assign({root:d,imageConfig:c},m))}/${i}`,srcSet:g,sizes:p,fallbackSrcImage:u,srcSetURL:f}}function ye(e){const{root:t,imageConfig:n}=e,r=(null==n?void 0:n.crop)?`c_${n.crop}`:"",i=(null==n?void 0:n.quality)?`q_${n.quality}`:"",a=(null==n?void 0:n.gravity)?`g_${n.gravity}`:"",l=(null==n?void 0:n.format)?`f_${n.format}`:"",s=(null==n?void 0:n.width)?`w_${o(n.width)}`:"",c=(null==n?void 0:n.height)?`h_${o(n.height)}`:"",d=(null==n?void 0:n.ar)?`ar_${n.ar}`:"";return`${t}/${`${r},${a},${l},${i},${s},${c},${d}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`}function je(){const[t,n]=e.useState(!1);return e.useEffect((()=>{n(!0)}),[]),t}function Oe(){const t=e.useRef(!0);return t.current?(t.current=!1,!0):t.current}function Se(){const t=e.useContext(L);return null==t?void 0:t.linkComponent}function we(){const{publicApiUrl:t,siteId:n,renderer:r}=oe(),{languageId:i}=U(),[o,a]=e.useState(),l="editor"===r;const{isError:s,isLoading:c,msg:d,data:u,isFirstFetch:g}=X(null==o?void 0:o.queryUrl);return[{query:u,isLoading:c,isError:s,msg:d,isFirstFetch:g},function({apiUrl:e=`${t}`,cached:r,data:o,exclude:s,fields:c,filterIds:d,filterOperator:u,globalOperator:g,items:p=10,operator:f,page:m=1,relations:v,search:h,includePending:b,allLanguages:y,preferenceLanguage:j}){var O;if(!o)return;const S=l?(new Date).valueOf().toString():r,w=null==h?void 0:h.replace(/\s/g,"+"),$="auto"===o.mode,E="manual"===o.mode,x="navigation"===o.mode,k=o.source||o.fixed||`reference/${o.referenceId}`||[],L=T({baseUrl:`${e}${$?"/list/":E?"/list/fixed/":x?"/list/navigations/":""}${k}/`,params:{site:o.site||n,lang:o.lang||i,get:c,page:m,items:p,order:$||x?o.order:void 0,filter:(I=d||o.filter,M(I)?V(I):B(I)?G(I):H(I)?J(I):void 0),maxItems:o.quantity,search:w,operator:W(f)?f:void 0,filterOperator:W(u)?u:void 0,globalOperator:W(g)?g:void 0,exclude:Array.isArray(s)?s:void 0,relations:K(v),includePending:b?"on":void 0,allLanguages:y?"on":void 0,preferenceLanguage:j?"true":void 0,cached:S}});var I;E&&Array.isArray(k)&&k.length<1&&a({queryUrl:void 0,extra:void 0}),a({queryUrl:L,extra:{totalItems:"manual"===o.mode&&(null===(O=o.fixed)||void 0===O?void 0:O.length)}})}]}function $e(e){const{items:t,queriedData:n,fields:r,page:i}=e,[{isError:o,isLoading:a,msg:l,query:s,isFirstFetch:c},d]=we(),u={page:i||1,totalItems:null==n?void 0:n.length,totalPages:(null==n?void 0:n.length)&&t&&Math.ceil((null==n?void 0:n.length)/t),items:null==n?void 0:n.slice(0,t||10).map((e=>Object.assign({id:e.id},function(e,t){if(e)return t?Object.fromEntries(Object.keys(e).map((n=>(null==t?void 0:t.includes(n))&&[n,e[n]])).filter(Boolean)):e}(e.content,r))))};return[{isError:o,isLoading:a,msg:l,isFirstFetch:c,query:(s?Object.assign(Object.assign({},s),{totalPages:t&&(null==s?void 0:s.totalItems)&&Math.ceil((null==s?void 0:s.totalItems)/t)}):void 0)||u},d]}const Ee="Invalid Date";function xe(e,t={dateStyle:"long"}){const{ISOLocale:n}=U();return e?ke(e,n||"en-US",t):{date:void 0,dateTime:void 0}}function ke(e,t,n={dateStyle:"long"}){if(!Le)return{date:e,dateTime:""};const r=new Date(e);if(isNaN(r.getTime()))return{date:Ee,dateTime:Ee};return{date:r.toLocaleDateString(t,n),dateTime:e.replaceAll("/","-")}}function Le(e){return Intl.DateTimeFormat.supportedLocalesOf(e,{dateStyle:"long"}).length>0}function Ie(){return e.useContext(ee)}const _e={};function Ce(t,n){const[r,i]=e.useState((()=>{var e;return!t||(null==n?void 0:n.shouldPreventLoad)?"idle":"undefined"==typeof window?"loading":null!==(e=_e[t])&&void 0!==e?e:"loading"}));return e.useEffect((()=>{var e,r;if(!t||(null==n?void 0:n.shouldPreventLoad))return;const o=_e[t];if("ready"===o||"error"===o)return void i(o);const a=function(e){const t=document.querySelector(`script[src="${e}"]`),n=null==t?void 0:t.getAttribute("data-status");return{node:t,status:n}}(t);let l=a.node;if(l)i(null!==(r=null!==(e=a.status)&&void 0!==e?e:o)&&void 0!==r?r:"loading");else{l=document.createElement("script"),l.src=t,l.async=!0,l.setAttribute("data-status","loading"),document.body.appendChild(l);const e=e=>{const t="load"===e.type?"ready":"error";null==l||l.setAttribute("data-status",t)};l.addEventListener("load",e),l.addEventListener("error",e)}const s=e=>{const n="load"===e.type?"ready":"error";i(n),_e[t]=n};return l.addEventListener("load",s),l.addEventListener("error",s),()=>{l&&(l.removeEventListener("load",s),l.removeEventListener("error",s)),l&&(null==n?void 0:n.removeOnUnmount)&&l.remove()}}),[t,null==n?void 0:n.shouldPreventLoad,null==n?void 0:n.removeOnUnmount]),r}const Ue=()=>t.useContext(ne);function ze(){const[t,n]=e.useState(),[i,o]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=U(),{siteMetadata:d}=oe();e.useEffect((()=>{u()}),[]);const u=()=>r(this,void 0,void 0,(function*(){var e,t,r;const i={};if(i.topMenu=[{label:null==d?void 0:d.title,children:null===(e=l.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!c&&`${c.domainUrl}${c.site}`}}],!d){const e=q(),t=`${a}/site/${e}`,n=yield fetch(t,function(){const e=N();return{method:"GET",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:e},R())}}()),{name:r}=yield n.json();i.topMenu[0].label=r,i.siteName=r}i.mainMenu=null===(t=null==l?void 0:l.mainMenu)||void 0===t?void 0:t.elements;const u=null===(r=null==s?void 0:s.legalMenu)||void 0===r?void 0:r.elements;i.footerMenu=[{label:null,children:u}],i.header=l,i.footer=s,n(i),o(!1)}));return[t,i]}function Pe(){const e="undefined"!=typeof window&&window.document&&window.document.documentElement;return{isBrowser:e,isServer:!e}}function Re(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}function qe(t){var{backgroundRepeat:r="no-repeat",backgroundSize:o="cover",backgroundPosition:a="50% 50%",children:l,overlayColor:s=null,overlayOpacity:c=0,overlayTransition:u="2s",ratio:g,publicId:p,src:f,customLazyClassName:m="lazy",lazy:v}=t,h=n(t,["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"]);const{cloudinaryDefaults:b}=oe(),y=Object.assign(Object.assign(Object.assign(Object.assign({},b),i),h),{backgroundLazy:b.backgroundLazy||i.backgroundLazy||v}),{srcSetURL:j}=be({responsive:[...y.responsive],quality:y.quality,crop:y.crop,gravity:y.gravity,format:y.format,publicId:p,ar:g}),O=f?[f]:j,S=f?[]:y.responsive.map((e=>e.breakpoint)),w=`Griddo-BgImage--${d()}`,$=y.backgroundLazy?m:"",E=function(e,t=0){return Array(e).fill(0).map(((e,n)=>n+t))}(O.length-1,1).map((e=>`@media (min-width: ${S[e]}) {\n .${w} {\n background-image: url(${O[e]});\n }\n }\n `)).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n\n .${w} {\n background-repeat: ${r};\n background-position: ${a};\n background-size: ${o};\n background-image: url(${O[0]});\n }\n\n ${E}\n\n .${w}::before {\n transition: all ${u} ease;\n background-color: rgba(0, 0, 0, ${c});\n ${s?`\n background-color: ${s};\n opacity: ${c};\n `:""}\n }`}}),e.createElement("div",{className:`Griddo-BgImage ${w} ${$}`},l))}function Ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ae(e,t){return e(t={exports:{}},t.exports),t.exports}Re('.Griddo-BgImage {\n\tdisplay: flex;\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.Griddo-BgImage::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n}\n\n.Griddo-BgImage.lazy {\n\tbackground-image: none;\n}\n');var Te=Symbol.for("react.element"),De=Symbol.for("react.fragment"),Fe=Object.prototype.hasOwnProperty,Me=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Be={key:!0,ref:!0,__self:!0,__source:!0};function He(e,t,n){var r,i={},o=null,a=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)Fe.call(t,r)&&!Be.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:Te,type:e,key:o,ref:a,props:i,_owner:Me.current}}var Ge={Fragment:De,jsx:He,jsxs:He},Ve=Ae((function(e){e.exports=Ge})),Je=Ae((function(e,n){n.__esModule=!0,n.default=void 0;var r=["className","children","ratio","style"];function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var o="--aspect-ratio";class a extends t.Component{constructor(){super(...arguments),this.node=null,this.setNode=e=>{this.node=e}}componentDidUpdate(){if(this.node){var{node:e}=this;e.style.getPropertyValue(o)||e.style.setProperty(o,"("+this.props.ratio+")")}}render(){var e=this.props,{className:t,children:n,ratio:a,style:l}=e,s=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,r),c=i({},l,{[o]:"("+a+")"});return(0,Ve.jsx)("div",i({className:t,ref:this.setNode,style:c},s,{children:n}))}}a.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var l=a;n.default=l}));Ne(Je);var We=Ae((function(e,t){t.__esModule=!0,t.default=void 0;var n=["className","children","ratio","style"];function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var i="--aspect-ratio",o="react-aspect-ratio-placeholder";var a=function(e){var{className:t=o,children:a,ratio:l=1,style:s}=e,c=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,n),d=r({},s,{[i]:"("+l+")"});return(0,Ve.jsx)("div",r({className:t,style:d},c,{children:a}))};t.default=a}));Ne(We);var Ke=Ae((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=i(Je),r=i(We);function i(e){return e&&e.__esModule?e:{default:e}}var o=n.default;t.default=o;var a=r.default;t.AspectRatio=a}));Ne(Ke);var Ye=Ke.AspectRatio;function Ze(t){const{alt:n,width:r,height:o,ratio:a,fixed:l,publicId:s,src:c,objectFit:d="cover"}=t,{cloudinaryDefaults:u}=oe(),g=Object.assign(Object.assign(Object.assign({},i),u),t),{srcSet:p,sizes:f,src:m}=be({crop:g.crop,format:g.format,gravity:g.gravity,quality:g.quality,sizes:g.sizes,responsive:g.responsive,ar:a,publicId:s}),v={alt:n,width:r,height:o,loading:g.loading,style:{objectFit:d},decoding:g.decoding},h=Object.assign(Object.assign({},v),{src:c}),b=Object.assign(Object.assign({},v),{srcSet:p,sizes:f,src:m}),y=c?h:b,j=()=>e.createElement("img",Object.assign({},y));return l?e.createElement(j,null):e.createElement(Ye,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(j,null))}Re('[style*="--aspect-ratio"] > img {\n height: auto;\n}\n\n[style*="--aspect-ratio"] {\n position: relative;\n}\n\n[style*="--aspect-ratio"] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n[style*="--aspect-ratio"]::before {\n content: "";\n display: block;\n width: 100%;\n}\n\n@supports not (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n height: 0;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n}\n\n@supports (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n aspect-ratio: calc(var(--aspect-ratio));\n }\n}\n');const Qe=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{d:"M16 9v10H8V9h8zm-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})),Xe=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5263 2.3158H4.78947C3.80526 2.3158 3 3.12106 3 4.10527V16.6316H4.78947V4.10527H15.5263V2.3158ZM18.2105 5.89475H8.36842C7.38421 5.89475 6.57894 6.70001 6.57894 7.68422V20.2105C6.57894 21.1947 7.38421 22 8.36842 22H18.2105C19.1947 22 20 21.1947 20 20.2105V7.68422C20 6.70001 19.1947 5.89475 18.2105 5.89475ZM8.36843 20.2105H18.2105V7.68422H8.36843V20.2105Z"}));Re('.--not-selected-nameplate {\n\tdisplay: none;\n}\n\n.--selected,\n.--selected-header-footer,\n.--selected-nameplate {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.--selected-header-footer::before,\n.--selected::before {\n\tposition: absolute;\n\theight: calc(100% - 8px);\n\twidth: calc(100% - 8px);\n\tpadding-bottom: 4px;\n\tcontent: "";\n\tborder: 4px solid rgb(80, 87, 255);\n\tpointer-events: none;\n\tz-index: 99;\n}\n\n.--selected-header-footer::after {\n\tposition: absolute;\n\tpadding: 8px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tcontent: attr(data-text);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n}\n\n.--selected-nameplate {\n\tdisplay: flex;\n\talign-items: center;\n\tposition: absolute;\n\tpadding: 4px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.span-svg-action {\n\tpadding-left: 4px;\n}\n\n.span-svg-action:first-child {\n\tpadding-left: 16px;\n}\n\n.svg-action {\n\tfill: #dadada;\n}\n\n.svg-action:hover {\n\tfill: #fff;\n\tcursor: pointer;\n}\n');const et=t=>{const n=e.useRef(null),[r,i]=e.useState(0),{selectEditorID:o,moduleActions:a}=e.useContext(L),{selectedEditorID:l,editorID:s,component:c,children:d,isSelectionAllowed:u,type:g}=t,p=!!g&&["header","footer"].includes(g);e.useEffect((()=>{n&&n.current&&i(n.current.scrollHeight)}),[d]),e.useEffect((()=>{v&&m()}),[n]);const f=e=>{(s||0===s)&&"undefined"!=typeof window&&u&&o&&o(t,void 0,e)},m=()=>{if(!n.current)return;const e=n.current.style.position,t=n.current.style.top;n.current.style.position="relative",n.current.style.top="-34px",n.current.scrollIntoView({behavior:"smooth",block:"nearest"}),n.current.style.top=t,n.current.style.position=e;0===n.current.offsetTop&&(n.current.style.marginTop="36px")},v=!!l&&l===s;v&&m();return e.createElement(e.Fragment,null,"Header"===c&&e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n [data-text="Header"].--selected::before {\n height: ${r-8}px;\n }`}}),p&&e.createElement("span",{className:""+(v?"--selected-header-footer":""),"data-text":c,ref:n,onClick:f},d),!p&&e.createElement("span",{className:""+(v?"--selected":""),"data-text":c,ref:n,onClick:f},e.createElement("span",{className:""+(v?"--selected-nameplate":"--not-selected-nameplate")},c,e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.duplicateModuleAction(s)}},e.createElement(Xe,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(Qe,{className:"svg-action"}))),d))},tt=(e,t)=>{const n=t.component;return void 0!==e[n]?e[n]:(console.warn(`The component <${n}> doesn't exist inside ${JSON.stringify(Object.keys(e))}`),null)};function nt(t){var r,{libComponents:i}=t,o=n(t,["libComponents"]);const{component:a,editorID:l,type:s="",parentEditorID:c}=o,{renderer:d}=oe(),u=null===(r=Ie())||void 0===r?void 0:r.isNavigation,g="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,p=tt(i,Object.assign({},o)),f=u&&!["header","footer"].includes(s);return"editor"===d?e.createElement(re,null,e.createElement(et,{selectedEditorID:g,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},p?e.createElement(p,Object.assign({},o)):e.createElement(e.Fragment,null))):"preview"===d?e.createElement(re,null,p&&e.createElement(p,Object.assign({},o))):p&&e.createElement(p,Object.assign({},o))}Re('.griddo-background-image {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\n\tposition: relative;\n\n\tbackground-repeat: no-repeat;\n\tbackground-size: cover;\n\tbackground-position: 50% 50%;\n}\n\n.griddo-background-image--lazy .griddo-background-image {\n\tbackground: none !important;\n}\n\n.griddo-background-image::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n\ttransition: all var(--veil-transition-time) var(--veil-transition-easing);\n\tbackground-color: var(--veil-opacity);\n}\n');const rt="griddo-background-image--lazy",it=e.forwardRef((({children:t,format:n,backgroundSize:r,veilOpacity:i=.5,veilColor:o="#000033",veilTransitionTime:a="2s",veilTransitionEasing:d="easing",url:u,src:g,responsive:p,className:f,style:m,quality:v,lazyOffset:h="200px",loading:b},y)=>{const{griddoDamDefaults:j}=oe(),O=e.useRef(null),S=s(u);e.useEffect((()=>{var e;if(IntersectionObserver){if(O.current){let e=new IntersectionObserver((t=>t.forEach((t=>{var n;t.isIntersecting&&(null===(n=O.current)||void 0===n||n.classList.remove(rt),e=e.disconnect())}))),{rootMargin:`0px 0px ${h} 0px`});return e.observe(O.current),()=>e=e&&e.disconnect()}}else null===(e=O.current)||void 0===e||e.classList.remove(rt)}),[]);const w=p&&Object.fromEntries(Object.keys(p).map((e=>[e,{url:`url("${l({damId:c(u),imageConfig:Object.assign(Object.assign(Object.assign({},j),{quality:v,format:n,domain:S}),p[e])})}")`,customProperty:p[e].customProperty}]))),$=p&&Object.fromEntries(Object.keys(p).map(((e,t)=>[w[e].customProperty?`${w[e].customProperty}`:`--image-${t}`,w[e].url]))),E=g?{"--image-default":`url(${g})`}:$;return e.createElement("div",{ref:O,"data-griddo":"loading-ref",className:`${"lazy"===b?rt:""}`},e.createElement("div",{"data-griddo":"image-ref",ref:y,className:`${f} griddo-background-image`,style:Object.assign(Object.assign(Object.assign({},m),{"--veil-opacity":`${o}${Math.round(255/(1/i)).toString(16)}`,"--veil-transition-time":a,"--veil-transition-easing":d,"--background-size":r}),E)},t))}));Re('[style*="--aspect-ratio"] [data-image="griddo"] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\twidth: 100%;\n\tobject-fit: cover;\n}\n');const ot=e.forwardRef(((t,r)=>{var{width:i,height:o,ratio:a,fixed:l,url:s,loading:c,decoding:d,responsive:u,quality:g,crop:p,format:f,formats:m,position:v,transforms:h}=t,b=n(t,["width","height","ratio","fixed","url","loading","decoding","responsive","quality","crop","format","formats","position","transforms"]);if(!s)return null;const{griddoDamDefaults:y}=oe()||{},j={loading:c||(null==y?void 0:y.loading),decoding:d||(null==y?void 0:y.decoding),quality:g||(null==y?void 0:y.quality),crop:p||(null==y?void 0:y.crop),format:f,formats:m||(null==y?void 0:y.formats),position:v,transforms:h},{src:O,sizes:S,avif:w,jpeg:$,gif:E,webp:x,svg:k}=ce({url:s,crop:j.crop,format:j.format,quality:j.quality,responsive:u,position:j.position,transforms:j.transforms,width:i,height:o}),L=()=>{var t;return e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:d||j.decoding,srcSet:u&&(null===(t=null==E?void 0:E.srcSet)||void 0===t?void 0:t.join(",")),sizes:u&&S,src:(null==E?void 0:E.srcSetURL)&&E.srcSetURL[0],width:i,height:o,fetchpriority:b.fetchpriority},b))},I=()=>e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:d||j.decoding,src:(null==k?void 0:k.srcSetURL)&&k.srcSetURL[0],width:i,height:o,fetchpriority:b.fetchpriority},b)),_=()=>{var t,n,a,l,s;return e.createElement("picture",{ref:r},(null===(t=j.formats)||void 0===t?void 0:t.includes("avif"))&&e.createElement("source",{srcSet:null===(n=null==w?void 0:w.srcSet)||void 0===n?void 0:n.join(","),sizes:u&&S,type:"image/avif"}),(null===(a=j.formats)||void 0===a?void 0:a.includes("webp"))&&e.createElement("source",{srcSet:null===(l=null==x?void 0:x.srcSet)||void 0===l?void 0:l.join(","),sizes:u&&S,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:d||j.decoding,sizes:u&&S,srcSet:null===(s=null==$?void 0:$.srcSet)||void 0===s?void 0:s.join(","),src:O,width:i,height:o,fetchpriority:b.fetchpriority},b)))};return s?"svg"===f?e.createElement(I,null):"gif"===f?e.createElement(L,null):l||!u?e.createElement(_,null):e.createElement(Ye,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(_,null)):null})),at=e.forwardRef(((t,r)=>{var i,o,a,l,s,{width:c,widths:d,height:u,url:g,loading:p,decoding:f,quality:m,crop:v,format:h,formats:b,position:y,transforms:j,sizes:O}=t,S=n(t,["width","widths","height","url","loading","decoding","quality","crop","format","formats","position","transforms","sizes"]);if(!g)return console.warn("`<GriddoImage> needs a DAM image `url`}"),null;!c&&u&&console.warn("`<GriddoImageExp> can't use only height, you have to set `width` or `width` & `height` together."),(d&&!O||!d&&O)&&console.warn("`<GriddoImageExp> needs a `sizes` property if the prop `widths` is provided and vice versa.");const{griddoDamDefaults:w}=oe()||{},$={loading:p||(null==w?void 0:w.loading),decoding:f||(null==w?void 0:w.decoding),quality:m||(null==w?void 0:w.quality),crop:v||(null==w?void 0:w.crop),format:h,formats:b||(null==w?void 0:w.formats),position:y,transforms:j,widths:d},{src:E,avif:x,jpeg:k,gif:L,webp:I,svg:_}=pe({url:g,crop:$.crop,format:$.format,quality:$.quality,position:$.position,transforms:$.transforms,width:c,height:u,widths:$.widths}),C=()=>{var t;return e.createElement("img",Object.assign({"data-image":"griddo",loading:p||$.loading,decoding:f||$.decoding,srcSet:null===(t=null==L?void 0:L.srcSet)||void 0===t?void 0:t.join(","),sizes:O,src:(null==L?void 0:L.srcSetURL)&&L.srcSetURL[0],width:c,height:u,fetchpriority:S.fetchpriority},S))},U=()=>e.createElement("img",Object.assign({"data-image":"griddo",loading:p||$.loading,decoding:f||$.decoding,src:(null==_?void 0:_.srcSetURL)&&_.srcSetURL[0],width:c,height:u,fetchpriority:S.fetchpriority},S));return"svg"===h?e.createElement(U,null):"gif"===h?e.createElement(C,null):e.createElement("picture",{ref:r,"data-testid":"picture"},(null===(i=$.formats)||void 0===i?void 0:i.includes("avif"))&&e.createElement("source",{srcSet:null===(o=null==x?void 0:x.srcSet)||void 0===o?void 0:o.join(","),sizes:O,type:"image/avif"}),(null===(a=$.formats)||void 0===a?void 0:a.includes("webp"))&&e.createElement("source",{srcSet:null===(l=null==I?void 0:I.srcSet)||void 0===l?void 0:l.join(","),sizes:O,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:p||$.loading,decoding:f||$.decoding,sizes:O,srcSet:null===(s=null==k?void 0:k.srcSet)||void 0===s?void 0:s.join(","),src:E,width:c,height:u,fetchpriority:S.fetchpriority},S)))})),lt={pre:"pre",pro:"pro"};function st(t){var{activeClassName:r="",activeStyle:i={},style:o={},children:a,getProps:l,partiallyActive:s,state:c,url:d,title:u,className:g=""}=t,p=n(t,["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"]);const{renderer:f,linkComponent:m}=oe(),{fullPath:v}=U(),h="editor"===f,b=null==d?void 0:d.href,y=null==d?void 0:d.linkToURL,j=(null==d?void 0:d.newTab)||!1,O=(null==d?void 0:d.noFollow)||!1,S=!(null==d?void 0:d.linkToURL)&&!(null==d?void 0:d.href),w=y===`${null==v?void 0:v.domainUrl}${null==v?void 0:v.compose}`,$=function(e){var t;return(null===(t=null==e?void 0:e.domainUrl)||void 0===t?void 0:t.endsWith(`/${e.domain}`))?lt.pro:lt.pre}(v),E=function(e,t){return`${t?"nofollow":""} ${e?"noreferrer":""}`.trim()}(j,O),x=function(e){return e?"_blank":"_self"}(j),k=v&&function({env:e,fullPath:t,to:n}){var r,i,o;if("string"!=typeof n)return n;if(e===lt.pre){const e=null===(r=null==t?void 0:t.domainUrl)||void 0===r?void 0:r.split((null==t?void 0:t.domain)||"").join("");return(null===(i=null==n?void 0:n.split(e||""))||void 0===i?void 0:i.join(""))||n}return e===lt.pro&&(null===(o=null==n?void 0:n.split((null==t?void 0:t.domainUrl)||""))||void 0===o?void 0:o.join(""))||n}({env:$,fullPath:v,to:y}),L=h||S?"":k;return b||j?e.createElement("a",Object.assign({"data-link":"anchor",target:x,rel:E,href:b||y,className:g,title:u},p),a):e.createElement(m,Object.assign({rel:E,target:x,to:L,getProps:l,partiallyActive:s,state:c,activeStyle:i,activeClassName:r,title:h?k:u,style:w?i:o,className:w?`${g} ${r||""}`.trim():g},p),a)}function ct(t){const{data:n}=t;return e.createElement("script",{dangerouslySetInnerHTML:{__html:`(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = \`${JSON.stringify(n)}\`;\n document.head.appendChild(ldJsonScript);\n})();`}})}function dt(t){const{url:r,linkProp:i="to",children:o}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=U(),s=Se()||"a",{href:c,to:d}=function(e){const t=null==e?void 0:e.href,n=null==e?void 0:e.linkToURL,r=null==n?void 0:n.match(/^\/{2}|^https?:/g),i=null==n?void 0:n.match(/^\/\w/g);return{href:t||(r?n:null),to:i?n:null}}(r),u=null==r?void 0:r.newTab,g=null==r?void 0:r.noFollow,p=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),u&&{target:"_blank"}),{rel:`${g?"nofollow":""} ${u?"noreferrer":""}`.trim()}),l&&c&&{href:P(l,c)}),l&&d&&{[i]:P(l,d)});return d?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(s,Object.assign({},p),o)):e.createElement("a",p,o)}function ut(t){const{component:n,content:r,library:{components:i}}=t;return r?e.createElement(nt,Object.assign({libComponents:i,component:n},r)):null}function gt(t){var n;const{apiUrl:r,content:i,footer:o,header:a,languageId:l,library:{templates:s,components:c},pageLanguages:d,siteMetadata:u}=t,g=s[i.template.templateType],p=i.template.heroSection?i.template.heroSection.modules&&i.template.heroSection.modules[0]:void 0,f=p?p.component:void 0,m=A({obj:i.template,searchKey:"component"}),v=Object.keys(null==i?void 0:i.template).filter((e=>(null==i?void 0:i.template[e])&&i.template[e].component)),h=Object.fromEntries(null==v?void 0:v.map((e=>{var t;return[e,null===(t=null==i?void 0:i.template[e].modules)||void 0===t?void 0:t.map((({component:e})=>e))]})));return e.createElement(C,{activeSectionBase:i.template.activeSectionBase,activeSectionSlug:i.template.activeSectionSlug||"/",apiUrl:r,breadcrumb:i.breadcrumb,canonicalSite:i.canonicalSite,componentList:m,dimensions:null===(n=i.dimensions)||void 0===n?void 0:n.values,firstModule:f,footer:o,fullPath:i.fullPath,fullUrl:i.fullUrl,header:a,isHome:i.isHome,languageId:l,modified:i.modified,origin:i.origin,pageLanguages:d,published:i.published,sectionModules:h,site:i.site,siteMetadata:u,siteSlug:i.siteSlug,structuredData:i.structuredData,structuredDataContent:i.structuredDataContent,title:i.title,template:i.template,headerTheme:i.headerTheme,footerTheme:i.footerTheme,theme:i.theme},e.createElement(e.Fragment,null,!!a&&e.createElement(te,null,e.createElement(nt,Object.assign({libComponents:c},a))),e.createElement(g,Object.assign({},i.template)),!!o&&e.createElement(te,null,e.createElement(nt,Object.assign({libComponents:c},o)))))}function pt(t){const{isPage:r=!1}=t,i=n(t,["isPage"]),o=i,a=i;return r?e.createElement(gt,Object.assign({},o)):e.createElement(ut,Object.assign({},a))}const ft=e=>e,mt=e=>e,vt=e=>e,ht=e=>e,bt=e=>e,yt=e=>e,jt=e=>e,Ot=e=>e,St=e=>e,wt=e=>e,$t=e=>e,Et=e=>e,xt=e=>e,kt=e=>e,Lt=e=>e,It=e=>e;function _t({area:e,description:t,fullData:n,instantNotification:i=!1,level:o,publicApiUrl:a}){return r(this,void 0,void 0,(function*(){const r=`${a}/alert`,l={level:o,area:e,description:t,fullData:n,instantNotification:i},s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)};try{yield fetch(r,s)}catch(e){console.error("Error creating Griddo alert:",e)}}))}var Ct=Object.freeze({__proto__:null}),Ut=Object.freeze({__proto__:null}),zt=Object.freeze({__proto__:null}),Pt=Object.freeze({__proto__:null}),Rt=Object.freeze({__proto__:null}),qt=Object.freeze({__proto__:null}),Nt=Object.freeze({__proto__:null});export{qe as CloudinaryBackgroundImage,Ze as CloudinaryImage,nt as Component,Ut as Core,Ct as Fields,it as GriddoBackgroundImage,ot as GriddoImage,at as GriddoImageExp,st as GriddoLink,ct as LdJson,dt as Link,gt as Page,zt as PageContentTypeFields,_ as PageContext,C as PageProvider,pt as Preview,qt as Schema,ne as SessionContext,re as SessionProvider,Pt as SimpleContentTypeFields,L as SiteContext,I as SiteProvider,Nt as Theme,Rt as UIFields,ht as createCategoryContentTypeSchema,ft as createComponentSchema,bt as createDamDefaultsSchema,yt as createDataPackCategorySchema,jt as createDataPackSchema,Ot as createFooterSchema,St as createHeaderSchema,wt as createLanguagesSchema,$t as createMenuSchema,Et as createModuleCategoriesSchema,xt as createModuleSchema,vt as createPageContentTypeSchema,mt as createSimpleContentTypeSchema,kt as createTemplateSchema,Lt as createThemesSchema,It as createTranslationsSchema,ke as formatLocaleDate,tt as getComponent,N as getLang,q as getSiteID,R as getToken,_t as griddoAlertRegister,Z as useContentType,Q as useContentTypeNavigation,ae as useDataFilters,Y as useDistributorData,u as useGlobalTheme,ce as useGriddoImage,pe as useGriddoImageExp,ve as useI18n,be as useImage,je as useIsClient,Oe as useIsFirstRender,Se as useLink,we as useList,$e as useListWithDefaultStaticPage,xe as useLocaleDate,Ie as useNavigation,U as usePage,Y as useReferenceFieldData,Pe as useSSR,Ce as useScript,Ue as useSession,oe as useSite,ze as useSitemap,g as useTheme,S as useThemeColors,$ as useThemeFont,w as useThemePrimitives};
|
|
1
|
+
import*as e from"react";import t from"react";function n(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function i(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((i=i.apply(e,t||[])).next())}))}var r={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"faces:center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function o(e){return null==e?void 0:e.toString().split(/cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%/)[0]}function a(e){return Object.fromEntries(Object.entries(e).filter((e=>e[1])))}function l(e){var t;const{damId:i,imageConfig:r}=e,l=n(e,["damId","imageConfig"]),s=(c=r,d=l,Object.assign(Object.assign({},a(c)),a(d)));var c,d;const u=s.crop?`c/${s.crop}`:"",g=s.quality?`q/${s.quality}`:"",p=s.format?`f/${s.format}`:"",f=`${u}/${g}/${s.width?`w/${o(s.width)}`:""}/${s.height?`h/${o(s.height)}`:""}/${s.position?`p/${s.position}`:""}/${(null===(t=s.transforms)||void 0===t?void 0:t.length)?`t/${s.transforms}`:""}/${p}`;return function(e){const[t,n]=e.split(/(^https?:\/\/|^\/\/)/).filter(Boolean);return`${t}${null==n?void 0:n.replace(/\/\/+/g,"/").replace(/\/$/,"")}`}(`${r.domain}/${f}/${i}`)}function s(e){return e&&"string"==typeof e?e.split(/(^[http:|https:|\/\/]*[\S][^\/]*)/)[1]:e}function c(e){if(e&&"string"==typeof e){return e.split("/").filter(Boolean).slice(-1)[0]}return e}const d=()=>Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,8);function u(e){return e.global}function g(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const i=e.themes.find((e=>e.id===t.theme));i&&n.push(i)}else n.push(...e.themes);return 1===n.length?n[0]:n}const p=e=>{const t={},n=e=>{e.forEach((e=>{e.values.forEach((({cssVar:e,value:n})=>{t[e]=n}))}))};return Array.isArray(e)?n(e):Object.values(e).forEach((e=>{n(e)})),t},f=(e,t)=>e.map((e=>Object.assign(Object.assign({},e),{values:e.values.map((e=>([...e.value.matchAll(/var\((.*?)\)/g)].forEach((n=>{n.length>=2&&(e.value=e.value.replace(n[0],t[n[1]]))})),Object.assign({},e)))).filter((({value:e})=>CSS.supports("color",e)))}))).filter((e=>e.values.length)),m=e=>{const t=(e=>{let t=Object.assign({},p(e.primitives));return"subthemes"in e&&e.subthemes&&e.subthemes.forEach((e=>{t=Object.assign(Object.assign({},t),p(e.primitives))})),t})(e);if(Array.isArray(e.primitives))return f(e.primitives,t);const{common:n,light:i,dark:r}=e.primitives;return{common:n&&f(n,t),light:f(i,t),dark:f(r,t)}},v=(e,t)=>e.filter((e=>Array.isArray(t)?t.includes(e.id):e.id===t)),h=(e,t)=>{if(Array.isArray(e.primitives))return v(e.primitives,t);const{common:n,light:i,dark:r}=e.primitives;return{common:n&&v(n,t),light:v(i,t),dark:v(r,t)}},b=e=>{if(Array.isArray(e.primitives))return e.primitives.length;const{common:t,light:n,dark:i}=e.primitives;return(null==t?void 0:t.length)||n.length||i.length},y=(e,t,n)=>{const i=void 0===n;return e.map((e=>Object.assign(Object.assign({},e),{primitives:i?m(e):h(e,n),subthemes:"subthemes"in e&&e.subthemes&&e.subthemes.map((e=>Object.assign(Object.assign({},e),{primitives:i?m(e):h(e,n)}))).filter((e=>b(e)&&(!t||e.id===t)))||[]}))).filter((e=>b(e)||e.subthemes.length))},j=(e,t,n)=>y(e,n,t),w=(e,t)=>y(e,t);function O(e,t){const n=[];if((null==t?void 0:t.global)&&n.push(e.global),null==t?void 0:t.theme){const i=e.themes.find((e=>e.id===t.theme));i&&n.push(i)}else n.push(...e.themes);return w(n,null==t?void 0:t.subtheme)}function S(e,t){const n=[],{global:i,primitive:r,subtheme:o}=t;if(i&&n.push(e.global),t.theme){const i=e.themes.find((e=>e.id===t.theme));i&&n.push(i)}else n.push(...e.themes);return j(n,r,o)}function $(e,t){return S(e,Object.assign(Object.assign({},t),{primitive:["fontFamily","fontSize"]}))}const x=e.createContext({translations:{}});function E(t){const{children:n,translations:i}=t;return e.createElement(x.Provider,{value:{translations:i}},n)}const k={linkComponent:function(t){const{children:i}=t,r=n(t,["children"]);return e.createElement("a",Object.assign({"data-griddo":"link"},r),i)},navigate:()=>null},L=e.createContext(k);function I(t){const{children:i}=t,r=n(t,["children"]),o=Object.assign(Object.assign({},k),r);return e.createElement(L.Provider,{value:o},i)}const C=e.createContext({});function z(t){const{children:i}=t,r=n(t,["children"]),o=e.useContext(L),a=null==o?void 0:o.translations;return e.createElement(C.Provider,{value:Object.assign({},r)},e.createElement(E,{translations:a},i))}function _(){var t,n;const i=e.useContext(C);if(!i)return console.warn("Griddo: You forgot to put <PageProvider>."),{};const r=null===(t=i.pageLanguages)||void 0===t?void 0:t.filter((e=>e.isLive)),o=null===(n=i.pageLanguages)||void 0===n?void 0:n.find((e=>e.languageId===i.languageId)),a=null==o?void 0:o.locale,l=null==o?void 0:o.locale.replace("_","-");return Object.assign(Object.assign({},i),{pageLanguages:r,locale:a,ISOLocale:l})}const U="undefined"!=typeof window;function P(e,t){return(null==t?void 0:t.startsWith(`${e}#`))?`#${t.split("#")[1]}`:t}function q(){const e=localStorage.getItem("persist:app");if(!e||!U)return null;const t=JSON.parse(e);let{token:n}=t;n=JSON.parse(n);return{Authorization:`bearer ${n}`}}function R(){var e;const t=localStorage.getItem("persist:root");if(!U||!t)return 1;const n=JSON.parse(t);let{sites:i}=n;i=JSON.parse(i);return null===(e=i.currentSiteInfo)||void 0===e?void 0:e.id}function N(){const e=localStorage.getItem("langID");return!(!U||!e)&&parseInt(e)}function A({obj:e,searchKey:t,resultsBuffer:n=[],unique:i=!0}={}){if(!e)return[];const r=n;return Object.keys(e).forEach((n=>{const i=e[n];n===t&&"object"!=typeof i?r.push(i):"object"==typeof i&&i&&A({obj:i,searchKey:t,resultsBuffer:r})})),i?[...new Set(r)]:r}function D({baseUrl:e,params:t}){const n=Object.keys(t).map((e=>function(e){return Array.isArray(e)&&e.length>0||"number"==typeof e||"string"==typeof e&&!!e}(t[e])?`${e}/${t[e]}`:"")).join("/");return`${e}${i=n,i.split("/").filter(Boolean).join("/")}`;var i}function T(e,t){const n=t||N();return{method:"POST",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:null==n?void 0:n.toString()},q()),redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(e)}}function F(e){return!!e&&e.every((e=>"number"==typeof e))}function M(e){return Array.isArray(e)&&F(e)}function B(e){return Array.isArray(e)&&!F(e)}function H(e){return!M(e)&&!B(e)}function J(e){if(!e)return;const t=e?e.reduce(((e,t)=>{const{source:n,id:i}=t;return e[n]||(e[n]=[]),e[n].push(i),e}),{}):{};return Object.keys(t).map((e=>`${e}:${t[e]}`)).join(";")}function G(e){return null==e?void 0:e.join(",")}function V(e){const t=[];for(const n in e){e[n].items.forEach((e=>{t.push({id:e.id,label:e.label,source:n})}))}return J(t)}function W(e){return!!e&&["or","and"].includes(e.toLowerCase())}function K(e){return"boolean"==typeof e?e?"simple":"off":"off"===e||"simple"===e||"full"===e?e:"off"}function Y(t){const[n,i]=e.useState(null),{order:r,quantity:o,source:a,mode:l,fixed:s,filter:c,allLanguages:d,preferenceLanguage:u,fullRelations:g=!1,filterOperator:p="OR",globalOperator:f="AND",site:m,lang:v}=t||{},{apiUrl:h}=_();return e.useEffect((()=>{const e=!!(v||N()),t=m||R()||"global",n=`${h}/site/${t}/distributor`,b=T("auto"===l?{mode:l,order:r,quantity:o,source:a,filter:c,fullRelations:g,allLanguages:d,preferenceLanguage:u,filterOperator:p,globalOperator:f}:{mode:l,fixed:s,fullRelations:g},v);e&&fetch(n,b).then((e=>e.json())).then((e=>i(e))).catch((e=>{console.error("Error:",e)}))}),[l,r,o,s,c,a,g,d,u,p,f,m,v]),n}function Z({data:e,queriedData:t}){return e&&Y(e)||t}function Q(t){const[n,i]=e.useState({previous:[],next:[],error:void 0}),{apiUrl:r,canonicalSite:o,structuredDataContent:a}=_(),{order:l="recent-asc",quantity:s=1,fullRelations:c=!1,referenceId:d=(null==a?void 0:a.id)}=t||{};return e.useEffect((()=>{const e=!!N(),t=R()||o||"global",n=`${r}/site/${t}/distributor`,a=T({mode:"navigation",order:l,quantity:s,fullRelations:c,referenceId:d});e&&fetch(n,a).then((e=>e.json())).then((e=>i(e))).catch((e=>{console.error("Error:",e)}))}),[l,s,c,d]),n}function X(t){const[n,i]=e.useState(),[r,o]=e.useState(!0),[a,l]=e.useState(!1),[s,c]=e.useState(!0),[d,u]=e.useState({});return e.useEffect((()=>{t&&(o(!0),fetch(t).then((e=>{if(c(!1),200!==e.status)throw o(!1),l(!0),u({code:e.status,msg:e.statusText}),new Error(e.statusText);return e.json()})).then((e=>{i(e)})).finally((()=>{o(!1),l(!1)})).catch((()=>{l(!0)})))}),[t]),{data:n,isLoading:r,isError:a,isFirstFetch:s,msg:d}}const ee=e.createContext(null);function te(t){return e.createElement(ee.Provider,{value:{isNavigation:!0}},t.children)}const ne=t.createContext([{},()=>null]),ie=e=>{const{children:n}=e,i=re();return t.createElement(ne.Provider,{value:i},n)},re=()=>{const[e,n]=t.useState({});return[e,e=>n((t=>Object.assign(Object.assign({},t),e)))]},oe=()=>e.useContext(L);function ae(){const{publicApiUrl:t,siteId:n,renderer:i}=oe(),{languageId:r}=_(),[o,a]=e.useState(),l="editor"===i;const{isError:s,isLoading:c,msg:d,data:u,isFirstFetch:g}=X(null==o?void 0:o.queryUrl);return[{query:u,isLoading:c,isError:s,msg:d,isFirstFetch:g},function({apiUrl:e=`${t}`,cached:i,data:o,lang:s=r,site:c=n}){if(!o)return;const d=l?(new Date).valueOf():i,u=D({baseUrl:`${e}/filters/${`${o.source||o.fixed}/`}`,params:{site:c,lang:s,related:(g=o.related,"number"==typeof g?g:M(g)?G(g):B(g)?J(g):H(g)?V(g):void 0),allLanguages:o.allLanguages?"on":"off",filterOperator:o.filterOperator,globalOperator:o.globalOperator,cached:d,order:o.order}});var g;a({queryUrl:u})}]}const le={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},se={quality:75,crop:"cover",loading:"lazy",decoding:"auto",blurSize:"8px",blurCSSTransition:"filter 0s ease-in-out",formats:["webp"]};function ce(t){var{url:i}=t,r=n(t,["url"]);if(!i)return{};const a=e.useContext(L),d=(null==a?void 0:a.griddoDamDefaults)||{},u=s(i),g=c(i),p=Object.assign(Object.assign(Object.assign(Object.assign({},se),d),r),{format:"jpeg",domain:u});void 0===p.responsive&&(p.responsive=[{width:p.width,height:p.height,quality:p.quality,crop:p.crop,position:p.position,transforms:p.transforms}]);const f=p.responsive.map((({width:e,height:t,quality:n,crop:i,position:r,transforms:a})=>`${l({damId:g,imageConfig:p,quality:n,crop:i,width:e,height:t,position:r,transforms:a})} ${e?`${o(e)}w`:""}`.trim())),m=function(e){const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(p.responsive.reverse()).map(((e,t)=>p.responsive&&t<p.responsive.length-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`)).join(", "),v=f.map((e=>null==e?void 0:e.split(" ")[0])),h=p.responsive[0],b=`${l(Object.assign({damId:g,imageConfig:p},h))}`;return{type:(null==p?void 0:p.format)?le[null==p?void 0:p.format]:le.jpeg,srcSet:f,srcSetURL:v,src:b,sizes:m,webpFallback:de({srcSet:f,srcSetURL:v,format:"jpeg"}),jpeg:de({srcSet:f,srcSetURL:v,format:"jpeg"}),webp:de({srcSet:f,srcSetURL:v,format:"webp"}),avif:de({srcSet:f,srcSetURL:v,format:"avif"}),png:de({srcSet:f,srcSetURL:v,format:"png"}),gif:de({srcSet:f,srcSetURL:v,format:"gif"}),svg:de({srcSet:f,srcSetURL:v,format:"svg"})}}function de({srcSet:e,srcSetURL:t,format:n}){return{type:le[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}const ue={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"},ge={quality:75,crop:"cover",loading:"lazy",decoding:"auto",formats:["webp"]};function pe(e){var t,{url:i}=e,r=n(e,["url"]);if(!i)return{};const{griddoDamDefaults:a}=oe(),d=s(i),u=c(i),g=Object.assign(Object.assign(Object.assign(Object.assign({},ge),a),r),{domain:d,format:"jpeg"}),p=me((null==r?void 0:r.width)||"1x")/me((null==r?void 0:r.height)||"1px"),f=Array.isArray(g.widths)&&g.widths.length||void 0!==g.widths?null===(t=g.widths)||void 0===t?void 0:t.map((e=>{const t=l({damId:u,imageConfig:g,width:e,height:g.height?`${Math.round(me(e)/p)}px`:void 0}),n=e?`${o(e)}w`:"";return g.width?`${t} ${n}`.trim():""})):[l({damId:u,imageConfig:g,width:g.width,height:g.height?`${Math.round(me(g.width||"1px")/p)}px`:void 0})],m=null==f?void 0:f.map((e=>null==e?void 0:e.split(" ")[0])),v=`${l({damId:u,imageConfig:g})}`;return{type:(null==g?void 0:g.format)?ue[null==g?void 0:g.format]:ue.jpeg,srcSet:f,srcSetURL:m,src:v,webpFallback:fe({srcSet:f,srcSetURL:m,format:"jpeg"}),jpeg:fe({srcSet:f,srcSetURL:m,format:"jpeg"}),webp:fe({srcSet:f,srcSetURL:m,format:"webp"}),avif:fe({srcSet:f,srcSetURL:m,format:"avif"}),png:fe({srcSet:f,srcSetURL:m,format:"png"}),gif:fe({srcSet:f,srcSetURL:m,format:"gif"}),svg:fe({srcSet:f,srcSetURL:m,format:"svg"})}}function fe({srcSet:e,srcSetURL:t,format:n}){return{type:ue[n],srcSet:null==e?void 0:e.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`))),srcSetURL:null==t?void 0:t.map((e=>null==e?void 0:e.replace(/f\/\w+/,`f/${n}`)))}}function me(e){const t=e.match(/^-?\d*\.?\d+/);return t?parseFloat(t[0]):0}function ve(t){const n=null==t?void 0:t.locale,i=e.useContext(x),{siteLangs:r}=oe(),{languageId:o}=_(),a=null==i?void 0:i.translations;a||console.warn("Griddo: <SiteProvider> needs to have the prop translations"),void 0===r&&console.warn("Griddo: <SiteProvider> needs to have the prop siteLangs set with the site languages"),o||console.warn("Griddo: <PageProvider> needs to have the prop languageId set with the page language id"),function(e,t){return!!(null==e?void 0:e.find((e=>e.id===t)))}(r,o)||console.warn(`Griddo: languageId ${o} doesn't exist in this site`),void 0===n||function(e,t){return!!(null==e?void 0:e.find((e=>(null==e?void 0:e.locale)===t)))}(r,n)||console.warn(`Griddo: locale ${n} doesn't exist in this site`);const l=n||function(e,t){var n;return null===(n=null==e?void 0:e.find((e=>e.id===t)))||void 0===n?void 0:n.locale}(r,o),s=a&&l?a[l]:void 0;return l&&o||console.warn("Griddo: You forgot to put <I18nProvider> or exists an error in language id."),{getTranslation:(e,t="")=>s&&s[e]?s[e]:t,getNestedTranslation:(e,t="")=>s&&function(e,t){const n=null==e?void 0:e.split(".").reduce(((e,t)=>e[t]?e[t]:""),t);return n}(e,s)||t}}const he={domain:"https://res.cloudinary.com",uploadFolder:"image/upload",fallback404ImageId:"dx-placeholders/fallback-404-image",quality:51,crop:"fill",gravity:"center",format:"auto",loading:"lazy",backgroundLazy:!1,decoding:"auto",responsive:[{breakpoint:null,width:"320px"}]};function be(e){var t,i,{publicId:r}=e,a=n(e,["publicId"]);const{cloudinaryCloudName:l,cloudinaryDefaults:s}=oe(),c=Object.assign(Object.assign(Object.assign({},he),s),a),d=`${c.domain}/${l}/${c.uploadFolder}`,u=`${ye({root:d,imageConfig:Object.assign(Object.assign({},c),{quality:20,width:"512"})})}/${c.fallback404ImageId}`,g=null===(t=null==c?void 0:c.responsive)||void 0===t?void 0:t.map((({width:e,height:t,quality:n,crop:i})=>`${ye({root:d,imageConfig:Object.assign({quality:n,crop:i,width:e,height:t},c)})}/${r} ${o(e)}w`)),p=function(e){if(!e)return[];const t=e.filter((e=>null===e.breakpoint));return[...e.filter((e=>null!==e.breakpoint)),...t]}(null===(i=null==c?void 0:c.responsive)||void 0===i?void 0:i.reverse()).map(((e,t)=>{var n;return c.responsive&&t<(null===(n=null==c?void 0:c.responsive)||void 0===n?void 0:n.length)-1?`(min-width: ${e.breakpoint}) ${e.width}`:`${e.width}`})).join(", "),f=null==g?void 0:g.map((e=>e.split(" ")[0])),m=(null==c?void 0:c.responsive)&&(null==c?void 0:c.responsive[0])||[];return{src:`${ye(Object.assign({root:d,imageConfig:c},m))}/${r}`,srcSet:g,sizes:p,fallbackSrcImage:u,srcSetURL:f}}function ye(e){const{root:t,imageConfig:n}=e,i=(null==n?void 0:n.crop)?`c_${n.crop}`:"",r=(null==n?void 0:n.quality)?`q_${n.quality}`:"",a=(null==n?void 0:n.gravity)?`g_${n.gravity}`:"",l=(null==n?void 0:n.format)?`f_${n.format}`:"",s=(null==n?void 0:n.width)?`w_${o(n.width)}`:"",c=(null==n?void 0:n.height)?`h_${o(n.height)}`:"",d=(null==n?void 0:n.ar)?`ar_${n.ar}`:"";return`${t}/${`${i},${a},${l},${r},${s},${c},${d}`.split(/._null|._undefined|,{1,}|._,|._$|undefined|null/).filter(Boolean).join(",")}`}function je(){const[t,n]=e.useState(!1);return e.useEffect((()=>{n(!0)}),[]),t}function we(){const t=e.useRef(!0);return t.current?(t.current=!1,!0):t.current}function Oe(){const t=e.useContext(L);return null==t?void 0:t.linkComponent}function Se(){const{publicApiUrl:t,siteId:n,renderer:i}=oe(),{languageId:r}=_(),[o,a]=e.useState(),l="editor"===i;const{isError:s,isLoading:c,msg:d,data:u,isFirstFetch:g}=X(null==o?void 0:o.queryUrl);return[{query:u,isLoading:c,isError:s,msg:d,isFirstFetch:g},function({apiUrl:e=`${t}`,cached:i,data:o,exclude:s,fields:c,filterIds:d,filterOperator:u,globalOperator:g,items:p=10,operator:f,page:m=1,relations:v,search:h,includePending:b,allLanguages:y,preferenceLanguage:j}){var w;if(!o)return;const O=l?(new Date).valueOf().toString():i,S=null==h?void 0:h.replace(/\s/g,"+"),$="auto"===o.mode,x="manual"===o.mode,E="navigation"===o.mode,k=o.source||o.fixed||`reference/${o.referenceId}`||[],L=D({baseUrl:`${e}${$?"/list/":x?"/list/fixed/":E?"/list/navigations/":""}${k}/`,params:{site:o.site||n,lang:o.lang||r,get:c,page:m,items:p,order:$||E?o.order:void 0,filter:(I=d||o.filter,M(I)?G(I):B(I)?J(I):H(I)?V(I):void 0),maxItems:o.quantity,search:S,operator:W(f)?f:void 0,filterOperator:W(u)?u:void 0,globalOperator:W(g)?g:void 0,exclude:Array.isArray(s)?s:void 0,relations:K(v),includePending:b?"on":void 0,allLanguages:y?"on":void 0,preferenceLanguage:j?"true":void 0,cached:O}});var I;x&&Array.isArray(k)&&k.length<1&&a({queryUrl:void 0,extra:void 0}),a({queryUrl:L,extra:{totalItems:"manual"===o.mode&&(null===(w=o.fixed)||void 0===w?void 0:w.length)}})}]}function $e(e){const{items:t,queriedData:n,fields:i,page:r}=e,[{isError:o,isLoading:a,msg:l,query:s,isFirstFetch:c},d]=Se(),u={page:r||1,totalItems:null==n?void 0:n.length,totalPages:(null==n?void 0:n.length)&&t&&Math.ceil((null==n?void 0:n.length)/t),items:null==n?void 0:n.slice(0,t||10).map((e=>Object.assign({id:e.id},function(e,t){if(e)return t?Object.fromEntries(Object.keys(e).map((n=>(null==t?void 0:t.includes(n))&&[n,e[n]])).filter(Boolean)):e}(e.content,i))))};return[{isError:o,isLoading:a,msg:l,isFirstFetch:c,query:(s?Object.assign(Object.assign({},s),{totalPages:t&&(null==s?void 0:s.totalItems)&&Math.ceil((null==s?void 0:s.totalItems)/t)}):void 0)||u},d]}const xe="Invalid Date";function Ee(e,t={dateStyle:"long"}){const{ISOLocale:n}=_();return e?ke(e,n||"en-US",t):{date:void 0,dateTime:void 0}}function ke(e,t,n={dateStyle:"long"}){if(!Le)return{date:e,dateTime:""};const i=new Date(e);if(isNaN(i.getTime()))return{date:xe,dateTime:xe};return{date:i.toLocaleDateString(t,n),dateTime:e.replaceAll("/","-")}}function Le(e){return Intl.DateTimeFormat.supportedLocalesOf(e,{dateStyle:"long"}).length>0}function Ie(){return e.useContext(ee)}const Ce={};function ze(t,n){const[i,r]=e.useState((()=>{var e;return!t||(null==n?void 0:n.shouldPreventLoad)?"idle":"undefined"==typeof window?"loading":null!==(e=Ce[t])&&void 0!==e?e:"loading"}));return e.useEffect((()=>{var e,i;if(!t||(null==n?void 0:n.shouldPreventLoad))return;const o=Ce[t];if("ready"===o||"error"===o)return void r(o);const a=function(e){const t=document.querySelector(`script[src="${e}"]`),n=null==t?void 0:t.getAttribute("data-status");return{node:t,status:n}}(t);let l=a.node;if(l)r(null!==(i=null!==(e=a.status)&&void 0!==e?e:o)&&void 0!==i?i:"loading");else{l=document.createElement("script"),l.src=t,l.async=!0,l.setAttribute("data-status","loading"),document.body.appendChild(l);const e=e=>{const t="load"===e.type?"ready":"error";null==l||l.setAttribute("data-status",t)};l.addEventListener("load",e),l.addEventListener("error",e)}const s=e=>{const n="load"===e.type?"ready":"error";r(n),Ce[t]=n};return l.addEventListener("load",s),l.addEventListener("error",s),()=>{l&&(l.removeEventListener("load",s),l.removeEventListener("error",s)),l&&(null==n?void 0:n.removeOnUnmount)&&l.remove()}}),[t,null==n?void 0:n.shouldPreventLoad,null==n?void 0:n.removeOnUnmount]),i}const _e=()=>t.useContext(ne);function Ue(){const[t,n]=e.useState(),[r,o]=e.useState(!0),{apiUrl:a,header:l,footer:s,fullPath:c}=_(),{siteMetadata:d}=oe();e.useEffect((()=>{u()}),[]);const u=()=>i(this,void 0,void 0,(function*(){var e,t,i;const r={};if(r.topMenu=[{label:null==d?void 0:d.title,children:null===(e=l.topMenu)||void 0===e?void 0:e.elements,url:{linkToURL:!!c&&`${c.domainUrl}${c.site}`}}],!d){const e=R(),t=`${a}/site/${e}`,n=yield fetch(t,function(){const e=N();return{method:"GET",mode:"cors",cache:"no-cache",headers:Object.assign({"Content-Type":"application/json",lang:e},q())}}()),{name:i}=yield n.json();r.topMenu[0].label=i,r.siteName=i}r.mainMenu=null===(t=null==l?void 0:l.mainMenu)||void 0===t?void 0:t.elements;const u=null===(i=null==s?void 0:s.legalMenu)||void 0===i?void 0:i.elements;r.footerMenu=[{label:null,children:u}],r.header=l,r.footer=s,n(r),o(!1)}));return[t,r]}function Pe(){const e="undefined"!=typeof window&&window.document&&window.document.documentElement;return{isBrowser:e,isServer:!e}}function qe(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}function Re(t){var{backgroundRepeat:i="no-repeat",backgroundSize:o="cover",backgroundPosition:a="50% 50%",children:l,overlayColor:s=null,overlayOpacity:c=0,overlayTransition:u="2s",ratio:g,publicId:p,src:f,customLazyClassName:m="lazy",lazy:v}=t,h=n(t,["backgroundRepeat","backgroundSize","backgroundPosition","children","overlayColor","overlayOpacity","overlayTransition","ratio","publicId","src","customLazyClassName","lazy"]);const{cloudinaryDefaults:b}=oe(),y=Object.assign(Object.assign(Object.assign(Object.assign({},b),r),h),{backgroundLazy:b.backgroundLazy||r.backgroundLazy||v}),{srcSetURL:j}=be({responsive:[...y.responsive],quality:y.quality,crop:y.crop,gravity:y.gravity,format:y.format,publicId:p,ar:g}),w=f?[f]:j,O=f?[]:y.responsive.map((e=>e.breakpoint)),S=`Griddo-BgImage--${d()}`,$=y.backgroundLazy?m:"",x=function(e,t=0){return Array(e).fill(0).map(((e,n)=>n+t))}(w.length-1,1).map((e=>`@media (min-width: ${O[e]}) {\n .${S} {\n background-image: url(${w[e]});\n }\n }\n `)).join("");return e.createElement(e.Fragment,null,e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n\n .${S} {\n background-repeat: ${i};\n background-position: ${a};\n background-size: ${o};\n background-image: url(${w[0]});\n }\n\n ${x}\n\n .${S}::before {\n transition: all ${u} ease;\n background-color: rgba(0, 0, 0, ${c});\n ${s?`\n background-color: ${s};\n opacity: ${c};\n `:""}\n }`}}),e.createElement("div",{className:`Griddo-BgImage ${S} ${$}`},l))}function Ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ae(e,t){return e(t={exports:{}},t.exports),t.exports}qe('.Griddo-BgImage {\n\tdisplay: flex;\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n}\n\n.Griddo-BgImage::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n}\n\n.Griddo-BgImage.lazy {\n\tbackground-image: none;\n}\n');var De=Symbol.for("react.element"),Te=Symbol.for("react.fragment"),Fe=Object.prototype.hasOwnProperty,Me=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Be={key:!0,ref:!0,__self:!0,__source:!0};function He(e,t,n){var i,r={},o=null,a=null;for(i in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)Fe.call(t,i)&&!Be.hasOwnProperty(i)&&(r[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===r[i]&&(r[i]=t[i]);return{$$typeof:De,type:e,key:o,ref:a,props:r,_owner:Me.current}}var Je={Fragment:Te,jsx:He,jsxs:He},Ge=Ae((function(e){e.exports=Je})),Ve=Ae((function(e,n){n.__esModule=!0,n.default=void 0;var i=["className","children","ratio","style"];function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r.apply(this,arguments)}var o="--aspect-ratio";class a extends t.Component{constructor(){super(...arguments),this.node=null,this.setNode=e=>{this.node=e}}componentDidUpdate(){if(this.node){var{node:e}=this;e.style.getPropertyValue(o)||e.style.setProperty(o,"("+this.props.ratio+")")}}render(){var e=this.props,{className:t,children:n,ratio:a,style:l}=e,s=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,i),c=r({},l,{[o]:"("+a+")"});return(0,Ge.jsx)("div",r({className:t,ref:this.setNode,style:c},s,{children:n}))}}a.defaultProps={className:"react-aspect-ratio-placeholder",ratio:1};var l=a;n.default=l}));Ne(Ve);var We=Ae((function(e,t){t.__esModule=!0,t.default=void 0;var n=["className","children","ratio","style"];function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},i.apply(this,arguments)}var r="--aspect-ratio",o="react-aspect-ratio-placeholder";var a=function(e){var{className:t=o,children:a,ratio:l=1,style:s}=e,c=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,n),d=i({},s,{[r]:"("+l+")"});return(0,Ge.jsx)("div",i({className:t,style:d},c,{children:a}))};t.default=a}));Ne(We);var Ke=Ae((function(e,t){t.__esModule=!0,t.default=t.AspectRatio=void 0;var n=r(Ve),i=r(We);function r(e){return e&&e.__esModule?e:{default:e}}var o=n.default;t.default=o;var a=i.default;t.AspectRatio=a}));Ne(Ke);var Ye=Ke.AspectRatio;function Ze(t){const{alt:n,width:i,height:o,ratio:a,fixed:l,publicId:s,src:c,objectFit:d="cover"}=t,{cloudinaryDefaults:u}=oe(),g=Object.assign(Object.assign(Object.assign({},r),u),t),{srcSet:p,sizes:f,src:m}=be({crop:g.crop,format:g.format,gravity:g.gravity,quality:g.quality,sizes:g.sizes,responsive:g.responsive,ar:a,publicId:s}),v={alt:n,width:i,height:o,loading:g.loading,style:{objectFit:d},decoding:g.decoding},h=Object.assign(Object.assign({},v),{src:c}),b=Object.assign(Object.assign({},v),{srcSet:p,sizes:f,src:m}),y=c?h:b,j=()=>e.createElement("img",Object.assign({},y));return l?e.createElement(j,null):e.createElement(Ye,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(j,null))}qe('[style*="--aspect-ratio"] > img {\n height: auto;\n}\n\n[style*="--aspect-ratio"] {\n position: relative;\n}\n\n[style*="--aspect-ratio"] > :first-child {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n}\n\n[style*="--aspect-ratio"]::before {\n content: "";\n display: block;\n width: 100%;\n}\n\n@supports not (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n height: 0;\n padding-bottom: calc(100% / (var(--aspect-ratio)));\n }\n}\n\n@supports (aspect-ratio: 1/1) {\n [style*="--aspect-ratio"]::before {\n aspect-ratio: calc(var(--aspect-ratio));\n }\n}\n');const Qe=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{d:"M16 9v10H8V9h8zm-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})),Xe=t=>e.createElement("svg",Object.assign({width:24,height:24,fill:"none"},t),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5263 2.3158H4.78947C3.80526 2.3158 3 3.12106 3 4.10527V16.6316H4.78947V4.10527H15.5263V2.3158ZM18.2105 5.89475H8.36842C7.38421 5.89475 6.57894 6.70001 6.57894 7.68422V20.2105C6.57894 21.1947 7.38421 22 8.36842 22H18.2105C19.1947 22 20 21.1947 20 20.2105V7.68422C20 6.70001 19.1947 5.89475 18.2105 5.89475ZM8.36843 20.2105H18.2105V7.68422H8.36843V20.2105Z"}));qe('.--not-selected-nameplate {\n\tdisplay: none;\n}\n\n.--selected,\n.--selected-header-footer,\n.--selected-nameplate {\n\tdisplay: block;\n\tposition: relative;\n}\n\n.--selected-header-footer::before,\n.--selected::before {\n\tposition: absolute;\n\theight: calc(100% - 8px);\n\twidth: calc(100% - 8px);\n\tpadding-bottom: 4px;\n\tcontent: "";\n\tborder: 4px solid rgb(80, 87, 255);\n\tpointer-events: none;\n\tz-index: 99;\n}\n\n.--selected-header-footer::after {\n\tposition: absolute;\n\tpadding: 8px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tcontent: attr(data-text);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n}\n\n.--selected-nameplate {\n\tdisplay: flex;\n\talign-items: center;\n\tposition: absolute;\n\tpadding: 4px 16px;\n\tborder-top-left-radius: 4px;\n\tborder-top-right-radius: 4px;\n\ttop: -34px;\n\tleft: 50%;\n\ttransform: translate(-50%, 0px);\n\tz-index: 9;\n\tbackground: rgb(80, 87, 255);\n\tcolor: rgb(255, 255, 255);\n\tfont-family: "Source Sans Pro", sans-serif;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.span-svg-action {\n\tpadding-left: 4px;\n}\n\n.span-svg-action:first-child {\n\tpadding-left: 16px;\n}\n\n.svg-action {\n\tfill: #dadada;\n}\n\n.svg-action:hover {\n\tfill: #fff;\n\tcursor: pointer;\n}\n');const et=t=>{const n=e.useRef(null),[i,r]=e.useState(0),{selectEditorID:o,moduleActions:a}=e.useContext(L),{selectedEditorID:l,editorID:s,component:c,children:d,isSelectionAllowed:u,type:g}=t,p=!!g&&["header","footer"].includes(g);e.useEffect((()=>{n&&n.current&&r(n.current.scrollHeight)}),[d]),e.useEffect((()=>{v&&m()}),[n]);const f=e=>{(s||0===s)&&"undefined"!=typeof window&&u&&o&&o(t,void 0,e)},m=()=>{if(!n.current)return;const e=n.current.style.position,t=n.current.style.top;n.current.style.position="relative",n.current.style.top="-34px",n.current.scrollIntoView({behavior:"smooth",block:"nearest"}),n.current.style.top=t,n.current.style.position=e;0===n.current.offsetTop&&(n.current.style.marginTop="36px")},v=!!l&&l===s;v&&m();return e.createElement(e.Fragment,null,"Header"===c&&e.createElement("style",{dangerouslySetInnerHTML:{__html:`\n [data-text="Header"].--selected::before {\n height: ${i-8}px;\n }`}}),p&&e.createElement("span",{className:""+(v?"--selected-header-footer":""),"data-text":c,ref:n,onClick:f},d),!p&&e.createElement("span",{className:""+(v?"--selected":""),"data-text":c,ref:n,onClick:f},e.createElement("span",{className:""+(v?"--selected-nameplate":"--not-selected-nameplate")},c,e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.duplicateModuleAction(s)}},e.createElement(Xe,{className:"svg-action"})),e.createElement("span",{className:"span-svg-action",onClick:e=>{e.stopPropagation(),a&&s&&a.deleteModuleAction(s)}},e.createElement(Qe,{className:"svg-action"}))),d))},tt=(e,t)=>{const n=t.component;return void 0!==e[n]?e[n]:(console.warn(`The component <${n}> doesn't exist inside ${JSON.stringify(Object.keys(e))}`),null)};function nt(t){var i,{libComponents:r}=t,o=n(t,["libComponents"]);const{component:a,editorID:l,type:s="",parentEditorID:c}=o,{renderer:d}=oe(),u=null===(i=Ie())||void 0===i?void 0:i.isNavigation,g="undefined"!=typeof window?parseInt(localStorage.getItem("selectedID")||"0"):null,p=tt(r,Object.assign({},o)),f=u&&!["header","footer"].includes(s);return"editor"===d?e.createElement(ie,null,e.createElement(et,{selectedEditorID:g,isSelectionAllowed:!f,editorID:l,component:a,type:s,parentEditorID:c},p?e.createElement(p,Object.assign({},o)):e.createElement(e.Fragment,null))):"preview"===d?e.createElement(ie,null,p&&e.createElement(p,Object.assign({},o))):p&&e.createElement(p,Object.assign({},o))}qe('.griddo-background-image {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\n\tposition: relative;\n\n\tbackground-repeat: no-repeat;\n\tbackground-size: cover;\n\tbackground-position: 50% 50%;\n}\n\n.griddo-background-image--lazy .griddo-background-image {\n\tbackground: none !important;\n}\n\n.griddo-background-image::before {\n\tz-index: 0;\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n\tcontent: "";\n\tdisplay: block;\n\ttransition: all var(--veil-transition-time) var(--veil-transition-easing);\n\tbackground-color: var(--veil-opacity);\n}\n');const it="griddo-background-image--lazy",rt=e.forwardRef((({children:t,format:n,backgroundSize:i,veilOpacity:r=.5,veilColor:o="#000033",veilTransitionTime:a="2s",veilTransitionEasing:d="easing",url:u,src:g,responsive:p,className:f,style:m,quality:v,lazyOffset:h="200px",loading:b},y)=>{const{griddoDamDefaults:j}=oe(),w=e.useRef(null),O=s(u);e.useEffect((()=>{var e;if(IntersectionObserver){if(w.current){let e=new IntersectionObserver((t=>t.forEach((t=>{var n;t.isIntersecting&&(null===(n=w.current)||void 0===n||n.classList.remove(it),e=e.disconnect())}))),{rootMargin:`0px 0px ${h} 0px`});return e.observe(w.current),()=>e=e&&e.disconnect()}}else null===(e=w.current)||void 0===e||e.classList.remove(it)}),[]);const S=p&&Object.fromEntries(Object.keys(p).map((e=>[e,{url:`url("${l({damId:c(u),imageConfig:Object.assign(Object.assign(Object.assign({},j),{quality:v,format:n,domain:O}),p[e])})}")`,customProperty:p[e].customProperty}]))),$=p&&Object.fromEntries(Object.keys(p).map(((e,t)=>[S[e].customProperty?`${S[e].customProperty}`:`--image-${t}`,S[e].url]))),x=g?{"--image-default":`url(${g})`}:$;return e.createElement("div",{ref:w,"data-griddo":"loading-ref",className:`${"lazy"===b?it:""}`},e.createElement("div",{"data-griddo":"image-ref",ref:y,className:`${f} griddo-background-image`,style:Object.assign(Object.assign(Object.assign({},m),{"--veil-opacity":`${o}${Math.round(255/(1/r)).toString(16)}`,"--veil-transition-time":a,"--veil-transition-easing":d,"--background-size":i}),x)},t))}));qe('[style*="--aspect-ratio"] [data-image="griddo"] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\twidth: 100%;\n\tobject-fit: cover;\n}\n');const ot=e.forwardRef(((t,i)=>{var{width:r,height:o,ratio:a,fixed:l,url:s,loading:c,decoding:d,responsive:u,quality:g,crop:p,format:f,formats:m,position:v,transforms:h}=t,b=n(t,["width","height","ratio","fixed","url","loading","decoding","responsive","quality","crop","format","formats","position","transforms"]);if(!s)return null;const{griddoDamDefaults:y}=oe()||{},j={loading:c||(null==y?void 0:y.loading),decoding:d||(null==y?void 0:y.decoding),quality:g||(null==y?void 0:y.quality),crop:p||(null==y?void 0:y.crop),format:f,formats:m||(null==y?void 0:y.formats),position:v,transforms:h},{src:w,sizes:O,avif:S,jpeg:$,gif:x,webp:E,svg:k}=ce({url:s,crop:j.crop,format:j.format,quality:j.quality,responsive:u,position:j.position,transforms:j.transforms,width:r,height:o}),L=()=>{var t;return e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:d||j.decoding,srcSet:u&&(null===(t=null==x?void 0:x.srcSet)||void 0===t?void 0:t.join(",")),sizes:u&&O,src:(null==x?void 0:x.srcSetURL)&&x.srcSetURL[0],width:r,height:o,fetchpriority:b.fetchpriority},b))},I=()=>e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:d||j.decoding,src:(null==k?void 0:k.srcSetURL)&&k.srcSetURL[0],width:r,height:o,fetchpriority:b.fetchpriority},b)),C=()=>{var t,n,a,l,s;return e.createElement("picture",{ref:i},(null===(t=j.formats)||void 0===t?void 0:t.includes("avif"))&&e.createElement("source",{srcSet:null===(n=null==S?void 0:S.srcSet)||void 0===n?void 0:n.join(","),sizes:u&&O,type:"image/avif"}),(null===(a=j.formats)||void 0===a?void 0:a.includes("webp"))&&e.createElement("source",{srcSet:null===(l=null==E?void 0:E.srcSet)||void 0===l?void 0:l.join(","),sizes:u&&O,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:c||j.loading,decoding:d||j.decoding,sizes:u&&O,srcSet:null===(s=null==$?void 0:$.srcSet)||void 0===s?void 0:s.join(","),src:w,width:r,height:o,fetchpriority:b.fetchpriority},b)))};return s?"svg"===f?e.createElement(I,null):"gif"===f?e.createElement(L,null):l||!u?e.createElement(C,null):e.createElement(Ye,{ratio:a||1,style:{maxWidth:"100%",alignSelf:"normal"}},e.createElement(C,null)):null})),at={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",png:"image/png",avif:"image/avif",webp:"image/webp"};function lt(e){const t=e.match(/^-?\d*\.?\d+/);return t?parseFloat(t[0]):0}const st=e.forwardRef(((t,i)=>{var r,a,d,u,g,p,f,m,v,{width:h,height:b,widths:y,loading:j,decoding:w,quality:O,crop:S,format:$,formats:x,position:E,transforms:k,sizes:L,sources:I,image:C}=t,z=n(t,["width","height","widths","loading","decoding","quality","crop","format","formats","position","transforms","sizes","sources","image"]);if(!(null==C?void 0:C.url)&&!I)return null;let _=null==C?void 0:C.url,U=h||(null==C?void 0:C.width)&&`${null==C?void 0:C.width}px`||"",P=b||(null==C?void 0:C.height)&&`${null==C?void 0:C.height}px`||"",q=null==C?void 0:C.position,R=null==C?void 0:C.title,N=null==C?void 0:C.alt;h&&b?(U=h,P=b):!h&&b&&C?(U=`${Math.round(C.width/(C.height/lt(b)))}px`,P=b):h||b||!C?h&&!b&&C?(U=h,P=`${Math.round(C.height/(C.width/lt(h)))}px`):!h||b||C||(U=h,P=""):(U=`${C.width}px`,P=`${C.height}px`);const{griddoDamDefaults:A}=oe(),D=Array.isArray(I)&&I.length>0,T=Object.assign({widths:["640px","750px","828px","1080px","1200px","1920px","2048px","3840px"]},A),F={loading:j||(null==T?void 0:T.loading),decoding:w||(null==T?void 0:T.decoding),quality:O||(null==T?void 0:T.quality),crop:S||(null==T?void 0:T.crop),formats:x||(null==T?void 0:T.formats),widths:y||(null==T?void 0:T.widths),format:$,position:E||q,transforms:k},{src:M,avif:B,jpeg:H,gif:J,webp:G,svg:V}=pe({crop:F.crop,format:F.format,quality:F.quality,position:F.position,transforms:F.transforms,widths:F.widths,width:U,height:P,url:_}),W=I&&function(e){const{griddoDamDefaults:t,sources:n,widths:i,sizes:r,transforms:a,quality:d,width:u,height:g,position:p,crop:f,imageField:m}=e,v=n.map((n=>{var v,h;const b=s((null===(v=n.image)||void 0===v?void 0:v.url)||(null==m?void 0:m.url)||""),y=c((null===(h=n.image)||void 0===h?void 0:h.url)||(null==m?void 0:m.url)||""),j=Object.assign(Object.assign(Object.assign({},t),e),{domain:b,format:"jpeg",transforms:n.transforms||a||void 0,quality:n.quality||d||(null==t?void 0:t.quality),position:n.position||p,crop:n.crop||f});let w=1,O="",S="";if(n.width&&n.height&&(w=lt(n.width)/lt(n.height),O=n.width,S=n.height),(!n.width||!n.height)&&(n.image||m)){const e=n.image||m||{};w=(null==e?void 0:e.width)/(null==e?void 0:e.height),n.width&&!n.height&&(O=n.width,S=`${Math.round(e.height/(e.width/lt(n.width)))}px`),!n.width&&n.height&&(O=`${Math.round(e.width/(e.height/lt(n.height)))}px`,S=n.height)}if(!n.width&&!n.height&&!m){const e=n.image||m||{};u&&g?(w=lt(u)/lt(g),O=u,S=g):(w=e.width/e.height,O=`${e.width}px`,S=`${e.height}px`)}n.width||n.height||!n.image||(w=n.image.width/n.image.height,O=`${n.image.width}px`,S=`${n.image.height}px`);const $=null==i?void 0:i.map((e=>l({damId:y,imageConfig:j,width:e,height:`${Math.round(lt(e)/w)}px`})+` ${o(e)}w`));return{type:at.jpeg,srcSet:$,sizes:n.sizes||r,media:n.media,width:O,height:S,src:l({damId:y,imageConfig:j,width:O||n.width||u,height:S||n.height||g})}}));return{jpeg:v,webp:JSON.parse(JSON.stringify(v).replaceAll("/jpeg","/webp")),avif:JSON.parse(JSON.stringify(v).replaceAll("/jpeg","/avif"))}}({griddoDamDefaults:T,crop:F.crop,quality:F.quality,position:F.position,transforms:F.transforms,widths:F.widths,width:U,height:P,imageField:C,sources:I,sizes:L});return"svg"===$?e.createElement("img",Object.assign({"data-image":"griddo","data-imageformat":"svg",loading:j||F.loading,decoding:w||F.decoding,src:(null==V?void 0:V.srcSetURL)&&V.srcSetURL[0],width:U,height:P,fetchpriority:z.fetchpriority,alt:N,title:R},z)):"gif"===$?e.createElement("img",Object.assign({"data-image":"griddo","data-imageformat":"gif",loading:j||F.loading,decoding:w||F.decoding,srcSet:null===(r=null==J?void 0:J.srcSet)||void 0===r?void 0:r.join(","),sizes:L,src:(null==J?void 0:J.srcSetURL)&&J.srcSetURL[0],width:U,height:P,fetchpriority:z.fetchpriority,alt:N,title:R},z)):D?e.createElement("picture",{"data-testid":"picture","data-artdirection":"true"},(null===(a=F.formats)||void 0===a?void 0:a.includes("avif"))&&(null==W?void 0:W.avif.map(((t,n)=>{var i;return e.createElement("source",{"data-imageformat":"avif",key:n,srcSet:null===(i=t.srcSet)||void 0===i?void 0:i.join(","),sizes:t.sizes,media:t.media,type:"image/avif",width:t.width,height:t.height})}))),(null===(d=F.formats)||void 0===d?void 0:d.includes("webp"))&&(null==W?void 0:W.webp.map(((t,n)=>{var i;return e.createElement("source",{"data-imageformat":"webp",key:n,srcSet:null===(i=t.srcSet)||void 0===i?void 0:i.join(","),sizes:t.sizes,media:t.media,type:"image/webp",width:t.width,height:t.height})}))),null==W?void 0:W.jpeg.map(((t,n)=>{var i;return e.createElement("source",{"data-imageformat":"jpeg",key:n,srcSet:null===(i=t.srcSet)||void 0===i?void 0:i.join(","),sizes:t.sizes,media:t.media,type:"image/jpeg",width:t.width,height:t.height})})),e.createElement("img",Object.assign({"data-image":"griddo",loading:j||F.loading,decoding:w||F.decoding,sizes:L,srcSet:null===(u=null==W?void 0:W.jpeg[0].srcSet)||void 0===u?void 0:u.join(","),src:null==W?void 0:W.jpeg[0].src,width:U||(null==W?void 0:W.jpeg[0].width),height:P||(null==W?void 0:W.jpeg[0].height),fetchpriority:z.fetchpriority,alt:N,title:R},z))):e.createElement("picture",{ref:i,"data-testid":"picture"},(null===(g=F.formats)||void 0===g?void 0:g.includes("avif"))&&e.createElement("source",{srcSet:null===(p=null==B?void 0:B.srcSet)||void 0===p?void 0:p.join(","),sizes:L,type:"image/avif"}),(null===(f=F.formats)||void 0===f?void 0:f.includes("webp"))&&e.createElement("source",{srcSet:null===(m=null==G?void 0:G.srcSet)||void 0===m?void 0:m.join(","),sizes:L,type:"image/webp"}),e.createElement("img",Object.assign({"data-image":"griddo",loading:j||F.loading,decoding:w||F.decoding,sizes:L,srcSet:null===(v=null==H?void 0:H.srcSet)||void 0===v?void 0:v.join(","),src:M,width:U,height:P,fetchpriority:z.fetchpriority,alt:N,title:R},z)))})),ct={pre:"pre",pro:"pro"};function dt(t){var{activeClassName:i="",activeStyle:r={},style:o={},children:a,getProps:l,partiallyActive:s,state:c,url:d,title:u,className:g=""}=t,p=n(t,["activeClassName","activeStyle","style","children","getProps","partiallyActive","state","url","title","className"]);const{renderer:f,linkComponent:m}=oe(),{fullPath:v}=_(),h="editor"===f,b=null==d?void 0:d.href,y=null==d?void 0:d.linkToURL,j=(null==d?void 0:d.newTab)||!1,w=(null==d?void 0:d.noFollow)||!1,O=!(null==d?void 0:d.linkToURL)&&!(null==d?void 0:d.href),S=y===`${null==v?void 0:v.domainUrl}${null==v?void 0:v.compose}`,$=function(e){var t;return(null===(t=null==e?void 0:e.domainUrl)||void 0===t?void 0:t.endsWith(`/${e.domain}`))?ct.pro:ct.pre}(v),x=function(e,t){return`${t?"nofollow":""} ${e?"noreferrer":""}`.trim()}(j,w),E=function(e){return e?"_blank":"_self"}(j),k=v&&function({env:e,fullPath:t,to:n}){var i,r,o;if("string"!=typeof n)return n;if(e===ct.pre){const e=null===(i=null==t?void 0:t.domainUrl)||void 0===i?void 0:i.split((null==t?void 0:t.domain)||"").join("");return(null===(r=null==n?void 0:n.split(e||""))||void 0===r?void 0:r.join(""))||n}return e===ct.pro&&(null===(o=null==n?void 0:n.split((null==t?void 0:t.domainUrl)||""))||void 0===o?void 0:o.join(""))||n}({env:$,fullPath:v,to:y}),L=h||O?"":k;return b||j?e.createElement("a",Object.assign({"data-link":"anchor",target:E,rel:x,href:b||y,className:g,title:u},p),a):e.createElement(m,Object.assign({rel:x,target:E,to:L,getProps:l,partiallyActive:s,state:c,activeStyle:r,activeClassName:i,title:h?k:u,style:S?r:o,className:S?`${g} ${i||""}`.trim():g},p),a)}function ut(t){const{data:n}=t;return e.createElement("script",{dangerouslySetInnerHTML:{__html:`(function(){\n const ldJsonScript = document.createElement('script');\n ldJsonScript.setAttribute('type', 'application/ld+json');\n ldJsonScript.textContent = \`${JSON.stringify(n)}\`;\n document.head.appendChild(ldJsonScript);\n})();`}})}function gt(t){const{url:i,linkProp:r="to",children:o}=t,a=n(t,["url","linkProp","children"]),{fullUrl:l}=_(),s=Oe()||"a",{href:c,to:d}=function(e){const t=null==e?void 0:e.href,n=null==e?void 0:e.linkToURL,i=null==n?void 0:n.match(/^\/{2}|^https?:/g),r=null==n?void 0:n.match(/^\/\w/g);return{href:t||(i?n:null),to:r?n:null}}(i),u=null==i?void 0:i.newTab,g=null==i?void 0:i.noFollow,p=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),u&&{target:"_blank"}),{rel:`${g?"nofollow":""} ${u?"noreferrer":""}`.trim()}),l&&c&&{href:P(l,c)}),l&&d&&{[r]:P(l,d)});return d?e.createElement(e.Fragment,null,e.createElement("p",null,"Router"),e.createElement(s,Object.assign({},p),o)):e.createElement("a",p,o)}function pt(t){const{component:n,content:i,library:{components:r}}=t;return i?e.createElement(nt,Object.assign({libComponents:r,component:n},i)):null}function ft(t){var n;const{apiUrl:i,content:r,footer:o,header:a,languageId:l,library:{templates:s,components:c},pageLanguages:d,siteMetadata:u}=t,g=s[r.template.templateType],p=r.template.heroSection?r.template.heroSection.modules&&r.template.heroSection.modules[0]:void 0,f=p?p.component:void 0,m=A({obj:r.template,searchKey:"component"}),v=Object.keys(null==r?void 0:r.template).filter((e=>(null==r?void 0:r.template[e])&&r.template[e].component)),h=Object.fromEntries(null==v?void 0:v.map((e=>{var t;return[e,null===(t=null==r?void 0:r.template[e].modules)||void 0===t?void 0:t.map((({component:e})=>e))]})));return e.createElement(z,{activeSectionBase:r.template.activeSectionBase,activeSectionSlug:r.template.activeSectionSlug||"/",apiUrl:i,breadcrumb:r.breadcrumb,canonicalSite:r.canonicalSite,componentList:m,dimensions:null===(n=r.dimensions)||void 0===n?void 0:n.values,firstModule:f,footer:o,fullPath:r.fullPath,fullUrl:r.fullUrl,header:a,isHome:r.isHome,languageId:l,modified:r.modified,origin:r.origin,pageLanguages:d,published:r.published,sectionModules:h,site:r.site,siteMetadata:u,siteSlug:r.siteSlug,structuredData:r.structuredData,structuredDataContent:r.structuredDataContent,title:r.title,template:r.template,headerTheme:r.headerTheme,footerTheme:r.footerTheme,theme:r.theme},e.createElement(e.Fragment,null,!!a&&e.createElement(te,null,e.createElement(nt,Object.assign({libComponents:c},a))),e.createElement(g,Object.assign({},r.template)),!!o&&e.createElement(te,null,e.createElement(nt,Object.assign({libComponents:c},o)))))}function mt(t){const{isPage:i=!1}=t,r=n(t,["isPage"]),o=r,a=r;return i?e.createElement(ft,Object.assign({},o)):e.createElement(pt,Object.assign({},a))}function vt({area:e,description:t,fullData:n,instantNotification:r=!1,level:o,publicApiUrl:a}){return i(this,void 0,void 0,(function*(){const i=`${a}/alert`,l={level:o,area:e,description:t,fullData:n,instantNotification:r},s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)};try{yield fetch(i,s)}catch(e){console.error("Error creating Griddo alert:",e)}}))}const ht=e=>e,bt=e=>e,yt=e=>e,jt=e=>e,wt=e=>e,Ot=e=>e,St=e=>e,$t=e=>e,xt=e=>e,Et=e=>e,kt=e=>e,Lt=e=>e,It=e=>e,Ct=e=>e,zt=e=>e,_t=e=>e;var Ut=Object.freeze({__proto__:null}),Pt=Object.freeze({__proto__:null}),qt=Object.freeze({__proto__:null}),Rt=Object.freeze({__proto__:null}),Nt=Object.freeze({__proto__:null}),At=Object.freeze({__proto__:null}),Dt=Object.freeze({__proto__:null});export{Re as CloudinaryBackgroundImage,Ze as CloudinaryImage,nt as Component,Pt as Core,Ut as Fields,rt as GriddoBackgroundImage,ot as GriddoImage,st as GriddoImageExp,dt as GriddoLink,ut as LdJson,gt as Link,ft as Page,qt as PageContentTypeFields,C as PageContext,z as PageProvider,mt as Preview,At as Schema,ne as SessionContext,ie as SessionProvider,Rt as SimpleContentTypeFields,L as SiteContext,I as SiteProvider,Dt as Theme,Nt as UIFields,jt as createCategoryContentTypeSchema,ht as createComponentSchema,wt as createDamDefaultsSchema,Ot as createDataPackCategorySchema,St as createDataPackSchema,$t as createFooterSchema,xt as createHeaderSchema,Et as createLanguagesSchema,kt as createMenuSchema,Lt as createModuleCategoriesSchema,It as createModuleSchema,yt as createPageContentTypeSchema,bt as createSimpleContentTypeSchema,Ct as createTemplateSchema,zt as createThemesSchema,_t as createTranslationsSchema,ke as formatLocaleDate,tt as getComponent,N as getLang,R as getSiteID,q as getToken,vt as griddoAlertRegister,Z as useContentType,Q as useContentTypeNavigation,ae as useDataFilters,Y as useDistributorData,u as useGlobalTheme,ce as useGriddoImage,pe as useGriddoImageExp,ve as useI18n,be as useImage,je as useIsClient,we as useIsFirstRender,Oe as useLink,Se as useList,$e as useListWithDefaultStaticPage,Ee as useLocaleDate,Ie as useNavigation,_ as usePage,Y as useReferenceFieldData,Pe as useSSR,ze as useScript,_e as useSession,oe as useSite,Ue as useSitemap,g as useTheme,O as useThemeColors,$ as useThemeFont,S as useThemePrimitives};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|