@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260326064607 → 0.8.1-dev.20260326104921
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/dist/index.js +1267 -1031
- package/dist/index.mjs +1109 -873
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1242,25 +1242,10 @@ var buttonClasses = /* @__PURE__ */ new Map([
|
|
|
1242
1242
|
["Primary" /* Solid */, "btn-solid"],
|
|
1243
1243
|
["PrimaryHollow" /* Hollow */, "btn-hollow"],
|
|
1244
1244
|
["Link" /* Link */, "btn-link"]
|
|
1245
|
-
// [StyleTypes.Solid, "relative inline-flex items-center justify-center bg-gradient-to-b from-secondary to-secondary-strong rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out text-body hover:bg-secondary-strong"],
|
|
1246
|
-
// [StyleTypes.Solid, "relative inline-flex items-center justify-center bg-neutral-strong rounded px-4 py-3 lg:py-2 font-medium shadow-sm hover:shadow-lg focus:outline-none active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed transition duration-150 ease-in-out text-body hover:bg-neutral-stronger"],
|
|
1247
|
-
// [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-primary border text-primary rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
|
|
1248
|
-
// [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-secondary border text-secondary rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
|
|
1249
|
-
// [StyleTypes.Hollow, "inline-flex font-medium items-center justify-center px-4 py-3 lg:py-2 transparent border-neutral border text-neutral rounded hover:shadow-md focus:outline-none transition duration-150 ease-in-out active:scale-95"],
|
|
1250
|
-
// [StyleTypes.Ripple, "px-3 py-1.5 inline-flex items-center text-sm font-medium rounded border-[1.5px] border-primary ripple btn-bg-primary btn-primary-text"],
|
|
1251
|
-
// [StyleTypes.Danger, "inline-flex text-sm font-medium items-center justify-center px-4 py-2 border border-alert bg-alert text-white rounded hover:bg-alert-600 hover:border-alert-600 focus:outline-none active:ring-1 active:ring-alert"],
|
|
1252
|
-
// [StyleTypes.Link, ""],
|
|
1253
|
-
// [StyleTypes.Light, "inline-flex items-center justify-center rounded bg-white border px-4 py-2 leading-6 text-primary shadow-sm hover:shadow focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:opacity-50 disabled:cursor-not-allowed"],
|
|
1254
1245
|
]);
|
|
1255
1246
|
var progressClasses = /* @__PURE__ */ new Map([
|
|
1256
1247
|
["Primary" /* Solid */, ""],
|
|
1257
1248
|
["PrimaryHollow" /* Hollow */, ""],
|
|
1258
|
-
// [StyleTypes.Solid, ""],
|
|
1259
|
-
// [StyleTypes.Hollow, ""],
|
|
1260
|
-
// [StyleTypes.Solid, ""],
|
|
1261
|
-
// [StyleTypes.Hollow, ""],
|
|
1262
|
-
// [StyleTypes.Ripple, ""],
|
|
1263
|
-
// [StyleTypes.Danger, ""],
|
|
1264
1249
|
["Link" /* Link */, ""]
|
|
1265
1250
|
]);
|
|
1266
1251
|
|
|
@@ -2647,10 +2632,10 @@ var DataList = (props) => {
|
|
|
2647
2632
|
var DataList_default = DataList;
|
|
2648
2633
|
|
|
2649
2634
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
2650
|
-
import
|
|
2635
|
+
import React46 from "react";
|
|
2651
2636
|
|
|
2652
2637
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2653
|
-
import
|
|
2638
|
+
import React36 from "react";
|
|
2654
2639
|
|
|
2655
2640
|
// src/components/pageRenderingEngine/nodes/TextNode.tsx
|
|
2656
2641
|
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
@@ -2726,669 +2711,1124 @@ var LineBreakNode = () => {
|
|
|
2726
2711
|
var LineBreakNode_default = LineBreakNode;
|
|
2727
2712
|
|
|
2728
2713
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
2714
|
+
import React35 from "react";
|
|
2715
|
+
|
|
2716
|
+
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
2729
2717
|
import React33 from "react";
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
var
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2718
|
+
|
|
2719
|
+
// src/components/utilities/AssetUtility.tsx
|
|
2720
|
+
var AssetUtility = class {
|
|
2721
|
+
constructor() {
|
|
2722
|
+
}
|
|
2723
|
+
static resolveUrl(assetBaseUrl, url) {
|
|
2724
|
+
if (!url) return void 0;
|
|
2725
|
+
if (url.startsWith("http")) return url;
|
|
2726
|
+
if (!assetBaseUrl) return url;
|
|
2727
|
+
return `${assetBaseUrl}/${url}`;
|
|
2728
|
+
}
|
|
2729
|
+
// static getAssetUrl(apiBaseUrl: string) {
|
|
2730
|
+
// let domainName = apiBaseUrl.replace("https://", "");
|
|
2731
|
+
// return `https://cdn.g-assets.com/${domainName}`;
|
|
2732
|
+
// }
|
|
2733
|
+
static getAssetFullPath(apiBaseUrl, relativePath) {
|
|
2734
|
+
const domainName = apiBaseUrl.replace("https://", "");
|
|
2735
|
+
return `https://cdn.g-assets.com/${domainName}/${relativePath}`;
|
|
2737
2736
|
}
|
|
2738
|
-
let formatClasses = props.node.cssClass || "";
|
|
2739
|
-
return /* @__PURE__ */ jsxs26(Link2, { className: formatClasses, href: props.node.url, title: props.node.title, children: [
|
|
2740
|
-
props.node.children && props.node.children.map((node, index) => {
|
|
2741
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
2742
|
-
return /* @__PURE__ */ jsx41(React33.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx41(SelectedNode, { node }) }, index);
|
|
2743
|
-
}),
|
|
2744
|
-
props.node.children.length == 0 && /* @__PURE__ */ jsx41("br", {})
|
|
2745
|
-
] });
|
|
2746
2737
|
};
|
|
2747
|
-
var
|
|
2738
|
+
var AssetUtility_default = AssetUtility;
|
|
2748
2739
|
|
|
2749
|
-
// src/components/pageRenderingEngine/nodes/
|
|
2750
|
-
import
|
|
2751
|
-
var SVGIconNode = ({ node }) => {
|
|
2752
|
-
if (!node?.svgCode) return null;
|
|
2753
|
-
return /* @__PURE__ */ jsx42(
|
|
2754
|
-
"span",
|
|
2755
|
-
{
|
|
2756
|
-
style: {
|
|
2757
|
-
display: "inline-flex",
|
|
2758
|
-
width: node.width,
|
|
2759
|
-
height: node.height,
|
|
2760
|
-
color: node.color
|
|
2761
|
-
},
|
|
2762
|
-
dangerouslySetInnerHTML: { __html: node.svgCode }
|
|
2763
|
-
}
|
|
2764
|
-
);
|
|
2765
|
-
};
|
|
2766
|
-
var SVGIconNode_default = SVGIconNode;
|
|
2740
|
+
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
2741
|
+
import dynamic from "next/dynamic";
|
|
2767
2742
|
|
|
2768
|
-
// src/components/
|
|
2769
|
-
import
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2743
|
+
// src/components/DeviceAssetSelector.tsx
|
|
2744
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2745
|
+
var DeviceAssetSelector = ({
|
|
2746
|
+
assets,
|
|
2747
|
+
assetBaseUrl,
|
|
2748
|
+
session,
|
|
2749
|
+
// This should receive the session
|
|
2750
|
+
width,
|
|
2751
|
+
tag,
|
|
2752
|
+
customProps,
|
|
2753
|
+
nodeProps,
|
|
2754
|
+
device
|
|
2755
|
+
}) => {
|
|
2756
|
+
console.log("\u{1F511} Session in DeviceAssetSelector:", session);
|
|
2757
|
+
const targetTag = tag || nodeProps?.tag;
|
|
2758
|
+
const selectAssetByDevice = (assets2, currentDevice) => {
|
|
2759
|
+
if (!assets2 || assets2.length === 0) return void 0;
|
|
2760
|
+
const exactMatch = assets2.find((asset) => asset.device === currentDevice);
|
|
2761
|
+
if (exactMatch) return exactMatch;
|
|
2762
|
+
const noDeviceMatch = assets2.find((asset) => !asset.device || asset.device === "");
|
|
2763
|
+
if (noDeviceMatch) return noDeviceMatch;
|
|
2764
|
+
return void 0;
|
|
2765
|
+
};
|
|
2766
|
+
const selectAssetByTagAndDevice = (assets2, currentDevice, targetTag2) => {
|
|
2767
|
+
if (!assets2 || assets2.length === 0) return void 0;
|
|
2768
|
+
if (!targetTag2) return selectAssetByDevice(assets2, currentDevice);
|
|
2769
|
+
const taggedAssets = assets2.filter((asset) => asset.tag === targetTag2);
|
|
2770
|
+
if (taggedAssets.length === 0) {
|
|
2771
|
+
return selectAssetByDevice(assets2, currentDevice);
|
|
2772
|
+
}
|
|
2773
|
+
const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
|
|
2774
|
+
if (exactTaggedMatch) return exactTaggedMatch;
|
|
2775
|
+
const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
|
|
2776
|
+
if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
|
|
2777
|
+
return void 0;
|
|
2778
|
+
};
|
|
2779
|
+
const selectAsset = () => {
|
|
2780
|
+
if (!assets || assets.length === 0) return void 0;
|
|
2781
|
+
if (targetTag) {
|
|
2782
|
+
return selectAssetByTagAndDevice(assets, device, targetTag);
|
|
2783
|
+
}
|
|
2784
|
+
return selectAssetByDevice(assets, device);
|
|
2785
|
+
};
|
|
2786
|
+
const selectedAsset = selectAsset();
|
|
2787
|
+
if (!selectedAsset) {
|
|
2788
|
+
console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
|
|
2789
|
+
return null;
|
|
2783
2790
|
}
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2791
|
+
const resolvedAssetUrl = AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.assetUrl);
|
|
2792
|
+
const resolvedThumbnailUrl = selectedAsset.posterUrl ? AssetUtility_default.resolveUrl(assetBaseUrl, selectedAsset.posterUrl) : void 0;
|
|
2793
|
+
console.log("Selected Asset:", resolvedThumbnailUrl);
|
|
2794
|
+
const title = selectedAsset.title || nodeProps?.title;
|
|
2795
|
+
const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
|
|
2796
|
+
const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
|
|
2797
|
+
const isHls = resolvedAssetUrl?.endsWith(".m3u8");
|
|
2798
|
+
const showControls = customProps?.showControls ?? nodeProps?.showControls === "true";
|
|
2799
|
+
const loop = customProps?.loop ?? nodeProps?.loop === "true";
|
|
2800
|
+
const playOptions = customProps?.playOptions ?? nodeProps?.playOptions;
|
|
2801
|
+
const styles = {};
|
|
2802
|
+
if (nodeProps?.height) {
|
|
2803
|
+
styles.height = nodeProps.height;
|
|
2792
2804
|
}
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
{
|
|
2796
|
-
className: "katex-block my-3 text-center",
|
|
2797
|
-
dangerouslySetInnerHTML: { __html: html }
|
|
2798
|
-
}
|
|
2799
|
-
);
|
|
2800
|
-
};
|
|
2801
|
-
var EquationNode_default = EquationNode;
|
|
2802
|
-
|
|
2803
|
-
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
2804
|
-
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2805
|
-
function getNestedProperty(obj, path) {
|
|
2806
|
-
if (!obj || !path) return null;
|
|
2807
|
-
if (path.includes(".")) {
|
|
2808
|
-
return path.split(".").reduce((prev, curr) => {
|
|
2809
|
-
if (prev && typeof prev === "object") {
|
|
2810
|
-
return prev[curr];
|
|
2811
|
-
}
|
|
2812
|
-
return null;
|
|
2813
|
-
}, obj);
|
|
2805
|
+
if (nodeProps?.borderRadius) {
|
|
2806
|
+
styles.borderRadius = nodeProps.borderRadius;
|
|
2814
2807
|
}
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
return value.map((item, index) => /* @__PURE__ */ jsx44("div", { children: String(item) }, index));
|
|
2808
|
+
if (nodeProps?.width) {
|
|
2809
|
+
styles.width = nodeProps.width;
|
|
2818
2810
|
}
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2811
|
+
const FormatClass = {
|
|
2812
|
+
"center": "justify-center",
|
|
2813
|
+
"left": "justify-start",
|
|
2814
|
+
"right": "justify-end"
|
|
2815
|
+
};
|
|
2816
|
+
const formatClasses = FormatClass[nodeProps?.format || ""] || "";
|
|
2817
|
+
const renderMedia = () => {
|
|
2818
|
+
if (isHls) {
|
|
2819
|
+
return /* @__PURE__ */ jsx41(
|
|
2820
|
+
HlsPlayer_default,
|
|
2821
|
+
{
|
|
2822
|
+
assetUrl: resolvedAssetUrl,
|
|
2823
|
+
posterUrl: resolvedThumbnailUrl,
|
|
2824
|
+
intrinsicWidth,
|
|
2825
|
+
intrinsicHeight,
|
|
2826
|
+
showControls,
|
|
2827
|
+
loop,
|
|
2828
|
+
playOptions,
|
|
2829
|
+
apiBaseUrl: assetBaseUrl,
|
|
2830
|
+
session
|
|
2830
2831
|
}
|
|
2831
|
-
|
|
2832
|
+
);
|
|
2833
|
+
} else {
|
|
2834
|
+
return (
|
|
2835
|
+
/* eslint-disable-next-line @next/next/no-img-element */
|
|
2836
|
+
/* @__PURE__ */ jsx41(
|
|
2837
|
+
"img",
|
|
2838
|
+
{
|
|
2839
|
+
style: styles,
|
|
2840
|
+
loading: "lazy",
|
|
2841
|
+
className: "object-cover w-full",
|
|
2842
|
+
src: resolvedAssetUrl,
|
|
2843
|
+
width: selectedAsset.intrinsicWidth,
|
|
2844
|
+
alt: title || "Asset image",
|
|
2845
|
+
height: selectedAsset.intrinsicHeight
|
|
2846
|
+
}
|
|
2847
|
+
)
|
|
2848
|
+
);
|
|
2832
2849
|
}
|
|
2833
|
-
|
|
2850
|
+
};
|
|
2851
|
+
if (width) {
|
|
2852
|
+
return /* @__PURE__ */ jsx41("div", { style: { width }, children: renderMedia() });
|
|
2834
2853
|
}
|
|
2835
|
-
|
|
2836
|
-
return
|
|
2854
|
+
if (nodeProps?.format) {
|
|
2855
|
+
return /* @__PURE__ */ jsx41("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
2837
2856
|
}
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2857
|
+
return renderMedia();
|
|
2858
|
+
};
|
|
2859
|
+
var DeviceAssetSelector_default = DeviceAssetSelector;
|
|
2860
|
+
|
|
2861
|
+
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
2862
|
+
import { Fragment as Fragment4, jsx as jsx42 } from "react/jsx-runtime";
|
|
2863
|
+
var HlsPlayer = dynamic(() => import("./HlsPlayer-FFEIK6FG.mjs"), {
|
|
2864
|
+
ssr: false
|
|
2865
|
+
});
|
|
2866
|
+
var getNestedValue = (obj, path) => {
|
|
2867
|
+
if (!obj || !path) return void 0;
|
|
2868
|
+
return path.split(".").reduce((current, key) => {
|
|
2869
|
+
return current && current[key] !== void 0 ? current[key] : void 0;
|
|
2870
|
+
}, obj);
|
|
2871
|
+
};
|
|
2872
|
+
var ImageNode = (props) => {
|
|
2873
|
+
let assets;
|
|
2874
|
+
let imageUrl;
|
|
2875
|
+
let posterUrl;
|
|
2876
|
+
const currentDevice = props.device;
|
|
2877
|
+
if (props.node.device) {
|
|
2878
|
+
const nodeDevice = props.node.device;
|
|
2879
|
+
if (nodeDevice !== currentDevice) {
|
|
2880
|
+
return null;
|
|
2881
|
+
}
|
|
2845
2882
|
}
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
"",
|
|
2853
|
-
"",
|
|
2854
|
-
"",
|
|
2855
|
-
"underline",
|
|
2856
|
-
"font-medium underline",
|
|
2857
|
-
"italic underline",
|
|
2858
|
-
"italic underline font-medium"
|
|
2859
|
-
];
|
|
2860
|
-
const styles = convertKeysToCamelCase2(
|
|
2861
|
-
cssStringToJson(props.node.style)
|
|
2862
|
-
);
|
|
2863
|
-
const fieldName = props.node.fieldName ?? "";
|
|
2864
|
-
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
2865
|
-
const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && value !== null && Object.keys(value).length === 0;
|
|
2866
|
-
const maxLines = props.node.maxLines;
|
|
2867
|
-
if (maxLines && Number(maxLines) > 0) {
|
|
2868
|
-
Object.assign(styles, {
|
|
2869
|
-
display: "-webkit-box",
|
|
2870
|
-
overflow: "hidden",
|
|
2871
|
-
WebkitBoxOrient: "vertical",
|
|
2872
|
-
WebkitLineClamp: String(maxLines)
|
|
2873
|
-
});
|
|
2874
|
-
}
|
|
2875
|
-
const dataType = props.node.dataType;
|
|
2876
|
-
if (isEmptyValue) return null;
|
|
2877
|
-
if (dataType === "rawContent") {
|
|
2878
|
-
return /* @__PURE__ */ jsx44(
|
|
2879
|
-
PageBodyRenderer_default,
|
|
2880
|
-
{
|
|
2881
|
-
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
2882
|
-
routeParameters: props.routeParameters,
|
|
2883
|
-
query: props.query,
|
|
2884
|
-
session: props.session,
|
|
2885
|
-
host: props.host,
|
|
2886
|
-
path: props.path,
|
|
2887
|
-
apiBaseUrl: props.apiBaseUrl,
|
|
2888
|
-
breadcrumb: props.breadcrumb,
|
|
2889
|
-
donotApplyContainerClass: true
|
|
2890
|
-
}
|
|
2883
|
+
console.log("ImageNode device / currentDevice:", props.node.device, currentDevice);
|
|
2884
|
+
if (props.node.imageUrl.startsWith("http")) {
|
|
2885
|
+
imageUrl = props.node.imageUrl;
|
|
2886
|
+
posterUrl = AssetUtility_default.resolveUrl(
|
|
2887
|
+
props.assetBaseUrl,
|
|
2888
|
+
props.node.posterUrl
|
|
2891
2889
|
);
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
"
|
|
2895
|
-
{
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2890
|
+
} else if (props.dataitem && props.node.datafield) {
|
|
2891
|
+
const image = getNestedValue(props.dataitem, props.node.datafield);
|
|
2892
|
+
console.log("ImageNode Datafield Image:", image);
|
|
2893
|
+
try {
|
|
2894
|
+
if (typeof image === "string") {
|
|
2895
|
+
assets = JSON.parse(image);
|
|
2896
|
+
} else if (Array.isArray(image)) {
|
|
2897
|
+
assets = image;
|
|
2898
|
+
} else if (image && typeof image === "object") {
|
|
2899
|
+
assets = [image];
|
|
2900
|
+
}
|
|
2901
|
+
} catch (error) {
|
|
2902
|
+
console.error("Error parsing assets in ImageNode:", error);
|
|
2903
|
+
}
|
|
2904
|
+
if (assets && assets.length > 0) {
|
|
2905
|
+
return /* @__PURE__ */ jsx42(Fragment4, { children: /* @__PURE__ */ jsx42(
|
|
2906
|
+
DeviceAssetSelector_default,
|
|
2900
2907
|
{
|
|
2901
|
-
|
|
2902
|
-
|
|
2908
|
+
device: props.device,
|
|
2909
|
+
assets,
|
|
2910
|
+
assetBaseUrl: props.assetBaseUrl,
|
|
2911
|
+
session: props.session,
|
|
2912
|
+
nodeProps: {
|
|
2913
|
+
title: props.node.title,
|
|
2914
|
+
showControls: props.node.showControls,
|
|
2915
|
+
loop: props.node.loop,
|
|
2916
|
+
playOptions: props.node.playOptions,
|
|
2917
|
+
borderRadius: props.node.borderRadius,
|
|
2918
|
+
width: props.node.width,
|
|
2919
|
+
height: props.node.height,
|
|
2920
|
+
format: props.node.format,
|
|
2921
|
+
tag: props.node.tag,
|
|
2922
|
+
// Add tag to ImageNode if needed
|
|
2923
|
+
placementCode: props.node.placementCode
|
|
2924
|
+
}
|
|
2903
2925
|
}
|
|
2904
|
-
)
|
|
2926
|
+
) });
|
|
2927
|
+
} else {
|
|
2928
|
+
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
2929
|
+
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
2905
2930
|
}
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
["equation"]: EquationNode_default,
|
|
2919
|
-
["svg-icon"]: SVGIconNode_default
|
|
2920
|
-
};
|
|
2931
|
+
} else {
|
|
2932
|
+
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
2933
|
+
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
2934
|
+
}
|
|
2935
|
+
console.log("ImageNode Assets:", assets);
|
|
2936
|
+
if (!imageUrl) {
|
|
2937
|
+
return null;
|
|
2938
|
+
}
|
|
2939
|
+
const styles = {};
|
|
2940
|
+
if (props.node.height) styles.height = props.node.height;
|
|
2941
|
+
if (props.node.borderRadius) styles.borderRadius = props.node.borderRadius;
|
|
2942
|
+
if (props.node.width) styles.width = props.node.width;
|
|
2921
2943
|
const FormatClass = {
|
|
2922
|
-
"center": "
|
|
2923
|
-
"
|
|
2944
|
+
"center": "justify-center",
|
|
2945
|
+
"left": "justify-start",
|
|
2946
|
+
"right": "justify-end"
|
|
2924
2947
|
};
|
|
2925
2948
|
{
|
|
2926
2949
|
}
|
|
2927
2950
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
2928
|
-
const
|
|
2929
|
-
const
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
return /* @__PURE__ */ jsx45(React34.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx45(
|
|
2934
|
-
SelectedNode,
|
|
2951
|
+
const isHls = imageUrl?.endsWith(".m3u8");
|
|
2952
|
+
const renderMedia = () => {
|
|
2953
|
+
if (isHls) {
|
|
2954
|
+
return /* @__PURE__ */ jsx42(
|
|
2955
|
+
HlsPlayer,
|
|
2935
2956
|
{
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2957
|
+
assetUrl: imageUrl,
|
|
2958
|
+
posterUrl,
|
|
2959
|
+
intrinsicWidth: props.node.intrinsicWidth,
|
|
2960
|
+
intrinsicHeight: props.node.intrinsicHeight,
|
|
2961
|
+
showControls: props.node.showControls === "true",
|
|
2962
|
+
loop: props.node.loop === "true",
|
|
2963
|
+
playOptions: props.node.playOptions,
|
|
2939
2964
|
apiBaseUrl: props.apiBaseUrl,
|
|
2940
|
-
|
|
2965
|
+
session: props.session
|
|
2941
2966
|
}
|
|
2942
|
-
)
|
|
2943
|
-
}
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
hasChildren && props.node.children.map((node, index) => {
|
|
2947
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
2948
|
-
return /* @__PURE__ */ jsx45(React34.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx45(
|
|
2949
|
-
SelectedNode,
|
|
2967
|
+
);
|
|
2968
|
+
} else {
|
|
2969
|
+
return /* @__PURE__ */ jsx42(React33.Fragment, { children: /* @__PURE__ */ jsx42(
|
|
2970
|
+
"img",
|
|
2950
2971
|
{
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2972
|
+
style: styles,
|
|
2973
|
+
loading: "lazy",
|
|
2974
|
+
className: "object-cover",
|
|
2975
|
+
src: imageUrl,
|
|
2976
|
+
width: props.node.intrinsicWidth,
|
|
2977
|
+
alt: props.node.title,
|
|
2978
|
+
height: props.node.intrinsicHeight
|
|
2956
2979
|
}
|
|
2957
|
-
) }
|
|
2958
|
-
}
|
|
2959
|
-
!hasChildren && /* @__PURE__ */ jsx45("div", { className: "py-1.5 lg:py-2" })
|
|
2960
|
-
] });
|
|
2961
|
-
};
|
|
2962
|
-
var ParagraphNode_default = ParagraphNode;
|
|
2963
|
-
|
|
2964
|
-
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
2965
|
-
import React35 from "react";
|
|
2966
|
-
import { Fragment as Fragment5, jsx as jsx46 } from "react/jsx-runtime";
|
|
2967
|
-
var HeadingNode = (props) => {
|
|
2968
|
-
const NodeTypes2 = {
|
|
2969
|
-
["text"]: TextNode_default,
|
|
2970
|
-
["link"]: LinkNode_default,
|
|
2971
|
-
["svg-icon"]: SVGIconNode_default,
|
|
2972
|
-
["linebreak"]: LineBreakNode_default,
|
|
2973
|
-
["datafield"]: DatafieldNode_default
|
|
2974
|
-
};
|
|
2975
|
-
const HeadingTag = `${props.node.tag}`;
|
|
2976
|
-
const FormatClass = {
|
|
2977
|
-
"center": "text-center"
|
|
2980
|
+
) });
|
|
2981
|
+
}
|
|
2978
2982
|
};
|
|
2979
|
-
{
|
|
2983
|
+
if (props.node.width) {
|
|
2984
|
+
return /* @__PURE__ */ jsx42("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
2980
2985
|
}
|
|
2981
|
-
|
|
2982
|
-
return /* @__PURE__ */ jsx46(Fragment5, { children: React35.createElement(
|
|
2983
|
-
HeadingTag,
|
|
2984
|
-
{ className: formatClasses },
|
|
2985
|
-
props.node.children && props.node.children.map((childNode, index) => {
|
|
2986
|
-
const SelectedNode = NodeTypes2[childNode.type];
|
|
2987
|
-
return /* @__PURE__ */ jsx46(React35.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx46(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
2988
|
-
})
|
|
2989
|
-
) });
|
|
2986
|
+
return renderMedia();
|
|
2990
2987
|
};
|
|
2991
|
-
var
|
|
2988
|
+
var ImageNode_default = ImageNode;
|
|
2992
2989
|
|
|
2993
|
-
// src/components/pageRenderingEngine/nodes/
|
|
2994
|
-
import
|
|
2990
|
+
// src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
|
|
2991
|
+
import { useCallback as useCallback3, useState as useState8 } from "react";
|
|
2995
2992
|
|
|
2996
|
-
// src/
|
|
2997
|
-
import
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
linebreak: LineBreakNode_default,
|
|
3003
|
-
link: LinkNode_default,
|
|
3004
|
-
list: ListNode_default
|
|
3005
|
-
};
|
|
3006
|
-
let foundFirstBreak = false;
|
|
3007
|
-
const firstTextChild = props.node.children?.find((c) => c.type === "text");
|
|
3008
|
-
let liStyle = {};
|
|
3009
|
-
if (firstTextChild?.style) {
|
|
3010
|
-
const match = firstTextChild.style.match(/font-size\s*:\s*([^;]+);?/);
|
|
3011
|
-
if (match) {
|
|
3012
|
-
liStyle.fontSize = match[1].trim();
|
|
3013
|
-
}
|
|
2993
|
+
// src/clients/CacheManage.tsx
|
|
2994
|
+
import NodeCache from "node-cache";
|
|
2995
|
+
var CacheManager = class _CacheManager {
|
|
2996
|
+
constructor() {
|
|
2997
|
+
this.maxCacheSize = 1e3;
|
|
2998
|
+
this.cache = new NodeCache({ stdTTL: 0, checkperiod: 300 });
|
|
3014
2999
|
}
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
if (!foundFirstBreak) {
|
|
3019
|
-
foundFirstBreak = true;
|
|
3020
|
-
return /* @__PURE__ */ jsx47("div", {}, index);
|
|
3021
|
-
} else {
|
|
3022
|
-
return /* @__PURE__ */ jsx47("div", { className: "py-1 lg:py-2" }, index);
|
|
3023
|
-
}
|
|
3024
|
-
} else {
|
|
3025
|
-
foundFirstBreak = false;
|
|
3026
|
-
return /* @__PURE__ */ jsx47(React36.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx47(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3000
|
+
static getInstance() {
|
|
3001
|
+
if (!_CacheManager.instance) {
|
|
3002
|
+
_CacheManager.instance = new _CacheManager();
|
|
3027
3003
|
}
|
|
3028
|
-
|
|
3029
|
-
}
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
}
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
const SelectedNode = NodeTypes2[node.type];
|
|
3045
|
-
return /* @__PURE__ */ jsx48(React37.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx48(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3046
|
-
}) })
|
|
3047
|
-
] });
|
|
3004
|
+
return _CacheManager.instance;
|
|
3005
|
+
}
|
|
3006
|
+
get(key) {
|
|
3007
|
+
return null;
|
|
3008
|
+
}
|
|
3009
|
+
set(key, data, ttl) {
|
|
3010
|
+
}
|
|
3011
|
+
clear() {
|
|
3012
|
+
this.cache.flushAll();
|
|
3013
|
+
}
|
|
3014
|
+
size() {
|
|
3015
|
+
return this.cache.keys().length;
|
|
3016
|
+
}
|
|
3017
|
+
destroy() {
|
|
3018
|
+
this.cache.close();
|
|
3019
|
+
}
|
|
3048
3020
|
};
|
|
3049
|
-
var ListNode_default = ListNode;
|
|
3050
3021
|
|
|
3051
|
-
// src/
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3022
|
+
// src/clients/ServiceClient.tsx
|
|
3023
|
+
var ServerApiError = class extends Error {
|
|
3024
|
+
constructor(data, status) {
|
|
3025
|
+
super(data.message || "---");
|
|
3026
|
+
this.status = status;
|
|
3027
|
+
this.data = data;
|
|
3028
|
+
this.data.isSuccessful = false;
|
|
3029
|
+
}
|
|
3030
|
+
};
|
|
3031
|
+
var ServiceClient = class {
|
|
3032
|
+
constructor(apiBaseUrl, session) {
|
|
3033
|
+
this.cacheManager = CacheManager.getInstance();
|
|
3034
|
+
this.baseUrl = apiBaseUrl;
|
|
3035
|
+
this.session = session;
|
|
3036
|
+
}
|
|
3037
|
+
buildFullPath(path, params) {
|
|
3038
|
+
let updatedPath = path;
|
|
3039
|
+
if (params) {
|
|
3040
|
+
Object.keys(params).forEach((key) => {
|
|
3041
|
+
updatedPath = updatedPath.replace(
|
|
3042
|
+
`{${key}}`,
|
|
3043
|
+
String(params[key])
|
|
3044
|
+
);
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
return this.baseUrl + updatedPath;
|
|
3048
|
+
}
|
|
3049
|
+
getConfig() {
|
|
3050
|
+
const config = { headers: {} };
|
|
3051
|
+
if (this.session) {
|
|
3052
|
+
if (this.session.oAuthToken) {
|
|
3053
|
+
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
3054
|
+
}
|
|
3055
|
+
config.headers["cid"] = this.session.cid || "";
|
|
3056
|
+
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
3057
|
+
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
3058
|
+
}
|
|
3059
|
+
return config;
|
|
3060
|
+
}
|
|
3061
|
+
handleFetchError(error) {
|
|
3062
|
+
console.log(error);
|
|
3063
|
+
const serverApiError = error;
|
|
3064
|
+
if (serverApiError) {
|
|
3065
|
+
return serverApiError.data;
|
|
3066
|
+
}
|
|
3067
|
+
return {
|
|
3068
|
+
message: "There is some error. Please try after sometime.",
|
|
3069
|
+
isSuccessful: false
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3072
|
+
async fetchJsonWithCache(fullPath, config) {
|
|
3073
|
+
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
3074
|
+
const cachedData = this.cacheManager.get(cacheKey);
|
|
3075
|
+
if (cachedData) {
|
|
3076
|
+
return cachedData;
|
|
3077
|
+
}
|
|
3078
|
+
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
3079
|
+
const response = await fetch(fullPath, { headers: config.headers });
|
|
3080
|
+
if (!response.ok) {
|
|
3081
|
+
const apiErrorData = await response.json();
|
|
3082
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
3083
|
+
}
|
|
3084
|
+
const cacheControl = response.headers.get("Cache-Control");
|
|
3085
|
+
let revalidate = null;
|
|
3086
|
+
if (cacheControl) {
|
|
3087
|
+
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
3088
|
+
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
3089
|
+
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
3090
|
+
revalidate = maxAge * 1e3;
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
const data = await response.json();
|
|
3094
|
+
data.isSuccessful = true;
|
|
3095
|
+
if (revalidate !== null && revalidate > 0) {
|
|
3096
|
+
console.log("revalidate............I am caching:" + revalidate);
|
|
3097
|
+
this.cacheManager.set(cacheKey, data, revalidate);
|
|
3098
|
+
}
|
|
3099
|
+
return data;
|
|
3100
|
+
}
|
|
3101
|
+
// private async refreshToken(): Promise<void> {
|
|
3102
|
+
// console.log("*******************calling refresh token***********************");
|
|
3103
|
+
// try {
|
|
3104
|
+
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
3105
|
+
// method: 'POST',
|
|
3106
|
+
// headers: {
|
|
3107
|
+
// 'Content-Type': 'application/json'
|
|
3108
|
+
// },
|
|
3109
|
+
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
3110
|
+
// });
|
|
3111
|
+
// if (!response.ok) {
|
|
3112
|
+
// throw new Error("Failed to refresh token");
|
|
3113
|
+
// }
|
|
3114
|
+
// const responseData = await response.json();
|
|
3115
|
+
// this.session.oAuthToken = responseData.result.accessToken;
|
|
3116
|
+
// if (typeof window === "undefined") {
|
|
3117
|
+
// // Running on the server
|
|
3118
|
+
// } else {
|
|
3119
|
+
// await fetch("/api/login", {
|
|
3120
|
+
// method: "post",
|
|
3121
|
+
// headers: {
|
|
3122
|
+
// "Content-Type": "application/json",
|
|
3123
|
+
// },
|
|
3124
|
+
// body: JSON.stringify({ session: this.session }),
|
|
3125
|
+
// });
|
|
3126
|
+
// }
|
|
3127
|
+
// } catch (error: any) {
|
|
3128
|
+
// throw new Error("Failed to refresh token");
|
|
3129
|
+
// }
|
|
3130
|
+
// }
|
|
3131
|
+
async handleRequest(request) {
|
|
3132
|
+
try {
|
|
3133
|
+
return await request();
|
|
3134
|
+
} catch (error) {
|
|
3135
|
+
throw error;
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
async post(path, data) {
|
|
3139
|
+
const request = async () => {
|
|
3140
|
+
const fullPath = this.baseUrl + path;
|
|
3141
|
+
const config = this.getConfig();
|
|
3142
|
+
const response = await fetch(fullPath, {
|
|
3143
|
+
method: "POST",
|
|
3144
|
+
headers: {
|
|
3145
|
+
...config.headers,
|
|
3146
|
+
"Content-Type": "application/json"
|
|
3147
|
+
},
|
|
3148
|
+
body: JSON.stringify(data)
|
|
3149
|
+
});
|
|
3150
|
+
if (!response.ok) {
|
|
3151
|
+
const apiErrorData = await response.json();
|
|
3152
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
3153
|
+
}
|
|
3154
|
+
const responseData = await response.json();
|
|
3155
|
+
responseData.isSuccessful = true;
|
|
3156
|
+
return responseData;
|
|
3157
|
+
};
|
|
3158
|
+
try {
|
|
3159
|
+
return await this.handleRequest(request);
|
|
3160
|
+
} catch (error) {
|
|
3161
|
+
return this.handleFetchError(error);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
async getSingle(path, params) {
|
|
3165
|
+
const request = async () => {
|
|
3166
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
3167
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
3168
|
+
) : void 0;
|
|
3169
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
3170
|
+
const config = this.getConfig();
|
|
3171
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
3172
|
+
};
|
|
3173
|
+
try {
|
|
3174
|
+
return await this.handleRequest(request);
|
|
3175
|
+
} catch (error) {
|
|
3176
|
+
return this.handleFetchError(error);
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
async get(path, params) {
|
|
3180
|
+
const request = async () => {
|
|
3181
|
+
const sanitizedParams = params ? Object.fromEntries(
|
|
3182
|
+
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
3183
|
+
) : void 0;
|
|
3184
|
+
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
3185
|
+
const config = this.getConfig();
|
|
3186
|
+
console.log(fullPath);
|
|
3187
|
+
return await this.fetchJsonWithCache(fullPath, config);
|
|
3188
|
+
};
|
|
3189
|
+
try {
|
|
3190
|
+
return await this.handleRequest(request);
|
|
3191
|
+
} catch (error) {
|
|
3192
|
+
return this.handleFetchError(error);
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
};
|
|
3196
|
+
var ServiceClient_default = ServiceClient;
|
|
3197
|
+
|
|
3198
|
+
// src/components/pageRenderingEngine/nodes/LinkNodeButton.tsx
|
|
3199
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3200
|
+
var LinkNodeButton = (props) => {
|
|
3201
|
+
const { node, dataitem, children, linkText, linkType, linkUrl } = props;
|
|
3202
|
+
const [isLoading, setIsLoading] = useState8(false);
|
|
3203
|
+
const [error, setError] = useState8(null);
|
|
3204
|
+
const extractFieldNames = useCallback3((template) => {
|
|
3205
|
+
if (!template) return [];
|
|
3206
|
+
const regex = /\{(\{\})?([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\}\})?\}/g;
|
|
3207
|
+
const matches = Array.from(template.matchAll(regex));
|
|
3208
|
+
const fieldNames = matches.map((match) => match[2] || match[1]).filter((name, index, self) => self.indexOf(name) === index);
|
|
3209
|
+
return fieldNames;
|
|
3210
|
+
}, []);
|
|
3211
|
+
const replaceTemplateVariables = useCallback3((template, responseData) => {
|
|
3212
|
+
if (!template) return template;
|
|
3213
|
+
let result = template;
|
|
3214
|
+
const fieldNames = extractFieldNames(template);
|
|
3215
|
+
if (responseData) {
|
|
3216
|
+
fieldNames.forEach((fieldName) => {
|
|
3217
|
+
const value = getNestedValue3(responseData, fieldName);
|
|
3218
|
+
if (value !== void 0) {
|
|
3219
|
+
const regex1 = new RegExp(`\\{${fieldName}\\}`, "g");
|
|
3220
|
+
const regex2 = new RegExp(`\\{\\{${fieldName}\\}\\}`, "g");
|
|
3221
|
+
result = result.replace(regex1, String(value));
|
|
3222
|
+
result = result.replace(regex2, String(value));
|
|
3223
|
+
}
|
|
3224
|
+
});
|
|
3225
|
+
}
|
|
3226
|
+
if (props.routeParameters) {
|
|
3227
|
+
Object.entries(props.routeParameters).forEach(([key, value]) => {
|
|
3228
|
+
const regex = new RegExp(`\\{\\{${key}\\}\\}`, "g");
|
|
3229
|
+
result = result.replace(regex, String(value));
|
|
3230
|
+
});
|
|
3231
|
+
}
|
|
3232
|
+
if (dataitem) {
|
|
3233
|
+
Object.entries(dataitem).forEach(([key, value]) => {
|
|
3234
|
+
const regex = new RegExp(`\\{\\{${key}\\}\\}`, "g");
|
|
3235
|
+
result = result.replace(regex, String(value));
|
|
3236
|
+
});
|
|
3237
|
+
}
|
|
3238
|
+
return result;
|
|
3239
|
+
}, [props.routeParameters, dataitem, extractFieldNames]);
|
|
3240
|
+
const getNestedValue3 = useCallback3((obj, path) => {
|
|
3241
|
+
if (!obj || !path) return void 0;
|
|
3242
|
+
if (obj[path] !== void 0) {
|
|
3243
|
+
return obj[path];
|
|
3244
|
+
}
|
|
3245
|
+
const keys = path.split(".");
|
|
3246
|
+
let current = obj;
|
|
3247
|
+
for (const key of keys) {
|
|
3248
|
+
if (current[key] === void 0) {
|
|
3249
|
+
return void 0;
|
|
3250
|
+
}
|
|
3251
|
+
current = current[key];
|
|
3252
|
+
}
|
|
3253
|
+
return current;
|
|
3254
|
+
}, []);
|
|
3255
|
+
const onClick = useCallback3(async (e) => {
|
|
3256
|
+
if (!node.postUrl) {
|
|
3257
|
+
setError("No POST URL configured for this button");
|
|
3258
|
+
return;
|
|
3259
|
+
}
|
|
3260
|
+
setIsLoading(true);
|
|
3261
|
+
setError(null);
|
|
3262
|
+
try {
|
|
3263
|
+
const resolvedPostUrl = replaceTemplateVariables(node.postUrl);
|
|
3264
|
+
let parsedPayload = {};
|
|
3265
|
+
if (node.payload) {
|
|
3266
|
+
try {
|
|
3267
|
+
const payloadStr = replaceTemplateVariables(node.payload);
|
|
3268
|
+
parsedPayload = JSON.parse(payloadStr);
|
|
3269
|
+
console.log("Parsed payload:", parsedPayload);
|
|
3270
|
+
} catch (err) {
|
|
3271
|
+
console.error("Failed to parse payload JSON:", err);
|
|
3272
|
+
parsedPayload = { error: "Invalid payload JSON" };
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
const serviceClient = new ServiceClient_default(props.apiBaseUrl, props.session);
|
|
3276
|
+
const response = await serviceClient.post(resolvedPostUrl, parsedPayload);
|
|
3277
|
+
console.log("API Response:", response);
|
|
3278
|
+
if (response && !response.isSuccessful) {
|
|
3279
|
+
const errorMessage = response.message || "API request failed";
|
|
3280
|
+
setError(errorMessage);
|
|
3281
|
+
setIsLoading(false);
|
|
3282
|
+
return { isSuccessful: false, message: errorMessage };
|
|
3283
|
+
}
|
|
3284
|
+
if (response && node.redirectUrl) {
|
|
3285
|
+
const fieldNames = extractFieldNames(node.redirectUrl);
|
|
3286
|
+
console.log("Field names in redirect URL:", fieldNames);
|
|
3287
|
+
const fieldValueMap = {};
|
|
3288
|
+
fieldNames.forEach((fieldName) => {
|
|
3289
|
+
const value = getNestedValue3(response, fieldName);
|
|
3290
|
+
if (value !== void 0) {
|
|
3291
|
+
fieldValueMap[fieldName] = String(value);
|
|
3292
|
+
} else {
|
|
3293
|
+
const resultValue = getNestedValue3(response, `result.${fieldName}`);
|
|
3294
|
+
if (resultValue !== void 0) {
|
|
3295
|
+
fieldValueMap[fieldName] = String(resultValue);
|
|
3296
|
+
} else {
|
|
3297
|
+
const dataValue = getNestedValue3(response, `data.${fieldName}`);
|
|
3298
|
+
if (dataValue !== void 0) {
|
|
3299
|
+
fieldValueMap[fieldName] = String(dataValue);
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
});
|
|
3304
|
+
console.log("Field value map:", fieldValueMap);
|
|
3305
|
+
const missingFields = fieldNames.filter((fieldName) => !fieldValueMap[fieldName]);
|
|
3306
|
+
if (missingFields.length > 0) {
|
|
3307
|
+
console.warn(`Missing field values for: ${missingFields.join(", ")}`);
|
|
3308
|
+
}
|
|
3309
|
+
let resolvedRedirectUrl = node.redirectUrl;
|
|
3310
|
+
Object.entries(fieldValueMap).forEach(([fieldName, value]) => {
|
|
3311
|
+
const regex1 = new RegExp(`\\{${fieldName}\\}`, "g");
|
|
3312
|
+
const regex2 = new RegExp(`\\{\\{${fieldName}\\}\\}`, "g");
|
|
3313
|
+
resolvedRedirectUrl = resolvedRedirectUrl.replace(regex1, value);
|
|
3314
|
+
resolvedRedirectUrl = resolvedRedirectUrl.replace(regex2, value);
|
|
3315
|
+
});
|
|
3316
|
+
resolvedRedirectUrl = replaceTemplateVariables(resolvedRedirectUrl, response);
|
|
3317
|
+
console.log("Final redirect URL:", resolvedRedirectUrl);
|
|
3318
|
+
if (resolvedRedirectUrl && !resolvedRedirectUrl.includes("{")) {
|
|
3319
|
+
window.location.href = resolvedRedirectUrl;
|
|
3320
|
+
}
|
|
3321
|
+
} else if (response && !response.result && response.message) {
|
|
3322
|
+
setError(response.message);
|
|
3323
|
+
throw new Error(response.message);
|
|
3324
|
+
} else if (!response) {
|
|
3325
|
+
setError("No response from server");
|
|
3326
|
+
}
|
|
3327
|
+
setIsLoading(false);
|
|
3328
|
+
return { isSuccessful: true, response };
|
|
3329
|
+
} catch (err) {
|
|
3330
|
+
console.error("Button API call failed:", err);
|
|
3331
|
+
setError(err.message || "An unexpected error occurred");
|
|
3332
|
+
setIsLoading(false);
|
|
3333
|
+
return { isSuccessful: false, message: err.message };
|
|
3334
|
+
}
|
|
3335
|
+
}, [node.postUrl, node.payload, node.redirectUrl, replaceTemplateVariables, extractFieldNames, getNestedValue3, props.apiBaseUrl, props.session]);
|
|
3336
|
+
const renderButtonContent = () => {
|
|
3337
|
+
if (children) {
|
|
3338
|
+
return children;
|
|
3339
|
+
}
|
|
3340
|
+
if (linkText) {
|
|
3341
|
+
return /* @__PURE__ */ jsx43("span", { children: linkText });
|
|
3342
|
+
}
|
|
3343
|
+
return node.title || "Button";
|
|
3059
3344
|
};
|
|
3060
|
-
return /* @__PURE__ */
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3345
|
+
return /* @__PURE__ */ jsx43("div", { className: "link-button-wrapper", children: /* @__PURE__ */ jsx43(
|
|
3346
|
+
Button_default,
|
|
3347
|
+
{
|
|
3348
|
+
ButtonType: linkType,
|
|
3349
|
+
onClick,
|
|
3350
|
+
disabled: isLoading,
|
|
3351
|
+
className: "w-full",
|
|
3352
|
+
children: renderButtonContent()
|
|
3353
|
+
}
|
|
3354
|
+
) });
|
|
3064
3355
|
};
|
|
3065
|
-
var
|
|
3356
|
+
var LinkNodeButton_default = LinkNodeButton;
|
|
3066
3357
|
|
|
3067
|
-
// src/components/pageRenderingEngine/nodes/
|
|
3068
|
-
import
|
|
3069
|
-
|
|
3070
|
-
import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3071
|
-
var CopyButton = dynamic(() => import("./CopyButton-XONTQQW7.mjs"), {
|
|
3072
|
-
ssr: false,
|
|
3073
|
-
// optional: fallback UI while loading
|
|
3074
|
-
loading: () => /* @__PURE__ */ jsx50("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
3075
|
-
});
|
|
3076
|
-
var CodeNode = (props) => {
|
|
3358
|
+
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
3359
|
+
import { Fragment as Fragment5, jsx as jsx44, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3360
|
+
var LinkNode = (props) => {
|
|
3077
3361
|
const NodeTypes2 = {
|
|
3078
3362
|
text: TextNode_default,
|
|
3079
|
-
|
|
3080
|
-
link: LinkNode_default
|
|
3363
|
+
image: ImageNode_default
|
|
3081
3364
|
};
|
|
3082
|
-
const
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3365
|
+
const { node, dataitem } = props;
|
|
3366
|
+
let linkUrl = node.url;
|
|
3367
|
+
if (node.datafield_link_url && dataitem) {
|
|
3368
|
+
const dynamicUrl = dataitem[node.datafield_link_url];
|
|
3369
|
+
if (dynamicUrl && typeof dynamicUrl === "string") {
|
|
3370
|
+
linkUrl = dynamicUrl;
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
if (props.routeParameters && linkUrl && linkUrl.includes("{")) {
|
|
3374
|
+
Object.keys(props.routeParameters).forEach((param) => {
|
|
3375
|
+
const value = props.routeParameters[param];
|
|
3376
|
+
if (value !== void 0 && value !== null) {
|
|
3377
|
+
linkUrl = linkUrl.replace(
|
|
3378
|
+
new RegExp(`\\{${param}\\}`, "gi"),
|
|
3379
|
+
encodeURIComponent(String(value))
|
|
3380
|
+
);
|
|
3381
|
+
}
|
|
3382
|
+
});
|
|
3383
|
+
}
|
|
3384
|
+
let linkText = null;
|
|
3385
|
+
if (node.datafield_link_text && dataitem) {
|
|
3386
|
+
const dynamicText = dataitem[node.datafield_link_text];
|
|
3387
|
+
if (dynamicText && typeof dynamicText === "string") {
|
|
3388
|
+
linkText = dynamicText;
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3391
|
+
const getLinkTypeFromCssClass = (cssClass) => {
|
|
3392
|
+
const classToTypeMap = {
|
|
3393
|
+
Primary: "Primary" /* Solid */,
|
|
3394
|
+
PrimaryHollow: "PrimaryHollow" /* Hollow */,
|
|
3395
|
+
Link: "Link" /* Link */
|
|
3396
|
+
};
|
|
3397
|
+
return classToTypeMap[cssClass];
|
|
3398
|
+
};
|
|
3399
|
+
const linkType = node.cssClass ? getLinkTypeFromCssClass(node.cssClass) : void 0;
|
|
3400
|
+
const isButton = node.isButton === true;
|
|
3401
|
+
const renderChildren = () => {
|
|
3402
|
+
if (!node.children || node.children.length === 0) return null;
|
|
3403
|
+
return /* @__PURE__ */ jsx44(Fragment5, { children: node.children.map((childNode, index) => {
|
|
3404
|
+
const SelectedNode = NodeTypes2[childNode.type];
|
|
3405
|
+
if (!SelectedNode) {
|
|
3406
|
+
console.warn("Unknown node type:", childNode.type);
|
|
3407
|
+
return null;
|
|
3408
|
+
}
|
|
3409
|
+
return /* @__PURE__ */ jsx44(React35.Fragment, { children: /* @__PURE__ */ jsx44(
|
|
3096
3410
|
SelectedNode,
|
|
3097
3411
|
{
|
|
3098
|
-
node,
|
|
3099
|
-
|
|
3100
|
-
|
|
3412
|
+
node: childNode,
|
|
3413
|
+
dataitem,
|
|
3414
|
+
linkText,
|
|
3101
3415
|
routeParameters: props.routeParameters
|
|
3102
3416
|
}
|
|
3103
3417
|
) }, index);
|
|
3104
|
-
}) })
|
|
3105
|
-
|
|
3418
|
+
}) });
|
|
3419
|
+
};
|
|
3420
|
+
const renderFallback = () => {
|
|
3421
|
+
if ((!node.children || node.children.length === 0) && linkText) {
|
|
3422
|
+
return /* @__PURE__ */ jsx44("span", { children: linkText });
|
|
3423
|
+
}
|
|
3424
|
+
if ((!node.children || node.children.length === 0) && !linkText) {
|
|
3425
|
+
return /* @__PURE__ */ jsx44("br", {});
|
|
3426
|
+
}
|
|
3427
|
+
return null;
|
|
3428
|
+
};
|
|
3429
|
+
if (isButton) {
|
|
3430
|
+
return /* @__PURE__ */ jsxs26(
|
|
3431
|
+
LinkNodeButton_default,
|
|
3432
|
+
{
|
|
3433
|
+
node,
|
|
3434
|
+
dataitem,
|
|
3435
|
+
routeParameters: props.routeParameters,
|
|
3436
|
+
session: props.session,
|
|
3437
|
+
apiBaseUrl: props.apiBaseUrl || "",
|
|
3438
|
+
linkText,
|
|
3439
|
+
linkType,
|
|
3440
|
+
linkUrl,
|
|
3441
|
+
children: [
|
|
3442
|
+
renderChildren(),
|
|
3443
|
+
renderFallback()
|
|
3444
|
+
]
|
|
3445
|
+
}
|
|
3446
|
+
);
|
|
3447
|
+
}
|
|
3448
|
+
return /* @__PURE__ */ jsxs26(
|
|
3449
|
+
Hyperlink,
|
|
3450
|
+
{
|
|
3451
|
+
href: linkUrl || "#",
|
|
3452
|
+
linkType,
|
|
3453
|
+
alt: linkText || node.title || "",
|
|
3454
|
+
children: [
|
|
3455
|
+
renderChildren(),
|
|
3456
|
+
renderFallback()
|
|
3457
|
+
]
|
|
3458
|
+
}
|
|
3459
|
+
);
|
|
3106
3460
|
};
|
|
3107
|
-
var
|
|
3461
|
+
var LinkNode_default = LinkNode;
|
|
3108
3462
|
|
|
3109
|
-
// src/components/pageRenderingEngine/nodes/
|
|
3110
|
-
import { jsx as
|
|
3111
|
-
var
|
|
3112
|
-
|
|
3463
|
+
// src/components/pageRenderingEngine/nodes/SVGIconNode.tsx
|
|
3464
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3465
|
+
var SVGIconNode = ({ node }) => {
|
|
3466
|
+
if (!node?.svgCode) return null;
|
|
3467
|
+
return /* @__PURE__ */ jsx45(
|
|
3468
|
+
"span",
|
|
3469
|
+
{
|
|
3470
|
+
style: {
|
|
3471
|
+
display: "inline-flex",
|
|
3472
|
+
width: node.width,
|
|
3473
|
+
height: node.height,
|
|
3474
|
+
color: node.color
|
|
3475
|
+
},
|
|
3476
|
+
dangerouslySetInnerHTML: { __html: node.svgCode }
|
|
3477
|
+
}
|
|
3478
|
+
);
|
|
3113
3479
|
};
|
|
3114
|
-
var
|
|
3115
|
-
|
|
3116
|
-
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3117
|
-
import React40 from "react";
|
|
3480
|
+
var SVGIconNode_default = SVGIconNode;
|
|
3118
3481
|
|
|
3119
|
-
// src/components/
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3482
|
+
// src/components/pageRenderingEngine/nodes/EquationNode.tsx
|
|
3483
|
+
import katex from "katex";
|
|
3484
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3485
|
+
var EquationNode = ({ node }) => {
|
|
3486
|
+
const { equation, inline } = node;
|
|
3487
|
+
let html = "";
|
|
3488
|
+
try {
|
|
3489
|
+
html = katex.renderToString(equation, {
|
|
3490
|
+
displayMode: !inline,
|
|
3491
|
+
throwOnError: false
|
|
3492
|
+
});
|
|
3493
|
+
} catch (error) {
|
|
3494
|
+
html = katex.renderToString(`\\text{Invalid equation}`, {
|
|
3495
|
+
throwOnError: false
|
|
3496
|
+
});
|
|
3128
3497
|
}
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3498
|
+
if (inline) {
|
|
3499
|
+
return /* @__PURE__ */ jsx46(
|
|
3500
|
+
"span",
|
|
3501
|
+
{
|
|
3502
|
+
className: "katex-inline",
|
|
3503
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
3504
|
+
}
|
|
3505
|
+
);
|
|
3136
3506
|
}
|
|
3507
|
+
return /* @__PURE__ */ jsx46(
|
|
3508
|
+
"div",
|
|
3509
|
+
{
|
|
3510
|
+
className: "katex-block my-3 text-center",
|
|
3511
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
3512
|
+
}
|
|
3513
|
+
);
|
|
3137
3514
|
};
|
|
3138
|
-
var
|
|
3139
|
-
|
|
3140
|
-
// src/components/pageRenderingEngine/nodes/ImageNode.tsx
|
|
3141
|
-
import dynamic2 from "next/dynamic";
|
|
3515
|
+
var EquationNode_default = EquationNode;
|
|
3142
3516
|
|
|
3143
|
-
// src/components/
|
|
3144
|
-
import { jsx as
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
}
|
|
3173
|
-
const exactTaggedMatch = taggedAssets.find((asset) => asset.device === currentDevice);
|
|
3174
|
-
if (exactTaggedMatch) return exactTaggedMatch;
|
|
3175
|
-
const noDeviceTaggedMatch = taggedAssets.find((asset) => !asset.device || asset.device === "");
|
|
3176
|
-
if (noDeviceTaggedMatch) return noDeviceTaggedMatch;
|
|
3177
|
-
return void 0;
|
|
3178
|
-
};
|
|
3179
|
-
const selectAsset = () => {
|
|
3180
|
-
if (!assets || assets.length === 0) return void 0;
|
|
3181
|
-
if (targetTag) {
|
|
3182
|
-
return selectAssetByTagAndDevice(assets, device, targetTag);
|
|
3517
|
+
// src/components/pageRenderingEngine/nodes/DatafieldNode.tsx
|
|
3518
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3519
|
+
function getNestedProperty(obj, path) {
|
|
3520
|
+
if (!obj || !path) return null;
|
|
3521
|
+
if (path.includes(".")) {
|
|
3522
|
+
return path.split(".").reduce((prev, curr) => {
|
|
3523
|
+
if (prev && typeof prev === "object") {
|
|
3524
|
+
return prev[curr];
|
|
3525
|
+
}
|
|
3526
|
+
return null;
|
|
3527
|
+
}, obj);
|
|
3528
|
+
}
|
|
3529
|
+
const value = obj[path];
|
|
3530
|
+
if (Array.isArray(value)) {
|
|
3531
|
+
return value.map((item, index) => /* @__PURE__ */ jsx47("div", { children: String(item) }, index));
|
|
3532
|
+
}
|
|
3533
|
+
return value;
|
|
3534
|
+
}
|
|
3535
|
+
var DatafieldNode = (props) => {
|
|
3536
|
+
function cssStringToJson(cssString) {
|
|
3537
|
+
const styleObject = {};
|
|
3538
|
+
const matches = cssString?.match(/([\w-]+)\s*:\s*([^;]+)\s*;/g);
|
|
3539
|
+
if (matches) {
|
|
3540
|
+
matches.forEach((match) => {
|
|
3541
|
+
const parts = match.match(/([\w-]+)\s*:\s*([^;]+)\s*;/);
|
|
3542
|
+
if (parts && parts.length === 3) {
|
|
3543
|
+
styleObject[parts[1].trim()] = parts[2].trim();
|
|
3544
|
+
}
|
|
3545
|
+
});
|
|
3183
3546
|
}
|
|
3184
|
-
return
|
|
3185
|
-
};
|
|
3186
|
-
const selectedAsset = selectAsset();
|
|
3187
|
-
if (!selectedAsset) {
|
|
3188
|
-
console.warn("No suitable asset found for device:", device, "and tag:", targetTag);
|
|
3189
|
-
return null;
|
|
3547
|
+
return styleObject;
|
|
3190
3548
|
}
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
console.log("Selected Asset:", resolvedThumbnailUrl);
|
|
3194
|
-
const title = selectedAsset.title || nodeProps?.title;
|
|
3195
|
-
const intrinsicWidth = selectedAsset.intrinsicWidth?.toString();
|
|
3196
|
-
const intrinsicHeight = selectedAsset.intrinsicHeight?.toString();
|
|
3197
|
-
const isHls = resolvedAssetUrl?.endsWith(".m3u8");
|
|
3198
|
-
const showControls = customProps?.showControls ?? nodeProps?.showControls === "true";
|
|
3199
|
-
const loop = customProps?.loop ?? nodeProps?.loop === "true";
|
|
3200
|
-
const playOptions = customProps?.playOptions ?? nodeProps?.playOptions;
|
|
3201
|
-
const styles = {};
|
|
3202
|
-
if (nodeProps?.height) {
|
|
3203
|
-
styles.height = nodeProps.height;
|
|
3549
|
+
function toCamelCase2(str) {
|
|
3550
|
+
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
3204
3551
|
}
|
|
3205
|
-
|
|
3206
|
-
|
|
3552
|
+
function convertKeysToCamelCase2(obj) {
|
|
3553
|
+
return Object.fromEntries(
|
|
3554
|
+
Object.entries(obj).map(([key, value2]) => [
|
|
3555
|
+
toCamelCase2(key),
|
|
3556
|
+
value2
|
|
3557
|
+
])
|
|
3558
|
+
);
|
|
3207
3559
|
}
|
|
3208
|
-
|
|
3209
|
-
|
|
3560
|
+
const Formats = [
|
|
3561
|
+
"",
|
|
3562
|
+
"font-medium",
|
|
3563
|
+
"italic",
|
|
3564
|
+
"font-medium italic",
|
|
3565
|
+
"",
|
|
3566
|
+
"",
|
|
3567
|
+
"",
|
|
3568
|
+
"",
|
|
3569
|
+
"underline",
|
|
3570
|
+
"font-medium underline",
|
|
3571
|
+
"italic underline",
|
|
3572
|
+
"italic underline font-medium"
|
|
3573
|
+
];
|
|
3574
|
+
const styles = convertKeysToCamelCase2(
|
|
3575
|
+
cssStringToJson(props.node.style)
|
|
3576
|
+
);
|
|
3577
|
+
const fieldName = props.node.fieldName ?? "";
|
|
3578
|
+
const value = props.dataitem ? getNestedProperty(props.dataitem, fieldName) : null;
|
|
3579
|
+
const isEmptyValue = value === null || value === void 0 || value === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && value !== null && Object.keys(value).length === 0;
|
|
3580
|
+
const maxLines = props.node.maxLines;
|
|
3581
|
+
if (maxLines && Number(maxLines) > 0) {
|
|
3582
|
+
Object.assign(styles, {
|
|
3583
|
+
display: "-webkit-box",
|
|
3584
|
+
overflow: "hidden",
|
|
3585
|
+
WebkitBoxOrient: "vertical",
|
|
3586
|
+
WebkitLineClamp: String(maxLines)
|
|
3587
|
+
});
|
|
3210
3588
|
}
|
|
3211
|
-
const
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3589
|
+
const dataType = props.node.dataType;
|
|
3590
|
+
if (isEmptyValue) return null;
|
|
3591
|
+
if (dataType === "rawContent") {
|
|
3592
|
+
return /* @__PURE__ */ jsx47(
|
|
3593
|
+
PageBodyRenderer_default,
|
|
3594
|
+
{
|
|
3595
|
+
rawBody: String(value ?? `@databound[${fieldName}]`),
|
|
3596
|
+
routeParameters: props.routeParameters,
|
|
3597
|
+
query: props.query,
|
|
3598
|
+
session: props.session,
|
|
3599
|
+
host: props.host,
|
|
3600
|
+
path: props.path,
|
|
3601
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3602
|
+
breadcrumb: props.breadcrumb,
|
|
3603
|
+
donotApplyContainerClass: true
|
|
3604
|
+
}
|
|
3605
|
+
);
|
|
3606
|
+
}
|
|
3607
|
+
return /* @__PURE__ */ jsx47(
|
|
3608
|
+
"span",
|
|
3609
|
+
{
|
|
3610
|
+
className: `datafield-node ${props.node.format < Formats.length ? Formats[props.node.format] : ""}`,
|
|
3611
|
+
style: styles,
|
|
3612
|
+
children: /* @__PURE__ */ jsx47(
|
|
3613
|
+
ViewControl_default,
|
|
3221
3614
|
{
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
intrinsicWidth,
|
|
3225
|
-
intrinsicHeight,
|
|
3226
|
-
showControls,
|
|
3227
|
-
loop,
|
|
3228
|
-
playOptions,
|
|
3229
|
-
apiBaseUrl: assetBaseUrl,
|
|
3230
|
-
session
|
|
3615
|
+
controlType: dataType,
|
|
3616
|
+
value: value ?? `@databound[${fieldName}]`
|
|
3231
3617
|
}
|
|
3232
|
-
)
|
|
3233
|
-
} else {
|
|
3234
|
-
return (
|
|
3235
|
-
/* eslint-disable-next-line @next/next/no-img-element */
|
|
3236
|
-
/* @__PURE__ */ jsx52(
|
|
3237
|
-
"img",
|
|
3238
|
-
{
|
|
3239
|
-
style: styles,
|
|
3240
|
-
loading: "lazy",
|
|
3241
|
-
className: "object-cover w-full",
|
|
3242
|
-
src: resolvedAssetUrl,
|
|
3243
|
-
width: selectedAsset.intrinsicWidth,
|
|
3244
|
-
alt: title || "Asset image",
|
|
3245
|
-
height: selectedAsset.intrinsicHeight
|
|
3246
|
-
}
|
|
3247
|
-
)
|
|
3248
|
-
);
|
|
3618
|
+
)
|
|
3249
3619
|
}
|
|
3250
|
-
|
|
3251
|
-
if (width) {
|
|
3252
|
-
return /* @__PURE__ */ jsx52("div", { style: { width }, children: renderMedia() });
|
|
3253
|
-
}
|
|
3254
|
-
if (nodeProps?.format) {
|
|
3255
|
-
return /* @__PURE__ */ jsx52("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3256
|
-
}
|
|
3257
|
-
return renderMedia();
|
|
3620
|
+
);
|
|
3258
3621
|
};
|
|
3259
|
-
var
|
|
3622
|
+
var DatafieldNode_default = DatafieldNode;
|
|
3260
3623
|
|
|
3261
|
-
// src/components/pageRenderingEngine/nodes/
|
|
3262
|
-
import { Fragment as Fragment6, jsx as
|
|
3263
|
-
var
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
};
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
if (props.node.device) {
|
|
3278
|
-
const nodeDevice = props.node.device;
|
|
3279
|
-
if (nodeDevice !== currentDevice) {
|
|
3280
|
-
return null;
|
|
3281
|
-
}
|
|
3624
|
+
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
3625
|
+
import { Fragment as Fragment6, jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3626
|
+
var ParagraphNode = (props) => {
|
|
3627
|
+
const NodeTypes2 = {
|
|
3628
|
+
["text"]: TextNode_default,
|
|
3629
|
+
["linebreak"]: LineBreakNode_default,
|
|
3630
|
+
["link"]: LinkNode_default,
|
|
3631
|
+
["datafield"]: DatafieldNode_default,
|
|
3632
|
+
["equation"]: EquationNode_default,
|
|
3633
|
+
["svg-icon"]: SVGIconNode_default
|
|
3634
|
+
};
|
|
3635
|
+
const FormatClass = {
|
|
3636
|
+
"center": "text-center",
|
|
3637
|
+
"right": "text-right"
|
|
3638
|
+
};
|
|
3639
|
+
{
|
|
3282
3640
|
}
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
const image = getNestedValue(props.dataitem, props.node.datafield);
|
|
3292
|
-
console.log("ImageNode Datafield Image:", image);
|
|
3293
|
-
try {
|
|
3294
|
-
if (typeof image === "string") {
|
|
3295
|
-
assets = JSON.parse(image);
|
|
3296
|
-
} else if (Array.isArray(image)) {
|
|
3297
|
-
assets = image;
|
|
3298
|
-
} else if (image && typeof image === "object") {
|
|
3299
|
-
assets = [image];
|
|
3300
|
-
}
|
|
3301
|
-
} catch (error) {
|
|
3302
|
-
console.error("Error parsing assets in ImageNode:", error);
|
|
3303
|
-
}
|
|
3304
|
-
if (assets && assets.length > 0) {
|
|
3305
|
-
return /* @__PURE__ */ jsx53(Fragment6, { children: /* @__PURE__ */ jsx53(
|
|
3306
|
-
DeviceAssetSelector_default,
|
|
3641
|
+
const formatClasses = FormatClass[props.node.format] || "";
|
|
3642
|
+
const isInlineOnlyParent = props.parentTag === "summary";
|
|
3643
|
+
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
3644
|
+
if (isInlineOnlyParent) {
|
|
3645
|
+
return /* @__PURE__ */ jsx48(Fragment6, { children: hasChildren && props.node.children.map((node, index) => {
|
|
3646
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3647
|
+
return /* @__PURE__ */ jsx48(React36.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx48(
|
|
3648
|
+
SelectedNode,
|
|
3307
3649
|
{
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
assetBaseUrl: props.assetBaseUrl,
|
|
3650
|
+
node,
|
|
3651
|
+
dataitem: props.dataitem,
|
|
3311
3652
|
session: props.session,
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
showControls: props.node.showControls,
|
|
3315
|
-
loop: props.node.loop,
|
|
3316
|
-
playOptions: props.node.playOptions,
|
|
3317
|
-
borderRadius: props.node.borderRadius,
|
|
3318
|
-
width: props.node.width,
|
|
3319
|
-
height: props.node.height,
|
|
3320
|
-
format: props.node.format,
|
|
3321
|
-
tag: props.node.tag,
|
|
3322
|
-
// Add tag to ImageNode if needed
|
|
3323
|
-
placementCode: props.node.placementCode
|
|
3324
|
-
}
|
|
3653
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3654
|
+
routeParameters: props.routeParameters
|
|
3325
3655
|
}
|
|
3326
|
-
) });
|
|
3327
|
-
}
|
|
3328
|
-
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3329
|
-
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3330
|
-
}
|
|
3331
|
-
} else {
|
|
3332
|
-
imageUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.imageUrl);
|
|
3333
|
-
posterUrl = AssetUtility_default.resolveUrl(props.assetBaseUrl, props.node.posterUrl);
|
|
3334
|
-
}
|
|
3335
|
-
console.log("ImageNode Assets:", assets);
|
|
3336
|
-
if (!imageUrl) {
|
|
3337
|
-
return null;
|
|
3656
|
+
) }, index);
|
|
3657
|
+
}) });
|
|
3338
3658
|
}
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3659
|
+
return /* @__PURE__ */ jsxs27("div", { className: " " + formatClasses, children: [
|
|
3660
|
+
hasChildren && props.node.children.map((node, index) => {
|
|
3661
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3662
|
+
return /* @__PURE__ */ jsx48(React36.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx48(
|
|
3663
|
+
SelectedNode,
|
|
3664
|
+
{
|
|
3665
|
+
node,
|
|
3666
|
+
dataitem: props.dataitem,
|
|
3667
|
+
session: props.session,
|
|
3668
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
3669
|
+
routeParameters: props.routeParameters
|
|
3670
|
+
}
|
|
3671
|
+
) }, index);
|
|
3672
|
+
}),
|
|
3673
|
+
!hasChildren && /* @__PURE__ */ jsx48("div", { className: "py-1.5 lg:py-2" })
|
|
3674
|
+
] });
|
|
3675
|
+
};
|
|
3676
|
+
var ParagraphNode_default = ParagraphNode;
|
|
3677
|
+
|
|
3678
|
+
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
3679
|
+
import React37 from "react";
|
|
3680
|
+
import { Fragment as Fragment7, jsx as jsx49 } from "react/jsx-runtime";
|
|
3681
|
+
var HeadingNode = (props) => {
|
|
3682
|
+
const NodeTypes2 = {
|
|
3683
|
+
["text"]: TextNode_default,
|
|
3684
|
+
["link"]: LinkNode_default,
|
|
3685
|
+
["svg-icon"]: SVGIconNode_default,
|
|
3686
|
+
["linebreak"]: LineBreakNode_default,
|
|
3687
|
+
["datafield"]: DatafieldNode_default
|
|
3688
|
+
};
|
|
3689
|
+
const HeadingTag = `${props.node.tag}`;
|
|
3343
3690
|
const FormatClass = {
|
|
3344
|
-
"center": "
|
|
3345
|
-
"left": "justify-start",
|
|
3346
|
-
"right": "justify-end"
|
|
3691
|
+
"center": "text-center"
|
|
3347
3692
|
};
|
|
3348
3693
|
{
|
|
3349
3694
|
}
|
|
3350
3695
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3696
|
+
return /* @__PURE__ */ jsx49(Fragment7, { children: React37.createElement(
|
|
3697
|
+
HeadingTag,
|
|
3698
|
+
{ className: formatClasses },
|
|
3699
|
+
props.node.children && props.node.children.map((childNode, index) => {
|
|
3700
|
+
const SelectedNode = NodeTypes2[childNode.type];
|
|
3701
|
+
return /* @__PURE__ */ jsx49(React37.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx49(SelectedNode, { node: childNode, dataitem: props.dataitem, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
3702
|
+
})
|
|
3703
|
+
) });
|
|
3704
|
+
};
|
|
3705
|
+
var HeadingNode_default = HeadingNode;
|
|
3706
|
+
|
|
3707
|
+
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3708
|
+
import React39 from "react";
|
|
3709
|
+
|
|
3710
|
+
// src/components/pageRenderingEngine/nodes/ListItemNode.tsx
|
|
3711
|
+
import React38 from "react";
|
|
3712
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
3713
|
+
var ListItemNode = (props) => {
|
|
3714
|
+
const NodeTypes2 = {
|
|
3715
|
+
text: TextNode_default,
|
|
3716
|
+
linebreak: LineBreakNode_default,
|
|
3717
|
+
link: LinkNode_default,
|
|
3718
|
+
list: ListNode_default
|
|
3719
|
+
};
|
|
3720
|
+
let foundFirstBreak = false;
|
|
3721
|
+
const firstTextChild = props.node.children?.find((c) => c.type === "text");
|
|
3722
|
+
let liStyle = {};
|
|
3723
|
+
if (firstTextChild?.style) {
|
|
3724
|
+
const match = firstTextChild.style.match(/font-size\s*:\s*([^;]+);?/);
|
|
3725
|
+
if (match) {
|
|
3726
|
+
liStyle.fontSize = match[1].trim();
|
|
3727
|
+
}
|
|
3728
|
+
}
|
|
3729
|
+
return /* @__PURE__ */ jsx50("li", { style: liStyle, children: props.node.children && props.node.children.map((node, index) => {
|
|
3730
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3731
|
+
if (node.type === "linebreak") {
|
|
3732
|
+
if (!foundFirstBreak) {
|
|
3733
|
+
foundFirstBreak = true;
|
|
3734
|
+
return /* @__PURE__ */ jsx50("div", {}, index);
|
|
3735
|
+
} else {
|
|
3736
|
+
return /* @__PURE__ */ jsx50("div", { className: "py-1 lg:py-2" }, index);
|
|
3737
|
+
}
|
|
3738
|
+
} else {
|
|
3739
|
+
foundFirstBreak = false;
|
|
3740
|
+
return /* @__PURE__ */ jsx50(React38.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx50(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3741
|
+
}
|
|
3742
|
+
}) });
|
|
3743
|
+
};
|
|
3744
|
+
var ListItemNode_default = ListItemNode;
|
|
3745
|
+
|
|
3746
|
+
// src/components/pageRenderingEngine/nodes/ListNode.tsx
|
|
3747
|
+
import { jsx as jsx51, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3748
|
+
var ListNode = (props) => {
|
|
3749
|
+
const NodeTypes2 = {
|
|
3750
|
+
listitem: ListItemNode_default
|
|
3751
|
+
};
|
|
3752
|
+
return /* @__PURE__ */ jsxs28(React39.Fragment, { children: [
|
|
3753
|
+
props.node.listType == "bullet" && /* @__PURE__ */ jsx51("ul", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3754
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3755
|
+
return /* @__PURE__ */ jsx51(React39.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx51(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3756
|
+
}) }),
|
|
3757
|
+
props.node.listType == "number" && /* @__PURE__ */ jsx51("ol", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3758
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3759
|
+
return /* @__PURE__ */ jsx51(React39.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx51(SelectedNode, { node, dataitem: props.dataitem, routeParameters: props.routeParameters }) }, index);
|
|
3760
|
+
}) })
|
|
3761
|
+
] });
|
|
3762
|
+
};
|
|
3763
|
+
var ListNode_default = ListNode;
|
|
3764
|
+
|
|
3765
|
+
// src/components/pageRenderingEngine/nodes/QuoteNode.tsx
|
|
3766
|
+
import React40 from "react";
|
|
3767
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3768
|
+
var QuoteNode = (props) => {
|
|
3769
|
+
const NodeTypes2 = {
|
|
3770
|
+
["text"]: TextNode_default,
|
|
3771
|
+
["linebreak"]: LineBreakNode_default,
|
|
3772
|
+
["link"]: LinkNode_default
|
|
3773
|
+
};
|
|
3774
|
+
return /* @__PURE__ */ jsx52("blockquote", { children: props.node.children && props.node.children.map((node, index) => {
|
|
3775
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3776
|
+
return /* @__PURE__ */ jsx52(React40.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx52(SelectedNode, { node, session: props.session, apiBaseUrl: props.apiBaseUrl, routeParameters: props.routeParameters }) }, index);
|
|
3777
|
+
}) });
|
|
3778
|
+
};
|
|
3779
|
+
var QuoteNode_default = QuoteNode;
|
|
3780
|
+
|
|
3781
|
+
// src/components/pageRenderingEngine/nodes/CodeNode.tsx
|
|
3782
|
+
import React41 from "react";
|
|
3783
|
+
import dynamic2 from "next/dynamic";
|
|
3784
|
+
import { jsx as jsx53, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3785
|
+
var CopyButton = dynamic2(() => import("./CopyButton-XONTQQW7.mjs"), {
|
|
3786
|
+
ssr: false,
|
|
3787
|
+
// optional: fallback UI while loading
|
|
3788
|
+
loading: () => /* @__PURE__ */ jsx53("span", { className: "text-gray-400 text-xs", children: "Copy" })
|
|
3789
|
+
});
|
|
3790
|
+
var CodeNode = (props) => {
|
|
3791
|
+
const NodeTypes2 = {
|
|
3792
|
+
text: TextNode_default,
|
|
3793
|
+
linebreak: LineBreakNode_default,
|
|
3794
|
+
link: LinkNode_default
|
|
3795
|
+
};
|
|
3796
|
+
const textContent = props.node?.children?.map((node) => {
|
|
3797
|
+
if (node.type === "text") return node.text || "";
|
|
3798
|
+
if (node.type === "linebreak") return "\n";
|
|
3799
|
+
if (node.type === "link") return node.text || node.url || "";
|
|
3800
|
+
return "";
|
|
3801
|
+
}).join("") ?? "";
|
|
3802
|
+
return /* @__PURE__ */ jsxs29("div", { children: [
|
|
3803
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex items-center relative bg-neutral-strong px-4 py-3 text-xs font-sans justify-between rounded-t-md ", children: [
|
|
3804
|
+
/* @__PURE__ */ jsx53("span", { children: "Code Snippet" }),
|
|
3805
|
+
/* @__PURE__ */ jsx53(CopyButton, { text: textContent })
|
|
3806
|
+
] }),
|
|
3807
|
+
/* @__PURE__ */ jsx53("code", { className: "bg-neutral-soft p-4 text-sm whitespace-pre-wrap border border-2 block", children: props.node.children && props.node.children.map((node, index) => {
|
|
3808
|
+
const SelectedNode = NodeTypes2[node.type];
|
|
3809
|
+
return /* @__PURE__ */ jsx53(React41.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx53(
|
|
3810
|
+
SelectedNode,
|
|
3356
3811
|
{
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
intrinsicWidth: props.node.intrinsicWidth,
|
|
3360
|
-
intrinsicHeight: props.node.intrinsicHeight,
|
|
3361
|
-
showControls: props.node.showControls === "true",
|
|
3362
|
-
loop: props.node.loop === "true",
|
|
3363
|
-
playOptions: props.node.playOptions,
|
|
3812
|
+
node,
|
|
3813
|
+
session: props.session,
|
|
3364
3814
|
apiBaseUrl: props.apiBaseUrl,
|
|
3365
|
-
|
|
3366
|
-
}
|
|
3367
|
-
);
|
|
3368
|
-
} else {
|
|
3369
|
-
return /* @__PURE__ */ jsx53(React40.Fragment, { children: /* @__PURE__ */ jsx53(
|
|
3370
|
-
"img",
|
|
3371
|
-
{
|
|
3372
|
-
style: styles,
|
|
3373
|
-
loading: "lazy",
|
|
3374
|
-
className: "object-cover",
|
|
3375
|
-
src: imageUrl,
|
|
3376
|
-
width: props.node.intrinsicWidth,
|
|
3377
|
-
alt: props.node.title,
|
|
3378
|
-
height: props.node.intrinsicHeight
|
|
3815
|
+
routeParameters: props.routeParameters
|
|
3379
3816
|
}
|
|
3380
|
-
) });
|
|
3381
|
-
}
|
|
3382
|
-
};
|
|
3383
|
-
if (props.node.width) {
|
|
3384
|
-
return /* @__PURE__ */ jsx53("div", { className: `flex ${formatClasses}`, children: renderMedia() });
|
|
3385
|
-
}
|
|
3386
|
-
return renderMedia();
|
|
3817
|
+
) }, index);
|
|
3818
|
+
}) })
|
|
3819
|
+
] });
|
|
3387
3820
|
};
|
|
3388
|
-
var
|
|
3821
|
+
var CodeNode_default = CodeNode;
|
|
3822
|
+
|
|
3823
|
+
// src/components/pageRenderingEngine/nodes/HorizontalRuleNode.tsx
|
|
3824
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
3825
|
+
var HorizontalRuleNode = () => {
|
|
3826
|
+
return /* @__PURE__ */ jsx54("hr", {});
|
|
3827
|
+
};
|
|
3828
|
+
var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
3389
3829
|
|
|
3390
3830
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
3391
|
-
import { Fragment as
|
|
3831
|
+
import { Fragment as Fragment8, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3392
3832
|
var WidgetNode = (props) => {
|
|
3393
3833
|
const getWidgetParameters = () => {
|
|
3394
3834
|
const widgetInputParameters = {
|
|
@@ -3445,14 +3885,14 @@ var WidgetNode = (props) => {
|
|
|
3445
3885
|
};
|
|
3446
3886
|
const widgetCode = props.node?.widgetCode;
|
|
3447
3887
|
if (!widgetCode) {
|
|
3448
|
-
return /* @__PURE__ */
|
|
3888
|
+
return /* @__PURE__ */ jsx55(Fragment8, { children: "Invalid widget" });
|
|
3449
3889
|
}
|
|
3450
3890
|
const SelectedWidget = getWidget(widgetCode);
|
|
3451
3891
|
if (!SelectedWidget) {
|
|
3452
3892
|
if (process.env.NODE_ENV !== "production") {
|
|
3453
3893
|
console.warn("Widget not found:", widgetCode);
|
|
3454
3894
|
}
|
|
3455
|
-
return /* @__PURE__ */ jsxs30(
|
|
3895
|
+
return /* @__PURE__ */ jsxs30(Fragment8, { children: [
|
|
3456
3896
|
"Widget not found: ",
|
|
3457
3897
|
widgetCode
|
|
3458
3898
|
] });
|
|
@@ -3460,7 +3900,7 @@ var WidgetNode = (props) => {
|
|
|
3460
3900
|
const widgetParams = getWidgetParameters();
|
|
3461
3901
|
return (
|
|
3462
3902
|
// eslint-disable-next-line react-hooks/static-components
|
|
3463
|
-
/* @__PURE__ */
|
|
3903
|
+
/* @__PURE__ */ jsx55(
|
|
3464
3904
|
SelectedWidget,
|
|
3465
3905
|
{
|
|
3466
3906
|
params: widgetParams,
|
|
@@ -3476,12 +3916,12 @@ var WidgetNode = (props) => {
|
|
|
3476
3916
|
var WidgetNode_default = WidgetNode;
|
|
3477
3917
|
|
|
3478
3918
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3479
|
-
import
|
|
3919
|
+
import React42, { useRef as useRef3, useReducer as useReducer2, useCallback as useCallback4, useEffect as useEffect7 } from "react";
|
|
3480
3920
|
|
|
3481
3921
|
// src/components/pageRenderingEngine/nodes/InputControlNode.tsx
|
|
3482
|
-
import { jsx as
|
|
3922
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
3483
3923
|
var InputControlNode = (props) => {
|
|
3484
|
-
return /* @__PURE__ */
|
|
3924
|
+
return /* @__PURE__ */ jsx56("div", { children: /* @__PURE__ */ jsx56(
|
|
3485
3925
|
InputControl_default,
|
|
3486
3926
|
{
|
|
3487
3927
|
name: props.node.name,
|
|
@@ -3509,213 +3949,8 @@ var InputControlNode = (props) => {
|
|
|
3509
3949
|
};
|
|
3510
3950
|
var InputControlNode_default = InputControlNode;
|
|
3511
3951
|
|
|
3512
|
-
// src/clients/CacheManage.tsx
|
|
3513
|
-
import NodeCache from "node-cache";
|
|
3514
|
-
var CacheManager = class _CacheManager {
|
|
3515
|
-
constructor() {
|
|
3516
|
-
this.maxCacheSize = 1e3;
|
|
3517
|
-
this.cache = new NodeCache({ stdTTL: 0, checkperiod: 300 });
|
|
3518
|
-
}
|
|
3519
|
-
static getInstance() {
|
|
3520
|
-
if (!_CacheManager.instance) {
|
|
3521
|
-
_CacheManager.instance = new _CacheManager();
|
|
3522
|
-
}
|
|
3523
|
-
return _CacheManager.instance;
|
|
3524
|
-
}
|
|
3525
|
-
get(key) {
|
|
3526
|
-
return null;
|
|
3527
|
-
}
|
|
3528
|
-
set(key, data, ttl) {
|
|
3529
|
-
}
|
|
3530
|
-
clear() {
|
|
3531
|
-
this.cache.flushAll();
|
|
3532
|
-
}
|
|
3533
|
-
size() {
|
|
3534
|
-
return this.cache.keys().length;
|
|
3535
|
-
}
|
|
3536
|
-
destroy() {
|
|
3537
|
-
this.cache.close();
|
|
3538
|
-
}
|
|
3539
|
-
};
|
|
3540
|
-
|
|
3541
|
-
// src/clients/ServiceClient.tsx
|
|
3542
|
-
var ServerApiError = class extends Error {
|
|
3543
|
-
constructor(data, status) {
|
|
3544
|
-
super(data.message || "---");
|
|
3545
|
-
this.status = status;
|
|
3546
|
-
this.data = data;
|
|
3547
|
-
this.data.isSuccessful = false;
|
|
3548
|
-
}
|
|
3549
|
-
};
|
|
3550
|
-
var ServiceClient = class {
|
|
3551
|
-
constructor(apiBaseUrl, session) {
|
|
3552
|
-
this.cacheManager = CacheManager.getInstance();
|
|
3553
|
-
this.baseUrl = apiBaseUrl;
|
|
3554
|
-
this.session = session;
|
|
3555
|
-
}
|
|
3556
|
-
buildFullPath(path, params) {
|
|
3557
|
-
let updatedPath = path;
|
|
3558
|
-
if (params) {
|
|
3559
|
-
Object.keys(params).forEach((key) => {
|
|
3560
|
-
updatedPath = updatedPath.replace(
|
|
3561
|
-
`{${key}}`,
|
|
3562
|
-
String(params[key])
|
|
3563
|
-
);
|
|
3564
|
-
});
|
|
3565
|
-
}
|
|
3566
|
-
return this.baseUrl + updatedPath;
|
|
3567
|
-
}
|
|
3568
|
-
getConfig() {
|
|
3569
|
-
const config = { headers: {} };
|
|
3570
|
-
if (this.session) {
|
|
3571
|
-
if (this.session.oAuthToken) {
|
|
3572
|
-
config.headers["Authorization"] = "Bearer " + this.session.oAuthToken;
|
|
3573
|
-
}
|
|
3574
|
-
config.headers["cid"] = this.session.cid || "";
|
|
3575
|
-
config.headers["UserCurrencyCode"] = this.session.userCurrencyCode || "INR";
|
|
3576
|
-
config.headers["MarketCode"] = this.session?.marketCode || "IND";
|
|
3577
|
-
}
|
|
3578
|
-
return config;
|
|
3579
|
-
}
|
|
3580
|
-
handleFetchError(error) {
|
|
3581
|
-
console.log(error);
|
|
3582
|
-
const serverApiError = error;
|
|
3583
|
-
if (serverApiError) {
|
|
3584
|
-
return serverApiError.data;
|
|
3585
|
-
}
|
|
3586
|
-
return {
|
|
3587
|
-
message: "There is some error. Please try after sometime.",
|
|
3588
|
-
isSuccessful: false
|
|
3589
|
-
};
|
|
3590
|
-
}
|
|
3591
|
-
async fetchJsonWithCache(fullPath, config) {
|
|
3592
|
-
const cacheKey = fullPath + "--" + (this.session?.marketCode || "IND");
|
|
3593
|
-
const cachedData = this.cacheManager.get(cacheKey);
|
|
3594
|
-
if (cachedData) {
|
|
3595
|
-
return cachedData;
|
|
3596
|
-
}
|
|
3597
|
-
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
3598
|
-
const response = await fetch(fullPath, { headers: config.headers });
|
|
3599
|
-
if (!response.ok) {
|
|
3600
|
-
const apiErrorData = await response.json();
|
|
3601
|
-
throw new ServerApiError(apiErrorData, response.status);
|
|
3602
|
-
}
|
|
3603
|
-
const cacheControl = response.headers.get("Cache-Control");
|
|
3604
|
-
let revalidate = null;
|
|
3605
|
-
if (cacheControl) {
|
|
3606
|
-
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
3607
|
-
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
3608
|
-
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
3609
|
-
revalidate = maxAge * 1e3;
|
|
3610
|
-
}
|
|
3611
|
-
}
|
|
3612
|
-
const data = await response.json();
|
|
3613
|
-
data.isSuccessful = true;
|
|
3614
|
-
if (revalidate !== null && revalidate > 0) {
|
|
3615
|
-
console.log("revalidate............I am caching:" + revalidate);
|
|
3616
|
-
this.cacheManager.set(cacheKey, data, revalidate);
|
|
3617
|
-
}
|
|
3618
|
-
return data;
|
|
3619
|
-
}
|
|
3620
|
-
// private async refreshToken(): Promise<void> {
|
|
3621
|
-
// console.log("*******************calling refresh token***********************");
|
|
3622
|
-
// try {
|
|
3623
|
-
// const response = await fetch(this.baseUrl + "/auth/storefront/login/refreshToken", {
|
|
3624
|
-
// method: 'POST',
|
|
3625
|
-
// headers: {
|
|
3626
|
-
// 'Content-Type': 'application/json'
|
|
3627
|
-
// },
|
|
3628
|
-
// body: JSON.stringify({ refreshToken: this.session.refreshToken })
|
|
3629
|
-
// });
|
|
3630
|
-
// if (!response.ok) {
|
|
3631
|
-
// throw new Error("Failed to refresh token");
|
|
3632
|
-
// }
|
|
3633
|
-
// const responseData = await response.json();
|
|
3634
|
-
// this.session.oAuthToken = responseData.result.accessToken;
|
|
3635
|
-
// if (typeof window === "undefined") {
|
|
3636
|
-
// // Running on the server
|
|
3637
|
-
// } else {
|
|
3638
|
-
// await fetch("/api/login", {
|
|
3639
|
-
// method: "post",
|
|
3640
|
-
// headers: {
|
|
3641
|
-
// "Content-Type": "application/json",
|
|
3642
|
-
// },
|
|
3643
|
-
// body: JSON.stringify({ session: this.session }),
|
|
3644
|
-
// });
|
|
3645
|
-
// }
|
|
3646
|
-
// } catch (error: any) {
|
|
3647
|
-
// throw new Error("Failed to refresh token");
|
|
3648
|
-
// }
|
|
3649
|
-
// }
|
|
3650
|
-
async handleRequest(request) {
|
|
3651
|
-
try {
|
|
3652
|
-
return await request();
|
|
3653
|
-
} catch (error) {
|
|
3654
|
-
throw error;
|
|
3655
|
-
}
|
|
3656
|
-
}
|
|
3657
|
-
async post(path, data) {
|
|
3658
|
-
const request = async () => {
|
|
3659
|
-
const fullPath = this.baseUrl + path;
|
|
3660
|
-
const config = this.getConfig();
|
|
3661
|
-
const response = await fetch(fullPath, {
|
|
3662
|
-
method: "POST",
|
|
3663
|
-
headers: {
|
|
3664
|
-
...config.headers,
|
|
3665
|
-
"Content-Type": "application/json"
|
|
3666
|
-
},
|
|
3667
|
-
body: JSON.stringify(data)
|
|
3668
|
-
});
|
|
3669
|
-
if (!response.ok) {
|
|
3670
|
-
const apiErrorData = await response.json();
|
|
3671
|
-
throw new ServerApiError(apiErrorData, response.status);
|
|
3672
|
-
}
|
|
3673
|
-
const responseData = await response.json();
|
|
3674
|
-
responseData.isSuccessful = true;
|
|
3675
|
-
return responseData;
|
|
3676
|
-
};
|
|
3677
|
-
try {
|
|
3678
|
-
return await this.handleRequest(request);
|
|
3679
|
-
} catch (error) {
|
|
3680
|
-
return this.handleFetchError(error);
|
|
3681
|
-
}
|
|
3682
|
-
}
|
|
3683
|
-
async getSingle(path, params) {
|
|
3684
|
-
const request = async () => {
|
|
3685
|
-
const sanitizedParams = params ? Object.fromEntries(
|
|
3686
|
-
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
3687
|
-
) : void 0;
|
|
3688
|
-
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
3689
|
-
const config = this.getConfig();
|
|
3690
|
-
return await this.fetchJsonWithCache(fullPath, config);
|
|
3691
|
-
};
|
|
3692
|
-
try {
|
|
3693
|
-
return await this.handleRequest(request);
|
|
3694
|
-
} catch (error) {
|
|
3695
|
-
return this.handleFetchError(error);
|
|
3696
|
-
}
|
|
3697
|
-
}
|
|
3698
|
-
async get(path, params) {
|
|
3699
|
-
const request = async () => {
|
|
3700
|
-
const sanitizedParams = params ? Object.fromEntries(
|
|
3701
|
-
Object.entries(params).map(([k, v]) => [k, String(v)])
|
|
3702
|
-
) : void 0;
|
|
3703
|
-
const fullPath = this.buildFullPath(path, sanitizedParams);
|
|
3704
|
-
const config = this.getConfig();
|
|
3705
|
-
console.log(fullPath);
|
|
3706
|
-
return await this.fetchJsonWithCache(fullPath, config);
|
|
3707
|
-
};
|
|
3708
|
-
try {
|
|
3709
|
-
return await this.handleRequest(request);
|
|
3710
|
-
} catch (error) {
|
|
3711
|
-
return this.handleFetchError(error);
|
|
3712
|
-
}
|
|
3713
|
-
}
|
|
3714
|
-
};
|
|
3715
|
-
var ServiceClient_default = ServiceClient;
|
|
3716
|
-
|
|
3717
3952
|
// src/components/pageRenderingEngine/nodes/FormContainerNode.tsx
|
|
3718
|
-
import { jsx as
|
|
3953
|
+
import { jsx as jsx57, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3719
3954
|
var FormContainerNode = (props) => {
|
|
3720
3955
|
const NodeTypes2 = {
|
|
3721
3956
|
["input-control"]: InputControlNode_default
|
|
@@ -3727,7 +3962,7 @@ var FormContainerNode = (props) => {
|
|
|
3727
3962
|
lastPropertyChanged: ""
|
|
3728
3963
|
};
|
|
3729
3964
|
const [formState, dispatch] = useReducer2(FormReducer_default, initialState);
|
|
3730
|
-
const handleInputChange =
|
|
3965
|
+
const handleInputChange = useCallback4((updatedValues) => {
|
|
3731
3966
|
dispatch({ type: FORM_INPUT_UPDATE, name: updatedValues.name, value: updatedValues.value });
|
|
3732
3967
|
}, [dispatch]);
|
|
3733
3968
|
useEffect7(() => {
|
|
@@ -3750,7 +3985,7 @@ var FormContainerNode = (props) => {
|
|
|
3750
3985
|
{
|
|
3751
3986
|
}
|
|
3752
3987
|
const SelectedNode = NodeTypes2[node2.type];
|
|
3753
|
-
return /* @__PURE__ */
|
|
3988
|
+
return /* @__PURE__ */ jsx57(React42.Fragment, { children: SelectedNode && node2.type == "input-control" && /* @__PURE__ */ jsx57(
|
|
3754
3989
|
InputControlNode_default,
|
|
3755
3990
|
{
|
|
3756
3991
|
value: formState.inputValues[node2.name],
|
|
@@ -3759,17 +3994,17 @@ var FormContainerNode = (props) => {
|
|
|
3759
3994
|
}
|
|
3760
3995
|
) }, index);
|
|
3761
3996
|
}),
|
|
3762
|
-
node.children.length == 0 && /* @__PURE__ */
|
|
3997
|
+
node.children.length == 0 && /* @__PURE__ */ jsx57("div", { className: "py-0.5 lg:py-1.5" })
|
|
3763
3998
|
] });
|
|
3764
3999
|
};
|
|
3765
4000
|
var FormContainerNode_default = FormContainerNode;
|
|
3766
4001
|
|
|
3767
4002
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
3768
|
-
import
|
|
4003
|
+
import React45 from "react";
|
|
3769
4004
|
|
|
3770
4005
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
3771
4006
|
import dynamic3 from "next/dynamic";
|
|
3772
|
-
import { jsx as
|
|
4007
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
3773
4008
|
var IframeClient = dynamic3(() => import("./IframeClient-J22NMEVY.mjs"), {
|
|
3774
4009
|
ssr: false
|
|
3775
4010
|
});
|
|
@@ -3782,13 +4017,13 @@ var EmbedNode = (props) => {
|
|
|
3782
4017
|
} else {
|
|
3783
4018
|
src = props.node.embedSrc;
|
|
3784
4019
|
}
|
|
3785
|
-
return /* @__PURE__ */
|
|
4020
|
+
return /* @__PURE__ */ jsx58("div", { className: "aspect-video", children: src && /* @__PURE__ */ jsx58(IframeClient, { src }) });
|
|
3786
4021
|
};
|
|
3787
4022
|
var EmbedNode_default = EmbedNode;
|
|
3788
4023
|
|
|
3789
4024
|
// src/components/Slider.tsx
|
|
3790
|
-
import
|
|
3791
|
-
import { Fragment as
|
|
4025
|
+
import React43, { useState as useState9, useEffect as useEffect8, Children, cloneElement } from "react";
|
|
4026
|
+
import { Fragment as Fragment9, jsx as jsx59, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3792
4027
|
var Slider = ({
|
|
3793
4028
|
children,
|
|
3794
4029
|
slidesToShow = 4,
|
|
@@ -3806,12 +4041,12 @@ var Slider = ({
|
|
|
3806
4041
|
pillStyle = "cumulative",
|
|
3807
4042
|
progressPosition = "bottom"
|
|
3808
4043
|
}) => {
|
|
3809
|
-
const [currentSlide, setCurrentSlide] =
|
|
3810
|
-
const [transition, setTransition] =
|
|
3811
|
-
const [slidesToShowState, setSlidesToShowState] =
|
|
4044
|
+
const [currentSlide, setCurrentSlide] = useState9(0);
|
|
4045
|
+
const [transition, setTransition] = useState9(true);
|
|
4046
|
+
const [slidesToShowState, setSlidesToShowState] = useState9(
|
|
3812
4047
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
3813
4048
|
);
|
|
3814
|
-
const [isPlaying, setIsPlaying] =
|
|
4049
|
+
const [isPlaying, setIsPlaying] = useState9(autoplay);
|
|
3815
4050
|
useEffect8(() => {
|
|
3816
4051
|
if (typeof slidesToShow === "number") return;
|
|
3817
4052
|
const handleResize = () => {
|
|
@@ -3882,10 +4117,10 @@ var Slider = ({
|
|
|
3882
4117
|
};
|
|
3883
4118
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
3884
4119
|
const slides = Children.map(children, (child, index) => {
|
|
3885
|
-
if (!
|
|
4120
|
+
if (!React43.isValidElement(child)) return null;
|
|
3886
4121
|
const childProps = child.props;
|
|
3887
4122
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
3888
|
-
return /* @__PURE__ */
|
|
4123
|
+
return /* @__PURE__ */ jsx59(
|
|
3889
4124
|
"div",
|
|
3890
4125
|
{
|
|
3891
4126
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
@@ -3915,7 +4150,7 @@ var Slider = ({
|
|
|
3915
4150
|
onMouseEnter: handleMouseEnter,
|
|
3916
4151
|
onMouseLeave: handleMouseLeave,
|
|
3917
4152
|
children: [
|
|
3918
|
-
/* @__PURE__ */
|
|
4153
|
+
/* @__PURE__ */ jsx59(
|
|
3919
4154
|
"div",
|
|
3920
4155
|
{
|
|
3921
4156
|
className: "flex h-full",
|
|
@@ -3926,15 +4161,15 @@ var Slider = ({
|
|
|
3926
4161
|
children: slides
|
|
3927
4162
|
}
|
|
3928
4163
|
),
|
|
3929
|
-
show_arrows && /* @__PURE__ */ jsxs32(
|
|
3930
|
-
/* @__PURE__ */
|
|
4164
|
+
show_arrows && /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
4165
|
+
/* @__PURE__ */ jsx59(
|
|
3931
4166
|
ArrowButton,
|
|
3932
4167
|
{
|
|
3933
4168
|
direction: "left",
|
|
3934
4169
|
onClick: prevSlide,
|
|
3935
4170
|
visible: infinite_scroll || currentSlide > 0,
|
|
3936
4171
|
className: arrowClassName,
|
|
3937
|
-
children: /* @__PURE__ */
|
|
4172
|
+
children: /* @__PURE__ */ jsx59("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ jsx59("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
3938
4173
|
}
|
|
3939
4174
|
),
|
|
3940
4175
|
/* @__PURE__ */ jsxs32(
|
|
@@ -3945,13 +4180,13 @@ var Slider = ({
|
|
|
3945
4180
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
3946
4181
|
className: arrowClassName,
|
|
3947
4182
|
children: [
|
|
3948
|
-
/* @__PURE__ */
|
|
4183
|
+
/* @__PURE__ */ jsx59("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ jsx59("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
3949
4184
|
" "
|
|
3950
4185
|
]
|
|
3951
4186
|
}
|
|
3952
4187
|
)
|
|
3953
4188
|
] }),
|
|
3954
|
-
show_dots && /* @__PURE__ */
|
|
4189
|
+
show_dots && /* @__PURE__ */ jsx59("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ jsx59(
|
|
3955
4190
|
ProgressPill,
|
|
3956
4191
|
{
|
|
3957
4192
|
active: index === currentSlide,
|
|
@@ -3977,7 +4212,7 @@ var ArrowButton = ({
|
|
|
3977
4212
|
visible,
|
|
3978
4213
|
children,
|
|
3979
4214
|
className = ""
|
|
3980
|
-
}) => /* @__PURE__ */
|
|
4215
|
+
}) => /* @__PURE__ */ jsx59(
|
|
3981
4216
|
"button",
|
|
3982
4217
|
{
|
|
3983
4218
|
className: `
|
|
@@ -4003,7 +4238,7 @@ var ProgressPill = ({
|
|
|
4003
4238
|
currentSlide,
|
|
4004
4239
|
totalSlides
|
|
4005
4240
|
}) => {
|
|
4006
|
-
const [progress, setProgress] =
|
|
4241
|
+
const [progress, setProgress] = useState9(0);
|
|
4007
4242
|
useEffect8(() => {
|
|
4008
4243
|
if (active) {
|
|
4009
4244
|
setProgress(0);
|
|
@@ -4064,7 +4299,7 @@ var ProgressPill = ({
|
|
|
4064
4299
|
const renderProgressBar = () => {
|
|
4065
4300
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4066
4301
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4067
|
-
return /* @__PURE__ */
|
|
4302
|
+
return /* @__PURE__ */ jsx59(
|
|
4068
4303
|
"div",
|
|
4069
4304
|
{
|
|
4070
4305
|
className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -4076,7 +4311,7 @@ var ProgressPill = ({
|
|
|
4076
4311
|
};
|
|
4077
4312
|
const renderCumulativeFill = () => {
|
|
4078
4313
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4079
|
-
return /* @__PURE__ */
|
|
4314
|
+
return /* @__PURE__ */ jsx59(
|
|
4080
4315
|
"div",
|
|
4081
4316
|
{
|
|
4082
4317
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4262,10 +4497,10 @@ var PathUtility = class {
|
|
|
4262
4497
|
var PathUtility_default = new PathUtility();
|
|
4263
4498
|
|
|
4264
4499
|
// src/components/NoDataFound.tsx
|
|
4265
|
-
import { jsx as
|
|
4500
|
+
import { jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4266
4501
|
var NoDataFound = () => {
|
|
4267
4502
|
return /* @__PURE__ */ jsxs33("div", { className: "flex flex-col items-center justify-center py-12 px-4 text-center bg-neutral-weak", children: [
|
|
4268
|
-
/* @__PURE__ */
|
|
4503
|
+
/* @__PURE__ */ jsx60("div", { className: "mb-5", children: /* @__PURE__ */ jsx60("div", { className: "mx-auto w-20 h-20 rounded-full flex items-center justify-center bg-neutral-soft", children: /* @__PURE__ */ jsx60(
|
|
4269
4504
|
"svg",
|
|
4270
4505
|
{
|
|
4271
4506
|
className: "w-10 h-10",
|
|
@@ -4273,7 +4508,7 @@ var NoDataFound = () => {
|
|
|
4273
4508
|
stroke: "currentColor",
|
|
4274
4509
|
viewBox: "0 0 24 24",
|
|
4275
4510
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4276
|
-
children: /* @__PURE__ */
|
|
4511
|
+
children: /* @__PURE__ */ jsx60(
|
|
4277
4512
|
"path",
|
|
4278
4513
|
{
|
|
4279
4514
|
strokeLinecap: "round",
|
|
@@ -4284,15 +4519,15 @@ var NoDataFound = () => {
|
|
|
4284
4519
|
)
|
|
4285
4520
|
}
|
|
4286
4521
|
) }) }),
|
|
4287
|
-
/* @__PURE__ */
|
|
4288
|
-
/* @__PURE__ */
|
|
4522
|
+
/* @__PURE__ */ jsx60("h3", { className: "text-lg font-medium mb-2", children: "No data available" }),
|
|
4523
|
+
/* @__PURE__ */ jsx60("p", { className: " max-w-sm mb-0", children: "No records found. Data may be empty or not available at the moment." })
|
|
4289
4524
|
] });
|
|
4290
4525
|
};
|
|
4291
4526
|
var NoDataFound_default = NoDataFound;
|
|
4292
4527
|
|
|
4293
4528
|
// src/components/Pagination.tsx
|
|
4294
4529
|
import { useMemo } from "react";
|
|
4295
|
-
import { jsx as
|
|
4530
|
+
import { jsx as jsx61, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4296
4531
|
var Pagination = (props) => {
|
|
4297
4532
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
4298
4533
|
const builder = useMemo(() => {
|
|
@@ -4336,7 +4571,7 @@ var Pagination = (props) => {
|
|
|
4336
4571
|
return range;
|
|
4337
4572
|
};
|
|
4338
4573
|
const paginationRange = getPaginationRange();
|
|
4339
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */
|
|
4574
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ jsx61(
|
|
4340
4575
|
Hyperlink,
|
|
4341
4576
|
{
|
|
4342
4577
|
linkType: "Link" /* Link */,
|
|
@@ -4351,9 +4586,9 @@ var Pagination = (props) => {
|
|
|
4351
4586
|
);
|
|
4352
4587
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
4353
4588
|
if (disabled) {
|
|
4354
|
-
return /* @__PURE__ */
|
|
4589
|
+
return /* @__PURE__ */ jsx61("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
|
|
4355
4590
|
}
|
|
4356
|
-
return /* @__PURE__ */
|
|
4591
|
+
return /* @__PURE__ */ jsx61(
|
|
4357
4592
|
Hyperlink,
|
|
4358
4593
|
{
|
|
4359
4594
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border transition-colors duration-150",
|
|
@@ -4374,7 +4609,7 @@ var Pagination = (props) => {
|
|
|
4374
4609
|
] }),
|
|
4375
4610
|
" ",
|
|
4376
4611
|
"out of ",
|
|
4377
|
-
/* @__PURE__ */
|
|
4612
|
+
/* @__PURE__ */ jsx61("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
4378
4613
|
" results"
|
|
4379
4614
|
] }),
|
|
4380
4615
|
totalPages > 1 && /* @__PURE__ */ jsxs34("div", { className: "flex items-center space-x-1", children: [
|
|
@@ -4384,14 +4619,14 @@ var Pagination = (props) => {
|
|
|
4384
4619
|
page: activePageNumber - 1,
|
|
4385
4620
|
disabled: activePageNumber === 1,
|
|
4386
4621
|
children: [
|
|
4387
|
-
/* @__PURE__ */
|
|
4388
|
-
/* @__PURE__ */
|
|
4622
|
+
/* @__PURE__ */ jsx61("span", { children: /* @__PURE__ */ jsx61(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
4623
|
+
/* @__PURE__ */ jsx61("span", { className: "text-sm", children: "Prev" })
|
|
4389
4624
|
]
|
|
4390
4625
|
}
|
|
4391
4626
|
),
|
|
4392
4627
|
paginationRange.map((item, index) => {
|
|
4393
4628
|
if (item === "...") {
|
|
4394
|
-
return /* @__PURE__ */
|
|
4629
|
+
return /* @__PURE__ */ jsx61(
|
|
4395
4630
|
"span",
|
|
4396
4631
|
{
|
|
4397
4632
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -4401,7 +4636,7 @@ var Pagination = (props) => {
|
|
|
4401
4636
|
);
|
|
4402
4637
|
}
|
|
4403
4638
|
const page = item;
|
|
4404
|
-
return /* @__PURE__ */
|
|
4639
|
+
return /* @__PURE__ */ jsx61(PageButton, { page, children: page }, page);
|
|
4405
4640
|
}),
|
|
4406
4641
|
/* @__PURE__ */ jsxs34(
|
|
4407
4642
|
NavigationButton,
|
|
@@ -4409,15 +4644,15 @@ var Pagination = (props) => {
|
|
|
4409
4644
|
page: activePageNumber + 1,
|
|
4410
4645
|
disabled: activePageNumber === totalPages,
|
|
4411
4646
|
children: [
|
|
4412
|
-
/* @__PURE__ */
|
|
4413
|
-
/* @__PURE__ */
|
|
4647
|
+
/* @__PURE__ */ jsx61("span", { className: "text-sm", children: "Next" }),
|
|
4648
|
+
/* @__PURE__ */ jsx61("span", { children: /* @__PURE__ */ jsx61(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
4414
4649
|
]
|
|
4415
4650
|
}
|
|
4416
4651
|
)
|
|
4417
4652
|
] }),
|
|
4418
4653
|
showJumpToPage && totalPages > 5 && /* @__PURE__ */ jsxs34("div", { className: "flex items-center space-x-2", children: [
|
|
4419
|
-
/* @__PURE__ */
|
|
4420
|
-
/* @__PURE__ */
|
|
4654
|
+
/* @__PURE__ */ jsx61("span", { className: "text-sm", children: "Go to:" }),
|
|
4655
|
+
/* @__PURE__ */ jsx61("div", { className: "relative", children: /* @__PURE__ */ jsx61(
|
|
4421
4656
|
"input",
|
|
4422
4657
|
{
|
|
4423
4658
|
type: "number",
|
|
@@ -4438,9 +4673,9 @@ var Pagination = (props) => {
|
|
|
4438
4673
|
) })
|
|
4439
4674
|
] })
|
|
4440
4675
|
] }),
|
|
4441
|
-
showPageSizeSelector && /* @__PURE__ */
|
|
4442
|
-
/* @__PURE__ */
|
|
4443
|
-
/* @__PURE__ */
|
|
4676
|
+
showPageSizeSelector && /* @__PURE__ */ jsx61("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
4677
|
+
/* @__PURE__ */ jsx61("span", { className: "text-sm", children: "Show:" }),
|
|
4678
|
+
/* @__PURE__ */ jsx61("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ jsx61(
|
|
4444
4679
|
Hyperlink,
|
|
4445
4680
|
{
|
|
4446
4681
|
className: `
|
|
@@ -4452,7 +4687,7 @@ var Pagination = (props) => {
|
|
|
4452
4687
|
},
|
|
4453
4688
|
size
|
|
4454
4689
|
)) }),
|
|
4455
|
-
/* @__PURE__ */
|
|
4690
|
+
/* @__PURE__ */ jsx61("span", { className: "text-sm", children: "per page" })
|
|
4456
4691
|
] }) })
|
|
4457
4692
|
] });
|
|
4458
4693
|
};
|
|
@@ -4460,7 +4695,7 @@ var Pagination_default = Pagination;
|
|
|
4460
4695
|
|
|
4461
4696
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
4462
4697
|
import dynamic4 from "next/dynamic";
|
|
4463
|
-
import { jsx as
|
|
4698
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
4464
4699
|
var HlsPlayer1 = dynamic4(() => import("./HlsPlayer-FFEIK6FG.mjs"), {
|
|
4465
4700
|
ssr: false
|
|
4466
4701
|
});
|
|
@@ -4497,7 +4732,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4497
4732
|
right: "justify-end"
|
|
4498
4733
|
};
|
|
4499
4734
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
4500
|
-
return /* @__PURE__ */
|
|
4735
|
+
return /* @__PURE__ */ jsx62("div", { className: `flex flex-wrap gap-4 ${formatClasses}`, children: visibleImages.map((img, idx) => {
|
|
4501
4736
|
const imageUrl = resolveImageUrl(img.imageUrl);
|
|
4502
4737
|
if (!imageUrl) return null;
|
|
4503
4738
|
const posterUrl = resolvePosterUrl(img.posterUrl);
|
|
@@ -4505,7 +4740,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4505
4740
|
const intrinsicHeight = parseMaybeNumber(img.intrinsicHeight);
|
|
4506
4741
|
const isHls = imageUrl.endsWith(".m3u8");
|
|
4507
4742
|
const alt = img.title || "Gallery image";
|
|
4508
|
-
return /* @__PURE__ */
|
|
4743
|
+
return /* @__PURE__ */ jsx62("div", { className: "max-w-full", children: isHls ? /* @__PURE__ */ jsx62(
|
|
4509
4744
|
HlsPlayer1,
|
|
4510
4745
|
{
|
|
4511
4746
|
assetUrl: imageUrl,
|
|
@@ -4520,7 +4755,7 @@ var ImageGalleryNode = (props) => {
|
|
|
4520
4755
|
}
|
|
4521
4756
|
) : (
|
|
4522
4757
|
/* eslint-disable-next-line @next/next/no-img-element */
|
|
4523
|
-
/* @__PURE__ */
|
|
4758
|
+
/* @__PURE__ */ jsx62(
|
|
4524
4759
|
"img",
|
|
4525
4760
|
{
|
|
4526
4761
|
loading: "lazy",
|
|
@@ -4537,7 +4772,8 @@ var ImageGalleryNode = (props) => {
|
|
|
4537
4772
|
var ImageGalleryNode_default = ImageGalleryNode;
|
|
4538
4773
|
|
|
4539
4774
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
4540
|
-
import
|
|
4775
|
+
import Link2 from "next/link";
|
|
4776
|
+
import { jsx as jsx63, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4541
4777
|
function toCamelCase(str) {
|
|
4542
4778
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
4543
4779
|
}
|
|
@@ -4720,7 +4956,7 @@ var DivContainer = async (props) => {
|
|
|
4720
4956
|
response = await serviceClient.get(endpoint);
|
|
4721
4957
|
result = response?.result;
|
|
4722
4958
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
4723
|
-
return /* @__PURE__ */
|
|
4959
|
+
return /* @__PURE__ */ jsx63(NoDataFound_default, {});
|
|
4724
4960
|
}
|
|
4725
4961
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
4726
4962
|
childCollectionData = getNestedValue2(props.dataitem, dataBindingProperties.childCollectionName);
|
|
@@ -4732,7 +4968,7 @@ var DivContainer = async (props) => {
|
|
|
4732
4968
|
}
|
|
4733
4969
|
const SelectedNode = NodeTypes2[node.type];
|
|
4734
4970
|
if (!SelectedNode) return null;
|
|
4735
|
-
return /* @__PURE__ */
|
|
4971
|
+
return /* @__PURE__ */ jsx63(React45.Fragment, { children: /* @__PURE__ */ jsx63(
|
|
4736
4972
|
SelectedNode,
|
|
4737
4973
|
{
|
|
4738
4974
|
node,
|
|
@@ -4800,7 +5036,7 @@ var DivContainer = async (props) => {
|
|
|
4800
5036
|
wrapperProps = { ...props.node.componentProperties, "slidesToShow": slidesToShow };
|
|
4801
5037
|
break;
|
|
4802
5038
|
case !!(props.node.href || props.href):
|
|
4803
|
-
Wrapper =
|
|
5039
|
+
Wrapper = Link2;
|
|
4804
5040
|
let href = props.node.href || props.href;
|
|
4805
5041
|
if (href?.includes("{")) {
|
|
4806
5042
|
href = resolveHrefTemplate(href, props.dataitem);
|
|
@@ -4832,9 +5068,9 @@ var DivContainer = async (props) => {
|
|
|
4832
5068
|
props.node.autoFormat && "auto-format",
|
|
4833
5069
|
props.node.bgClass
|
|
4834
5070
|
].filter(Boolean).join(" ");
|
|
4835
|
-
return /* @__PURE__ */ jsxs35(
|
|
4836
|
-
/* @__PURE__ */
|
|
4837
|
-
/* @__PURE__ */
|
|
5071
|
+
return /* @__PURE__ */ jsxs35(React45.Fragment, { children: [
|
|
5072
|
+
/* @__PURE__ */ jsx63("style", { dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS } }),
|
|
5073
|
+
/* @__PURE__ */ jsx63(React45.Fragment, { children: /* @__PURE__ */ jsx63(
|
|
4838
5074
|
Wrapper,
|
|
4839
5075
|
{
|
|
4840
5076
|
id: guid,
|
|
@@ -4843,18 +5079,18 @@ var DivContainer = async (props) => {
|
|
|
4843
5079
|
...wrapperProps,
|
|
4844
5080
|
children: dataToRender.map(
|
|
4845
5081
|
(item, idx) => item?.links?.view && renderLink ? renderChildren(props.node.children, props, item, idx, props.href ? void 0 : item?.links?.view)?.map(
|
|
4846
|
-
(child, i) => /* @__PURE__ */
|
|
5082
|
+
(child, i) => /* @__PURE__ */ jsx63(React45.Fragment, { children: child }, i)
|
|
4847
5083
|
) : renderChildren(props.node.children, props, item, idx)
|
|
4848
5084
|
)
|
|
4849
5085
|
}
|
|
4850
5086
|
) }),
|
|
4851
|
-
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */
|
|
5087
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ jsx63("div", { children: /* @__PURE__ */ jsx63(Pagination_default, { path: props.path, query: props.query, dataset: response }) })
|
|
4852
5088
|
] });
|
|
4853
5089
|
};
|
|
4854
5090
|
var DivContainer_default = DivContainer;
|
|
4855
5091
|
|
|
4856
5092
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
4857
|
-
import { jsx as
|
|
5093
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4858
5094
|
var NodeTypes = {
|
|
4859
5095
|
["paragraph"]: ParagraphNode_default,
|
|
4860
5096
|
["heading"]: HeadingNode_default,
|
|
@@ -4882,11 +5118,11 @@ var PageBodyRenderer = (props) => {
|
|
|
4882
5118
|
if (pageBodyTree && pageBodyTree.root) {
|
|
4883
5119
|
rootNode = pageBodyTree.root;
|
|
4884
5120
|
}
|
|
4885
|
-
return /* @__PURE__ */
|
|
5121
|
+
return /* @__PURE__ */ jsx64(React46.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
4886
5122
|
{
|
|
4887
5123
|
}
|
|
4888
5124
|
const SelectedNode = NodeTypes[node.type];
|
|
4889
|
-
return /* @__PURE__ */
|
|
5125
|
+
return /* @__PURE__ */ jsx64(React46.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx64(React46.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ jsx64(React46.Fragment, { children: /* @__PURE__ */ jsx64(
|
|
4890
5126
|
SelectedNode,
|
|
4891
5127
|
{
|
|
4892
5128
|
node,
|
|
@@ -4901,7 +5137,7 @@ var PageBodyRenderer = (props) => {
|
|
|
4901
5137
|
assetBaseUrl: props.assetBaseUrl,
|
|
4902
5138
|
device: props.device
|
|
4903
5139
|
}
|
|
4904
|
-
) }) : /* @__PURE__ */
|
|
5140
|
+
) }) : /* @__PURE__ */ jsx64(React46.Fragment, { children: /* @__PURE__ */ jsx64(
|
|
4905
5141
|
SelectedNode,
|
|
4906
5142
|
{
|
|
4907
5143
|
node,
|