@wayke-se/components-react 3.0.0-beta.4 → 3.0.0-beta.6
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 +841 -2205
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +822 -2186
- package/dist/index.mjs.map +4 -4
- package/esbuild/lib.js +1 -0
- package/package.json +2 -3
- package/src/components/Gallery/index.tsx +30 -32
- package/src/components/Lightbox/index.tsx +11 -11
package/dist/index.mjs
CHANGED
|
@@ -2310,12 +2310,6 @@ var IconChevronLeft = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2,
|
|
|
2310
2310
|
}, /* @__PURE__ */ React4.createElement("path", {
|
|
2311
2311
|
d: "M13 17.7L4.3 9 13 .3l.7.7-8 8 8 8-.7.7z"
|
|
2312
2312
|
}));
|
|
2313
|
-
var IconChevronRight = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2, {
|
|
2314
|
-
viewBox: "0 0 18 18",
|
|
2315
|
-
block
|
|
2316
|
-
}, /* @__PURE__ */ React4.createElement("path", {
|
|
2317
|
-
d: "M5 .3L13.7 9 5 17.7l-.7-.7 8-8-8-8L5 .3z"
|
|
2318
|
-
}));
|
|
2319
2313
|
var IconCheck = ({ block }) => /* @__PURE__ */ React4.createElement(Icon2, {
|
|
2320
2314
|
viewBox: "0 0 16 16",
|
|
2321
2315
|
block
|
|
@@ -4522,7 +4516,7 @@ var WaykeSearch = ({
|
|
|
4522
4516
|
var search_default = WaykeSearch;
|
|
4523
4517
|
|
|
4524
4518
|
// src/layouts/searchItem/index.tsx
|
|
4525
|
-
import
|
|
4519
|
+
import React83, { useMemo as useMemo6, useRef as useRef3, useCallback as useCallback34, useEffect as useEffect14 } from "react";
|
|
4526
4520
|
import WaykeEcomWeb from "@wayke-se/ecom-web";
|
|
4527
4521
|
|
|
4528
4522
|
// src/components/PriceTable/index.tsx
|
|
@@ -4801,1731 +4795,175 @@ var ExtendContent = ({ children, actionTitle, onClick }) => {
|
|
|
4801
4795
|
var ExtendContent_default = ExtendContent;
|
|
4802
4796
|
|
|
4803
4797
|
// src/components/Gallery/index.tsx
|
|
4804
|
-
import
|
|
4805
|
-
import Slider3 from "react-slick";
|
|
4798
|
+
import React38, { useState as useState9, useCallback as useCallback14, useRef as useRef2, useMemo as useMemo3 } from "react";
|
|
4806
4799
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4800
|
+
var Gallery = ({ media, placeholderImage }) => {
|
|
4801
|
+
const slider = useRef2(null);
|
|
4802
|
+
const quickNavRef = useRef2(null);
|
|
4803
|
+
const isDragging = useRef2(false);
|
|
4804
|
+
const [index2, setIndex] = useState9(0);
|
|
4805
|
+
const [lightbox, setLightbox] = useState9(false);
|
|
4806
|
+
const [navigationDisabled, setNavigationDisabled] = useState9(false);
|
|
4807
|
+
const beforeChange = useCallback14((_, newIndex) => {
|
|
4808
|
+
const element = quickNavRef.current?.querySelectorAll("li")?.[newIndex];
|
|
4809
|
+
if (element) {
|
|
4810
|
+
scrollIntoView(element, { scrollMode: "if-needed", block: "nearest", inline: "nearest" });
|
|
4816
4811
|
}
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
margin-right: ${size(-2)};
|
|
4812
|
+
setIndex(newIndex);
|
|
4813
|
+
}, []);
|
|
4814
|
+
const onMouseDown = useCallback14(() => {
|
|
4815
|
+
if (isDragging.current) {
|
|
4816
|
+
isDragging.current = false;
|
|
4823
4817
|
}
|
|
4824
|
-
}
|
|
4818
|
+
}, []);
|
|
4819
|
+
const onMouseMove = useCallback14(() => {
|
|
4820
|
+
if (!isDragging.current) {
|
|
4821
|
+
isDragging.current = true;
|
|
4822
|
+
}
|
|
4823
|
+
}, []);
|
|
4824
|
+
const onClick = useCallback14(() => {
|
|
4825
|
+
pubsub_default.publish("ImagesClick");
|
|
4826
|
+
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
4827
|
+
setLightbox(true);
|
|
4828
|
+
}
|
|
4829
|
+
}, [lightbox, media]);
|
|
4830
|
+
const nextImage = useCallback14(() => {
|
|
4831
|
+
if (!slider || !slider.current) {
|
|
4832
|
+
return;
|
|
4833
|
+
}
|
|
4834
|
+
slider.current.slickNext();
|
|
4835
|
+
}, [slider]);
|
|
4836
|
+
const prevImage = useCallback14(() => {
|
|
4837
|
+
if (!slider || !slider.current) {
|
|
4838
|
+
return;
|
|
4839
|
+
}
|
|
4840
|
+
slider.current.slickPrev();
|
|
4841
|
+
}, [slider]);
|
|
4842
|
+
const goTo = (target) => {
|
|
4843
|
+
if (!slider || !slider.current) {
|
|
4844
|
+
return;
|
|
4845
|
+
}
|
|
4846
|
+
if (slider.current) {
|
|
4847
|
+
setIndex(target);
|
|
4848
|
+
slider.current.slickGoTo(target);
|
|
4849
|
+
}
|
|
4850
|
+
};
|
|
4851
|
+
const onDisableNavigation = () => {
|
|
4852
|
+
if (!isDragging.current)
|
|
4853
|
+
setNavigationDisabled(true);
|
|
4854
|
+
};
|
|
4855
|
+
const onEnableNavigation = (e) => {
|
|
4856
|
+
e.stopPropagation();
|
|
4857
|
+
isDragging.current = false;
|
|
4858
|
+
setNavigationDisabled(false);
|
|
4859
|
+
};
|
|
4860
|
+
const onToggleLightbox = useCallback14(() => setLightbox(!lightbox), [lightbox]);
|
|
4861
|
+
const mediaLength = media?.length || 0;
|
|
4862
|
+
const placeholder = useMemo3(
|
|
4863
|
+
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
4864
|
+
[placeholderImage]
|
|
4865
|
+
);
|
|
4866
|
+
return /* @__PURE__ */ React38.createElement("p", null, "heheh");
|
|
4867
|
+
};
|
|
4868
|
+
var Gallery_default = Gallery;
|
|
4825
4869
|
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
var Main = styled33.div`
|
|
4832
|
-
position: relative;
|
|
4833
|
-
height: 0;
|
|
4834
|
-
padding-bottom: 66.66666667%;
|
|
4870
|
+
// src/components/ProductPage/index.tsx
|
|
4871
|
+
import styled33 from "styled-components";
|
|
4872
|
+
var ProductPage = styled33.div`
|
|
4873
|
+
display: flex;
|
|
4874
|
+
flex-direction: column;
|
|
4835
4875
|
|
|
4836
4876
|
${(props) => props.theme.breakpoint.Md} {
|
|
4837
|
-
|
|
4838
|
-
}
|
|
4839
|
-
|
|
4840
|
-
.slick-slider,
|
|
4841
|
-
.slick-list,
|
|
4842
|
-
.slick-track,
|
|
4843
|
-
.slick-slide,
|
|
4844
|
-
.slick-slide > * {
|
|
4845
|
-
height: 100%;
|
|
4846
|
-
}
|
|
4847
|
-
|
|
4848
|
-
.slick-slide > * {
|
|
4849
|
-
font-size: 0;
|
|
4850
|
-
|
|
4851
|
-
> * {
|
|
4852
|
-
font-size: 1rem;
|
|
4853
|
-
}
|
|
4877
|
+
flex-direction: row;
|
|
4854
4878
|
}
|
|
4855
4879
|
`;
|
|
4856
|
-
var
|
|
4857
|
-
position: absolute;
|
|
4858
|
-
top: 0;
|
|
4859
|
-
bottom: 0;
|
|
4860
|
-
right: 0;
|
|
4861
|
-
width: ${quickNavWidth}px;
|
|
4862
|
-
padding-left: ${size(1)};
|
|
4863
|
-
|
|
4880
|
+
var ProductPageAside = styled33.div`
|
|
4864
4881
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
4865
|
-
display:
|
|
4882
|
+
display: contents;
|
|
4866
4883
|
}
|
|
4867
4884
|
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
left: 0;
|
|
4873
|
-
right: 0;
|
|
4874
|
-
height: ${size(2.5)};
|
|
4875
|
-
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
|
|
4876
|
-
pointer-events: none;
|
|
4885
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
4886
|
+
flex-shrink: 0;
|
|
4887
|
+
width: calc(375px + ${size(2)});
|
|
4888
|
+
padding-right: ${size(2)};
|
|
4877
4889
|
}
|
|
4878
4890
|
`;
|
|
4879
|
-
var
|
|
4880
|
-
position: relative;
|
|
4881
|
-
width: 100%;
|
|
4882
|
-
height: 100%;
|
|
4883
|
-
overflow: hidden;
|
|
4884
|
-
|
|
4885
|
-
:focus {
|
|
4886
|
-
outline: none;
|
|
4887
|
-
}
|
|
4888
|
-
|
|
4891
|
+
var ProductPageMain = styled33.div`
|
|
4889
4892
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
4890
|
-
|
|
4891
|
-
transition: border-radius 150ms ease;
|
|
4893
|
+
display: contents;
|
|
4892
4894
|
}
|
|
4893
|
-
`;
|
|
4894
|
-
var SliderWrapper = styled33.div`
|
|
4895
|
-
position: absolute;
|
|
4896
|
-
top: 0;
|
|
4897
|
-
bottom: 0;
|
|
4898
|
-
left: 0;
|
|
4899
|
-
right: 0;
|
|
4900
|
-
|
|
4901
|
-
.slick-slider {
|
|
4902
|
-
position: absolute;
|
|
4903
|
-
top: 0;
|
|
4904
|
-
bottom: 0;
|
|
4905
|
-
left: 0;
|
|
4906
|
-
right: 0;
|
|
4907
|
-
user-select: none;
|
|
4908
|
-
touch-action: pan-y;
|
|
4909
|
-
-webkit-tap-highlight-color: transparent;
|
|
4910
4895
|
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
}
|
|
4896
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
4897
|
+
flex: 1 1 100%;
|
|
4898
|
+
min-width: 0;
|
|
4899
|
+
padding-left: ${size(2)};
|
|
4915
4900
|
}
|
|
4901
|
+
`;
|
|
4902
|
+
var ProductPageAsideSection = styled33.div`
|
|
4903
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
4904
|
+
order: ${(props) => props.mobileOrder};
|
|
4916
4905
|
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
display: block;
|
|
4920
|
-
margin: 0;
|
|
4921
|
-
padding: 0;
|
|
4922
|
-
overflow: hidden;
|
|
4923
|
-
|
|
4924
|
-
&:focus {
|
|
4925
|
-
outline: none;
|
|
4926
|
-
}
|
|
4927
|
-
|
|
4928
|
-
&.dragging {
|
|
4929
|
-
cursor: pointer;
|
|
4930
|
-
cursor: hand;
|
|
4906
|
+
& + & {
|
|
4907
|
+
margin-top: ${size(2)};
|
|
4931
4908
|
}
|
|
4932
|
-
}
|
|
4933
4909
|
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
top: 0;
|
|
4937
|
-
left: 0;
|
|
4938
|
-
display: block;
|
|
4939
|
-
margin-left: auto;
|
|
4940
|
-
margin-right: auto;
|
|
4941
|
-
|
|
4942
|
-
&::before,
|
|
4943
|
-
&::after {
|
|
4944
|
-
content: '';
|
|
4945
|
-
display: table;
|
|
4910
|
+
:last-child {
|
|
4911
|
+
margin-bottom: ${size(4)};
|
|
4946
4912
|
}
|
|
4947
4913
|
|
|
4948
|
-
|
|
4949
|
-
|
|
4914
|
+
${ProductPageMain} & {
|
|
4915
|
+
margin-top: ${size(2)};
|
|
4950
4916
|
}
|
|
4951
4917
|
}
|
|
4952
4918
|
|
|
4953
|
-
.
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
min-height: 1px;
|
|
4957
|
-
}
|
|
4958
|
-
|
|
4959
|
-
.slick-loading {
|
|
4960
|
-
.slick-track {
|
|
4961
|
-
visibility: hidden;
|
|
4962
|
-
}
|
|
4963
|
-
|
|
4964
|
-
img {
|
|
4965
|
-
display: none;
|
|
4919
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
4920
|
+
& + & {
|
|
4921
|
+
margin-top: ${size(4)};
|
|
4966
4922
|
}
|
|
4967
|
-
}
|
|
4968
4923
|
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
display: block;
|
|
4924
|
+
${ProductPageMain} & {
|
|
4925
|
+
margin-bottom: ${size(8)};
|
|
4972
4926
|
}
|
|
4973
4927
|
}
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
pointer-events: none;
|
|
4977
|
-
}
|
|
4978
|
-
|
|
4928
|
+
`;
|
|
4929
|
+
var ProductPageMainSection = styled33.div`
|
|
4979
4930
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
overflow: visible;
|
|
4984
|
-
width: 95%;
|
|
4985
|
-
}
|
|
4931
|
+
order: 99;
|
|
4932
|
+
padding: ${size(4)} 0;
|
|
4933
|
+
border-top: ${size(1)} solid ${(props) => props.theme.color.accent};
|
|
4986
4934
|
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4935
|
+
${Wrapper} & {
|
|
4936
|
+
margin-left: ${size(-2)};
|
|
4937
|
+
margin-right: ${size(-2)};
|
|
4938
|
+
padding-left: ${size(2)};
|
|
4939
|
+
padding-right: ${size(2)};
|
|
4992
4940
|
}
|
|
4941
|
+
}
|
|
4993
4942
|
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
${
|
|
4998
|
-
|
|
4999
|
-
border-bottom-left-radius: 0;
|
|
5000
|
-
}
|
|
4943
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
4944
|
+
& + & {
|
|
4945
|
+
margin-top: ${size(8)};
|
|
4946
|
+
padding-top: ${size(8)};
|
|
4947
|
+
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
5001
4948
|
}
|
|
5002
4949
|
}
|
|
5003
4950
|
`;
|
|
5004
|
-
var
|
|
5005
|
-
|
|
5006
|
-
position: absolute;
|
|
5007
|
-
left: 0;
|
|
5008
|
-
top: 0;
|
|
5009
|
-
right: 0;
|
|
5010
|
-
bottom: 0;
|
|
5011
|
-
margin: auto;
|
|
5012
|
-
max-width: 100%;
|
|
5013
|
-
max-height: 100%;
|
|
5014
|
-
object-fit: cover;
|
|
5015
|
-
cursor: pointer;
|
|
5016
|
-
`;
|
|
5017
|
-
var ImageFull = styled33.img`
|
|
5018
|
-
display: block;
|
|
5019
|
-
position: absolute;
|
|
5020
|
-
top: 0;
|
|
5021
|
-
left: 0;
|
|
5022
|
-
width: 100%;
|
|
5023
|
-
height: 100%;
|
|
5024
|
-
object-fit: cover;
|
|
4951
|
+
var ProductPageContentLimit = styled33.div`
|
|
4952
|
+
max-width: 420px;
|
|
5025
4953
|
`;
|
|
5026
|
-
var Arrow = styled33(ButtonReset)`
|
|
5027
|
-
position: absolute;
|
|
5028
|
-
top: 50%;
|
|
5029
|
-
transform: translateY(-50%);
|
|
5030
|
-
display: flex;
|
|
5031
|
-
align-items: center;
|
|
5032
|
-
justify-content: center;
|
|
5033
|
-
width: ${size(4)};
|
|
5034
|
-
height: ${size(4)};
|
|
5035
|
-
border-radius: 50%;
|
|
5036
|
-
font-size: 1rem;
|
|
5037
|
-
line-height: 1;
|
|
5038
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5039
|
-
backdrop-filter: blur(5px);
|
|
5040
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5041
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5042
|
-
transform-origin: 50% 50%;
|
|
5043
|
-
transition: transform 200ms ease;
|
|
5044
|
-
|
|
5045
|
-
:before {
|
|
5046
|
-
content: '';
|
|
5047
|
-
position: absolute;
|
|
5048
|
-
top: 0;
|
|
5049
|
-
bottom: 0;
|
|
5050
|
-
left: 0;
|
|
5051
|
-
right: 0;
|
|
5052
|
-
border-radius: 50%;
|
|
5053
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
5054
|
-
opacity: 0;
|
|
5055
|
-
transition: opacity 200ms ease;
|
|
5056
|
-
}
|
|
5057
|
-
|
|
5058
|
-
:hover {
|
|
5059
|
-
:before {
|
|
5060
|
-
opacity: 1;
|
|
5061
|
-
}
|
|
5062
|
-
}
|
|
5063
4954
|
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
}
|
|
4955
|
+
// src/hooks/useSearchItem.ts
|
|
4956
|
+
import { useQuery } from "@apollo/client";
|
|
5067
4957
|
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
`;
|
|
5078
|
-
var QuickNav = styled33.ul`
|
|
5079
|
-
position: relative;
|
|
5080
|
-
max-height: 100%;
|
|
5081
|
-
list-style: none;
|
|
5082
|
-
padding: 0;
|
|
5083
|
-
margin: 0;
|
|
5084
|
-
overflow: auto;
|
|
5085
|
-
-webkit-overflow-scrolling: touch;
|
|
5086
|
-
`;
|
|
5087
|
-
var QuickNavItem = styled33.li.attrs(() => ({
|
|
5088
|
-
className: "wayke__theme wayke__color--primary-text"
|
|
5089
|
-
}))`
|
|
5090
|
-
position: relative;
|
|
5091
|
-
|
|
5092
|
-
& + & {
|
|
5093
|
-
margin-top: ${size(1)};
|
|
5094
|
-
}
|
|
5095
|
-
|
|
5096
|
-
${({ active }) => active && css12`
|
|
5097
|
-
:before {
|
|
5098
|
-
content: '';
|
|
5099
|
-
position: absolute;
|
|
5100
|
-
top: 0;
|
|
5101
|
-
left: 0;
|
|
5102
|
-
width: 100%;
|
|
5103
|
-
height: 100%;
|
|
5104
|
-
border: 3px solid currentColor;
|
|
5105
|
-
z-index: 2;
|
|
5106
|
-
}
|
|
5107
|
-
`}
|
|
5108
|
-
`;
|
|
5109
|
-
var QuickNavBtn = styled33(ButtonReset)`
|
|
5110
|
-
position: relative;
|
|
5111
|
-
display: block;
|
|
5112
|
-
width: 100%;
|
|
5113
|
-
height: 0;
|
|
5114
|
-
padding-bottom: 66.66666667%; // 3:2
|
|
5115
|
-
transform-origin: 50% 50%;
|
|
5116
|
-
transition: transform 300ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
|
|
5117
|
-
|
|
5118
|
-
:before {
|
|
5119
|
-
content: '';
|
|
5120
|
-
position: absolute;
|
|
5121
|
-
top: 0;
|
|
5122
|
-
left: 0;
|
|
5123
|
-
width: 100%;
|
|
5124
|
-
height: 100%;
|
|
5125
|
-
background-color: rgba(0, 0, 0, 0.15);
|
|
5126
|
-
opacity: 0;
|
|
5127
|
-
z-index: 1;
|
|
5128
|
-
transition: opacity 150ms ease;
|
|
5129
|
-
}
|
|
5130
|
-
|
|
5131
|
-
:hover {
|
|
5132
|
-
:before {
|
|
5133
|
-
opacity: 1;
|
|
5134
|
-
}
|
|
5135
|
-
}
|
|
5136
|
-
|
|
5137
|
-
:active {
|
|
5138
|
-
transform: scale(0.95);
|
|
5139
|
-
}
|
|
5140
|
-
`;
|
|
5141
|
-
var QuickNavImg = styled33.img`
|
|
5142
|
-
display: block;
|
|
5143
|
-
position: absolute;
|
|
5144
|
-
top: 0;
|
|
5145
|
-
left: 0;
|
|
5146
|
-
width: 100%;
|
|
5147
|
-
height: 100%;
|
|
5148
|
-
object-fit: cover;
|
|
5149
|
-
`;
|
|
5150
|
-
var MediaButtonWrapper = styled33.div`
|
|
5151
|
-
position: absolute;
|
|
5152
|
-
bottom: ${size(2)};
|
|
5153
|
-
left: 50%;
|
|
5154
|
-
transform: translateX(-50%);
|
|
5155
|
-
z-index: 1;
|
|
5156
|
-
`;
|
|
5157
|
-
var EnableNavigationButton = styled33.div`
|
|
5158
|
-
position: absolute;
|
|
5159
|
-
bottom: ${size(2)};
|
|
5160
|
-
left: 50%;
|
|
5161
|
-
transform: translateX(-50%);
|
|
5162
|
-
z-index: 1;
|
|
5163
|
-
`;
|
|
5164
|
-
|
|
5165
|
-
// src/components/Lightbox/index.tsx
|
|
5166
|
-
import React47 from "react";
|
|
5167
|
-
|
|
5168
|
-
// src/components/Lightbox/wrapper.tsx
|
|
5169
|
-
import styled34 from "styled-components";
|
|
5170
|
-
var Wrapper18 = styled34.div`
|
|
5171
|
-
position: fixed;
|
|
5172
|
-
top: 0;
|
|
5173
|
-
bottom: 0;
|
|
5174
|
-
left: 0;
|
|
5175
|
-
right: 0;
|
|
5176
|
-
padding: ${size(3)};
|
|
5177
|
-
z-index: 90;
|
|
5178
|
-
overflow: auto;
|
|
5179
|
-
|
|
5180
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
5181
|
-
padding: ${size(2)};
|
|
5182
|
-
}
|
|
5183
|
-
`;
|
|
5184
|
-
var UiBlock2 = styled34.div.attrs(() => ({
|
|
5185
|
-
role: "button"
|
|
5186
|
-
}))`
|
|
5187
|
-
position: fixed;
|
|
5188
|
-
top: 0;
|
|
5189
|
-
bottom: 0;
|
|
5190
|
-
left: 0;
|
|
5191
|
-
right: 0;
|
|
5192
|
-
background-color: rgba(0, 0, 0, 0.3);
|
|
5193
|
-
z-index: -1;
|
|
5194
|
-
`;
|
|
5195
|
-
var Item9 = styled34.div`
|
|
5196
|
-
position: relative;
|
|
5197
|
-
|
|
5198
|
-
& + & {
|
|
5199
|
-
margin-top: ${size(1)};
|
|
5200
|
-
}
|
|
5201
|
-
`;
|
|
5202
|
-
var Img2 = styled34.img`
|
|
5203
|
-
position: relative;
|
|
5204
|
-
display: block;
|
|
5205
|
-
max-width: 100%;
|
|
5206
|
-
max-height: calc(100vh - ${size(6)});
|
|
5207
|
-
margin: 0 auto;
|
|
5208
|
-
z-index: 1;
|
|
5209
|
-
|
|
5210
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
5211
|
-
max-height: calc(100vh - ${size(4)});
|
|
5212
|
-
}
|
|
5213
|
-
`;
|
|
5214
|
-
var CloseBtn2 = styled34(ButtonReset)`
|
|
5215
|
-
display: flex;
|
|
5216
|
-
align-items: center;
|
|
5217
|
-
justify-content: center;
|
|
5218
|
-
position: fixed;
|
|
5219
|
-
top: ${size(2)};
|
|
5220
|
-
right: ${size(2)};
|
|
5221
|
-
width: ${size(5)};
|
|
5222
|
-
height: ${size(5)};
|
|
5223
|
-
border-radius: 50%;
|
|
5224
|
-
background-color: ${(props) => props.theme.color.bg};
|
|
5225
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5226
|
-
transform-origin: 50% 50%;
|
|
5227
|
-
transition: 200ms ease, transform 300ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
|
|
5228
|
-
z-index: 1;
|
|
5229
|
-
|
|
5230
|
-
:before {
|
|
5231
|
-
content: '';
|
|
5232
|
-
position: absolute;
|
|
5233
|
-
top: 0;
|
|
5234
|
-
left: 0;
|
|
5235
|
-
width: 100%;
|
|
5236
|
-
height: 100%;
|
|
5237
|
-
background-color: ${(props) => props.theme.color.hoverOverlay};
|
|
5238
|
-
border-radius: 50%;
|
|
5239
|
-
opacity: 0;
|
|
5240
|
-
transition: opacity 150ms ease;
|
|
5241
|
-
}
|
|
5242
|
-
|
|
5243
|
-
:hover {
|
|
5244
|
-
:before {
|
|
5245
|
-
opacity: 1;
|
|
5246
|
-
}
|
|
5247
|
-
}
|
|
5248
|
-
|
|
5249
|
-
:active {
|
|
5250
|
-
transform: scale(0.97);
|
|
5251
|
-
}
|
|
5252
|
-
|
|
5253
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
5254
|
-
top: ${size(1)};
|
|
5255
|
-
right: ${size(1)};
|
|
5256
|
-
}
|
|
5257
|
-
`;
|
|
5258
|
-
|
|
5259
|
-
// src/components/Video/EmbeddedVideoLightbox.tsx
|
|
5260
|
-
import React41 from "react";
|
|
5261
|
-
|
|
5262
|
-
// src/components/Video/YoutubePlayer.tsx
|
|
5263
|
-
import React38 from "react";
|
|
5264
|
-
|
|
5265
|
-
// src/components/Video/utils.ts
|
|
5266
|
-
var getVimeoId = (url) => {
|
|
5267
|
-
const regExp = /\/(\d+)/;
|
|
5268
|
-
const match = url.match(regExp);
|
|
5269
|
-
return match && match[1].length > 3 ? match[1] : "";
|
|
5270
|
-
};
|
|
5271
|
-
var getYouTubeId = (url) => {
|
|
5272
|
-
const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
|
|
5273
|
-
const match = url.match(regExp);
|
|
5274
|
-
return match && match[7].length === 11 ? match[7] : "";
|
|
5275
|
-
};
|
|
5276
|
-
var youtubeBase = "https://img.youtube.com/vi/";
|
|
5277
|
-
var getYoutubeThumbnail = (url) => {
|
|
5278
|
-
const id = getYouTubeId(url);
|
|
5279
|
-
if (!id) {
|
|
5280
|
-
return void 0;
|
|
5281
|
-
}
|
|
5282
|
-
return {
|
|
5283
|
-
maxresdefault: `${youtubeBase}${id}/maxresdefault.jpg`,
|
|
5284
|
-
hqdefault: `${youtubeBase}${id}/hqdefault.jpg`,
|
|
5285
|
-
mqdefault: `${youtubeBase}${id}/mqdefault.jpg`
|
|
5286
|
-
};
|
|
5287
|
-
};
|
|
5288
|
-
var onImageLoad = (e, thumbnail) => {
|
|
5289
|
-
if (thumbnail?.length === 2 && e.currentTarget.src === thumbnail[0] && e.currentTarget.naturalWidth === 120 && e.currentTarget.naturalHeight === 90) {
|
|
5290
|
-
e.currentTarget.src = thumbnail[1];
|
|
5291
|
-
}
|
|
5292
|
-
};
|
|
5293
|
-
var onImageError = (e, thumbnail) => {
|
|
5294
|
-
if (thumbnail?.length === 2) {
|
|
5295
|
-
e.currentTarget.src = thumbnail[1];
|
|
5296
|
-
}
|
|
5297
|
-
};
|
|
5298
|
-
|
|
5299
|
-
// src/components/Video/wrapper.tsx
|
|
5300
|
-
import styled35 from "styled-components";
|
|
5301
|
-
var Wrapper19 = styled35.div`
|
|
5302
|
-
position: relative;
|
|
5303
|
-
width: 100%;
|
|
5304
|
-
height: ${(props) => props.isPreview ? "100%" : 0};
|
|
5305
|
-
padding-bottom: ${(props) => props.ratio ? props.ratio : "56.25%"};
|
|
5306
|
-
`;
|
|
5307
|
-
var Iframe = styled35.iframe.attrs(() => ({
|
|
5308
|
-
width: "100%",
|
|
5309
|
-
height: "100%",
|
|
5310
|
-
allowFullScreen: true,
|
|
5311
|
-
frameBorder: "0"
|
|
5312
|
-
}))`
|
|
5313
|
-
position: absolute;
|
|
5314
|
-
top: 0;
|
|
5315
|
-
left: 0;
|
|
5316
|
-
width: 100%;
|
|
5317
|
-
height: 100%;
|
|
5318
|
-
`;
|
|
5319
|
-
|
|
5320
|
-
// src/components/Video/YoutubePlayer.tsx
|
|
5321
|
-
var YouTubePlayer = ({ url, autoplay }) => /* @__PURE__ */ React38.createElement(Wrapper19, null, /* @__PURE__ */ React38.createElement(Iframe, {
|
|
5322
|
-
src: `https://www.youtube.com/embed/${getYouTubeId(url)}?&enablejsapi=1&?rel=0${autoplay ? "&autoplay=1" : ""}`
|
|
5323
|
-
}));
|
|
5324
|
-
var YoutubePlayer_default = YouTubePlayer;
|
|
5325
|
-
|
|
5326
|
-
// src/components/Video/VimeoPlayer.tsx
|
|
5327
|
-
import React39 from "react";
|
|
5328
|
-
var VimeoPlayer = ({ url, autoplay }) => /* @__PURE__ */ React39.createElement(Wrapper19, null, /* @__PURE__ */ React39.createElement(Iframe, {
|
|
5329
|
-
src: `https://player.vimeo.com/video/${getVimeoId(url)}?${autoplay ? "&autoplay=1" : ""}&loop=0&autopause=0`
|
|
5330
|
-
}));
|
|
5331
|
-
var VimeoPlayer_default = VimeoPlayer;
|
|
5332
|
-
|
|
5333
|
-
// src/components/Video/CustomPlayer.tsx
|
|
5334
|
-
import React40 from "react";
|
|
5335
|
-
|
|
5336
|
-
// src/components/Video/Video.tsx
|
|
5337
|
-
import styled36 from "styled-components";
|
|
5338
|
-
var Video = styled36.video`
|
|
5339
|
-
position: absolute;
|
|
5340
|
-
top: 0;
|
|
5341
|
-
left: 0;
|
|
5342
|
-
object-fit: ${({ modal }) => modal ? "contain" : "cover"};
|
|
5343
|
-
`;
|
|
5344
|
-
var Video_default = Video;
|
|
5345
|
-
|
|
5346
|
-
// src/components/Video/CustomPlayer.tsx
|
|
5347
|
-
var CustomPlayer = ({ url, controls, modal, ratio = "56.25%", isPreview }) => {
|
|
5348
|
-
return /* @__PURE__ */ React40.createElement(Wrapper19, {
|
|
5349
|
-
ratio,
|
|
5350
|
-
isPreview
|
|
5351
|
-
}, /* @__PURE__ */ React40.createElement(Video_default, {
|
|
5352
|
-
key: url,
|
|
5353
|
-
modal,
|
|
5354
|
-
preload: "metadata",
|
|
5355
|
-
controls,
|
|
5356
|
-
width: "100%",
|
|
5357
|
-
height: "100%",
|
|
5358
|
-
src: url
|
|
5359
|
-
}));
|
|
5360
|
-
};
|
|
5361
|
-
var CustomPlayer_default = CustomPlayer;
|
|
5362
|
-
|
|
5363
|
-
// src/components/Video/EmbeddedVideoLightbox.tsx
|
|
5364
|
-
var ytNames = ["youtube.com", "youtu.be"];
|
|
5365
|
-
var isYouTubeVideo = (url) => ytNames.some((host) => url.indexOf(host) >= 0);
|
|
5366
|
-
var vNames = ["vimeo.com"];
|
|
5367
|
-
var isVimeoVideo = (url) => vNames.some((host) => url.indexOf(host) >= 0);
|
|
5368
|
-
var VideoPlayer = ({ url, autoplay = false, controls = true }) => {
|
|
5369
|
-
if (!url)
|
|
5370
|
-
return null;
|
|
5371
|
-
if (isYouTubeVideo(url))
|
|
5372
|
-
return /* @__PURE__ */ React41.createElement(YoutubePlayer_default, {
|
|
5373
|
-
url,
|
|
5374
|
-
autoplay
|
|
5375
|
-
});
|
|
5376
|
-
if (isVimeoVideo(url))
|
|
5377
|
-
return /* @__PURE__ */ React41.createElement(VimeoPlayer_default, {
|
|
5378
|
-
url,
|
|
5379
|
-
autoplay
|
|
5380
|
-
});
|
|
5381
|
-
return /* @__PURE__ */ React41.createElement(CustomPlayer_default, {
|
|
5382
|
-
ratio: "56.25%",
|
|
5383
|
-
controls,
|
|
5384
|
-
url
|
|
5385
|
-
});
|
|
5386
|
-
};
|
|
5387
|
-
var EmbeddedVideoLightbox_default = VideoPlayer;
|
|
5388
|
-
|
|
5389
|
-
// src/components/Sphere/SphereLightbox.tsx
|
|
5390
|
-
import React43 from "react";
|
|
5391
|
-
|
|
5392
|
-
// src/components/Sphere/SphereViewer.tsx
|
|
5393
|
-
import React42, { lazy, useState as useState9, useEffect as useEffect7 } from "react";
|
|
5394
|
-
|
|
5395
|
-
// src/components/Sphere/wrapper.tsx
|
|
5396
|
-
import styled37 from "styled-components";
|
|
5397
|
-
var compassSize = size(4);
|
|
5398
|
-
var controlBtnSize = size(4);
|
|
5399
|
-
var Wrapper20 = styled37.div`
|
|
5400
|
-
position: relative;
|
|
5401
|
-
width: 100%;
|
|
5402
|
-
height: 0 !important;
|
|
5403
|
-
padding-bottom: 66.666% !important; // 3:2
|
|
5404
|
-
|
|
5405
|
-
.pnlm-container {
|
|
5406
|
-
position: absolute;
|
|
5407
|
-
height: 100% !important;
|
|
5408
|
-
background-image: none;
|
|
5409
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5410
|
-
}
|
|
5411
|
-
|
|
5412
|
-
// Compass
|
|
5413
|
-
|
|
5414
|
-
.pnlm-compass {
|
|
5415
|
-
width: ${compassSize};
|
|
5416
|
-
height: ${compassSize};
|
|
5417
|
-
border-radius: 50%;
|
|
5418
|
-
bottom: ${size(2)};
|
|
5419
|
-
left: ${size(2)};
|
|
5420
|
-
right: auto;
|
|
5421
|
-
margin-top: 0;
|
|
5422
|
-
border: 5px solid transparent;
|
|
5423
|
-
border-top-color: ${(props) => props.theme.color.textLight};
|
|
5424
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5425
|
-
background-image: none;
|
|
5426
|
-
backdrop-filter: blur(5px);
|
|
5427
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5428
|
-
box-sizing: border-box;
|
|
5429
|
-
|
|
5430
|
-
&:hover {
|
|
5431
|
-
background-color: red;
|
|
5432
|
-
}
|
|
5433
|
-
}
|
|
5434
|
-
|
|
5435
|
-
// Controls (zoom & fullscreen button)
|
|
5436
|
-
|
|
5437
|
-
.pnlm-grab,
|
|
5438
|
-
.pnlm-grabbing {
|
|
5439
|
-
.pnlm-controls-container {
|
|
5440
|
-
display: block;
|
|
5441
|
-
}
|
|
5442
|
-
}
|
|
5443
|
-
|
|
5444
|
-
.pnlm-controls-container {
|
|
5445
|
-
display: none;
|
|
5446
|
-
top: ${size(2)};
|
|
5447
|
-
left: ${size(2)};
|
|
5448
|
-
}
|
|
5449
|
-
|
|
5450
|
-
.pnlm-controls {
|
|
5451
|
-
margin-top: 0;
|
|
5452
|
-
|
|
5453
|
-
& + .pnlm-controls {
|
|
5454
|
-
margin-top: ${size(1)};
|
|
5455
|
-
}
|
|
5456
|
-
}
|
|
5457
|
-
|
|
5458
|
-
// Fullscreen button
|
|
5459
|
-
|
|
5460
|
-
.pnlm-fullscreen-toggle-button {
|
|
5461
|
-
display: none;
|
|
5462
|
-
position: relative;
|
|
5463
|
-
width: ${controlBtnSize};
|
|
5464
|
-
height: ${controlBtnSize};
|
|
5465
|
-
background-image: none;
|
|
5466
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5467
|
-
backdrop-filter: blur(5px);
|
|
5468
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5469
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5470
|
-
border: 0;
|
|
5471
|
-
border-radius: 50%;
|
|
5472
|
-
|
|
5473
|
-
&:hover {
|
|
5474
|
-
background-color: rgba(255, 255, 255, 0.6);
|
|
5475
|
-
}
|
|
5476
|
-
|
|
5477
|
-
&:before {
|
|
5478
|
-
position: absolute;
|
|
5479
|
-
top: 50%;
|
|
5480
|
-
left: 50%;
|
|
5481
|
-
transform: translate(-50%, -50%);
|
|
5482
|
-
font-size: 0.875rem;
|
|
5483
|
-
}
|
|
5484
|
-
}
|
|
5485
|
-
|
|
5486
|
-
.pnlm-fullscreen-toggle-button-inactive {
|
|
5487
|
-
&:before {
|
|
5488
|
-
content: '⤢';
|
|
5489
|
-
}
|
|
5490
|
-
|
|
5491
|
-
&.pnlm-fullscreen-toggle-button-active {
|
|
5492
|
-
&:before {
|
|
5493
|
-
content: '⤢';
|
|
5494
|
-
}
|
|
5495
|
-
}
|
|
5496
|
-
}
|
|
5497
|
-
|
|
5498
|
-
// Gyroscope (Orientation)
|
|
5499
|
-
|
|
5500
|
-
.pnlm-orientation-button {
|
|
5501
|
-
background-image: none;
|
|
5502
|
-
width: ${controlBtnSize};
|
|
5503
|
-
height: ${controlBtnSize};
|
|
5504
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5505
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5506
|
-
border: 0;
|
|
5507
|
-
border-radius: 999px;
|
|
5508
|
-
|
|
5509
|
-
&:hover {
|
|
5510
|
-
background-color: red;
|
|
5511
|
-
}
|
|
5512
|
-
|
|
5513
|
-
&:before {
|
|
5514
|
-
content: 'A';
|
|
5515
|
-
position: absolute;
|
|
5516
|
-
top: 50%;
|
|
5517
|
-
left: 50%;
|
|
5518
|
-
transform: translate(-50%, -50%);
|
|
5519
|
-
font-size: 0.875rem;
|
|
5520
|
-
}
|
|
5521
|
-
|
|
5522
|
-
&.pnlm-orientation-button-active {
|
|
5523
|
-
background-color: green;
|
|
5524
|
-
|
|
5525
|
-
&:hover {
|
|
5526
|
-
background-color: pink;
|
|
5527
|
-
}
|
|
5528
|
-
}
|
|
5529
|
-
}
|
|
5530
|
-
|
|
5531
|
-
// Zoom controls
|
|
5532
|
-
|
|
5533
|
-
.pnlm-zoom-controls {
|
|
5534
|
-
display: none;
|
|
5535
|
-
height: auto;
|
|
5536
|
-
width: auto;
|
|
5537
|
-
background-color: transparent;
|
|
5538
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
5539
|
-
border: 0;
|
|
5540
|
-
border-radius: 999px;
|
|
5541
|
-
|
|
5542
|
-
> * {
|
|
5543
|
-
&:first-child {
|
|
5544
|
-
border-top-left-radius: 999px;
|
|
5545
|
-
border-top-right-radius: 999px;
|
|
5546
|
-
}
|
|
5547
|
-
|
|
5548
|
-
&:last-child {
|
|
5549
|
-
border-bottom-left-radius: 999px;
|
|
5550
|
-
border-bottom-right-radius: 999px;
|
|
5551
|
-
}
|
|
5552
|
-
}
|
|
5553
|
-
}
|
|
5554
|
-
|
|
5555
|
-
.pnlm-zoom-in,
|
|
5556
|
-
.pnlm-zoom-out {
|
|
5557
|
-
position: relative;
|
|
5558
|
-
display: block;
|
|
5559
|
-
width: ${controlBtnSize};
|
|
5560
|
-
height: ${controlBtnSize};
|
|
5561
|
-
background-image: none;
|
|
5562
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5563
|
-
backdrop-filter: blur(5px);
|
|
5564
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5565
|
-
border-radius: 0;
|
|
5566
|
-
|
|
5567
|
-
&:before {
|
|
5568
|
-
position: absolute;
|
|
5569
|
-
top: 50%;
|
|
5570
|
-
left: 50%;
|
|
5571
|
-
transform: translate(-50%, -50%);
|
|
5572
|
-
}
|
|
5573
|
-
|
|
5574
|
-
&:hover {
|
|
5575
|
-
background-color: rgba(255, 255, 255, 0.6);
|
|
5576
|
-
}
|
|
5577
|
-
}
|
|
5578
|
-
|
|
5579
|
-
.pnlm-zoom-in {
|
|
5580
|
-
top: auto;
|
|
5581
|
-
|
|
5582
|
-
&:before {
|
|
5583
|
-
content: '+';
|
|
5584
|
-
}
|
|
5585
|
-
}
|
|
5586
|
-
|
|
5587
|
-
.pnlm-zoom-out {
|
|
5588
|
-
bottom: auto;
|
|
5589
|
-
border-top: 1px solid ${(props) => props.theme.color.textDark};
|
|
5590
|
-
|
|
5591
|
-
&:before {
|
|
5592
|
-
content: '-';
|
|
5593
|
-
}
|
|
5594
|
-
}
|
|
5595
|
-
|
|
5596
|
-
// Load Button
|
|
5597
|
-
|
|
5598
|
-
.pnlm-load-button {
|
|
5599
|
-
top: auto;
|
|
5600
|
-
bottom: ${size(2)};
|
|
5601
|
-
transform: translateX(-50%);
|
|
5602
|
-
width: auto;
|
|
5603
|
-
height: auto;
|
|
5604
|
-
padding: ${size(1.75)} ${size(2)};
|
|
5605
|
-
border-radius: 3px;
|
|
5606
|
-
margin: 0;
|
|
5607
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5608
|
-
color: ${(props) => props.theme.color.textDark};
|
|
5609
|
-
line-height: 1.1;
|
|
5610
|
-
user-select: none;
|
|
5611
|
-
|
|
5612
|
-
&:hover {
|
|
5613
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
5614
|
-
}
|
|
5615
|
-
|
|
5616
|
-
p {
|
|
5617
|
-
margin: 0;
|
|
5618
|
-
font-size: 0.875rem;
|
|
5619
|
-
}
|
|
5620
|
-
}
|
|
5621
|
-
|
|
5622
|
-
// Load box
|
|
5623
|
-
|
|
5624
|
-
.pnlm-load-box {
|
|
5625
|
-
background-color: transparent;
|
|
5626
|
-
height: auto;
|
|
5627
|
-
margin: 0;
|
|
5628
|
-
width: 150px;
|
|
5629
|
-
transform: translate(-50%, -50%);
|
|
5630
|
-
|
|
5631
|
-
> p {
|
|
5632
|
-
display: none;
|
|
5633
|
-
}
|
|
5634
|
-
}
|
|
5635
|
-
|
|
5636
|
-
// Load bar
|
|
5637
|
-
|
|
5638
|
-
.pnlm-lbar {
|
|
5639
|
-
width: 100%;
|
|
5640
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
5641
|
-
border: 0;
|
|
5642
|
-
}
|
|
5643
|
-
|
|
5644
|
-
.pnlm-lbar-fill {
|
|
5645
|
-
background-color: ${(props) => props.theme.color.textLight};
|
|
5646
|
-
}
|
|
5647
|
-
`;
|
|
5648
|
-
|
|
5649
|
-
// src/components/Sphere/SphereViewer.tsx
|
|
5650
|
-
var ReactPannellum = lazy(() => import("pannellum-react/es/elements/Pannellum"));
|
|
5651
|
-
var SphereViewer = ({ id, src, preview, autoLoad, onStart }) => {
|
|
5652
|
-
const [number] = useState9(Math.floor(1e8 + Math.random() * 9e8));
|
|
5653
|
-
useEffect7(() => {
|
|
5654
|
-
setTimeout(() => {
|
|
5655
|
-
if (onStart) {
|
|
5656
|
-
const startBtn = document.querySelector(".pnlm-load-button");
|
|
5657
|
-
if (startBtn)
|
|
5658
|
-
startBtn.addEventListener("click", onStart);
|
|
5659
|
-
}
|
|
5660
|
-
}, 100);
|
|
5661
|
-
}, []);
|
|
5662
|
-
return /* @__PURE__ */ React42.createElement(Wrapper20, null, /* @__PURE__ */ React42.createElement(React42.Suspense, {
|
|
5663
|
-
fallback: /* @__PURE__ */ React42.createElement(Loader_default, null)
|
|
5664
|
-
}, /* @__PURE__ */ React42.createElement(ReactPannellum, {
|
|
5665
|
-
id: `a-${id}-${number}`,
|
|
5666
|
-
image: src,
|
|
5667
|
-
hfov: 120,
|
|
5668
|
-
autoLoad,
|
|
5669
|
-
compass: true,
|
|
5670
|
-
width: "100%",
|
|
5671
|
-
preview
|
|
5672
|
-
})));
|
|
5673
|
-
};
|
|
5674
|
-
var SphereViewer_default = SphereViewer;
|
|
5675
|
-
|
|
5676
|
-
// src/components/Sphere/SphereLightbox.tsx
|
|
5677
|
-
var SphereLightbox = ({ url }) => /* @__PURE__ */ React43.createElement(SphereViewer_default, {
|
|
5678
|
-
id: url,
|
|
5679
|
-
src: url,
|
|
5680
|
-
preview: url,
|
|
5681
|
-
autoLoad: true
|
|
5682
|
-
});
|
|
5683
|
-
var SphereLightbox_default = SphereLightbox;
|
|
5684
|
-
|
|
5685
|
-
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5686
|
-
import React46, { useState as useState11, useCallback as useCallback14 } from "react";
|
|
5687
|
-
|
|
5688
|
-
// src/components/Gallery/MediaButton.tsx
|
|
5689
|
-
import React44 from "react";
|
|
5690
|
-
var MediaButton = ({ text, onClick }) => /* @__PURE__ */ React44.createElement(MediaButtonWrapper, null, /* @__PURE__ */ React44.createElement(ButtonSecondary, {
|
|
5691
|
-
onClick,
|
|
5692
|
-
title: text
|
|
5693
|
-
}, /* @__PURE__ */ React44.createElement(ButtonContent, null, text)));
|
|
5694
|
-
var MediaButton_default = MediaButton;
|
|
5695
|
-
|
|
5696
|
-
// src/components/ThreeSixty/Rotation.tsx
|
|
5697
|
-
import React45, { useState as useState10, useEffect as useEffect8, useRef as useRef2, cloneElement, Children } from "react";
|
|
5698
|
-
var calculateCurrentFrame = (startFrame, delta, length) => {
|
|
5699
|
-
const frame = (startFrame + delta) % length;
|
|
5700
|
-
if (frame < 0) {
|
|
5701
|
-
return frame + length;
|
|
5702
|
-
}
|
|
5703
|
-
return frame;
|
|
5704
|
-
};
|
|
5705
|
-
var Rotation = ({ children }) => {
|
|
5706
|
-
const startFrame = useRef2(0);
|
|
5707
|
-
const pointerPosition = useRef2();
|
|
5708
|
-
const max = useRef2(0);
|
|
5709
|
-
const [state, setState] = useState10({
|
|
5710
|
-
current: 0,
|
|
5711
|
-
outsideMouseMove: false
|
|
5712
|
-
});
|
|
5713
|
-
useEffect8(() => {
|
|
5714
|
-
document.addEventListener("mouseup", touchEnd);
|
|
5715
|
-
return () => {
|
|
5716
|
-
window.document.removeEventListener("mouseup", touchEnd);
|
|
5717
|
-
window.document.body.removeEventListener("mousemove", mouseMove);
|
|
5718
|
-
window.document.body.removeEventListener("mouseup", mouseUp);
|
|
5719
|
-
};
|
|
5720
|
-
}, []);
|
|
5721
|
-
const touchMove = (event) => {
|
|
5722
|
-
const notTouched = typeof pointerPosition.current !== "number";
|
|
5723
|
-
event.preventDefault();
|
|
5724
|
-
if (notTouched) {
|
|
5725
|
-
return;
|
|
5726
|
-
}
|
|
5727
|
-
const childCount = Children.count(children);
|
|
5728
|
-
const { offsetWidth } = event.currentTarget;
|
|
5729
|
-
const pointer = calculatePointerPosition(event);
|
|
5730
|
-
const max2 = offsetWidth;
|
|
5731
|
-
const offset = pointer - (pointerPosition.current || 0);
|
|
5732
|
-
const delta = Math.floor(offset / max2 * childCount);
|
|
5733
|
-
setCurrentFrame(calculateCurrentFrame(startFrame.current, delta, childCount));
|
|
5734
|
-
};
|
|
5735
|
-
const mouseMove = (event) => {
|
|
5736
|
-
const notTouched = typeof pointerPosition.current !== "number";
|
|
5737
|
-
event.preventDefault();
|
|
5738
|
-
if (notTouched || !state.outsideMouseMove)
|
|
5739
|
-
return;
|
|
5740
|
-
const childCount = Children.count(children);
|
|
5741
|
-
const pointer = calculatePointerPosition(event);
|
|
5742
|
-
const offset = pointer - (pointerPosition.current || 0);
|
|
5743
|
-
const delta = Math.floor(offset / max.current * childCount);
|
|
5744
|
-
setCurrentFrame(calculateCurrentFrame(startFrame.current, delta, childCount));
|
|
5745
|
-
};
|
|
5746
|
-
const mouseUp = () => {
|
|
5747
|
-
window.document.body.removeEventListener("mousemove", mouseMove);
|
|
5748
|
-
window.document.body.removeEventListener("mouseup", mouseUp);
|
|
5749
|
-
pointerPosition.current = void 0;
|
|
5750
|
-
startFrame.current = 0;
|
|
5751
|
-
};
|
|
5752
|
-
const touchStart = (event) => {
|
|
5753
|
-
event.preventDefault();
|
|
5754
|
-
pointerPosition.current = calculatePointerPosition(event);
|
|
5755
|
-
startFrame.current = state.current;
|
|
5756
|
-
const { offsetWidth } = event.currentTarget;
|
|
5757
|
-
max.current = offsetWidth;
|
|
5758
|
-
window.document.body.addEventListener("mousemove", mouseMove);
|
|
5759
|
-
window.document.body.addEventListener("mouseup", mouseUp);
|
|
5760
|
-
};
|
|
5761
|
-
const touchEnd = (event) => {
|
|
5762
|
-
event.preventDefault();
|
|
5763
|
-
pointerPosition.current = void 0;
|
|
5764
|
-
startFrame.current = 0;
|
|
5765
|
-
};
|
|
5766
|
-
const onMouseEnter = () => {
|
|
5767
|
-
if (state.outsideMouseMove)
|
|
5768
|
-
setState({ ...state, outsideMouseMove: false });
|
|
5769
|
-
};
|
|
5770
|
-
const onMouseLeave = () => {
|
|
5771
|
-
if (!state.outsideMouseMove)
|
|
5772
|
-
setState({ ...state, outsideMouseMove: true });
|
|
5773
|
-
};
|
|
5774
|
-
const setCurrentFrame = (current) => {
|
|
5775
|
-
if (current !== state.current) {
|
|
5776
|
-
setState({ ...state, current });
|
|
5777
|
-
}
|
|
5778
|
-
};
|
|
5779
|
-
const calculatePointerPosition = (event) => {
|
|
5780
|
-
const { clientX } = event.type.indexOf("touch") === 0 ? event.changedTouches[0] : event;
|
|
5781
|
-
const { offsetLeft } = event.currentTarget;
|
|
5782
|
-
return clientX - offsetLeft;
|
|
5783
|
-
};
|
|
5784
|
-
return /* @__PURE__ */ React45.createElement("div", {
|
|
5785
|
-
onTouchStart: touchStart,
|
|
5786
|
-
onTouchMove: touchMove,
|
|
5787
|
-
onTouchEnd: touchEnd,
|
|
5788
|
-
onMouseDown: touchStart,
|
|
5789
|
-
onMouseMove: touchMove,
|
|
5790
|
-
onMouseEnter,
|
|
5791
|
-
onMouseLeave
|
|
5792
|
-
}, Children.map(
|
|
5793
|
-
children,
|
|
5794
|
-
(child, i) => cloneElement(child, {
|
|
5795
|
-
style: {
|
|
5796
|
-
width: "100%",
|
|
5797
|
-
display: state.current === i ? "block" : "none"
|
|
5798
|
-
}
|
|
5799
|
-
})
|
|
5800
|
-
));
|
|
5801
|
-
};
|
|
5802
|
-
var Rotation_default = Rotation;
|
|
5803
|
-
|
|
5804
|
-
// src/components/ThreeSixty/ThreeSixtLightbox.tsx
|
|
5805
|
-
var ThreeSixtyLightbox = ({ urls }) => {
|
|
5806
|
-
const [started2, setStarted] = useState11(false);
|
|
5807
|
-
const onStart = useCallback14(() => setStarted(true), []);
|
|
5808
|
-
if (!started2) {
|
|
5809
|
-
return /* @__PURE__ */ React46.createElement(Item9, null, /* @__PURE__ */ React46.createElement(Img2, {
|
|
5810
|
-
src: urls[0],
|
|
5811
|
-
alt: "alt"
|
|
5812
|
-
}), /* @__PURE__ */ React46.createElement(MediaButton_default, {
|
|
5813
|
-
text: "Starta 360\xB0 exteri\xF6rt",
|
|
5814
|
-
onClick: onStart
|
|
5815
|
-
}));
|
|
5816
|
-
}
|
|
5817
|
-
return /* @__PURE__ */ React46.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React46.createElement(Img2, {
|
|
5818
|
-
key: image,
|
|
5819
|
-
src: image,
|
|
5820
|
-
alt: `Bild ${i + 1}`
|
|
5821
|
-
})));
|
|
5822
|
-
};
|
|
5823
|
-
var ThreeSixtLightbox_default = ThreeSixtyLightbox;
|
|
5824
|
-
|
|
5825
|
-
// src/components/Lightbox/index.tsx
|
|
5826
|
-
var Lightbox = ({ index: index2, media, onClose }) => {
|
|
5827
|
-
const onRef = (ref) => {
|
|
5828
|
-
if (ref) {
|
|
5829
|
-
setTimeout(() => {
|
|
5830
|
-
ref.scrollIntoView();
|
|
5831
|
-
}, 300);
|
|
5832
|
-
}
|
|
5833
|
-
};
|
|
5834
|
-
const onKeyDown = (e) => {
|
|
5835
|
-
if (e.keyCode === 27) {
|
|
5836
|
-
onClose();
|
|
5837
|
-
}
|
|
5838
|
-
};
|
|
5839
|
-
return /* @__PURE__ */ React47.createElement(Wrapper18, {
|
|
5840
|
-
ref: (ref) => ref?.focus(),
|
|
5841
|
-
onKeyDown,
|
|
5842
|
-
tabIndex: 0
|
|
5843
|
-
}, /* @__PURE__ */ React47.createElement(UiBlock2, {
|
|
5844
|
-
onClick: onClose,
|
|
5845
|
-
"aria-hidden": true
|
|
5846
|
-
}), media.map((m, i) => /* @__PURE__ */ React47.createElement(Item9, {
|
|
5847
|
-
key: i,
|
|
5848
|
-
ref: index2 === i ? onRef : void 0
|
|
5849
|
-
}, m.type === "image" && /* @__PURE__ */ React47.createElement(Img2, {
|
|
5850
|
-
id: `lightbox-image-${i}`,
|
|
5851
|
-
src: m.files[0].url,
|
|
5852
|
-
alt: `Bild ${i + 1}`
|
|
5853
|
-
}), m.type === "threesixty" && /* @__PURE__ */ React47.createElement(ThreeSixtLightbox_default, {
|
|
5854
|
-
urls: m.files.map((x) => x.url)
|
|
5855
|
-
}), m.type === "sphere" && /* @__PURE__ */ React47.createElement(SphereLightbox_default, {
|
|
5856
|
-
url: m.files[0].url
|
|
5857
|
-
}), m.type === "embedded" && /* @__PURE__ */ React47.createElement(EmbeddedVideoLightbox_default, {
|
|
5858
|
-
url: m.files[0].url
|
|
5859
|
-
}))), /* @__PURE__ */ React47.createElement(CloseBtn2, {
|
|
5860
|
-
onClick: onClose,
|
|
5861
|
-
title: "St\xE4ng"
|
|
5862
|
-
}, /* @__PURE__ */ React47.createElement(IconCancel, {
|
|
5863
|
-
block: true
|
|
5864
|
-
})));
|
|
5865
|
-
};
|
|
5866
|
-
var Lightbox_default = Lightbox;
|
|
5867
|
-
|
|
5868
|
-
// src/components/Video/EmbededVideo.tsx
|
|
5869
|
-
import React49, { useState as useState15, useCallback as useCallback16 } from "react";
|
|
5870
|
-
|
|
5871
|
-
// src/components/Video/useThumbnail.ts
|
|
5872
|
-
import { useEffect as useEffect11, useState as useState14 } from "react";
|
|
5873
|
-
|
|
5874
|
-
// src/hooks/useVimeoThumbnail.ts
|
|
5875
|
-
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
5876
|
-
|
|
5877
|
-
// src/hooks/useFetch.ts
|
|
5878
|
-
import { useEffect as useEffect9, useState as useState12, useCallback as useCallback15 } from "react";
|
|
5879
|
-
var cache = {};
|
|
5880
|
-
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
5881
|
-
var setCachedResult = (key, value) => {
|
|
5882
|
-
cache[key] = value;
|
|
5883
|
-
};
|
|
5884
|
-
var pendingPromise = {};
|
|
5885
|
-
var isPendingPromise = (url) => !!pendingPromise[url];
|
|
5886
|
-
var setPendingPromise = (url, promise) => {
|
|
5887
|
-
pendingPromise = {
|
|
5888
|
-
...pendingPromise,
|
|
5889
|
-
[url]: promise
|
|
5890
|
-
};
|
|
5891
|
-
};
|
|
5892
|
-
var clearPendingPromise = (url) => {
|
|
5893
|
-
delete pendingPromise[url];
|
|
5894
|
-
};
|
|
5895
|
-
var useFetch = (path, options, skip, promiseCache) => {
|
|
5896
|
-
const [data, setData] = useState12();
|
|
5897
|
-
const [loading, setLoading] = useState12(false);
|
|
5898
|
-
const [error, setError] = useState12(false);
|
|
5899
|
-
const doFetch = useCallback15(async () => {
|
|
5900
|
-
const key = path.toString();
|
|
5901
|
-
const cached = getCachedResult(key);
|
|
5902
|
-
setError(false);
|
|
5903
|
-
if (cached) {
|
|
5904
|
-
setData(cached);
|
|
5905
|
-
return;
|
|
5906
|
-
}
|
|
5907
|
-
setLoading(true);
|
|
5908
|
-
try {
|
|
5909
|
-
const reusePromise = promiseCache && isPendingPromise(key);
|
|
5910
|
-
const request = reusePromise ? pendingPromise[key] : fetch(path, options);
|
|
5911
|
-
if (promiseCache) {
|
|
5912
|
-
setPendingPromise(key, request);
|
|
5913
|
-
}
|
|
5914
|
-
const result = await request;
|
|
5915
|
-
if (result.ok) {
|
|
5916
|
-
const json2 = await result.clone().json();
|
|
5917
|
-
setCachedResult(key, json2);
|
|
5918
|
-
setData(json2);
|
|
5919
|
-
}
|
|
5920
|
-
} catch (e) {
|
|
5921
|
-
setError(true);
|
|
5922
|
-
} finally {
|
|
5923
|
-
setLoading(false);
|
|
5924
|
-
clearPendingPromise(key);
|
|
5925
|
-
}
|
|
5926
|
-
return;
|
|
5927
|
-
}, [path, options]);
|
|
5928
|
-
useEffect9(() => {
|
|
5929
|
-
if (!skip) {
|
|
5930
|
-
doFetch();
|
|
5931
|
-
}
|
|
5932
|
-
}, [path, skip]);
|
|
5933
|
-
return {
|
|
5934
|
-
loading,
|
|
5935
|
-
data,
|
|
5936
|
-
error
|
|
5937
|
-
};
|
|
5938
|
-
};
|
|
5939
|
-
var useFetch_default = useFetch;
|
|
5940
|
-
|
|
5941
|
-
// src/hooks/useVimeoThumbnail.ts
|
|
5942
|
-
var useVimeoThumbnail = (id, small) => {
|
|
5943
|
-
const [thumbnail, setThumbnail] = useState13();
|
|
5944
|
-
const { data } = useFetch_default(
|
|
5945
|
-
`http://vimeo.com/api/v2/video/${id}.json`,
|
|
5946
|
-
{},
|
|
5947
|
-
!id || !!thumbnail,
|
|
5948
|
-
true
|
|
5949
|
-
);
|
|
5950
|
-
useEffect10(() => {
|
|
5951
|
-
if (data?.[0]) {
|
|
5952
|
-
if (small && data[0].thumbnail_small) {
|
|
5953
|
-
setThumbnail(data[0].thumbnail_small);
|
|
5954
|
-
} else if (data[0].thumbnail_large) {
|
|
5955
|
-
setThumbnail(data[0].thumbnail_large);
|
|
5956
|
-
}
|
|
5957
|
-
}
|
|
5958
|
-
}, [data]);
|
|
5959
|
-
return thumbnail;
|
|
5960
|
-
};
|
|
5961
|
-
var useVimeoThumbnail_default = useVimeoThumbnail;
|
|
5962
|
-
|
|
5963
|
-
// src/components/Video/useThumbnail.ts
|
|
5964
|
-
var useThumbnail = (url, small) => {
|
|
5965
|
-
if (url?.toLowerCase().endsWith(".mp4"))
|
|
5966
|
-
return;
|
|
5967
|
-
const [thumbnail, setThumbnail] = useState14();
|
|
5968
|
-
const vimeoId = url ? getVimeoId(url) : void 0;
|
|
5969
|
-
const vimeoThumbnail = useVimeoThumbnail_default(vimeoId, small);
|
|
5970
|
-
useEffect11(() => {
|
|
5971
|
-
if (url) {
|
|
5972
|
-
const youtubeThumbnail = getYoutubeThumbnail(url);
|
|
5973
|
-
if (youtubeThumbnail) {
|
|
5974
|
-
if (small) {
|
|
5975
|
-
setThumbnail([youtubeThumbnail.mqdefault]);
|
|
5976
|
-
} else {
|
|
5977
|
-
setThumbnail([youtubeThumbnail.maxresdefault, youtubeThumbnail.hqdefault]);
|
|
5978
|
-
}
|
|
5979
|
-
}
|
|
5980
|
-
}
|
|
5981
|
-
}, [url]);
|
|
5982
|
-
return vimeoThumbnail ? [vimeoThumbnail] : thumbnail;
|
|
5983
|
-
};
|
|
5984
|
-
var useThumbnail_default = useThumbnail;
|
|
5985
|
-
|
|
5986
|
-
// src/components/Modal/index.tsx
|
|
5987
|
-
import * as React48 from "react";
|
|
5988
|
-
|
|
5989
|
-
// src/components/Modal/wrapper.tsx
|
|
5990
|
-
import styled38 from "styled-components";
|
|
5991
|
-
var Wrapper21 = styled38.div.attrs(() => ({
|
|
5992
|
-
role: "dialog"
|
|
5993
|
-
}))`
|
|
5994
|
-
position: fixed;
|
|
5995
|
-
top: 0;
|
|
5996
|
-
bottom: 0;
|
|
5997
|
-
left: 0;
|
|
5998
|
-
right: 0;
|
|
5999
|
-
width: 100%;
|
|
6000
|
-
white-space: normal;
|
|
6001
|
-
text-align: left;
|
|
6002
|
-
z-index: 90;
|
|
6003
|
-
display: flex;
|
|
6004
|
-
align-items: center;
|
|
6005
|
-
justify-content: center;
|
|
6006
|
-
|
|
6007
|
-
${(props) => props.theme.breakpoint.Sm} {
|
|
6008
|
-
padding: ${size(2)};
|
|
6009
|
-
}
|
|
6010
|
-
`;
|
|
6011
|
-
var UiBlock3 = styled38.div.attrs(() => ({
|
|
6012
|
-
"aria-hidden": "true",
|
|
6013
|
-
role: "button"
|
|
6014
|
-
}))`
|
|
6015
|
-
position: fixed;
|
|
6016
|
-
top: 0;
|
|
6017
|
-
bottom: 0;
|
|
6018
|
-
left: 0;
|
|
6019
|
-
right: 0;
|
|
6020
|
-
background-color: rgba(0, 0, 0, 0.35);
|
|
6021
|
-
z-index: -1;
|
|
6022
|
-
|
|
6023
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
6024
|
-
animation: ${fadeIn} 300ms ease forwards;
|
|
6025
|
-
}
|
|
6026
|
-
|
|
6027
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
6028
|
-
animation: ${fadeIn} 400ms ease forwards;
|
|
6029
|
-
}
|
|
6030
|
-
`;
|
|
6031
|
-
var Dialog = styled38.article.attrs(() => ({
|
|
6032
|
-
className: "wayke__theme wayke__font--regular"
|
|
6033
|
-
}))`
|
|
6034
|
-
display: flex;
|
|
6035
|
-
flex-direction: column;
|
|
6036
|
-
background-color: ${(props) => props.theme.color.bg};
|
|
6037
|
-
z-index: 1;
|
|
6038
|
-
width: 100%;
|
|
6039
|
-
max-width: 680px;
|
|
6040
|
-
max-height: 100%;
|
|
6041
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
|
6042
|
-
overflow: hidden;
|
|
6043
|
-
|
|
6044
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
6045
|
-
align-self: flex-end;
|
|
6046
|
-
transform: translateY(100%);
|
|
6047
|
-
animation: ${noTransform} 300ms ease forwards;
|
|
6048
|
-
}
|
|
6049
|
-
|
|
6050
|
-
${(props) => props.theme.breakpoint.Sm} {
|
|
6051
|
-
transform: translateY(${size(2)});
|
|
6052
|
-
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
6053
|
-
}
|
|
6054
|
-
`;
|
|
6055
|
-
var Content4 = styled38.div`
|
|
6056
|
-
flex: 1 1 auto;
|
|
6057
|
-
overflow: auto;
|
|
6058
|
-
-webkit-overflow-scrolling: touch;
|
|
6059
|
-
`;
|
|
6060
|
-
var Header4 = styled38.header`
|
|
6061
|
-
display: flex;
|
|
6062
|
-
align-items: center;
|
|
6063
|
-
min-height: 60px;
|
|
6064
|
-
padding: ${size(3)};
|
|
6065
|
-
padding-bottom: 0;
|
|
6066
|
-
`;
|
|
6067
|
-
var Heading5 = styled38.div`
|
|
6068
|
-
flex: 1 1 auto;
|
|
6069
|
-
|
|
6070
|
-
${H1} {
|
|
6071
|
-
font-size: 1.5rem;
|
|
6072
|
-
}
|
|
6073
|
-
`;
|
|
6074
|
-
var Close2 = styled38.div`
|
|
6075
|
-
flex-shrink: 0;
|
|
6076
|
-
margin: ${size(-2)};
|
|
6077
|
-
padding-left: ${size(3)};
|
|
6078
|
-
`;
|
|
6079
|
-
var CloseBtn3 = styled38(ButtonReset)`
|
|
6080
|
-
display: block;
|
|
6081
|
-
padding: ${size(2)};
|
|
6082
|
-
`;
|
|
6083
|
-
var Body4 = styled38.div`
|
|
6084
|
-
padding: ${size(3)};
|
|
6085
|
-
`;
|
|
6086
|
-
var Image3 = styled38.img`
|
|
6087
|
-
display: block;
|
|
6088
|
-
width: calc(100% + ${size(6)});
|
|
6089
|
-
margin-left: ${size(-3)};
|
|
6090
|
-
margin-bottom: ${size(3)};
|
|
6091
|
-
`;
|
|
6092
|
-
var ModalFoldout = styled38.div`
|
|
6093
|
-
background-color: ${(props) => props.theme.color.accent};
|
|
6094
|
-
margin: ${size(-3)};
|
|
6095
|
-
margin-top: ${size(3)};
|
|
6096
|
-
padding: ${size(3)};
|
|
6097
|
-
`;
|
|
6098
|
-
var ModalFoldoutBody = styled38.div``;
|
|
6099
|
-
|
|
6100
|
-
// src/components/Modal/index.tsx
|
|
6101
|
-
var Modal = ({ id, title, onClose, children }) => {
|
|
6102
|
-
return /* @__PURE__ */ React48.createElement(portal_default, {
|
|
6103
|
-
id: id || portal_namespace_exports.DefaultPortal
|
|
6104
|
-
}, /* @__PURE__ */ React48.createElement(Wrapper21, {
|
|
6105
|
-
onClick: (e) => e.stopPropagation()
|
|
6106
|
-
}, /* @__PURE__ */ React48.createElement(UiBlock3, {
|
|
6107
|
-
onClick: onClose,
|
|
6108
|
-
title: "St\xE4ng modal"
|
|
6109
|
-
}), /* @__PURE__ */ React48.createElement(Dialog, null, /* @__PURE__ */ React48.createElement(Content4, null, /* @__PURE__ */ React48.createElement(Header4, null, /* @__PURE__ */ React48.createElement(Heading5, null, /* @__PURE__ */ React48.createElement(H1, {
|
|
6110
|
-
noMargin: true
|
|
6111
|
-
}, title)), /* @__PURE__ */ React48.createElement(Close2, null, /* @__PURE__ */ React48.createElement(CloseBtn3, {
|
|
6112
|
-
onClick: onClose,
|
|
6113
|
-
title: "St\xE4ng modal"
|
|
6114
|
-
}, /* @__PURE__ */ React48.createElement(IconCancel, {
|
|
6115
|
-
block: true
|
|
6116
|
-
})))), /* @__PURE__ */ React48.createElement(Body4, null, children)))));
|
|
6117
|
-
};
|
|
6118
|
-
var Modal_default = Modal;
|
|
6119
|
-
|
|
6120
|
-
// src/components/Video/EmbededVideo.tsx
|
|
6121
|
-
var GalleryEmbed = ({ src, index: index2 }) => {
|
|
6122
|
-
const [modal, setModal] = useState15();
|
|
6123
|
-
const thumbnail = useThumbnail_default(src);
|
|
6124
|
-
const onClick = (e) => {
|
|
6125
|
-
e.stopPropagation();
|
|
6126
|
-
setModal(src);
|
|
6127
|
-
};
|
|
6128
|
-
const onCloseModal = (e) => {
|
|
6129
|
-
e.stopPropagation();
|
|
6130
|
-
setModal(void 0);
|
|
6131
|
-
};
|
|
6132
|
-
const onError = useCallback16(
|
|
6133
|
-
(e) => onImageError(e, thumbnail),
|
|
6134
|
-
[thumbnail]
|
|
6135
|
-
);
|
|
6136
|
-
const onLoad = useCallback16(
|
|
6137
|
-
(e) => onImageLoad(e, thumbnail),
|
|
6138
|
-
[thumbnail]
|
|
6139
|
-
);
|
|
6140
|
-
const customVideo = src.toLowerCase().endsWith(".mp4");
|
|
6141
|
-
if (thumbnail?.length && !customVideo) {
|
|
6142
|
-
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(ImageFull, {
|
|
6143
|
-
onLoad,
|
|
6144
|
-
src: thumbnail[0],
|
|
6145
|
-
onError,
|
|
6146
|
-
alt: `Bild ${index2 + 1}`
|
|
6147
|
-
}), /* @__PURE__ */ React49.createElement(MediaButton_default, {
|
|
6148
|
-
text: "Spela video",
|
|
6149
|
-
onClick
|
|
6150
|
-
}), modal && /* @__PURE__ */ React49.createElement(Modal_default, {
|
|
6151
|
-
title: "Video",
|
|
6152
|
-
onClose: onCloseModal
|
|
6153
|
-
}, /* @__PURE__ */ React49.createElement(EmbeddedVideoLightbox_default, {
|
|
6154
|
-
url: modal
|
|
6155
|
-
})));
|
|
6156
|
-
}
|
|
6157
|
-
if (customVideo)
|
|
6158
|
-
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(CustomPlayer_default, {
|
|
6159
|
-
ratio: "66.66%",
|
|
6160
|
-
isPreview: true,
|
|
6161
|
-
controls: false,
|
|
6162
|
-
url: src
|
|
6163
|
-
}), /* @__PURE__ */ React49.createElement(MediaButton_default, {
|
|
6164
|
-
text: "Spela video",
|
|
6165
|
-
onClick
|
|
6166
|
-
}), modal && /* @__PURE__ */ React49.createElement(Modal_default, {
|
|
6167
|
-
title: "Video",
|
|
6168
|
-
onClose: onCloseModal
|
|
6169
|
-
}, /* @__PURE__ */ React49.createElement(EmbeddedVideoLightbox_default, {
|
|
6170
|
-
url: modal
|
|
6171
|
-
})));
|
|
6172
|
-
return null;
|
|
6173
|
-
};
|
|
6174
|
-
var EmbededVideo_default = GalleryEmbed;
|
|
6175
|
-
|
|
6176
|
-
// src/components/Video/QuickNavEmbeded.tsx
|
|
6177
|
-
import React50, { useCallback as useCallback17 } from "react";
|
|
6178
|
-
var QuickNavEmbeded = ({ src, index: index2 }) => {
|
|
6179
|
-
const thumbnail = useThumbnail_default(src);
|
|
6180
|
-
const onError = useCallback17(
|
|
6181
|
-
(e) => onImageError(e, thumbnail),
|
|
6182
|
-
[thumbnail]
|
|
6183
|
-
);
|
|
6184
|
-
const onLoad = useCallback17(
|
|
6185
|
-
(e) => onImageLoad(e, thumbnail),
|
|
6186
|
-
[thumbnail]
|
|
6187
|
-
);
|
|
6188
|
-
const customVideo = src?.toLowerCase().endsWith(".mp4");
|
|
6189
|
-
if (thumbnail?.length && !customVideo)
|
|
6190
|
-
return /* @__PURE__ */ React50.createElement(QuickNavImg, {
|
|
6191
|
-
onLoad,
|
|
6192
|
-
src: thumbnail[0],
|
|
6193
|
-
onError,
|
|
6194
|
-
alt: `Bild ${index2 + 1}`
|
|
6195
|
-
});
|
|
6196
|
-
if (customVideo)
|
|
6197
|
-
return /* @__PURE__ */ React50.createElement(CustomPlayer_default, {
|
|
6198
|
-
key: index2,
|
|
6199
|
-
url: src,
|
|
6200
|
-
ratio: "66.66%"
|
|
6201
|
-
});
|
|
6202
|
-
return null;
|
|
6203
|
-
};
|
|
6204
|
-
var QuickNavEmbeded_default = QuickNavEmbeded;
|
|
6205
|
-
|
|
6206
|
-
// src/components/Sphere/Sphere.tsx
|
|
6207
|
-
import React51 from "react";
|
|
6208
|
-
var onMediaClick = (e, func) => {
|
|
6209
|
-
e.stopPropagation();
|
|
6210
|
-
e.preventDefault();
|
|
6211
|
-
func();
|
|
6212
|
-
};
|
|
6213
|
-
var Sphere = ({ url, preview, visible, onDisableNavigation, navigationDisabled }) => {
|
|
6214
|
-
if (!visible || !navigationDisabled && visible) {
|
|
6215
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(ImageFull, {
|
|
6216
|
-
src: preview,
|
|
6217
|
-
alt: "alt"
|
|
6218
|
-
}), /* @__PURE__ */ React51.createElement(MediaButton_default, {
|
|
6219
|
-
text: "Starta 360\xB0 interi\xF6rt",
|
|
6220
|
-
onClick: (e) => onMediaClick(e, onDisableNavigation)
|
|
6221
|
-
}));
|
|
6222
|
-
}
|
|
6223
|
-
if (navigationDisabled && visible) {
|
|
6224
|
-
return /* @__PURE__ */ React51.createElement(SphereViewer_default, {
|
|
6225
|
-
id: url,
|
|
6226
|
-
preview: url,
|
|
6227
|
-
src: url,
|
|
6228
|
-
autoLoad: true,
|
|
6229
|
-
onStart: onDisableNavigation
|
|
6230
|
-
});
|
|
6231
|
-
}
|
|
6232
|
-
return null;
|
|
6233
|
-
};
|
|
6234
|
-
var Sphere_default = Sphere;
|
|
6235
|
-
|
|
6236
|
-
// src/components/ThreeSixty/ThreeSixty.tsx
|
|
6237
|
-
import React52 from "react";
|
|
6238
|
-
var onMediaClick2 = (e, func) => {
|
|
6239
|
-
e.stopPropagation();
|
|
6240
|
-
e.preventDefault();
|
|
6241
|
-
func();
|
|
6242
|
-
};
|
|
6243
|
-
var ThreeSixty = ({ urls, visible, onDisableNavigation, navigationDisabled }) => {
|
|
6244
|
-
if (!visible || !navigationDisabled && visible) {
|
|
6245
|
-
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(Image2, {
|
|
6246
|
-
src: urls[0],
|
|
6247
|
-
alt: "alt"
|
|
6248
|
-
}), /* @__PURE__ */ React52.createElement(MediaButton_default, {
|
|
6249
|
-
text: "Starta 360\xB0 exteri\xF6rt",
|
|
6250
|
-
onClick: (e) => onMediaClick2(e, onDisableNavigation)
|
|
6251
|
-
}));
|
|
6252
|
-
}
|
|
6253
|
-
if (navigationDisabled && visible) {
|
|
6254
|
-
return /* @__PURE__ */ React52.createElement("div", {
|
|
6255
|
-
onClick: (e) => {
|
|
6256
|
-
e.stopPropagation();
|
|
6257
|
-
e.preventDefault();
|
|
6258
|
-
}
|
|
6259
|
-
}, /* @__PURE__ */ React52.createElement(Rotation_default, null, urls.map((image, i) => /* @__PURE__ */ React52.createElement(Image2, {
|
|
6260
|
-
key: image,
|
|
6261
|
-
src: image,
|
|
6262
|
-
alt: `Bild ${i + 1}`
|
|
6263
|
-
}))));
|
|
6264
|
-
}
|
|
6265
|
-
return null;
|
|
6266
|
-
};
|
|
6267
|
-
var ThreeSixty_default = ThreeSixty;
|
|
6268
|
-
|
|
6269
|
-
// src/components/Gallery/index.tsx
|
|
6270
|
-
var sliderSettings = {
|
|
6271
|
-
dots: false,
|
|
6272
|
-
arrows: false,
|
|
6273
|
-
infinite: true,
|
|
6274
|
-
speed: 300,
|
|
6275
|
-
slidesToShow: 1,
|
|
6276
|
-
slidesToScroll: 1
|
|
6277
|
-
};
|
|
6278
|
-
var Gallery = ({ media, placeholderImage }) => {
|
|
6279
|
-
const slider = useRef3(null);
|
|
6280
|
-
const quickNavRef = useRef3(null);
|
|
6281
|
-
const isDragging = useRef3(false);
|
|
6282
|
-
const [index2, setIndex] = useState16(0);
|
|
6283
|
-
const [lightbox, setLightbox] = useState16(false);
|
|
6284
|
-
const [navigationDisabled, setNavigationDisabled] = useState16(false);
|
|
6285
|
-
const beforeChange = useCallback18((_, newIndex) => {
|
|
6286
|
-
const element = quickNavRef.current?.querySelectorAll("li")?.[newIndex];
|
|
6287
|
-
if (element) {
|
|
6288
|
-
scrollIntoView(element, { scrollMode: "if-needed", block: "nearest", inline: "nearest" });
|
|
6289
|
-
}
|
|
6290
|
-
setIndex(newIndex);
|
|
6291
|
-
}, []);
|
|
6292
|
-
const onMouseDown = useCallback18(() => {
|
|
6293
|
-
if (isDragging.current) {
|
|
6294
|
-
isDragging.current = false;
|
|
6295
|
-
}
|
|
6296
|
-
}, []);
|
|
6297
|
-
const onMouseMove = useCallback18(() => {
|
|
6298
|
-
if (!isDragging.current) {
|
|
6299
|
-
isDragging.current = true;
|
|
6300
|
-
}
|
|
6301
|
-
}, []);
|
|
6302
|
-
const onClick = useCallback18(() => {
|
|
6303
|
-
pubsub_default.publish("ImagesClick");
|
|
6304
|
-
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
6305
|
-
setLightbox(true);
|
|
6306
|
-
}
|
|
6307
|
-
}, [lightbox, media]);
|
|
6308
|
-
const nextImage = useCallback18(() => {
|
|
6309
|
-
if (!slider || !slider.current) {
|
|
6310
|
-
return;
|
|
6311
|
-
}
|
|
6312
|
-
slider.current.slickNext();
|
|
6313
|
-
}, [slider]);
|
|
6314
|
-
const prevImage = useCallback18(() => {
|
|
6315
|
-
if (!slider || !slider.current) {
|
|
6316
|
-
return;
|
|
6317
|
-
}
|
|
6318
|
-
slider.current.slickPrev();
|
|
6319
|
-
}, [slider]);
|
|
6320
|
-
const goTo = (target) => {
|
|
6321
|
-
if (!slider || !slider.current) {
|
|
6322
|
-
return;
|
|
6323
|
-
}
|
|
6324
|
-
if (slider.current) {
|
|
6325
|
-
setIndex(target);
|
|
6326
|
-
slider.current.slickGoTo(target);
|
|
6327
|
-
}
|
|
6328
|
-
};
|
|
6329
|
-
const onDisableNavigation = () => {
|
|
6330
|
-
if (!isDragging.current)
|
|
6331
|
-
setNavigationDisabled(true);
|
|
6332
|
-
};
|
|
6333
|
-
const onEnableNavigation = (e) => {
|
|
6334
|
-
e.stopPropagation();
|
|
6335
|
-
isDragging.current = false;
|
|
6336
|
-
setNavigationDisabled(false);
|
|
6337
|
-
};
|
|
6338
|
-
const onToggleLightbox = useCallback18(() => setLightbox(!lightbox), [lightbox]);
|
|
6339
|
-
const mediaLength = media?.length || 0;
|
|
6340
|
-
const placeholder = useMemo3(
|
|
6341
|
-
() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE,
|
|
6342
|
-
[placeholderImage]
|
|
6343
|
-
);
|
|
6344
|
-
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(Wrapper17, null, /* @__PURE__ */ React53.createElement(Main, null, /* @__PURE__ */ React53.createElement(SliderWrapper, {
|
|
6345
|
-
onMouseDown,
|
|
6346
|
-
onMouseMove,
|
|
6347
|
-
onClick
|
|
6348
|
-
}, /* @__PURE__ */ React53.createElement(Slider3, {
|
|
6349
|
-
...sliderSettings,
|
|
6350
|
-
swipe: !navigationDisabled,
|
|
6351
|
-
touchMove: !navigationDisabled,
|
|
6352
|
-
swipeToSlide: !navigationDisabled,
|
|
6353
|
-
ref: slider,
|
|
6354
|
-
beforeChange
|
|
6355
|
-
}, !!media?.length ? media.map((m, i) => /* @__PURE__ */ React53.createElement(Item8, {
|
|
6356
|
-
key: m.files[0].url || i
|
|
6357
|
-
}, m.type === "image" && /* @__PURE__ */ React53.createElement(Image2, {
|
|
6358
|
-
src: m.files[0].formats.filter(notEmpty).find((x) => x.format === "1170x")?.url,
|
|
6359
|
-
alt: `Bild ${i + 1}`
|
|
6360
|
-
}), m.type === "threesixty" && /* @__PURE__ */ React53.createElement(ThreeSixty_default, {
|
|
6361
|
-
urls: m.files.map((x) => x.url),
|
|
6362
|
-
visible: i === index2,
|
|
6363
|
-
onDisableNavigation,
|
|
6364
|
-
navigationDisabled
|
|
6365
|
-
}), m.type === "embedded" && /* @__PURE__ */ React53.createElement(EmbededVideo_default, {
|
|
6366
|
-
src: m.files[0].url,
|
|
6367
|
-
index: i + 1
|
|
6368
|
-
}), m.type === "sphere" && /* @__PURE__ */ React53.createElement(Sphere_default, {
|
|
6369
|
-
visible: i === index2,
|
|
6370
|
-
url: m.files[0].url,
|
|
6371
|
-
preview: m.files[0].url,
|
|
6372
|
-
onDisableNavigation,
|
|
6373
|
-
navigationDisabled
|
|
6374
|
-
}))) : /* @__PURE__ */ React53.createElement(Item8, {
|
|
6375
|
-
key: placeholder
|
|
6376
|
-
}, /* @__PURE__ */ React53.createElement(Image2, {
|
|
6377
|
-
src: placeholder,
|
|
6378
|
-
alt: `Bild 1`
|
|
6379
|
-
}))), navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React53.createElement(EnableNavigationButton, null, /* @__PURE__ */ React53.createElement(ButtonSecondary, {
|
|
6380
|
-
onClick: onEnableNavigation,
|
|
6381
|
-
title: "St\xE4ng"
|
|
6382
|
-
}, /* @__PURE__ */ React53.createElement(ButtonContent, null, "St\xE4ng")))), !navigationDisabled && mediaLength > 1 && /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(ArrowLeft, {
|
|
6383
|
-
onClick: prevImage,
|
|
6384
|
-
title: "F\xF6reg\xE5ende bild"
|
|
6385
|
-
}, /* @__PURE__ */ React53.createElement(IconChevronLeft, {
|
|
6386
|
-
block: true
|
|
6387
|
-
})), /* @__PURE__ */ React53.createElement(ArrowRight, {
|
|
6388
|
-
onClick: nextImage,
|
|
6389
|
-
title: "N\xE4sta bild"
|
|
6390
|
-
}, /* @__PURE__ */ React53.createElement(IconChevronRight, {
|
|
6391
|
-
block: true
|
|
6392
|
-
})))), /* @__PURE__ */ React53.createElement(Alt, null, /* @__PURE__ */ React53.createElement(QuickNav, {
|
|
6393
|
-
ref: quickNavRef
|
|
6394
|
-
}, !!media?.length ? media.map((m, i) => {
|
|
6395
|
-
const src = m.files[0].formats.filter(notEmpty).find((x) => x.format === "225x150")?.url || m.files[0].url;
|
|
6396
|
-
return /* @__PURE__ */ React53.createElement(QuickNavItem, {
|
|
6397
|
-
key: src || i,
|
|
6398
|
-
active: index2 === i
|
|
6399
|
-
}, /* @__PURE__ */ React53.createElement(QuickNavBtn, {
|
|
6400
|
-
onClick: () => goTo(i),
|
|
6401
|
-
title: `G\xE5 till bild ${i + 1}`
|
|
6402
|
-
}, m.type === "image" && /* @__PURE__ */ React53.createElement(QuickNavImg, {
|
|
6403
|
-
src,
|
|
6404
|
-
alt: `Bild ${i + 1}`
|
|
6405
|
-
}), m.type === "threesixty" && /* @__PURE__ */ React53.createElement(QuickNavImg, {
|
|
6406
|
-
src,
|
|
6407
|
-
alt: `Bild ${i + 1}`
|
|
6408
|
-
}), m.type === "embedded" && /* @__PURE__ */ React53.createElement(QuickNavEmbeded_default, {
|
|
6409
|
-
src,
|
|
6410
|
-
index: i
|
|
6411
|
-
}), m.type === "sphere" && /* @__PURE__ */ React53.createElement(QuickNavImg, {
|
|
6412
|
-
src: m.files[0].url,
|
|
6413
|
-
alt: `Bild ${i + 1}`
|
|
6414
|
-
})));
|
|
6415
|
-
}) : /* @__PURE__ */ React53.createElement(QuickNavItem, {
|
|
6416
|
-
key: placeholder,
|
|
6417
|
-
active: true
|
|
6418
|
-
}, /* @__PURE__ */ React53.createElement(QuickNavBtn, {
|
|
6419
|
-
onClick: () => goTo(0),
|
|
6420
|
-
title: `G\xE5 till bild 0`
|
|
6421
|
-
}, /* @__PURE__ */ React53.createElement(QuickNavImg, {
|
|
6422
|
-
src: placeholder,
|
|
6423
|
-
alt: `Bild 1`
|
|
6424
|
-
})))))), lightbox && !!media?.length && /* @__PURE__ */ React53.createElement(Lightbox_default, {
|
|
6425
|
-
media,
|
|
6426
|
-
index: index2,
|
|
6427
|
-
onClose: onToggleLightbox
|
|
6428
|
-
}));
|
|
6429
|
-
};
|
|
6430
|
-
var Gallery_default = Gallery;
|
|
6431
|
-
|
|
6432
|
-
// src/components/ProductPage/index.tsx
|
|
6433
|
-
import styled39 from "styled-components";
|
|
6434
|
-
var ProductPage = styled39.div`
|
|
6435
|
-
display: flex;
|
|
6436
|
-
flex-direction: column;
|
|
6437
|
-
|
|
6438
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
6439
|
-
flex-direction: row;
|
|
6440
|
-
}
|
|
6441
|
-
`;
|
|
6442
|
-
var ProductPageAside = styled39.div`
|
|
6443
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
6444
|
-
display: contents;
|
|
6445
|
-
}
|
|
6446
|
-
|
|
6447
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
6448
|
-
flex-shrink: 0;
|
|
6449
|
-
width: calc(375px + ${size(2)});
|
|
6450
|
-
padding-right: ${size(2)};
|
|
6451
|
-
}
|
|
6452
|
-
`;
|
|
6453
|
-
var ProductPageMain = styled39.div`
|
|
6454
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
6455
|
-
display: contents;
|
|
6456
|
-
}
|
|
6457
|
-
|
|
6458
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
6459
|
-
flex: 1 1 100%;
|
|
6460
|
-
min-width: 0;
|
|
6461
|
-
padding-left: ${size(2)};
|
|
6462
|
-
}
|
|
6463
|
-
`;
|
|
6464
|
-
var ProductPageAsideSection = styled39.div`
|
|
6465
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
6466
|
-
order: ${(props) => props.mobileOrder};
|
|
6467
|
-
|
|
6468
|
-
& + & {
|
|
6469
|
-
margin-top: ${size(2)};
|
|
6470
|
-
}
|
|
6471
|
-
|
|
6472
|
-
:last-child {
|
|
6473
|
-
margin-bottom: ${size(4)};
|
|
6474
|
-
}
|
|
6475
|
-
|
|
6476
|
-
${ProductPageMain} & {
|
|
6477
|
-
margin-top: ${size(2)};
|
|
6478
|
-
}
|
|
6479
|
-
}
|
|
6480
|
-
|
|
6481
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
6482
|
-
& + & {
|
|
6483
|
-
margin-top: ${size(4)};
|
|
6484
|
-
}
|
|
6485
|
-
|
|
6486
|
-
${ProductPageMain} & {
|
|
6487
|
-
margin-bottom: ${size(8)};
|
|
6488
|
-
}
|
|
6489
|
-
}
|
|
6490
|
-
`;
|
|
6491
|
-
var ProductPageMainSection = styled39.div`
|
|
6492
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
6493
|
-
order: 99;
|
|
6494
|
-
padding: ${size(4)} 0;
|
|
6495
|
-
border-top: ${size(1)} solid ${(props) => props.theme.color.accent};
|
|
6496
|
-
|
|
6497
|
-
${Wrapper} & {
|
|
6498
|
-
margin-left: ${size(-2)};
|
|
6499
|
-
margin-right: ${size(-2)};
|
|
6500
|
-
padding-left: ${size(2)};
|
|
6501
|
-
padding-right: ${size(2)};
|
|
6502
|
-
}
|
|
6503
|
-
}
|
|
6504
|
-
|
|
6505
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
6506
|
-
& + & {
|
|
6507
|
-
margin-top: ${size(8)};
|
|
6508
|
-
padding-top: ${size(8)};
|
|
6509
|
-
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
6510
|
-
}
|
|
6511
|
-
}
|
|
6512
|
-
`;
|
|
6513
|
-
var ProductPageContentLimit = styled39.div`
|
|
6514
|
-
max-width: 420px;
|
|
6515
|
-
`;
|
|
6516
|
-
|
|
6517
|
-
// src/hooks/useSearchItem.ts
|
|
6518
|
-
import { useQuery } from "@apollo/client";
|
|
6519
|
-
|
|
6520
|
-
// src/queries/SEARCH_ITEM_QUERY.ts
|
|
6521
|
-
import { gql } from "@apollo/client";
|
|
6522
|
-
var FinancialOptionDetail = gql`
|
|
6523
|
-
fragment FinancialOptionDetail on FinancialOptionDetail {
|
|
6524
|
-
current
|
|
6525
|
-
default
|
|
6526
|
-
max
|
|
6527
|
-
min
|
|
6528
|
-
step
|
|
4958
|
+
// src/queries/SEARCH_ITEM_QUERY.ts
|
|
4959
|
+
import { gql } from "@apollo/client";
|
|
4960
|
+
var FinancialOptionDetail = gql`
|
|
4961
|
+
fragment FinancialOptionDetail on FinancialOptionDetail {
|
|
4962
|
+
current
|
|
4963
|
+
default
|
|
4964
|
+
max
|
|
4965
|
+
min
|
|
4966
|
+
step
|
|
6529
4967
|
}
|
|
6530
4968
|
`;
|
|
6531
4969
|
var HoursOpen = gql`
|
|
@@ -6747,30 +5185,164 @@ var SEARCH_ITEM_QUERY = gql`
|
|
|
6747
5185
|
title
|
|
6748
5186
|
}
|
|
6749
5187
|
}
|
|
6750
|
-
${HoursOpen}
|
|
6751
|
-
${FinancialOptionDetail}
|
|
5188
|
+
${HoursOpen}
|
|
5189
|
+
${FinancialOptionDetail}
|
|
5190
|
+
`;
|
|
5191
|
+
var SEARCH_ITEM_QUERY_default = SEARCH_ITEM_QUERY;
|
|
5192
|
+
|
|
5193
|
+
// src/hooks/useSearchItem.ts
|
|
5194
|
+
var useSearchItem = (id) => useQuery(SEARCH_ITEM_QUERY_default, {
|
|
5195
|
+
variables: { id },
|
|
5196
|
+
skip: !id
|
|
5197
|
+
});
|
|
5198
|
+
var useSearchItem_default = useSearchItem;
|
|
5199
|
+
|
|
5200
|
+
// src/components/Modal/index.tsx
|
|
5201
|
+
import * as React39 from "react";
|
|
5202
|
+
|
|
5203
|
+
// src/components/Modal/wrapper.tsx
|
|
5204
|
+
import styled34 from "styled-components";
|
|
5205
|
+
var Wrapper17 = styled34.div.attrs(() => ({
|
|
5206
|
+
role: "dialog"
|
|
5207
|
+
}))`
|
|
5208
|
+
position: fixed;
|
|
5209
|
+
top: 0;
|
|
5210
|
+
bottom: 0;
|
|
5211
|
+
left: 0;
|
|
5212
|
+
right: 0;
|
|
5213
|
+
width: 100%;
|
|
5214
|
+
white-space: normal;
|
|
5215
|
+
text-align: left;
|
|
5216
|
+
z-index: 90;
|
|
5217
|
+
display: flex;
|
|
5218
|
+
align-items: center;
|
|
5219
|
+
justify-content: center;
|
|
5220
|
+
|
|
5221
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5222
|
+
padding: ${size(2)};
|
|
5223
|
+
}
|
|
6752
5224
|
`;
|
|
6753
|
-
var
|
|
5225
|
+
var UiBlock2 = styled34.div.attrs(() => ({
|
|
5226
|
+
"aria-hidden": "true",
|
|
5227
|
+
role: "button"
|
|
5228
|
+
}))`
|
|
5229
|
+
position: fixed;
|
|
5230
|
+
top: 0;
|
|
5231
|
+
bottom: 0;
|
|
5232
|
+
left: 0;
|
|
5233
|
+
right: 0;
|
|
5234
|
+
background-color: rgba(0, 0, 0, 0.35);
|
|
5235
|
+
z-index: -1;
|
|
6754
5236
|
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
}
|
|
6760
|
-
|
|
5237
|
+
${(props) => props.theme.breakpoint.LtMd} {
|
|
5238
|
+
animation: ${fadeIn} 300ms ease forwards;
|
|
5239
|
+
}
|
|
5240
|
+
|
|
5241
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
5242
|
+
animation: ${fadeIn} 400ms ease forwards;
|
|
5243
|
+
}
|
|
5244
|
+
`;
|
|
5245
|
+
var Dialog = styled34.article.attrs(() => ({
|
|
5246
|
+
className: "wayke__theme wayke__font--regular"
|
|
5247
|
+
}))`
|
|
5248
|
+
display: flex;
|
|
5249
|
+
flex-direction: column;
|
|
5250
|
+
background-color: ${(props) => props.theme.color.bg};
|
|
5251
|
+
z-index: 1;
|
|
5252
|
+
width: 100%;
|
|
5253
|
+
max-width: 680px;
|
|
5254
|
+
max-height: 100%;
|
|
5255
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
|
5256
|
+
overflow: hidden;
|
|
5257
|
+
|
|
5258
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
5259
|
+
align-self: flex-end;
|
|
5260
|
+
transform: translateY(100%);
|
|
5261
|
+
animation: ${noTransform} 300ms ease forwards;
|
|
5262
|
+
}
|
|
5263
|
+
|
|
5264
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5265
|
+
transform: translateY(${size(2)});
|
|
5266
|
+
animation: ${fadeIn} 400ms ease, ${noTransform} 400ms ease forwards;
|
|
5267
|
+
}
|
|
5268
|
+
`;
|
|
5269
|
+
var Content4 = styled34.div`
|
|
5270
|
+
flex: 1 1 auto;
|
|
5271
|
+
overflow: auto;
|
|
5272
|
+
-webkit-overflow-scrolling: touch;
|
|
5273
|
+
`;
|
|
5274
|
+
var Header4 = styled34.header`
|
|
5275
|
+
display: flex;
|
|
5276
|
+
align-items: center;
|
|
5277
|
+
min-height: 60px;
|
|
5278
|
+
padding: ${size(3)};
|
|
5279
|
+
padding-bottom: 0;
|
|
5280
|
+
`;
|
|
5281
|
+
var Heading5 = styled34.div`
|
|
5282
|
+
flex: 1 1 auto;
|
|
5283
|
+
|
|
5284
|
+
${H1} {
|
|
5285
|
+
font-size: 1.5rem;
|
|
5286
|
+
}
|
|
5287
|
+
`;
|
|
5288
|
+
var Close2 = styled34.div`
|
|
5289
|
+
flex-shrink: 0;
|
|
5290
|
+
margin: ${size(-2)};
|
|
5291
|
+
padding-left: ${size(3)};
|
|
5292
|
+
`;
|
|
5293
|
+
var CloseBtn2 = styled34(ButtonReset)`
|
|
5294
|
+
display: block;
|
|
5295
|
+
padding: ${size(2)};
|
|
5296
|
+
`;
|
|
5297
|
+
var Body4 = styled34.div`
|
|
5298
|
+
padding: ${size(3)};
|
|
5299
|
+
`;
|
|
5300
|
+
var Image2 = styled34.img`
|
|
5301
|
+
display: block;
|
|
5302
|
+
width: calc(100% + ${size(6)});
|
|
5303
|
+
margin-left: ${size(-3)};
|
|
5304
|
+
margin-bottom: ${size(3)};
|
|
5305
|
+
`;
|
|
5306
|
+
var ModalFoldout = styled34.div`
|
|
5307
|
+
background-color: ${(props) => props.theme.color.accent};
|
|
5308
|
+
margin: ${size(-3)};
|
|
5309
|
+
margin-top: ${size(3)};
|
|
5310
|
+
padding: ${size(3)};
|
|
5311
|
+
`;
|
|
5312
|
+
var ModalFoldoutBody = styled34.div``;
|
|
5313
|
+
|
|
5314
|
+
// src/components/Modal/index.tsx
|
|
5315
|
+
var Modal = ({ id, title, onClose, children }) => {
|
|
5316
|
+
return /* @__PURE__ */ React39.createElement(portal_default, {
|
|
5317
|
+
id: id || portal_namespace_exports.DefaultPortal
|
|
5318
|
+
}, /* @__PURE__ */ React39.createElement(Wrapper17, {
|
|
5319
|
+
onClick: (e) => e.stopPropagation()
|
|
5320
|
+
}, /* @__PURE__ */ React39.createElement(UiBlock2, {
|
|
5321
|
+
onClick: onClose,
|
|
5322
|
+
title: "St\xE4ng modal"
|
|
5323
|
+
}), /* @__PURE__ */ React39.createElement(Dialog, null, /* @__PURE__ */ React39.createElement(Content4, null, /* @__PURE__ */ React39.createElement(Header4, null, /* @__PURE__ */ React39.createElement(Heading5, null, /* @__PURE__ */ React39.createElement(H1, {
|
|
5324
|
+
noMargin: true
|
|
5325
|
+
}, title)), /* @__PURE__ */ React39.createElement(Close2, null, /* @__PURE__ */ React39.createElement(CloseBtn2, {
|
|
5326
|
+
onClick: onClose,
|
|
5327
|
+
title: "St\xE4ng modal"
|
|
5328
|
+
}, /* @__PURE__ */ React39.createElement(IconCancel, {
|
|
5329
|
+
block: true
|
|
5330
|
+
})))), /* @__PURE__ */ React39.createElement(Body4, null, children)))));
|
|
5331
|
+
};
|
|
5332
|
+
var Modal_default = Modal;
|
|
6761
5333
|
|
|
6762
5334
|
// src/components/FinancialOptions/index.tsx
|
|
6763
|
-
import
|
|
5335
|
+
import React48, { Fragment } from "react";
|
|
6764
5336
|
|
|
6765
5337
|
// src/components/FinancialOptions/leasing.tsx
|
|
6766
|
-
import
|
|
5338
|
+
import React42, { useState as useState10, useCallback as useCallback15 } from "react";
|
|
6767
5339
|
|
|
6768
5340
|
// src/components/OptionBox/index.tsx
|
|
6769
|
-
import * as
|
|
5341
|
+
import * as React40 from "react";
|
|
6770
5342
|
|
|
6771
5343
|
// src/components/OptionBox/wrapper.tsx
|
|
6772
|
-
import
|
|
6773
|
-
var
|
|
5344
|
+
import styled35 from "styled-components";
|
|
5345
|
+
var Wrapper18 = styled35.div`
|
|
6774
5346
|
display: flex;
|
|
6775
5347
|
align-items: center;
|
|
6776
5348
|
padding: ${size(1)};
|
|
@@ -6781,14 +5353,14 @@ var Wrapper22 = styled40.div`
|
|
|
6781
5353
|
margin-top: ${size(1)};
|
|
6782
5354
|
}
|
|
6783
5355
|
`;
|
|
6784
|
-
var Logo2 =
|
|
5356
|
+
var Logo2 = styled35.div`
|
|
6785
5357
|
position: relative;
|
|
6786
5358
|
flex-shrink: 0;
|
|
6787
5359
|
margin-right: ${size(1)};
|
|
6788
5360
|
width: ${size(9.5)};
|
|
6789
5361
|
height: ${size(6)};
|
|
6790
5362
|
`;
|
|
6791
|
-
var LogoImg =
|
|
5363
|
+
var LogoImg = styled35.img`
|
|
6792
5364
|
display: block;
|
|
6793
5365
|
position: absolute;
|
|
6794
5366
|
left: 0;
|
|
@@ -6799,17 +5371,17 @@ var LogoImg = styled40.img`
|
|
|
6799
5371
|
max-width: 100%;
|
|
6800
5372
|
max-height: 100%;
|
|
6801
5373
|
`;
|
|
6802
|
-
var Content5 =
|
|
5374
|
+
var Content5 = styled35.div`
|
|
6803
5375
|
flex: 1 1 auto;
|
|
6804
5376
|
text-align: right;
|
|
6805
5377
|
line-height: 1.4;
|
|
6806
5378
|
`;
|
|
6807
|
-
var OptionBoxHeading =
|
|
5379
|
+
var OptionBoxHeading = styled35.div.attrs(() => ({
|
|
6808
5380
|
className: "wayke__theme wayke__font--bold"
|
|
6809
5381
|
}))`
|
|
6810
5382
|
font-size: 1rem;
|
|
6811
5383
|
`;
|
|
6812
|
-
var OptionBoxContent =
|
|
5384
|
+
var OptionBoxContent = styled35.div`
|
|
6813
5385
|
margin-top: ${size(0.5)};
|
|
6814
5386
|
font-size: 0.875rem;
|
|
6815
5387
|
|
|
@@ -6819,24 +5391,24 @@ var OptionBoxContent = styled40.div`
|
|
|
6819
5391
|
`;
|
|
6820
5392
|
|
|
6821
5393
|
// src/components/OptionBox/index.tsx
|
|
6822
|
-
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */
|
|
5394
|
+
var OptionBox = ({ logo, logo2x, logoAlt, children }) => /* @__PURE__ */ React40.createElement(Wrapper18, null, logo && /* @__PURE__ */ React40.createElement(Logo2, null, /* @__PURE__ */ React40.createElement(LogoImg, {
|
|
6823
5395
|
src: logo,
|
|
6824
5396
|
srcSet: logo2x,
|
|
6825
5397
|
alt: logoAlt
|
|
6826
|
-
})), /* @__PURE__ */
|
|
5398
|
+
})), /* @__PURE__ */ React40.createElement(Content5, null, children));
|
|
6827
5399
|
var OptionBox_default = OptionBox;
|
|
6828
5400
|
|
|
6829
5401
|
// src/components/DataList/index.tsx
|
|
6830
|
-
import
|
|
5402
|
+
import React41 from "react";
|
|
6831
5403
|
|
|
6832
5404
|
// src/components/DataList/wrapper.tsx
|
|
6833
|
-
import
|
|
6834
|
-
var List8 =
|
|
5405
|
+
import styled36 from "styled-components";
|
|
5406
|
+
var List8 = styled36.ul`
|
|
6835
5407
|
list-style: none;
|
|
6836
5408
|
padding: 0;
|
|
6837
5409
|
margin: 0;
|
|
6838
5410
|
`;
|
|
6839
|
-
var
|
|
5411
|
+
var Item8 = styled36.li`
|
|
6840
5412
|
display: flex;
|
|
6841
5413
|
align-items: flex-start;
|
|
6842
5414
|
|
|
@@ -6844,10 +5416,10 @@ var Item10 = styled41.li`
|
|
|
6844
5416
|
margin-top: ${size(1)};
|
|
6845
5417
|
}
|
|
6846
5418
|
`;
|
|
6847
|
-
var Label7 =
|
|
5419
|
+
var Label7 = styled36.div`
|
|
6848
5420
|
flex: 1 1 auto;
|
|
6849
5421
|
`;
|
|
6850
|
-
var Value2 =
|
|
5422
|
+
var Value2 = styled36.div.attrs(() => ({
|
|
6851
5423
|
className: "wayke__theme wayke__font--bold"
|
|
6852
5424
|
}))`
|
|
6853
5425
|
flex-shrink: 0;
|
|
@@ -6855,25 +5427,25 @@ var Value2 = styled41.div.attrs(() => ({
|
|
|
6855
5427
|
`;
|
|
6856
5428
|
|
|
6857
5429
|
// src/components/DataList/index.tsx
|
|
6858
|
-
var DataList = ({ items }) => /* @__PURE__ */
|
|
5430
|
+
var DataList = ({ items }) => /* @__PURE__ */ React41.createElement(List8, null, items.map((item) => /* @__PURE__ */ React41.createElement(Item8, {
|
|
6859
5431
|
key: item.label
|
|
6860
|
-
}, /* @__PURE__ */
|
|
5432
|
+
}, /* @__PURE__ */ React41.createElement(Label7, null, item.label), /* @__PURE__ */ React41.createElement(Value2, null, item.value))));
|
|
6861
5433
|
var DataList_default = DataList;
|
|
6862
5434
|
|
|
6863
5435
|
// src/components/FinancialOptions/leasing.tsx
|
|
6864
5436
|
var Leasing = ({ financialOption }) => {
|
|
6865
|
-
const [modal, setModal] =
|
|
6866
|
-
const toggleModal =
|
|
5437
|
+
const [modal, setModal] = useState10(false);
|
|
5438
|
+
const toggleModal = useCallback15(() => setModal(!modal), [modal]);
|
|
6867
5439
|
const { image, description, monthlyCost, duration, mileage } = financialOption;
|
|
6868
|
-
return /* @__PURE__ */
|
|
5440
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, modal && /* @__PURE__ */ React42.createElement(Modal_default, {
|
|
6869
5441
|
title: "Privatleasing",
|
|
6870
5442
|
onClose: toggleModal
|
|
6871
|
-
}, image && /* @__PURE__ */
|
|
5443
|
+
}, image && /* @__PURE__ */ React42.createElement(Image2, {
|
|
6872
5444
|
src: image,
|
|
6873
5445
|
alt: "Privatleasing"
|
|
6874
|
-
}), description && /* @__PURE__ */
|
|
5446
|
+
}), description && /* @__PURE__ */ React42.createElement(Content_default, {
|
|
6875
5447
|
dangerouslySetInnerHTML: { __html: description }
|
|
6876
|
-
}), /* @__PURE__ */
|
|
5448
|
+
}), /* @__PURE__ */ React42.createElement(ModalFoldout, null, /* @__PURE__ */ React42.createElement(ModalFoldoutBody, null, /* @__PURE__ */ React42.createElement(DataList_default, {
|
|
6877
5449
|
items: [
|
|
6878
5450
|
{
|
|
6879
5451
|
label: "M\xE5nadskostnad",
|
|
@@ -6888,14 +5460,14 @@ var Leasing = ({ financialOption }) => {
|
|
|
6888
5460
|
value: `${numberSeparator(mileage?.current || 0)} mil/\xE5r`
|
|
6889
5461
|
}
|
|
6890
5462
|
]
|
|
6891
|
-
})))), /* @__PURE__ */
|
|
5463
|
+
})))), /* @__PURE__ */ React42.createElement(OptionBox_default, null, /* @__PURE__ */ React42.createElement(React42.Fragment, null, monthlyCost !== null && monthlyCost !== void 0 && /* @__PURE__ */ React42.createElement(OptionBoxHeading, null, `ca ${numberSeparator(monthlyCost)} kr/m\xE5n`)), /* @__PURE__ */ React42.createElement(OptionBoxContent, null, /* @__PURE__ */ React42.createElement("p", null, "Privatleasing", " ", mileage?.current && duration?.current && /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(UtilityTextPrimary, null, numberSeparator(mileage?.current), " mil/\xE5r"), " ", "i ", /* @__PURE__ */ React42.createElement(UtilityTextPrimary, null, duration?.current, " m\xE5n"), ".", " ")), /* @__PURE__ */ React42.createElement("p", null, /* @__PURE__ */ React42.createElement(ButtonInline, {
|
|
6892
5464
|
onClick: toggleModal
|
|
6893
5465
|
}, "L\xE4s mer")))));
|
|
6894
5466
|
};
|
|
6895
5467
|
var leasing_default = Leasing;
|
|
6896
5468
|
|
|
6897
5469
|
// src/components/FinancialOptions/loan.tsx
|
|
6898
|
-
import
|
|
5470
|
+
import React47, { useState as useState13, useCallback as useCallback18 } from "react";
|
|
6899
5471
|
|
|
6900
5472
|
// src/hooks/useLoan.ts
|
|
6901
5473
|
import { useQuery as useQuery2 } from "@apollo/client";
|
|
@@ -6951,22 +5523,22 @@ var useLoanCalculation = (id, duration, downPayment, residual) => useQuery2(LOAN
|
|
|
6951
5523
|
var useLoan_default = useLoanCalculation;
|
|
6952
5524
|
|
|
6953
5525
|
// src/components/FinancialOptions/LoanModal.tsx
|
|
6954
|
-
import
|
|
5526
|
+
import React46, { useState as useState12, useCallback as useCallback17, useEffect as useEffect8 } from "react";
|
|
6955
5527
|
|
|
6956
5528
|
// src/components/ContentLogo/index.tsx
|
|
6957
|
-
import
|
|
6958
|
-
var ContentLogo =
|
|
5529
|
+
import styled37 from "styled-components";
|
|
5530
|
+
var ContentLogo = styled37.div`
|
|
6959
5531
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6960
5532
|
display: flex;
|
|
6961
5533
|
align-items: flex-start;
|
|
6962
5534
|
}
|
|
6963
5535
|
`;
|
|
6964
|
-
var ContentLogoText =
|
|
5536
|
+
var ContentLogoText = styled37.div`
|
|
6965
5537
|
${(props) => props.theme.breakpoint.Sm} {
|
|
6966
5538
|
flex: 1 1 auto;
|
|
6967
5539
|
}
|
|
6968
5540
|
`;
|
|
6969
|
-
var ContentLogoMedia =
|
|
5541
|
+
var ContentLogoMedia = styled37.div`
|
|
6970
5542
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
6971
5543
|
margin-top: ${size(2)};
|
|
6972
5544
|
}
|
|
@@ -6978,44 +5550,44 @@ var ContentLogoMedia = styled42.div`
|
|
|
6978
5550
|
`;
|
|
6979
5551
|
|
|
6980
5552
|
// src/components/RangeSlider/SliderWithLabel.tsx
|
|
6981
|
-
import
|
|
5553
|
+
import React45, { useCallback as useCallback16, useEffect as useEffect7, useState as useState11 } from "react";
|
|
6982
5554
|
|
|
6983
5555
|
// src/components/RangeSliderLabel/index.tsx
|
|
6984
|
-
import
|
|
5556
|
+
import React43 from "react";
|
|
6985
5557
|
|
|
6986
5558
|
// src/components/RangeSliderLabel/wrapper.tsx
|
|
6987
|
-
import
|
|
6988
|
-
var
|
|
5559
|
+
import styled38, { css as css12 } from "styled-components";
|
|
5560
|
+
var Wrapper19 = styled38.div`
|
|
6989
5561
|
display: flex;
|
|
6990
5562
|
align-items: flex-end;
|
|
6991
5563
|
`;
|
|
6992
|
-
var Label8 =
|
|
5564
|
+
var Label8 = styled38.div.attrs(() => ({
|
|
6993
5565
|
className: "wayke__theme wayke__font--bold"
|
|
6994
5566
|
}))`
|
|
6995
5567
|
flex: 1 1 auto;
|
|
6996
5568
|
`;
|
|
6997
|
-
var Value3 =
|
|
5569
|
+
var Value3 = styled38.div.attrs(() => ({
|
|
6998
5570
|
className: "wayke__theme wayke__font--bold wayke__color--primary-text"
|
|
6999
5571
|
}))`
|
|
7000
5572
|
flex-shrink: 0;
|
|
7001
5573
|
padding-left: ${size(2)};
|
|
7002
5574
|
font-size: 1.125rem;
|
|
7003
5575
|
|
|
7004
|
-
${({ isHighlighted }) => isHighlighted &&
|
|
5576
|
+
${({ isHighlighted }) => isHighlighted && css12`
|
|
7005
5577
|
font-size: 1.375rem;
|
|
7006
5578
|
color: ${(props) => props.theme.color.textDark} !important;
|
|
7007
5579
|
`}
|
|
7008
5580
|
`;
|
|
7009
5581
|
|
|
7010
5582
|
// src/components/RangeSliderLabel/index.tsx
|
|
7011
|
-
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */
|
|
5583
|
+
var RangeSliderLabel = ({ label, value, highlight }) => /* @__PURE__ */ React43.createElement(Wrapper19, null, /* @__PURE__ */ React43.createElement(Label8, null, label), value && /* @__PURE__ */ React43.createElement(Value3, {
|
|
7012
5584
|
isHighlighted: highlight
|
|
7013
5585
|
}, value));
|
|
7014
5586
|
var RangeSliderLabel_default = RangeSliderLabel;
|
|
7015
5587
|
|
|
7016
5588
|
// src/components/RangeSlider/RangeSliderSimple.tsx
|
|
7017
|
-
import
|
|
7018
|
-
import { Slider as
|
|
5589
|
+
import React44 from "react";
|
|
5590
|
+
import { Slider as Slider3, Rail as Rail2, Handles as Handles2, Tracks as Tracks2 } from "react-compound-slider";
|
|
7019
5591
|
var RangeSliderSimple = ({
|
|
7020
5592
|
loading,
|
|
7021
5593
|
values,
|
|
@@ -7034,7 +5606,7 @@ var RangeSliderSimple = ({
|
|
|
7034
5606
|
if (steps.length < 2) {
|
|
7035
5607
|
return null;
|
|
7036
5608
|
}
|
|
7037
|
-
return /* @__PURE__ */
|
|
5609
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(Slider, null, /* @__PURE__ */ React44.createElement(Slider3, {
|
|
7038
5610
|
disabled: loading,
|
|
7039
5611
|
mode: 1,
|
|
7040
5612
|
step,
|
|
@@ -7043,20 +5615,20 @@ var RangeSliderSimple = ({
|
|
|
7043
5615
|
onUpdate,
|
|
7044
5616
|
values,
|
|
7045
5617
|
rootStyle: { position: "relative" }
|
|
7046
|
-
}, /* @__PURE__ */
|
|
5618
|
+
}, /* @__PURE__ */ React44.createElement(Rail2, null, ({ getRailProps }) => /* @__PURE__ */ React44.createElement(Bar2, {
|
|
7047
5619
|
...getRailProps()
|
|
7048
|
-
})), /* @__PURE__ */
|
|
5620
|
+
})), /* @__PURE__ */ React44.createElement(Handles2, null, ({ handles, getHandleProps }) => /* @__PURE__ */ React44.createElement("div", {
|
|
7049
5621
|
className: "slider-handles"
|
|
7050
|
-
}, handles.map((handle) => /* @__PURE__ */
|
|
5622
|
+
}, handles.map((handle) => /* @__PURE__ */ React44.createElement(Handle2, {
|
|
7051
5623
|
key: handle.id,
|
|
7052
5624
|
handle,
|
|
7053
5625
|
domain,
|
|
7054
5626
|
getHandleProps
|
|
7055
|
-
})))), /* @__PURE__ */
|
|
5627
|
+
})))), /* @__PURE__ */ React44.createElement(Tracks2, {
|
|
7056
5628
|
right: false
|
|
7057
|
-
}, ({ tracks, getTrackProps }) => /* @__PURE__ */
|
|
5629
|
+
}, ({ tracks, getTrackProps }) => /* @__PURE__ */ React44.createElement("div", {
|
|
7058
5630
|
className: "slider-tracks"
|
|
7059
|
-
}, tracks.map(({ id, source, target }) => /* @__PURE__ */
|
|
5631
|
+
}, tracks.map(({ id, source, target }) => /* @__PURE__ */ React44.createElement(Track2, {
|
|
7060
5632
|
key: id,
|
|
7061
5633
|
source,
|
|
7062
5634
|
target,
|
|
@@ -7076,18 +5648,18 @@ var SliderWithLabel = ({
|
|
|
7076
5648
|
formatValues,
|
|
7077
5649
|
onChange
|
|
7078
5650
|
}) => {
|
|
7079
|
-
const [local, setLocal] =
|
|
7080
|
-
const onUpdate =
|
|
5651
|
+
const [local, setLocal] = useState11(steps);
|
|
5652
|
+
const onUpdate = useCallback16((nextValues) => {
|
|
7081
5653
|
setLocal([...nextValues]);
|
|
7082
5654
|
}, []);
|
|
7083
|
-
|
|
5655
|
+
useEffect7(() => {
|
|
7084
5656
|
if (!loading)
|
|
7085
5657
|
setLocal(void 0);
|
|
7086
5658
|
}, [loading]);
|
|
7087
|
-
return /* @__PURE__ */
|
|
5659
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(RepeatTiny, null, /* @__PURE__ */ React45.createElement(RangeSliderLabel_default, {
|
|
7088
5660
|
label,
|
|
7089
5661
|
value: `${numberSeparator(local?.[0] || values[0])}${unit ? ` ${unit}` : ""}`
|
|
7090
|
-
})), /* @__PURE__ */
|
|
5662
|
+
})), /* @__PURE__ */ React45.createElement(RepeatTiny, null, /* @__PURE__ */ React45.createElement(RangeSliderSimple_default, {
|
|
7091
5663
|
loading,
|
|
7092
5664
|
values,
|
|
7093
5665
|
domain,
|
|
@@ -7112,22 +5684,22 @@ var stepGenerator = (step, max, steps = [], current) => {
|
|
|
7112
5684
|
return stepGenerator(step, max, steps, nextCurrent);
|
|
7113
5685
|
};
|
|
7114
5686
|
var LoanModal = ({ id, financialOption, onClose }) => {
|
|
7115
|
-
const [tmp, setTmp] =
|
|
7116
|
-
const [extend, setExtend] =
|
|
7117
|
-
const onToggleExtend =
|
|
5687
|
+
const [tmp, setTmp] = useState12();
|
|
5688
|
+
const [extend, setExtend] = React46.useState(false);
|
|
5689
|
+
const onToggleExtend = React46.useCallback(() => {
|
|
7118
5690
|
if (!extend) {
|
|
7119
5691
|
pubsub_default.publish("FinanceInterest");
|
|
7120
5692
|
}
|
|
7121
5693
|
setExtend(!extend);
|
|
7122
5694
|
}, [extend]);
|
|
7123
|
-
const [variables, setVariables] =
|
|
5695
|
+
const [variables, setVariables] = useState12({
|
|
7124
5696
|
duration: financialOption.duration?.current,
|
|
7125
5697
|
downPayment: financialOption.downPayment?.current,
|
|
7126
5698
|
residual: financialOption.residual?.current
|
|
7127
5699
|
});
|
|
7128
5700
|
const { duration, downPayment, residual } = variables;
|
|
7129
5701
|
const { loading, data } = useLoan_default(id, duration, downPayment, residual);
|
|
7130
|
-
|
|
5702
|
+
useEffect8(() => {
|
|
7131
5703
|
if (data) {
|
|
7132
5704
|
setTmp(data);
|
|
7133
5705
|
setVariables({
|
|
@@ -7143,7 +5715,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7143
5715
|
const downPaymentMax = loan?.downPayment?.max || 0;
|
|
7144
5716
|
const downPaymentStep = loan?.downPayment?.step || 0;
|
|
7145
5717
|
const downPaymentSteps = stepGenerator(downPaymentStep, downPaymentMax);
|
|
7146
|
-
const onDownPaymentChange =
|
|
5718
|
+
const onDownPaymentChange = useCallback17(
|
|
7147
5719
|
(values) => {
|
|
7148
5720
|
pubsub_default.publish("FinanceInterest");
|
|
7149
5721
|
setVariables({ ...variables, downPayment: values[0] });
|
|
@@ -7155,7 +5727,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7155
5727
|
const durationMax = loan?.duration?.max || 0;
|
|
7156
5728
|
const durationStep = loan?.duration?.step || 0;
|
|
7157
5729
|
const durationSteps = stepGenerator(durationStep, durationMax);
|
|
7158
|
-
const onDurationChange =
|
|
5730
|
+
const onDurationChange = useCallback17(
|
|
7159
5731
|
(values) => {
|
|
7160
5732
|
pubsub_default.publish("FinanceInterest");
|
|
7161
5733
|
setVariables({ ...variables, duration: values[0] });
|
|
@@ -7167,7 +5739,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7167
5739
|
const residualMax = (loan?.residual?.max || 0) * 100 || 0;
|
|
7168
5740
|
const residualStep = (loan?.residual?.step || 0) * 100 || 0;
|
|
7169
5741
|
const residualSteps = stepGenerator(residualStep, residualMax);
|
|
7170
|
-
const onResidualChange =
|
|
5742
|
+
const onResidualChange = useCallback17(
|
|
7171
5743
|
(values) => {
|
|
7172
5744
|
pubsub_default.publish("FinanceInterest");
|
|
7173
5745
|
setVariables({ ...variables, residual: values[0] / 100 });
|
|
@@ -7176,14 +5748,14 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7176
5748
|
);
|
|
7177
5749
|
const interestText = ((loan?.interest || 0) * 100).toFixed(2);
|
|
7178
5750
|
const effectiveInterestText = ((loan?.effectiveInterest || 0) * 100).toFixed(2);
|
|
7179
|
-
return /* @__PURE__ */
|
|
5751
|
+
return /* @__PURE__ */ React46.createElement(Modal_default, {
|
|
7180
5752
|
title: "L\xE5nealternativ",
|
|
7181
5753
|
onClose
|
|
7182
|
-
}, /* @__PURE__ */
|
|
5754
|
+
}, /* @__PURE__ */ React46.createElement(Repeat, null, /* @__PURE__ */ React46.createElement(ContentLogo, null, financialOption?.description && /* @__PURE__ */ React46.createElement(ContentLogoText, null, /* @__PURE__ */ React46.createElement(Content_default, null, /* @__PURE__ */ React46.createElement("p", null, financialOption.description))), financialOption?.image && /* @__PURE__ */ React46.createElement(ContentLogoMedia, null, /* @__PURE__ */ React46.createElement(LogoBox_default, {
|
|
7183
5755
|
logo: financialOption.image,
|
|
7184
5756
|
alt: financialOption.name || "Logotyp",
|
|
7185
5757
|
wide: true
|
|
7186
|
-
})))), /* @__PURE__ */
|
|
5758
|
+
})))), /* @__PURE__ */ React46.createElement(Repeat, null, /* @__PURE__ */ React46.createElement(RepeatSmall, null, /* @__PURE__ */ React46.createElement(SliderWithLabel_default, {
|
|
7187
5759
|
label: "Kontantinsatts",
|
|
7188
5760
|
values: [downPaymentCurrent],
|
|
7189
5761
|
domain: [downPaymentMin, downPaymentMax],
|
|
@@ -7192,7 +5764,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7192
5764
|
formatValues: true,
|
|
7193
5765
|
loading,
|
|
7194
5766
|
onChange: onDownPaymentChange
|
|
7195
|
-
})), /* @__PURE__ */
|
|
5767
|
+
})), /* @__PURE__ */ React46.createElement(RepeatSmall, null, /* @__PURE__ */ React46.createElement(SliderWithLabel_default, {
|
|
7196
5768
|
label: "Avbetalning",
|
|
7197
5769
|
values: [durationCurrent],
|
|
7198
5770
|
domain: [durationMin, durationMax],
|
|
@@ -7200,7 +5772,7 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7200
5772
|
unit: "m\xE5n",
|
|
7201
5773
|
loading,
|
|
7202
5774
|
onChange: onDurationChange
|
|
7203
|
-
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */
|
|
5775
|
+
})), residual !== void 0 && residualMax !== 0 && /* @__PURE__ */ React46.createElement(RepeatSmall, null, /* @__PURE__ */ React46.createElement(SliderWithLabel_default, {
|
|
7204
5776
|
label: "Restskuld",
|
|
7205
5777
|
values: [residualCurrent],
|
|
7206
5778
|
domain: [residualMin, residualMax],
|
|
@@ -7208,12 +5780,12 @@ var LoanModal = ({ id, financialOption, onClose }) => {
|
|
|
7208
5780
|
unit: "%",
|
|
7209
5781
|
loading,
|
|
7210
5782
|
onChange: onResidualChange
|
|
7211
|
-
})), /* @__PURE__ */
|
|
5783
|
+
})), /* @__PURE__ */ React46.createElement(RepeatSmall, null, /* @__PURE__ */ React46.createElement(RepeatTiny, null, /* @__PURE__ */ React46.createElement(Content_default, {
|
|
7212
5784
|
small: true
|
|
7213
|
-
}, /* @__PURE__ */
|
|
5785
|
+
}, /* @__PURE__ */ React46.createElement("p", null, `*Ber\xE4knat p\xE5 ${interestText} % r\xE4nta (effektivt ${effectiveInterestText} %)${loan?.mileage !== null ? `och en \xE5rlig k\xF6rstr\xE4cka om ${loan?.mileage} mil.` : ""}`)))), /* @__PURE__ */ React46.createElement(RepeatSmall, null, /* @__PURE__ */ React46.createElement(ButtonClear, {
|
|
7214
5786
|
onClick: onToggleExtend,
|
|
7215
5787
|
title: extend ? "Visa mindre information" : "Visa mer information"
|
|
7216
|
-
}, /* @__PURE__ */
|
|
5788
|
+
}, /* @__PURE__ */ React46.createElement(ButtonContent, null, extend ? "Mindre information" : "Mer information"))), /* @__PURE__ */ React46.createElement(React46.Fragment, null, extend && /* @__PURE__ */ React46.createElement(ModalFoldout, null, /* @__PURE__ */ React46.createElement(ModalFoldoutBody, null, /* @__PURE__ */ React46.createElement(DataList_default, {
|
|
7217
5789
|
items: [
|
|
7218
5790
|
{
|
|
7219
5791
|
label: "R\xE4nta",
|
|
@@ -7242,8 +5814,8 @@ var LoanModal_default = LoanModal;
|
|
|
7242
5814
|
|
|
7243
5815
|
// src/components/FinancialOptions/loan.tsx
|
|
7244
5816
|
var Loan = ({ id, financialOption }) => {
|
|
7245
|
-
const [modal, setModal] =
|
|
7246
|
-
const toggleModal =
|
|
5817
|
+
const [modal, setModal] = useState13(false);
|
|
5818
|
+
const toggleModal = useCallback18(() => setModal(!modal), [modal]);
|
|
7247
5819
|
const { data } = useLoan_default(
|
|
7248
5820
|
id,
|
|
7249
5821
|
financialOption.duration?.current,
|
|
@@ -7255,100 +5827,100 @@ var Loan = ({ id, financialOption }) => {
|
|
|
7255
5827
|
const monthlyCost = data?.loan?.monthlyCost;
|
|
7256
5828
|
const logo = financialOption?.logotype || "https://placehold.it/67x10";
|
|
7257
5829
|
if (financialOption.loanAmount === void 0 || financialOption.loanAmount === null || interest === void 0 || duration === void 0 || monthlyCost === void 0 || interest === null || duration === null || monthlyCost === null) {
|
|
7258
|
-
return /* @__PURE__ */
|
|
5830
|
+
return /* @__PURE__ */ React47.createElement(OptionBox_default, {
|
|
7259
5831
|
logo,
|
|
7260
5832
|
logoAlt: "Logotyp"
|
|
7261
|
-
}, /* @__PURE__ */
|
|
5833
|
+
}, /* @__PURE__ */ React47.createElement(OptionBoxHeading, null, "Laddar..."), /* @__PURE__ */ React47.createElement(OptionBoxContent, null, /* @__PURE__ */ React47.createElement("p", null, "Laddar...")));
|
|
7262
5834
|
}
|
|
7263
|
-
return /* @__PURE__ */
|
|
5835
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, modal && /* @__PURE__ */ React47.createElement(LoanModal_default, {
|
|
7264
5836
|
id,
|
|
7265
5837
|
financialOption,
|
|
7266
5838
|
onClose: toggleModal
|
|
7267
|
-
}), /* @__PURE__ */
|
|
5839
|
+
}), /* @__PURE__ */ React47.createElement(OptionBox_default, {
|
|
7268
5840
|
logo,
|
|
7269
5841
|
logoAlt: "Logotyp"
|
|
7270
|
-
}, /* @__PURE__ */
|
|
5842
|
+
}, /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(OptionBoxHeading, null, `${numberSeparator(monthlyCost)} kr/m\xE5n*`), /* @__PURE__ */ React47.createElement(OptionBoxContent, null, /* @__PURE__ */ React47.createElement("p", null, "Delbetala", " ", financialOption.loanAmount && duration && /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(UtilityTextPrimary, null, numberSeparator(financialOption.loanAmount), " kr"), " ", "i ", /* @__PURE__ */ React47.createElement(UtilityTextPrimary, null, duration, " m\xE5n"), ".")), /* @__PURE__ */ React47.createElement("p", null, `*Ber\xE4knat p\xE5 ${(interest * 100).toFixed(2)}% r\xE4nta. `, /* @__PURE__ */ React47.createElement(ButtonInline, {
|
|
7271
5843
|
onClick: toggleModal
|
|
7272
5844
|
}, "L\xE4s mer"))))));
|
|
7273
5845
|
};
|
|
7274
5846
|
var loan_default = Loan;
|
|
7275
5847
|
|
|
7276
5848
|
// src/components/FinancialOptions/index.tsx
|
|
7277
|
-
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */
|
|
5849
|
+
var FinancialOptions = ({ id, financialOptions }) => /* @__PURE__ */ React48.createElement(Repeat, null, /* @__PURE__ */ React48.createElement(RepeatTiny, null, /* @__PURE__ */ React48.createElement(VisualHeading, null, "Andra finansieringsalternativ")), /* @__PURE__ */ React48.createElement(RepeatTiny, null, financialOptions.map((financialOption, index2) => /* @__PURE__ */ React48.createElement(Fragment, {
|
|
7278
5850
|
key: index2
|
|
7279
|
-
}, financialOption.type === "leasing" && /* @__PURE__ */
|
|
5851
|
+
}, financialOption.type === "leasing" && /* @__PURE__ */ React48.createElement(leasing_default, {
|
|
7280
5852
|
financialOption
|
|
7281
|
-
}), financialOption.type === "loan" && /* @__PURE__ */
|
|
5853
|
+
}), financialOption.type === "loan" && /* @__PURE__ */ React48.createElement(loan_default, {
|
|
7282
5854
|
id,
|
|
7283
5855
|
financialOption
|
|
7284
5856
|
})))));
|
|
7285
5857
|
var FinancialOptions_default = FinancialOptions;
|
|
7286
5858
|
|
|
7287
5859
|
// src/components/InsuranceOptions/index.tsx
|
|
7288
|
-
import
|
|
5860
|
+
import React60 from "react";
|
|
7289
5861
|
|
|
7290
5862
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
7291
|
-
import
|
|
5863
|
+
import React57, { useState as useState16, useCallback as useCallback21 } from "react";
|
|
7292
5864
|
|
|
7293
5865
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
7294
|
-
import
|
|
5866
|
+
import React56, { useState as useState15, useCallback as useCallback20 } from "react";
|
|
7295
5867
|
|
|
7296
5868
|
// src/components/DetailBox/index.tsx
|
|
7297
|
-
import
|
|
5869
|
+
import React49 from "react";
|
|
7298
5870
|
|
|
7299
5871
|
// src/components/DetailBox/wrapper.tsx
|
|
7300
|
-
import
|
|
7301
|
-
var
|
|
5872
|
+
import styled39 from "styled-components";
|
|
5873
|
+
var Wrapper20 = styled39.article`
|
|
7302
5874
|
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
|
|
7303
5875
|
border-radius: 3px;
|
|
7304
5876
|
overflow: hidden;
|
|
7305
5877
|
`;
|
|
7306
|
-
var
|
|
5878
|
+
var Main = styled39.div`
|
|
7307
5879
|
padding: ${size(2.5)};
|
|
7308
5880
|
`;
|
|
7309
|
-
var Heading6 =
|
|
5881
|
+
var Heading6 = styled39(H2).attrs(() => ({
|
|
7310
5882
|
as: "h1"
|
|
7311
5883
|
}))`
|
|
7312
5884
|
margin-bottom: 0;
|
|
7313
5885
|
`;
|
|
7314
|
-
var Description3 =
|
|
5886
|
+
var Description3 = styled39.div`
|
|
7315
5887
|
margin-top: ${size(1)};
|
|
7316
5888
|
`;
|
|
7317
|
-
var Footer3 =
|
|
5889
|
+
var Footer3 = styled39.div`
|
|
7318
5890
|
margin-top: ${size(1)};
|
|
7319
5891
|
color: red;
|
|
7320
5892
|
`;
|
|
7321
|
-
var Foldout =
|
|
5893
|
+
var Foldout = styled39.div`
|
|
7322
5894
|
background-color: ${(props) => props.theme.color.accent};
|
|
7323
5895
|
padding: ${size(2.5)};
|
|
7324
5896
|
`;
|
|
7325
5897
|
|
|
7326
5898
|
// src/components/DetailBox/index.tsx
|
|
7327
5899
|
var DetailBox = ({ heading, description, children }) => {
|
|
7328
|
-
const [extend, setExtend] =
|
|
7329
|
-
const onToggleExtend =
|
|
5900
|
+
const [extend, setExtend] = React49.useState(false);
|
|
5901
|
+
const onToggleExtend = React49.useCallback(() => setExtend(!extend), [extend]);
|
|
7330
5902
|
const extendBtnText = extend ? "Mindre information" : "Mer information";
|
|
7331
|
-
return /* @__PURE__ */
|
|
5903
|
+
return /* @__PURE__ */ React49.createElement(Wrapper20, null, /* @__PURE__ */ React49.createElement(Main, null, /* @__PURE__ */ React49.createElement(Heading6, null, heading), description && /* @__PURE__ */ React49.createElement(Description3, null, description), /* @__PURE__ */ React49.createElement(Footer3, null, /* @__PURE__ */ React49.createElement(ButtonClear, {
|
|
7332
5904
|
onClick: onToggleExtend
|
|
7333
|
-
}, /* @__PURE__ */
|
|
5905
|
+
}, /* @__PURE__ */ React49.createElement(ButtonContent, null, extendBtnText)))), extend && /* @__PURE__ */ React49.createElement(Foldout, null, children));
|
|
7334
5906
|
};
|
|
7335
5907
|
var DetailBox_default = DetailBox;
|
|
7336
5908
|
|
|
7337
5909
|
// src/components/ExtendInfo/index.tsx
|
|
7338
|
-
import
|
|
5910
|
+
import React50, { useState as useState14, useCallback as useCallback19 } from "react";
|
|
7339
5911
|
|
|
7340
5912
|
// src/components/ExtendInfo/wrapper.tsx
|
|
7341
|
-
import
|
|
7342
|
-
var
|
|
7343
|
-
var Header5 =
|
|
5913
|
+
import styled40 from "styled-components";
|
|
5914
|
+
var Wrapper21 = styled40.div``;
|
|
5915
|
+
var Header5 = styled40.div`
|
|
7344
5916
|
display: flex;
|
|
7345
5917
|
align-items: center;
|
|
7346
5918
|
`;
|
|
7347
|
-
var Title =
|
|
7348
|
-
var Info2 =
|
|
5919
|
+
var Title = styled40.div``;
|
|
5920
|
+
var Info2 = styled40.div`
|
|
7349
5921
|
margin-left: ${size(1)};
|
|
7350
5922
|
`;
|
|
7351
|
-
var InfoBtn =
|
|
5923
|
+
var InfoBtn = styled40(ButtonReset).attrs(() => ({
|
|
7352
5924
|
className: "wayke__theme wayke__color--primary-text"
|
|
7353
5925
|
}))`
|
|
7354
5926
|
position: relative;
|
|
@@ -7386,7 +5958,7 @@ var InfoBtn = styled45(ButtonReset).attrs(() => ({
|
|
|
7386
5958
|
transform: scale(0.95);
|
|
7387
5959
|
}
|
|
7388
5960
|
`;
|
|
7389
|
-
var Extend2 =
|
|
5961
|
+
var Extend2 = styled40.div`
|
|
7390
5962
|
padding-top: ${size(1)};
|
|
7391
5963
|
margin-top: ${size(1)};
|
|
7392
5964
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
@@ -7395,23 +5967,23 @@ var Extend2 = styled45.div`
|
|
|
7395
5967
|
|
|
7396
5968
|
// src/components/ExtendInfo/index.tsx
|
|
7397
5969
|
var ExtendInfo = ({ title, children }) => {
|
|
7398
|
-
const [extend, setExtend] =
|
|
7399
|
-
const onToggleExtend =
|
|
7400
|
-
return /* @__PURE__ */
|
|
5970
|
+
const [extend, setExtend] = useState14(false);
|
|
5971
|
+
const onToggleExtend = useCallback19(() => setExtend(!extend), [extend]);
|
|
5972
|
+
return /* @__PURE__ */ React50.createElement(Wrapper21, null, /* @__PURE__ */ React50.createElement(Header5, null, /* @__PURE__ */ React50.createElement(Title, null, title), children && /* @__PURE__ */ React50.createElement(Info2, null, /* @__PURE__ */ React50.createElement(InfoBtn, {
|
|
7401
5973
|
onClick: onToggleExtend,
|
|
7402
5974
|
title: "Mer information"
|
|
7403
|
-
}, /* @__PURE__ */
|
|
5975
|
+
}, /* @__PURE__ */ React50.createElement(IconInfo, {
|
|
7404
5976
|
block: true
|
|
7405
|
-
})))), extend && /* @__PURE__ */
|
|
5977
|
+
})))), extend && /* @__PURE__ */ React50.createElement(Extend2, null, children));
|
|
7406
5978
|
};
|
|
7407
5979
|
var ExtendInfo_default = ExtendInfo;
|
|
7408
5980
|
|
|
7409
5981
|
// src/components/InputLabel/index.tsx
|
|
7410
|
-
import
|
|
5982
|
+
import React51 from "react";
|
|
7411
5983
|
|
|
7412
5984
|
// src/components/InputLabel/wrapper.tsx
|
|
7413
|
-
import
|
|
7414
|
-
var
|
|
5985
|
+
import styled41 from "styled-components";
|
|
5986
|
+
var Wrapper22 = styled41.label.attrs(() => ({
|
|
7415
5987
|
className: "wayke__theme wayke__font--bold"
|
|
7416
5988
|
}))`
|
|
7417
5989
|
margin-bottom: ${size(0.5)};
|
|
@@ -7419,24 +5991,24 @@ var Wrapper26 = styled46.label.attrs(() => ({
|
|
|
7419
5991
|
`;
|
|
7420
5992
|
|
|
7421
5993
|
// src/components/InputLabel/index.tsx
|
|
7422
|
-
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */
|
|
5994
|
+
var InputLabel = ({ children, htmlFor }) => /* @__PURE__ */ React51.createElement(Wrapper22, {
|
|
7423
5995
|
htmlFor
|
|
7424
5996
|
}, children);
|
|
7425
5997
|
var InputLabel_default = InputLabel;
|
|
7426
5998
|
|
|
7427
5999
|
// src/components/InputText/index.tsx
|
|
7428
|
-
import
|
|
6000
|
+
import React52 from "react";
|
|
7429
6001
|
|
|
7430
6002
|
// src/components/InputText/wrapper.tsx
|
|
7431
|
-
import
|
|
7432
|
-
var
|
|
6003
|
+
import styled42 from "styled-components";
|
|
6004
|
+
var Wrapper23 = styled42.div`
|
|
7433
6005
|
position: relative;
|
|
7434
6006
|
display: flex;
|
|
7435
6007
|
align-items: stretch;
|
|
7436
6008
|
background-color: ${(props) => props.theme.color.accent};
|
|
7437
6009
|
border-radius: 3px;
|
|
7438
6010
|
`;
|
|
7439
|
-
var Input2 =
|
|
6011
|
+
var Input2 = styled42.input.attrs(() => ({
|
|
7440
6012
|
type: "text",
|
|
7441
6013
|
className: "wayke__theme wayke__font--regular"
|
|
7442
6014
|
}))`
|
|
@@ -7483,7 +6055,7 @@ var Input2 = styled47.input.attrs(() => ({
|
|
|
7483
6055
|
`;
|
|
7484
6056
|
|
|
7485
6057
|
// src/components/InputText/index.tsx
|
|
7486
|
-
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */
|
|
6058
|
+
var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @__PURE__ */ React52.createElement(Wrapper23, null, /* @__PURE__ */ React52.createElement(Input2, {
|
|
7487
6059
|
placeholder,
|
|
7488
6060
|
value,
|
|
7489
6061
|
id,
|
|
@@ -7494,12 +6066,12 @@ var InputText = ({ placeholder, label, value, id, onChange, onKeyDown }) => /* @
|
|
|
7494
6066
|
var InputText_default = InputText;
|
|
7495
6067
|
|
|
7496
6068
|
// src/components/InputCheckbox/index.tsx
|
|
7497
|
-
import * as
|
|
6069
|
+
import * as React54 from "react";
|
|
7498
6070
|
|
|
7499
6071
|
// src/components/InputCheckbox/wrapper.tsx
|
|
7500
|
-
import * as
|
|
7501
|
-
import
|
|
7502
|
-
var Label9 =
|
|
6072
|
+
import * as React53 from "react";
|
|
6073
|
+
import styled43, { css as css13 } from "styled-components";
|
|
6074
|
+
var Label9 = styled43.label.attrs(() => ({
|
|
7503
6075
|
className: "wayke__theme wayke__color--primary-text"
|
|
7504
6076
|
}))`
|
|
7505
6077
|
position: relative;
|
|
@@ -7529,13 +6101,13 @@ var Label9 = styled48.label.attrs(() => ({
|
|
|
7529
6101
|
margin-top: -2px;
|
|
7530
6102
|
}
|
|
7531
6103
|
`;
|
|
7532
|
-
var
|
|
6104
|
+
var Wrapper24 = styled43((props) => /* @__PURE__ */ React53.createElement("div", {
|
|
7533
6105
|
...props
|
|
7534
6106
|
})).attrs(({ type, checked }) => ({
|
|
7535
6107
|
role: type || "checkbox",
|
|
7536
6108
|
"aria-checked": checked
|
|
7537
6109
|
}))`
|
|
7538
|
-
${({ error }) => error &&
|
|
6110
|
+
${({ error }) => error && css13`
|
|
7539
6111
|
${Label9} {
|
|
7540
6112
|
color: ${(props) => props.theme.color.ui.negative};
|
|
7541
6113
|
|
|
@@ -7545,7 +6117,7 @@ var Wrapper28 = styled48((props) => /* @__PURE__ */ React67.createElement("div",
|
|
|
7545
6117
|
}
|
|
7546
6118
|
`}
|
|
7547
6119
|
`;
|
|
7548
|
-
var Input3 =
|
|
6120
|
+
var Input3 = styled43((props) => /* @__PURE__ */ React53.createElement("input", {
|
|
7549
6121
|
...props,
|
|
7550
6122
|
className: `${props.checked ? "checked" : void 0} ${props.className}`
|
|
7551
6123
|
})).attrs(({ type, checked }) => ({
|
|
@@ -7576,23 +6148,23 @@ var Input3 = styled48((props) => /* @__PURE__ */ React67.createElement("input",
|
|
|
7576
6148
|
}
|
|
7577
6149
|
}
|
|
7578
6150
|
`;
|
|
7579
|
-
var LabelText =
|
|
6151
|
+
var LabelText = styled43.div`
|
|
7580
6152
|
color: ${(props) => props.theme.color.textDark};
|
|
7581
6153
|
`;
|
|
7582
6154
|
|
|
7583
6155
|
// src/components/InputSelect/index.tsx
|
|
7584
|
-
import
|
|
6156
|
+
import React55 from "react";
|
|
7585
6157
|
|
|
7586
6158
|
// src/components/InputSelect/wrapper.tsx
|
|
7587
|
-
import
|
|
6159
|
+
import styled44 from "styled-components";
|
|
7588
6160
|
var iconSize2 = "0.875rem";
|
|
7589
6161
|
var selectPadding = size(2);
|
|
7590
|
-
var
|
|
6162
|
+
var Wrapper25 = styled44.div`
|
|
7591
6163
|
position: relative;
|
|
7592
6164
|
background-color: ${(props) => props.theme.color.accent};
|
|
7593
6165
|
border-radius: 3px;
|
|
7594
6166
|
`;
|
|
7595
|
-
var Select2 =
|
|
6167
|
+
var Select2 = styled44.select.attrs(() => ({
|
|
7596
6168
|
className: "wayke__theme wayke__font--regular"
|
|
7597
6169
|
}))`
|
|
7598
6170
|
position: relative;
|
|
@@ -7626,10 +6198,10 @@ var Select2 = styled49.select.attrs(() => ({
|
|
|
7626
6198
|
border: 0;
|
|
7627
6199
|
}
|
|
7628
6200
|
`;
|
|
7629
|
-
var Option2 =
|
|
6201
|
+
var Option2 = styled44.option`
|
|
7630
6202
|
color: ${(props) => props.theme.color.textDark};
|
|
7631
6203
|
`;
|
|
7632
|
-
var Icon5 =
|
|
6204
|
+
var Icon5 = styled44.div`
|
|
7633
6205
|
position: absolute;
|
|
7634
6206
|
top: 50%;
|
|
7635
6207
|
right: ${selectPadding};
|
|
@@ -7638,29 +6210,29 @@ var Icon5 = styled49.div`
|
|
|
7638
6210
|
`;
|
|
7639
6211
|
|
|
7640
6212
|
// src/components/InputSelect/index.tsx
|
|
7641
|
-
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */
|
|
6213
|
+
var InputSelect = ({ value, options, onChange, unit, title }) => /* @__PURE__ */ React55.createElement(Wrapper25, null, /* @__PURE__ */ React55.createElement(Select2, {
|
|
7642
6214
|
value,
|
|
7643
6215
|
onChange,
|
|
7644
6216
|
title,
|
|
7645
6217
|
"aria-label": title
|
|
7646
|
-
}, options?.map((option) => /* @__PURE__ */
|
|
6218
|
+
}, options?.map((option) => /* @__PURE__ */ React55.createElement(Option2, {
|
|
7647
6219
|
key: option.value,
|
|
7648
6220
|
value: option.value
|
|
7649
|
-
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */
|
|
6221
|
+
}, option.displayName || option.value, unit ? ` ${unit}` : ""))), /* @__PURE__ */ React55.createElement(Icon5, null, /* @__PURE__ */ React55.createElement(IconChevronDown, {
|
|
7650
6222
|
block: true
|
|
7651
6223
|
})));
|
|
7652
6224
|
var InputSelect_default = InputSelect;
|
|
7653
6225
|
|
|
7654
6226
|
// src/components/InputGroup/index.tsx
|
|
7655
|
-
import
|
|
7656
|
-
var InputGroup =
|
|
6227
|
+
import styled45 from "styled-components";
|
|
6228
|
+
var InputGroup = styled45.div`
|
|
7657
6229
|
${(props) => props.theme.breakpoint.Sm} {
|
|
7658
6230
|
display: flex;
|
|
7659
6231
|
align-items: flex-start;
|
|
7660
6232
|
margin: ${size(-0.5)};
|
|
7661
6233
|
}
|
|
7662
6234
|
`;
|
|
7663
|
-
var InputGroupColumn =
|
|
6235
|
+
var InputGroupColumn = styled45.div`
|
|
7664
6236
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
7665
6237
|
& + & {
|
|
7666
6238
|
margin-top: ${size(1)};
|
|
@@ -7674,12 +6246,12 @@ var InputGroupColumn = styled50.div`
|
|
|
7674
6246
|
`;
|
|
7675
6247
|
|
|
7676
6248
|
// src/components/ColumnRow/index.tsx
|
|
7677
|
-
import
|
|
7678
|
-
var ColumnRow =
|
|
6249
|
+
import styled46 from "styled-components";
|
|
6250
|
+
var ColumnRow = styled46.div`
|
|
7679
6251
|
display: flex;
|
|
7680
6252
|
align-items: flex-start;
|
|
7681
6253
|
`;
|
|
7682
|
-
var ColumnRowItem =
|
|
6254
|
+
var ColumnRowItem = styled46.div`
|
|
7683
6255
|
flex: 1 1 auto;
|
|
7684
6256
|
|
|
7685
6257
|
:last-child:not(:only-child) {
|
|
@@ -7754,30 +6326,30 @@ var ssnIsValid = (s) => s ? /^\d{2,4}\d{2}\d{2}\-?\d{4}$/.test(s) : false;
|
|
|
7754
6326
|
|
|
7755
6327
|
// src/components/InsuranceOptions/InsuranceModal.tsx
|
|
7756
6328
|
var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
7757
|
-
const [form, setForm] =
|
|
6329
|
+
const [form, setForm] = useState15({
|
|
7758
6330
|
ssn: "",
|
|
7759
6331
|
drivingDistance: "BETWEEN0AND1000" /* Between0And1000 */
|
|
7760
6332
|
});
|
|
7761
|
-
const [payload, setPayload] =
|
|
6333
|
+
const [payload, setPayload] = useState15();
|
|
7762
6334
|
const { loading, data, error } = useInsurance_default(
|
|
7763
6335
|
id,
|
|
7764
6336
|
branch?.id ? branch?.id : void 0,
|
|
7765
6337
|
ssnIsValid(payload?.ssn) ? payload?.ssn : void 0,
|
|
7766
6338
|
payload?.drivingDistance
|
|
7767
6339
|
);
|
|
7768
|
-
const onChangeSsn =
|
|
6340
|
+
const onChangeSsn = useCallback20(
|
|
7769
6341
|
(e) => setForm({ ...form, ssn: e.currentTarget.value }),
|
|
7770
6342
|
[form]
|
|
7771
6343
|
);
|
|
7772
|
-
const onChangeDrivingDistance =
|
|
6344
|
+
const onChangeDrivingDistance = useCallback20(
|
|
7773
6345
|
(e) => setForm({ ...form, drivingDistance: e.currentTarget.value }),
|
|
7774
6346
|
[form]
|
|
7775
6347
|
);
|
|
7776
|
-
const onShowInsurances =
|
|
6348
|
+
const onShowInsurances = useCallback20(() => {
|
|
7777
6349
|
pubsub_default.publish("InsuranceInterest");
|
|
7778
6350
|
setPayload(form);
|
|
7779
6351
|
}, [form]);
|
|
7780
|
-
const onKeyDown =
|
|
6352
|
+
const onKeyDown = useCallback20(
|
|
7781
6353
|
(e) => {
|
|
7782
6354
|
if (e.keyCode === 13 && ssnIsValid(form.ssn) && !loading) {
|
|
7783
6355
|
onShowInsurances();
|
|
@@ -7792,105 +6364,105 @@ var InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
|
|
|
7792
6364
|
{ value: "BETWEEN2000AND2500" /* Between2000And2500 */, displayName: "2000 - 2500" },
|
|
7793
6365
|
{ value: "OVER2500" /* Over2500 */, displayName: "2500+" }
|
|
7794
6366
|
];
|
|
7795
|
-
return /* @__PURE__ */
|
|
6367
|
+
return /* @__PURE__ */ React56.createElement(Modal_default, {
|
|
7796
6368
|
title: "F\xF6rs\xE4kring",
|
|
7797
6369
|
onClose
|
|
7798
|
-
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */
|
|
6370
|
+
}, (insuranceOptions?.description || insuranceOptions?.logotype) && /* @__PURE__ */ React56.createElement(Repeat, null, /* @__PURE__ */ React56.createElement(ContentLogo, null, insuranceOptions.description && /* @__PURE__ */ React56.createElement(ContentLogoText, null, /* @__PURE__ */ React56.createElement(Content_default, null, /* @__PURE__ */ React56.createElement("p", null, insuranceOptions.description))), insuranceOptions.logotype && /* @__PURE__ */ React56.createElement(ContentLogoMedia, null, /* @__PURE__ */ React56.createElement(LogoBox_default, {
|
|
7799
6371
|
logo: insuranceOptions.logotype,
|
|
7800
6372
|
alt: insuranceOptions.name || "Logotyp",
|
|
7801
6373
|
wide: true
|
|
7802
|
-
})))), /* @__PURE__ */
|
|
6374
|
+
})))), /* @__PURE__ */ React56.createElement(Repeat, null, /* @__PURE__ */ React56.createElement(RepeatSmall, null, /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(InputGroup, null, /* @__PURE__ */ React56.createElement(InputGroupColumn, null, /* @__PURE__ */ React56.createElement(InputLabel_default, {
|
|
7803
6375
|
htmlFor: "input-insurance-personalnumber"
|
|
7804
|
-
}, "Personnummer"), /* @__PURE__ */
|
|
6376
|
+
}, "Personnummer"), /* @__PURE__ */ React56.createElement(InputText_default, {
|
|
7805
6377
|
placeholder: "\xC5\xC5\xC5\xC5MMDD-XXXX",
|
|
7806
6378
|
label: "Personnummer",
|
|
7807
6379
|
value: form.ssn,
|
|
7808
6380
|
onChange: onChangeSsn,
|
|
7809
6381
|
onKeyDown,
|
|
7810
6382
|
id: "input-insurance-personalnumber"
|
|
7811
|
-
})), /* @__PURE__ */
|
|
6383
|
+
})), /* @__PURE__ */ React56.createElement(InputGroupColumn, null, /* @__PURE__ */ React56.createElement(InputLabel_default, {
|
|
7812
6384
|
htmlFor: "input-insurance-mileage"
|
|
7813
|
-
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */
|
|
6385
|
+
}, "Uppskattad k\xF6rstr\xE4cka per \xE5r"), /* @__PURE__ */ React56.createElement(InputSelect_default, {
|
|
7814
6386
|
value: form.drivingDistance,
|
|
7815
6387
|
onChange: onChangeDrivingDistance,
|
|
7816
6388
|
options,
|
|
7817
6389
|
unit: "mil",
|
|
7818
6390
|
title: "Uppskattad k\xF6rstr\xE4cka per \xE5r"
|
|
7819
|
-
})))), /* @__PURE__ */
|
|
6391
|
+
})))), /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(ButtonPrimary, {
|
|
7820
6392
|
fullWidth: true,
|
|
7821
6393
|
disabled: !ssnIsValid(form.ssn) || loading,
|
|
7822
6394
|
onClick: onShowInsurances
|
|
7823
|
-
}, /* @__PURE__ */
|
|
6395
|
+
}, /* @__PURE__ */ React56.createElement(ButtonContent, null, "Visa f\xF6rs\xE4kringar")))), false, /* @__PURE__ */ React56.createElement(RepeatSmall, null, /* @__PURE__ */ React56.createElement(Content_default, {
|
|
7824
6396
|
small: true
|
|
7825
|
-
}, /* @__PURE__ */
|
|
6397
|
+
}, /* @__PURE__ */ React56.createElement("p", null, "Spara personnummer p\xE5 denna dator f\xF6r att direkt visa f\xF6rs\xE4kringskostnaderna i Wayke. Personnumret lagras inte hos Wayke utan finns bara sparad i din webbl\xE4sare.")))), loading && /* @__PURE__ */ React56.createElement(Repeat, null, /* @__PURE__ */ React56.createElement(Loader_default, null)), error && /* @__PURE__ */ React56.createElement(Repeat, null, /* @__PURE__ */ React56.createElement(Snackbar_default, {
|
|
7826
6398
|
severity: "error",
|
|
7827
6399
|
icon: true,
|
|
7828
6400
|
heading: "Ett fel har intr\xE4ffat"
|
|
7829
|
-
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */
|
|
6401
|
+
}, "Kunde inte h\xE4mta f\xF6rs\xE4kringar. V\xE4nligen f\xF6rs\xF6k igen.")), /* @__PURE__ */ React56.createElement(React56.Fragment, null, data?.insurances && /* @__PURE__ */ React56.createElement(Repeat, null, data?.insurances.map((insurance) => /* @__PURE__ */ React56.createElement(Repeat, {
|
|
7830
6402
|
key: insurance.name
|
|
7831
|
-
}, /* @__PURE__ */
|
|
6403
|
+
}, /* @__PURE__ */ React56.createElement(DetailBox_default, {
|
|
7832
6404
|
heading: `${numberSeparator(insurance.price)} ${insurance.unit}`,
|
|
7833
6405
|
description: insurance.name
|
|
7834
|
-
}, /* @__PURE__ */
|
|
6406
|
+
}, /* @__PURE__ */ React56.createElement(Repeat, null, /* @__PURE__ */ React56.createElement(React56.Fragment, null, insurance.description && /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(Content_default, null, /* @__PURE__ */ React56.createElement("p", null, insurance.description)))), /* @__PURE__ */ React56.createElement(React56.Fragment, null, insurance.url && /* @__PURE__ */ React56.createElement(RepeatTiny, null, /* @__PURE__ */ React56.createElement(ButtonInline, {
|
|
7835
6407
|
as: "a",
|
|
7836
6408
|
href: insurance.url || "",
|
|
7837
6409
|
target: "_blank",
|
|
7838
6410
|
rel: "noopener noreferrer nofollow"
|
|
7839
|
-
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */
|
|
6411
|
+
}, "F\xF6rk\xF6psinformation och villkor (\xF6ppnas i ny flik)")))), insurance.items && insurance.items.length > 0 && /* @__PURE__ */ React56.createElement(Repeat, null, /* @__PURE__ */ React56.createElement(H4, null, "F\xF6rs\xE4kringen inneh\xE5ller"), insurance.items.map((item) => /* @__PURE__ */ React56.createElement(RepeatSmall, {
|
|
7840
6412
|
key: item.name || ""
|
|
7841
|
-
}, /* @__PURE__ */
|
|
6413
|
+
}, /* @__PURE__ */ React56.createElement(ExtendInfo_default, {
|
|
7842
6414
|
title: item.name || ""
|
|
7843
|
-
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */
|
|
6415
|
+
}, item.description)))), insurance.addons && insurance.addons.length > 0 && /* @__PURE__ */ React56.createElement(Repeat, null, /* @__PURE__ */ React56.createElement(H4, null, "V\xE4lj till"), insurance.addons.map((addon) => /* @__PURE__ */ React56.createElement(RepeatSmall, {
|
|
7844
6416
|
key: addon.title || ""
|
|
7845
|
-
}, /* @__PURE__ */
|
|
6417
|
+
}, /* @__PURE__ */ React56.createElement(ColumnRow, null, /* @__PURE__ */ React56.createElement(ColumnRowItem, null, /* @__PURE__ */ React56.createElement(ExtendInfo_default, {
|
|
7846
6418
|
title: addon.title || ""
|
|
7847
|
-
}, addon.description)), /* @__PURE__ */
|
|
6419
|
+
}, addon.description)), /* @__PURE__ */ React56.createElement(ColumnRowItem, null, /* @__PURE__ */ React56.createElement(UtilityTextBold, null, "+", addon.price, " ", addon.unit))))))))))));
|
|
7848
6420
|
};
|
|
7849
6421
|
var InsuranceModal_default = InsuranceModal;
|
|
7850
6422
|
|
|
7851
6423
|
// src/components/InsuranceOptions/Insurance.tsx
|
|
7852
6424
|
var Insurance = ({ id, branch, insuranceOptions }) => {
|
|
7853
|
-
const [modal, setModal] =
|
|
7854
|
-
const toggleModal =
|
|
6425
|
+
const [modal, setModal] = useState16(false);
|
|
6426
|
+
const toggleModal = useCallback21(() => setModal(!modal), [modal]);
|
|
7855
6427
|
if (!insuranceOptions.length) {
|
|
7856
6428
|
return null;
|
|
7857
6429
|
}
|
|
7858
|
-
return /* @__PURE__ */
|
|
6430
|
+
return /* @__PURE__ */ React57.createElement(React57.Fragment, null, modal && /* @__PURE__ */ React57.createElement(InsuranceModal_default, {
|
|
7859
6431
|
id,
|
|
7860
6432
|
branch,
|
|
7861
6433
|
onClose: toggleModal,
|
|
7862
6434
|
insuranceOptions: insuranceOptions[0]
|
|
7863
|
-
}), /* @__PURE__ */
|
|
6435
|
+
}), /* @__PURE__ */ React57.createElement(Repeat, null, /* @__PURE__ */ React57.createElement(RepeatTiny, null, /* @__PURE__ */ React57.createElement(VisualHeading, null, "V\xE4lj till f\xF6rs\xE4kring")), /* @__PURE__ */ React57.createElement(RepeatTiny, null, /* @__PURE__ */ React57.createElement(React57.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ React57.createElement(OptionBox_default, {
|
|
7864
6436
|
key: `${insuranceOption.url}-${index2}`,
|
|
7865
6437
|
logo: insuranceOption.logotype || void 0,
|
|
7866
6438
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
7867
|
-
}, /* @__PURE__ */
|
|
6439
|
+
}, /* @__PURE__ */ React57.createElement(OptionBoxHeading, null, "F\xE5 prisf\xF6rslag"), /* @__PURE__ */ React57.createElement(OptionBoxContent, null, /* @__PURE__ */ React57.createElement("p", null, /* @__PURE__ */ React57.createElement(ButtonInline, {
|
|
7868
6440
|
onClick: toggleModal
|
|
7869
6441
|
}, "Mer information")))))))));
|
|
7870
6442
|
};
|
|
7871
6443
|
var Insurance_default = Insurance;
|
|
7872
6444
|
|
|
7873
6445
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
7874
|
-
import
|
|
6446
|
+
import React59, { useState as useState17, useCallback as useCallback22 } from "react";
|
|
7875
6447
|
import { marked as marked2 } from "marked";
|
|
7876
6448
|
|
|
7877
6449
|
// src/components/InsuranceOptions/InsuranceFreeModal.tsx
|
|
7878
|
-
import
|
|
6450
|
+
import React58 from "react";
|
|
7879
6451
|
import { marked } from "marked";
|
|
7880
6452
|
var InsuranceFreeModal = ({ onClose, insuranceOptions }) => {
|
|
7881
|
-
return /* @__PURE__ */
|
|
6453
|
+
return /* @__PURE__ */ React58.createElement(Modal_default, {
|
|
7882
6454
|
title: insuranceOptions?.insuranceHeader ?? "F\xF6rs\xE4kring",
|
|
7883
6455
|
onClose
|
|
7884
|
-
}, insuranceOptions?.longDescription && /* @__PURE__ */
|
|
6456
|
+
}, insuranceOptions?.longDescription && /* @__PURE__ */ React58.createElement(Repeat, null, /* @__PURE__ */ React58.createElement(Content_default, {
|
|
7885
6457
|
dangerouslySetInnerHTML: {
|
|
7886
6458
|
__html: marked(insuranceOptions.longDescription)
|
|
7887
6459
|
}
|
|
7888
|
-
})), insuranceOptions?.url && /* @__PURE__ */
|
|
6460
|
+
})), insuranceOptions?.url && /* @__PURE__ */ React58.createElement(Repeat, null, /* @__PURE__ */ React58.createElement(ButtonInline, {
|
|
7889
6461
|
as: "a",
|
|
7890
6462
|
href: insuranceOptions.url,
|
|
7891
6463
|
target: "_blank",
|
|
7892
6464
|
rel: "noopener noreferrer"
|
|
7893
|
-
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */
|
|
6465
|
+
}, "L\xE4s mer om f\xF6rs\xE4kringen (\xD6ppnas i ett nytt f\xF6nster)")), insuranceOptions?.logotype && /* @__PURE__ */ React58.createElement(Repeat, null, /* @__PURE__ */ React58.createElement(LogoBox_default, {
|
|
7894
6466
|
logo: insuranceOptions.logotype,
|
|
7895
6467
|
alt: insuranceOptions.name || "Logotyp",
|
|
7896
6468
|
wide: true
|
|
@@ -7900,23 +6472,23 @@ var InsuranceFreeModal_default = InsuranceFreeModal;
|
|
|
7900
6472
|
|
|
7901
6473
|
// src/components/InsuranceOptions/InsuranceFree.tsx
|
|
7902
6474
|
var Insurance2 = ({ insuranceOptions }) => {
|
|
7903
|
-
const [modal, setModal] =
|
|
7904
|
-
const toggleModal =
|
|
6475
|
+
const [modal, setModal] = useState17(false);
|
|
6476
|
+
const toggleModal = useCallback22(() => setModal(!modal), [modal]);
|
|
7905
6477
|
if (!insuranceOptions.length) {
|
|
7906
6478
|
return null;
|
|
7907
6479
|
}
|
|
7908
|
-
return /* @__PURE__ */
|
|
6480
|
+
return /* @__PURE__ */ React59.createElement(React59.Fragment, null, modal && /* @__PURE__ */ React59.createElement(InsuranceFreeModal_default, {
|
|
7909
6481
|
onClose: toggleModal,
|
|
7910
6482
|
insuranceOptions: insuranceOptions[0]
|
|
7911
|
-
}), /* @__PURE__ */
|
|
6483
|
+
}), /* @__PURE__ */ React59.createElement(Repeat, null, /* @__PURE__ */ React59.createElement(RepeatTiny, null, /* @__PURE__ */ React59.createElement(VisualHeading, null, insuranceOptions[0]?.insuranceHeader ?? "F\xF6rs\xE4kring")), /* @__PURE__ */ React59.createElement(RepeatTiny, null, /* @__PURE__ */ React59.createElement(React59.Fragment, null, insuranceOptions.map((insuranceOption, index2) => /* @__PURE__ */ React59.createElement(OptionBox_default, {
|
|
7912
6484
|
key: `${insuranceOption.url}-${index2}`,
|
|
7913
6485
|
logo: insuranceOption.logotype || void 0,
|
|
7914
6486
|
logoAlt: insuranceOption.name || "Logotyp"
|
|
7915
|
-
}, insuranceOption.description && /* @__PURE__ */
|
|
6487
|
+
}, insuranceOption.description && /* @__PURE__ */ React59.createElement(Content_default, {
|
|
7916
6488
|
dangerouslySetInnerHTML: {
|
|
7917
6489
|
__html: marked2(insuranceOption.description)
|
|
7918
6490
|
}
|
|
7919
|
-
}), /* @__PURE__ */
|
|
6491
|
+
}), /* @__PURE__ */ React59.createElement(OptionBoxContent, null, /* @__PURE__ */ React59.createElement("p", null, /* @__PURE__ */ React59.createElement(ButtonInline, {
|
|
7920
6492
|
onClick: toggleModal
|
|
7921
6493
|
}, "Mer information")))))))));
|
|
7922
6494
|
};
|
|
@@ -7929,12 +6501,12 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
7929
6501
|
}
|
|
7930
6502
|
if (insuranceOptions.length > 0) {
|
|
7931
6503
|
if (insuranceOptions[0].requiresDistance && insuranceOptions[0].requiresPersonalNumber)
|
|
7932
|
-
return /* @__PURE__ */
|
|
6504
|
+
return /* @__PURE__ */ React60.createElement(Insurance_default, {
|
|
7933
6505
|
id,
|
|
7934
6506
|
branch,
|
|
7935
6507
|
insuranceOptions
|
|
7936
6508
|
});
|
|
7937
|
-
return /* @__PURE__ */
|
|
6509
|
+
return /* @__PURE__ */ React60.createElement(InsuranceFree_default, {
|
|
7938
6510
|
insuranceOptions
|
|
7939
6511
|
});
|
|
7940
6512
|
}
|
|
@@ -7943,22 +6515,22 @@ var InsuranceOptions = ({ id, branch, insuranceOptions }) => {
|
|
|
7943
6515
|
var InsuranceOptions_default = InsuranceOptions;
|
|
7944
6516
|
|
|
7945
6517
|
// src/layouts/searchItem/ManufacturerPackagesOption.tsx
|
|
7946
|
-
import
|
|
6518
|
+
import React61 from "react";
|
|
7947
6519
|
import { marked as marked3 } from "marked";
|
|
7948
6520
|
var ManufacturerPackageOption = ({ packageOption }) => {
|
|
7949
6521
|
if (!packageOption) {
|
|
7950
6522
|
return null;
|
|
7951
6523
|
}
|
|
7952
|
-
return /* @__PURE__ */
|
|
6524
|
+
return /* @__PURE__ */ React61.createElement(ProductPageMainSection, null, /* @__PURE__ */ React61.createElement(Repeat, null, /* @__PURE__ */ React61.createElement(H2, {
|
|
7953
6525
|
noMargin: true
|
|
7954
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
6526
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React61.createElement(Repeat, null, /* @__PURE__ */ React61.createElement(Content_default, {
|
|
7955
6527
|
dangerouslySetInnerHTML: { __html: marked3(packageOption.description) }
|
|
7956
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
6528
|
+
})), packageOption.link?.url && /* @__PURE__ */ React61.createElement(Repeat, null, /* @__PURE__ */ React61.createElement(ButtonInline, {
|
|
7957
6529
|
as: "a",
|
|
7958
6530
|
href: packageOption.link.url,
|
|
7959
6531
|
target: "_blank",
|
|
7960
6532
|
rel: "noopener noreferrer"
|
|
7961
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
6533
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ React61.createElement(Repeat, null, /* @__PURE__ */ React61.createElement(LogoBox_default, {
|
|
7962
6534
|
logo: packageOption.image,
|
|
7963
6535
|
alt: "Logotyp",
|
|
7964
6536
|
wide: true
|
|
@@ -7967,23 +6539,23 @@ var ManufacturerPackageOption = ({ packageOption }) => {
|
|
|
7967
6539
|
var ManufacturerPackagesOption_default = ManufacturerPackageOption;
|
|
7968
6540
|
|
|
7969
6541
|
// src/layouts/searchItem/CheckList.tsx
|
|
7970
|
-
import
|
|
6542
|
+
import React68, { useState as useState21, useCallback as useCallback27, useEffect as useEffect9 } from "react";
|
|
7971
6543
|
|
|
7972
6544
|
// src/components/ActionList/index.tsx
|
|
7973
|
-
import
|
|
6545
|
+
import React63, { useCallback as useCallback24 } from "react";
|
|
7974
6546
|
|
|
7975
6547
|
// src/components/ActionList/toggle-item.tsx
|
|
7976
|
-
import
|
|
6548
|
+
import React62, { useState as useState18, useCallback as useCallback23 } from "react";
|
|
7977
6549
|
var initialValue = {};
|
|
7978
6550
|
var getInitialValue = (title) => title && !!initialValue[title];
|
|
7979
6551
|
var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
7980
|
-
const [visible, setVisible] =
|
|
7981
|
-
const _onClickValue =
|
|
6552
|
+
const [visible, setVisible] = useState18(() => getInitialValue(type));
|
|
6553
|
+
const _onClickValue = useCallback23(() => {
|
|
7982
6554
|
if (onClickValue) {
|
|
7983
6555
|
onClickValue();
|
|
7984
6556
|
}
|
|
7985
6557
|
}, []);
|
|
7986
|
-
const onClick =
|
|
6558
|
+
const onClick = useCallback23(() => {
|
|
7987
6559
|
if (!visible) {
|
|
7988
6560
|
initialValue[type] = true;
|
|
7989
6561
|
setVisible(true);
|
|
@@ -7993,17 +6565,17 @@ var ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
|
|
|
7993
6565
|
}
|
|
7994
6566
|
}, [visible]);
|
|
7995
6567
|
const visibleTitle = type === "tel" ? "Ring" : type === "mailto" ? "Skicka ett mail till" : "";
|
|
7996
|
-
return /* @__PURE__ */
|
|
6568
|
+
return /* @__PURE__ */ React62.createElement(RepeatTiny, null, visible ? /* @__PURE__ */ React62.createElement(ButtonSecondary, {
|
|
7997
6569
|
onClick: _onClickValue,
|
|
7998
6570
|
as: "a",
|
|
7999
6571
|
href: `${type}:${value}`,
|
|
8000
6572
|
title: `${visibleTitle} ${value}`,
|
|
8001
6573
|
fullWidth: true
|
|
8002
|
-
}, /* @__PURE__ */
|
|
6574
|
+
}, /* @__PURE__ */ React62.createElement(ButtonContent, null, value)) : /* @__PURE__ */ React62.createElement(ButtonSecondary, {
|
|
8003
6575
|
onClick,
|
|
8004
6576
|
title,
|
|
8005
6577
|
fullWidth: true
|
|
8006
|
-
}, /* @__PURE__ */
|
|
6578
|
+
}, /* @__PURE__ */ React62.createElement(ButtonContent, null, title)));
|
|
8007
6579
|
};
|
|
8008
6580
|
var toggle_item_default = ToggleItem;
|
|
8009
6581
|
|
|
@@ -8116,18 +6688,18 @@ var formatPhonenumber = (text) => {
|
|
|
8116
6688
|
var ActionList = ({ contact, branch }) => {
|
|
8117
6689
|
const email = contact?.email || branch?.contact?.email;
|
|
8118
6690
|
const phonenumber = contact?.phonenumber || branch?.contact?.phonenumber;
|
|
8119
|
-
const onClickMailVisible =
|
|
8120
|
-
const onClickPhoneVisible =
|
|
8121
|
-
const onClickPhoneValue =
|
|
6691
|
+
const onClickMailVisible = useCallback24(() => pubsub_default.publish("MailVisible"), []);
|
|
6692
|
+
const onClickPhoneVisible = useCallback24(() => pubsub_default.publish("PhonenumberVisible"), []);
|
|
6693
|
+
const onClickPhoneValue = useCallback24(() => pubsub_default.publish("PhonenumberCall"), []);
|
|
8122
6694
|
if (!email && !phonenumber) {
|
|
8123
6695
|
return null;
|
|
8124
6696
|
}
|
|
8125
|
-
return /* @__PURE__ */
|
|
6697
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, email && /* @__PURE__ */ React63.createElement(toggle_item_default, {
|
|
8126
6698
|
onClickVisible: onClickMailVisible,
|
|
8127
6699
|
title: "Visa mailadress",
|
|
8128
6700
|
value: email,
|
|
8129
6701
|
type: "mailto"
|
|
8130
|
-
}), phonenumber && /* @__PURE__ */
|
|
6702
|
+
}), phonenumber && /* @__PURE__ */ React63.createElement(toggle_item_default, {
|
|
8131
6703
|
title: "Visa telefonnummer",
|
|
8132
6704
|
value: formatPhonenumber(phonenumber),
|
|
8133
6705
|
type: "tel",
|
|
@@ -8138,16 +6710,16 @@ var ActionList = ({ contact, branch }) => {
|
|
|
8138
6710
|
var ActionList_default = ActionList;
|
|
8139
6711
|
|
|
8140
6712
|
// src/components/CheckMarkList/index.tsx
|
|
8141
|
-
import
|
|
6713
|
+
import React64 from "react";
|
|
8142
6714
|
|
|
8143
6715
|
// src/components/CheckMarkList/wrapper.tsx
|
|
8144
|
-
import
|
|
8145
|
-
var List9 =
|
|
6716
|
+
import styled47 from "styled-components";
|
|
6717
|
+
var List9 = styled47.ul`
|
|
8146
6718
|
list-style: none;
|
|
8147
6719
|
padding: 0;
|
|
8148
6720
|
margin: 0;
|
|
8149
6721
|
`;
|
|
8150
|
-
var
|
|
6722
|
+
var Item9 = styled47.li`
|
|
8151
6723
|
position: relative;
|
|
8152
6724
|
font-size: 0.875rem;
|
|
8153
6725
|
|
|
@@ -8155,7 +6727,7 @@ var Item11 = styled52.li`
|
|
|
8155
6727
|
margin-top: ${size(0.5)};
|
|
8156
6728
|
}
|
|
8157
6729
|
`;
|
|
8158
|
-
var Icon6 =
|
|
6730
|
+
var Icon6 = styled47.div.attrs(() => ({
|
|
8159
6731
|
className: "wayke__theme wayke__color--primary-text"
|
|
8160
6732
|
}))`
|
|
8161
6733
|
position: absolute;
|
|
@@ -8163,52 +6735,52 @@ var Icon6 = styled52.div.attrs(() => ({
|
|
|
8163
6735
|
top: 4px; // Magic number
|
|
8164
6736
|
font-size: 0.875em;
|
|
8165
6737
|
`;
|
|
8166
|
-
var Label10 =
|
|
6738
|
+
var Label10 = styled47.div`
|
|
8167
6739
|
padding-left: calc(1em + ${size(1)});
|
|
8168
6740
|
`;
|
|
8169
6741
|
|
|
8170
6742
|
// src/components/CheckMarkList/index.tsx
|
|
8171
|
-
var CheckMarkListItem = ({ children }) => /* @__PURE__ */
|
|
6743
|
+
var CheckMarkListItem = ({ children }) => /* @__PURE__ */ React64.createElement(Item9, null, /* @__PURE__ */ React64.createElement(Icon6, null, /* @__PURE__ */ React64.createElement(IconCheck, {
|
|
8172
6744
|
block: true
|
|
8173
|
-
})), /* @__PURE__ */
|
|
8174
|
-
var CheckMarkList = ({ children }) => /* @__PURE__ */
|
|
6745
|
+
})), /* @__PURE__ */ React64.createElement(Label10, null, children));
|
|
6746
|
+
var CheckMarkList = ({ children }) => /* @__PURE__ */ React64.createElement(List9, null, children);
|
|
8175
6747
|
var CheckMarkList_default = CheckMarkList;
|
|
8176
6748
|
|
|
8177
6749
|
// src/components/SwitchBar/index.tsx
|
|
8178
|
-
import
|
|
6750
|
+
import React65, { useState as useState19, useCallback as useCallback25 } from "react";
|
|
8179
6751
|
|
|
8180
6752
|
// src/components/SwitchBar/wrapper.tsx
|
|
8181
|
-
import
|
|
8182
|
-
var
|
|
6753
|
+
import styled48 from "styled-components";
|
|
6754
|
+
var Wrapper26 = styled48.div`
|
|
8183
6755
|
padding: ${size(1.5)} ${size(2)};
|
|
8184
6756
|
background-color: ${(props) => props.theme.color.accentDark};
|
|
8185
6757
|
border-radius: 3px;
|
|
8186
6758
|
font-size: 0.875rem;
|
|
8187
6759
|
`;
|
|
8188
|
-
var Header6 =
|
|
6760
|
+
var Header6 = styled48.div`
|
|
8189
6761
|
display: flex;
|
|
8190
6762
|
align-items: center;
|
|
8191
6763
|
`;
|
|
8192
|
-
var Body5 =
|
|
6764
|
+
var Body5 = styled48.div`
|
|
8193
6765
|
font-size: 0.875rem;
|
|
8194
6766
|
margin-top: ${size(1)};
|
|
8195
6767
|
`;
|
|
8196
|
-
var Info3 =
|
|
6768
|
+
var Info3 = styled48.div`
|
|
8197
6769
|
flex: 1 1 auto;
|
|
8198
6770
|
display: flex;
|
|
8199
6771
|
align-items: center;
|
|
8200
6772
|
`;
|
|
8201
|
-
var Action7 =
|
|
6773
|
+
var Action7 = styled48.div`
|
|
8202
6774
|
flex-shrink: 0;
|
|
8203
6775
|
padding-left: ${size(1.5)};
|
|
8204
6776
|
font-size: 0.875rem;
|
|
8205
6777
|
`;
|
|
8206
|
-
var InfoContent =
|
|
6778
|
+
var InfoContent = styled48.div`
|
|
8207
6779
|
& + & {
|
|
8208
6780
|
margin-left: ${size(0.75)};
|
|
8209
6781
|
}
|
|
8210
6782
|
`;
|
|
8211
|
-
var InfoBtn2 =
|
|
6783
|
+
var InfoBtn2 = styled48(ButtonReset).attrs(() => ({
|
|
8212
6784
|
className: "wayke__theme wayke__color--primary-text"
|
|
8213
6785
|
}))`
|
|
8214
6786
|
position: relative;
|
|
@@ -8242,7 +6814,7 @@ var InfoBtn2 = styled53(ButtonReset).attrs(() => ({
|
|
|
8242
6814
|
transform: scale(0.95);
|
|
8243
6815
|
}
|
|
8244
6816
|
`;
|
|
8245
|
-
var Title2 =
|
|
6817
|
+
var Title2 = styled48.div.attrs(() => ({
|
|
8246
6818
|
className: "wayke__theme wayke__font--bold"
|
|
8247
6819
|
}))`
|
|
8248
6820
|
font-size: 1rem;
|
|
@@ -8250,17 +6822,17 @@ var Title2 = styled53.div.attrs(() => ({
|
|
|
8250
6822
|
|
|
8251
6823
|
// src/components/SwitchBar/index.tsx
|
|
8252
6824
|
var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
8253
|
-
const [info, setInfo] =
|
|
8254
|
-
const onToggleInfo =
|
|
8255
|
-
return /* @__PURE__ */
|
|
6825
|
+
const [info, setInfo] = useState19(false);
|
|
6826
|
+
const onToggleInfo = useCallback25(() => setInfo(!info), [info]);
|
|
6827
|
+
return /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(Wrapper26, null, /* @__PURE__ */ React65.createElement(Header6, null, /* @__PURE__ */ React65.createElement(Info3, null, /* @__PURE__ */ React65.createElement(InfoContent, null, /* @__PURE__ */ React65.createElement(Title2, null, title)), children && /* @__PURE__ */ React65.createElement(InfoContent, null, /* @__PURE__ */ React65.createElement(InfoBtn2, {
|
|
8256
6828
|
onClick: onToggleInfo,
|
|
8257
6829
|
title: "Mer information"
|
|
8258
|
-
}, /* @__PURE__ */
|
|
6830
|
+
}, /* @__PURE__ */ React65.createElement(IconInfo, {
|
|
8259
6831
|
block: true
|
|
8260
|
-
})))), actionTitle && /* @__PURE__ */
|
|
6832
|
+
})))), actionTitle && /* @__PURE__ */ React65.createElement(Action7, null, /* @__PURE__ */ React65.createElement(ButtonInline, {
|
|
8261
6833
|
onClick,
|
|
8262
6834
|
title: actionTitle
|
|
8263
|
-
}, actionTitle))), body && /* @__PURE__ */
|
|
6835
|
+
}, actionTitle))), body && /* @__PURE__ */ React65.createElement(Body5, null, body)), info && /* @__PURE__ */ React65.createElement(Modal_default, {
|
|
8264
6836
|
title,
|
|
8265
6837
|
onClose: onToggleInfo
|
|
8266
6838
|
}, children));
|
|
@@ -8268,7 +6840,7 @@ var SwitchBar = ({ title, body, actionTitle, children, onClick }) => {
|
|
|
8268
6840
|
var SwitchBar_default = SwitchBar;
|
|
8269
6841
|
|
|
8270
6842
|
// src/layouts/searchItem/BranchModal.tsx
|
|
8271
|
-
import
|
|
6843
|
+
import React66, { useState as useState20, useCallback as useCallback26, useContext as useContext3 } from "react";
|
|
8272
6844
|
|
|
8273
6845
|
// src/State/CentralStorage/CentralStorageContext.ts
|
|
8274
6846
|
import { createContext as createContext3 } from "react";
|
|
@@ -8280,23 +6852,23 @@ var CentralStorageContext = createContext3({
|
|
|
8280
6852
|
// src/layouts/searchItem/BranchModal.tsx
|
|
8281
6853
|
var BranchModal = ({ loading, connections, onClose }) => {
|
|
8282
6854
|
const { centralStorageId, setCentralStorageId } = useContext3(CentralStorageContext);
|
|
8283
|
-
const [localValue, setLocalValue] =
|
|
8284
|
-
const onConfirm =
|
|
6855
|
+
const [localValue, setLocalValue] = useState20(centralStorageId);
|
|
6856
|
+
const onConfirm = useCallback26((id) => {
|
|
8285
6857
|
if (id) {
|
|
8286
6858
|
setCentralStorageId(id);
|
|
8287
6859
|
}
|
|
8288
6860
|
}, []);
|
|
8289
|
-
const onChange =
|
|
6861
|
+
const onChange = useCallback26(
|
|
8290
6862
|
(e) => setLocalValue(e.currentTarget.value),
|
|
8291
6863
|
[]
|
|
8292
6864
|
);
|
|
8293
6865
|
if (!localValue) {
|
|
8294
6866
|
return null;
|
|
8295
6867
|
}
|
|
8296
|
-
return /* @__PURE__ */
|
|
6868
|
+
return /* @__PURE__ */ React66.createElement(Modal_default, {
|
|
8297
6869
|
title: "Byt anl\xE4ggning",
|
|
8298
6870
|
onClose
|
|
8299
|
-
}, /* @__PURE__ */
|
|
6871
|
+
}, /* @__PURE__ */ React66.createElement(Repeat, null, /* @__PURE__ */ React66.createElement(RepeatTiny, null, /* @__PURE__ */ React66.createElement(Content_default, null, /* @__PURE__ */ React66.createElement("p", null, "V\xE4lj den anl\xE4ggning du vill visa kontaktuppgifter f\xF6r."))), /* @__PURE__ */ React66.createElement(RepeatTiny, null, /* @__PURE__ */ React66.createElement(InputLabel_default, null, "V\xE4lj anl\xE4ggning"), /* @__PURE__ */ React66.createElement(InputSelect_default, {
|
|
8300
6872
|
value: localValue,
|
|
8301
6873
|
onChange,
|
|
8302
6874
|
options: connections?.map((x) => ({
|
|
@@ -8304,27 +6876,27 @@ var BranchModal = ({ loading, connections, onClose }) => {
|
|
|
8304
6876
|
displayName: x.name
|
|
8305
6877
|
})),
|
|
8306
6878
|
title: "V\xE4lj anl\xE4ggning"
|
|
8307
|
-
}))), /* @__PURE__ */
|
|
6879
|
+
}))), /* @__PURE__ */ React66.createElement(Repeat, null, /* @__PURE__ */ React66.createElement(ButtonPrimary, {
|
|
8308
6880
|
disabled: loading,
|
|
8309
6881
|
fullWidth: true,
|
|
8310
6882
|
onClick: () => onConfirm(localValue)
|
|
8311
|
-
}, /* @__PURE__ */
|
|
6883
|
+
}, /* @__PURE__ */ React66.createElement(ButtonContent, null, "V\xE4lj"))));
|
|
8312
6884
|
};
|
|
8313
6885
|
var BranchModal_default = BranchModal;
|
|
8314
6886
|
|
|
8315
6887
|
// src/layouts/searchItem/PackageOptionModal.tsx
|
|
8316
|
-
import
|
|
6888
|
+
import React67 from "react";
|
|
8317
6889
|
import { marked as marked4 } from "marked";
|
|
8318
|
-
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */
|
|
6890
|
+
var PackageOptionModal = ({ packageOption, onClose }) => /* @__PURE__ */ React67.createElement(Modal_default, {
|
|
8319
6891
|
title: packageOption.title || "",
|
|
8320
6892
|
onClose
|
|
8321
|
-
}, packageOption.image && /* @__PURE__ */
|
|
6893
|
+
}, packageOption.image && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(LogoBox_default, {
|
|
8322
6894
|
logo: packageOption.image,
|
|
8323
6895
|
alt: packageOption.title || void 0,
|
|
8324
6896
|
wide: true
|
|
8325
|
-
})), packageOption.description && /* @__PURE__ */
|
|
6897
|
+
})), packageOption.description && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(Content_default, {
|
|
8326
6898
|
dangerouslySetInnerHTML: { __html: marked4(packageOption.description) }
|
|
8327
|
-
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */
|
|
6899
|
+
})), packageOption.link?.href && packageOption.link.title && /* @__PURE__ */ React67.createElement(Repeat, null, /* @__PURE__ */ React67.createElement(ButtonInline, {
|
|
8328
6900
|
as: "a",
|
|
8329
6901
|
href: packageOption.link.href,
|
|
8330
6902
|
target: "_blank",
|
|
@@ -8342,90 +6914,90 @@ var CheckList = ({
|
|
|
8342
6914
|
toggleEcomModal,
|
|
8343
6915
|
loadingCentralStorageVehicle
|
|
8344
6916
|
}) => {
|
|
8345
|
-
const [modalBranch, setModalBranch] =
|
|
8346
|
-
const openModalBranch =
|
|
8347
|
-
const closeModalBranch =
|
|
8348
|
-
const [modal, setModal] =
|
|
8349
|
-
const onOpen =
|
|
8350
|
-
const onClose =
|
|
8351
|
-
|
|
6917
|
+
const [modalBranch, setModalBranch] = useState21(false);
|
|
6918
|
+
const openModalBranch = useCallback27(() => setModalBranch(true), []);
|
|
6919
|
+
const closeModalBranch = useCallback27(() => setModalBranch(false), []);
|
|
6920
|
+
const [modal, setModal] = useState21();
|
|
6921
|
+
const onOpen = useCallback27((nextModal) => setModal(nextModal), []);
|
|
6922
|
+
const onClose = useCallback27(() => setModal(void 0), []);
|
|
6923
|
+
useEffect9(() => {
|
|
8352
6924
|
if ((branch || contact) && modalBranch) {
|
|
8353
6925
|
setModalBranch(false);
|
|
8354
6926
|
}
|
|
8355
6927
|
}, [branch, contact]);
|
|
8356
6928
|
const packageOption = manufacturer?.packageOption;
|
|
8357
|
-
return /* @__PURE__ */
|
|
6929
|
+
return /* @__PURE__ */ React68.createElement(React68.Fragment, null, modalBranch && /* @__PURE__ */ React68.createElement(BranchModal_default, {
|
|
8358
6930
|
loading: loadingCentralStorageVehicle,
|
|
8359
6931
|
connections: branch?.connections,
|
|
8360
6932
|
onClose: closeModalBranch
|
|
8361
|
-
}), modal && /* @__PURE__ */
|
|
6933
|
+
}), modal && /* @__PURE__ */ React68.createElement(PackageOptionModal_default, {
|
|
8362
6934
|
packageOption: modal,
|
|
8363
6935
|
onClose
|
|
8364
|
-
}), /* @__PURE__ */
|
|
6936
|
+
}), /* @__PURE__ */ React68.createElement(Repeat, null, /* @__PURE__ */ React68.createElement(CheckMarkList_default, null, packageOption?.title && /* @__PURE__ */ React68.createElement(CheckMarkListItem, null, /* @__PURE__ */ React68.createElement(React68.Fragment, null, "Inkl.", " ", /* @__PURE__ */ React68.createElement(ButtonInline, {
|
|
8365
6937
|
onClick: () => onOpen({
|
|
8366
6938
|
title: packageOption?.title,
|
|
8367
6939
|
image: packageOption?.image,
|
|
8368
6940
|
description: packageOption?.description,
|
|
8369
6941
|
link: packageOption?.link
|
|
8370
6942
|
})
|
|
8371
|
-
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */
|
|
6943
|
+
}, packageOption.title), " ", "begagnatgaranti")), packageOptions?.map((packageOption2, index2) => /* @__PURE__ */ React68.createElement(CheckMarkListItem, {
|
|
8372
6944
|
key: packageOption2.title || index2
|
|
8373
|
-
}, /* @__PURE__ */
|
|
6945
|
+
}, /* @__PURE__ */ React68.createElement(React68.Fragment, null, "Inkl.", " ", /* @__PURE__ */ React68.createElement(ButtonInline, {
|
|
8374
6946
|
onClick: () => onOpen({
|
|
8375
6947
|
title: packageOption2?.title,
|
|
8376
6948
|
image: packageOption2?.image,
|
|
8377
6949
|
description: packageOption2?.description,
|
|
8378
6950
|
link: packageOption2?.link
|
|
8379
6951
|
})
|
|
8380
|
-
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */
|
|
6952
|
+
}, packageOption2.title)))), ecommerce?.withHomeDelivery && /* @__PURE__ */ React68.createElement(CheckMarkListItem, null, "Hemleverans"))), /* @__PURE__ */ React68.createElement(Repeat, null, ecommerce && ecommerce.enabled && /* @__PURE__ */ React68.createElement(RepeatTiny, null, /* @__PURE__ */ React68.createElement(ButtonPrimary, {
|
|
8381
6953
|
disabled: !!ecommerce.reserved,
|
|
8382
6954
|
fullWidth: true,
|
|
8383
6955
|
onClick: toggleEcomModal
|
|
8384
|
-
}, /* @__PURE__ */
|
|
6956
|
+
}, /* @__PURE__ */ React68.createElement(ButtonContent, null, "K\xF6p bilen online"))), ecommerce?.reserved && /* @__PURE__ */ React68.createElement(RepeatTiny, null, /* @__PURE__ */ React68.createElement(SwitchBar_default, {
|
|
8385
6957
|
title: "Bilen \xE4r reserverad",
|
|
8386
6958
|
body: "Denna bil \xE4r reserverad av en annan k\xF6pare."
|
|
8387
|
-
}, /* @__PURE__ */
|
|
6959
|
+
}, /* @__PURE__ */ React68.createElement(Content_default, null, /* @__PURE__ */ React68.createElement("p", null, "Denna bil \xE4r reserverad av en annan k\xF6pare.")))), /* @__PURE__ */ React68.createElement(ActionList_default, {
|
|
8388
6960
|
branch,
|
|
8389
6961
|
contact
|
|
8390
|
-
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */
|
|
6962
|
+
})), (branch?.connections.length || 0) > 1 && /* @__PURE__ */ React68.createElement(Repeat, null, /* @__PURE__ */ React68.createElement(SwitchBar_default, {
|
|
8391
6963
|
title: "Centrallagerbil",
|
|
8392
6964
|
actionTitle: "Byt anl\xE4ggning",
|
|
8393
6965
|
onClick: openModalBranch
|
|
8394
|
-
}, /* @__PURE__ */
|
|
6966
|
+
}, /* @__PURE__ */ React68.createElement(Content_default, null, /* @__PURE__ */ React68.createElement("p", null, "Denna bil tillh\xF6r ett centrallager och g\xE5r att k\xF6pa genom flera anl\xE4ggningar. Byt anl\xE4ggning f\xF6r att visa kontaktuppgifter till just den anl\xE4ggningen.")))));
|
|
8395
6967
|
};
|
|
8396
6968
|
var CheckList_default = CheckList;
|
|
8397
6969
|
|
|
8398
6970
|
// src/layouts/searchItem/Related.tsx
|
|
8399
|
-
import
|
|
6971
|
+
import React70, { useCallback as useCallback28 } from "react";
|
|
8400
6972
|
|
|
8401
6973
|
// src/components/SectionHeader/index.tsx
|
|
8402
|
-
import
|
|
6974
|
+
import React69 from "react";
|
|
8403
6975
|
|
|
8404
6976
|
// src/components/SectionHeader/wrapper.tsx
|
|
8405
|
-
import
|
|
8406
|
-
var
|
|
6977
|
+
import styled49 from "styled-components";
|
|
6978
|
+
var Wrapper27 = styled49.div`
|
|
8407
6979
|
display: flex;
|
|
8408
6980
|
align-items: center;
|
|
8409
6981
|
`;
|
|
8410
|
-
var Heading7 =
|
|
6982
|
+
var Heading7 = styled49.div`
|
|
8411
6983
|
flex: 1 1 auto;
|
|
8412
6984
|
`;
|
|
8413
|
-
var Action8 =
|
|
6985
|
+
var Action8 = styled49.div`
|
|
8414
6986
|
flex-shrink: 0;
|
|
8415
6987
|
padding-left: ${size(2)};
|
|
8416
6988
|
`;
|
|
8417
6989
|
|
|
8418
6990
|
// src/components/SectionHeader/index.tsx
|
|
8419
|
-
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */
|
|
6991
|
+
var SectionHeader = ({ children, onClick, actionTitle }) => /* @__PURE__ */ React69.createElement(Wrapper27, null, /* @__PURE__ */ React69.createElement(Heading7, null, children), onClick && actionTitle && /* @__PURE__ */ React69.createElement(Action8, null, /* @__PURE__ */ React69.createElement(ButtonClear, {
|
|
8420
6992
|
as: "a",
|
|
8421
6993
|
href: "#",
|
|
8422
6994
|
onClick
|
|
8423
|
-
}, /* @__PURE__ */
|
|
6995
|
+
}, /* @__PURE__ */ React69.createElement(ButtonContent, null, actionTitle))));
|
|
8424
6996
|
var SectionHeader_default = SectionHeader;
|
|
8425
6997
|
|
|
8426
6998
|
// src/components/OverflowGrid/index.tsx
|
|
8427
|
-
import
|
|
8428
|
-
var OverflowGrid =
|
|
6999
|
+
import styled50 from "styled-components";
|
|
7000
|
+
var OverflowGrid = styled50.div`
|
|
8429
7001
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
8430
7002
|
${Wrapper} & {
|
|
8431
7003
|
margin-left: ${size(-3)};
|
|
@@ -8440,7 +7012,7 @@ var OverflowGrid = styled55.div`
|
|
|
8440
7012
|
}
|
|
8441
7013
|
}
|
|
8442
7014
|
`;
|
|
8443
|
-
var OverflowGridList =
|
|
7015
|
+
var OverflowGridList = styled50.ul`
|
|
8444
7016
|
display: flex;
|
|
8445
7017
|
align-items: flex-start;
|
|
8446
7018
|
list-style: none;
|
|
@@ -8472,7 +7044,7 @@ var OverflowGridList = styled55.ul`
|
|
|
8472
7044
|
}
|
|
8473
7045
|
}
|
|
8474
7046
|
`;
|
|
8475
|
-
var OverflowGridItem =
|
|
7047
|
+
var OverflowGridItem = styled50.li`
|
|
8476
7048
|
flex: 1 0 auto;
|
|
8477
7049
|
width: calc(100% - ${size(2)});
|
|
8478
7050
|
max-width: calc(100% - ${size(2)});
|
|
@@ -8490,7 +7062,7 @@ var OverflowGridItem = styled55.li`
|
|
|
8490
7062
|
`;
|
|
8491
7063
|
|
|
8492
7064
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
8493
|
-
import { useContext as useContext4, useEffect as
|
|
7065
|
+
import { useContext as useContext4, useEffect as useEffect10 } from "react";
|
|
8494
7066
|
|
|
8495
7067
|
// src/State/RelatedSearch/RelatedSearchContext.ts
|
|
8496
7068
|
import { createContext as createContext4 } from "react";
|
|
@@ -8506,7 +7078,7 @@ var RelatedSearchContext = createContext4({
|
|
|
8506
7078
|
// src/State/RelatedSearch/useRelatedSearch.ts
|
|
8507
7079
|
var useRelatedSearch = (id) => {
|
|
8508
7080
|
const data = useContext4(RelatedSearchContext);
|
|
8509
|
-
|
|
7081
|
+
useEffect10(() => {
|
|
8510
7082
|
const searchParams = new URLSearchParams();
|
|
8511
7083
|
searchParams.set("hits", "3");
|
|
8512
7084
|
if (data.moreLikeThisUrl && id) {
|
|
@@ -8532,7 +7104,7 @@ var regexPathGuid = (path) => {
|
|
|
8532
7104
|
// src/layouts/searchItem/Related.tsx
|
|
8533
7105
|
var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
8534
7106
|
const { loading, response, moreLikeThisUrl } = useRelatedSearch_default(id);
|
|
8535
|
-
const onItemClicked =
|
|
7107
|
+
const onItemClicked = useCallback28((id2) => {
|
|
8536
7108
|
pubsub_default.publish("ItemClicked", id2);
|
|
8537
7109
|
if (onClickSearchItem) {
|
|
8538
7110
|
onClickSearchItem(id2);
|
|
@@ -8542,30 +7114,30 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
8542
7114
|
return null;
|
|
8543
7115
|
}
|
|
8544
7116
|
if (loading) {
|
|
8545
|
-
return /* @__PURE__ */
|
|
7117
|
+
return /* @__PURE__ */ React70.createElement(Loader_default, null);
|
|
8546
7118
|
}
|
|
8547
|
-
return /* @__PURE__ */
|
|
7119
|
+
return /* @__PURE__ */ React70.createElement(PageSection, {
|
|
8548
7120
|
accent: true,
|
|
8549
7121
|
large: true,
|
|
8550
7122
|
className: "wayke__theme wayke__color--accent-bg"
|
|
8551
|
-
}, /* @__PURE__ */
|
|
7123
|
+
}, /* @__PURE__ */ React70.createElement(Container_default, null, moreLikeThisUrl ? /* @__PURE__ */ React70.createElement(Repeat, null, /* @__PURE__ */ React70.createElement(SectionHeader_default, {
|
|
8552
7124
|
onClick: () => {
|
|
8553
7125
|
}
|
|
8554
|
-
}, /* @__PURE__ */
|
|
7126
|
+
}, /* @__PURE__ */ React70.createElement(H2, {
|
|
8555
7127
|
noMargin: true
|
|
8556
|
-
}, "Relaterade fordon"))) : /* @__PURE__ */
|
|
7128
|
+
}, "Relaterade fordon"))) : /* @__PURE__ */ React70.createElement(Repeat, null, /* @__PURE__ */ React70.createElement(SectionHeader_default, {
|
|
8557
7129
|
onClick: () => {
|
|
8558
7130
|
},
|
|
8559
7131
|
actionTitle: "Visa alla"
|
|
8560
|
-
}, /* @__PURE__ */
|
|
7132
|
+
}, /* @__PURE__ */ React70.createElement(H2, {
|
|
8561
7133
|
noMargin: true
|
|
8562
|
-
}, "Senast inkomna"))), /* @__PURE__ */
|
|
7134
|
+
}, "Senast inkomna"))), /* @__PURE__ */ React70.createElement(Repeat, null, /* @__PURE__ */ React70.createElement(OverflowGrid, null, /* @__PURE__ */ React70.createElement(OverflowGridList, null, response?.documentList.documents.map((document2) => {
|
|
8563
7135
|
const prefix = pathRoute ? `/${pathRoute}` : "/";
|
|
8564
7136
|
const r = regexPathGuid(pathRoute);
|
|
8565
7137
|
const pathRouteUrl = window.location.pathname === "/" ? `${prefix}${document2._id}` : r.test(`${pathRoute}${id}`) ? window.location.pathname.replace(r, `${pathRoute}${document2._id}`) : `${window.location.pathname}${prefix}${document2._id}`;
|
|
8566
|
-
return /* @__PURE__ */
|
|
7138
|
+
return /* @__PURE__ */ React70.createElement(OverflowGridItem, {
|
|
8567
7139
|
key: document2._id
|
|
8568
|
-
}, /* @__PURE__ */
|
|
7140
|
+
}, /* @__PURE__ */ React70.createElement(ProductCard_default, {
|
|
8569
7141
|
id: document2._id,
|
|
8570
7142
|
onClick: onItemClicked,
|
|
8571
7143
|
title: document2.title,
|
|
@@ -8595,24 +7167,24 @@ var Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
|
|
|
8595
7167
|
var Related_default = Related;
|
|
8596
7168
|
|
|
8597
7169
|
// src/layouts/searchItem/PackageOptions.tsx
|
|
8598
|
-
import
|
|
7170
|
+
import React71 from "react";
|
|
8599
7171
|
import { marked as marked5 } from "marked";
|
|
8600
7172
|
var PackageOptions = ({ packageOptions }) => {
|
|
8601
7173
|
if (!packageOptions) {
|
|
8602
7174
|
return null;
|
|
8603
7175
|
}
|
|
8604
|
-
return /* @__PURE__ */
|
|
7176
|
+
return /* @__PURE__ */ React71.createElement(React71.Fragment, null, packageOptions.map((packageOption, index2) => /* @__PURE__ */ React71.createElement(ProductPageMainSection, {
|
|
8605
7177
|
key: packageOption.title || index2
|
|
8606
|
-
}, /* @__PURE__ */
|
|
7178
|
+
}, /* @__PURE__ */ React71.createElement(Repeat, null, /* @__PURE__ */ React71.createElement(H2, {
|
|
8607
7179
|
noMargin: true
|
|
8608
|
-
}, packageOption.title)), packageOption.description && /* @__PURE__ */
|
|
7180
|
+
}, packageOption.title)), packageOption.description && /* @__PURE__ */ React71.createElement(Repeat, null, /* @__PURE__ */ React71.createElement(Content_default, {
|
|
8609
7181
|
dangerouslySetInnerHTML: { __html: marked5(packageOption.description) }
|
|
8610
|
-
})), packageOption.link?.url && /* @__PURE__ */
|
|
7182
|
+
})), packageOption.link?.url && /* @__PURE__ */ React71.createElement(Repeat, null, /* @__PURE__ */ React71.createElement(ButtonInline, {
|
|
8611
7183
|
as: "a",
|
|
8612
7184
|
href: packageOption.link.url,
|
|
8613
7185
|
target: "_blank",
|
|
8614
7186
|
rel: "noopener noreferrer"
|
|
8615
|
-
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */
|
|
7187
|
+
}, packageOption.link.title ? packageOption.link.title : "L\xE4s mer (\xD6ppnas i ett nytt f\xF6nster)")), packageOption.image && /* @__PURE__ */ React71.createElement(Repeat, null, /* @__PURE__ */ React71.createElement(LogoBox_default, {
|
|
8616
7188
|
logo: packageOption.image,
|
|
8617
7189
|
alt: "Logotyp",
|
|
8618
7190
|
wide: true
|
|
@@ -8621,31 +7193,31 @@ var PackageOptions = ({ packageOptions }) => {
|
|
|
8621
7193
|
var PackageOptions_default = PackageOptions;
|
|
8622
7194
|
|
|
8623
7195
|
// src/layouts/searchItem/Branch.tsx
|
|
8624
|
-
import
|
|
7196
|
+
import React76, { useState as useState24, useCallback as useCallback31, useEffect as useEffect11 } from "react";
|
|
8625
7197
|
|
|
8626
7198
|
// src/components/TableColumn/index.tsx
|
|
8627
|
-
import
|
|
8628
|
-
var TableColumn =
|
|
7199
|
+
import styled51 from "styled-components";
|
|
7200
|
+
var TableColumn = styled51.div`
|
|
8629
7201
|
line-height: 1.2;
|
|
8630
7202
|
`;
|
|
8631
|
-
var TableColumnRow =
|
|
7203
|
+
var TableColumnRow = styled51.div`
|
|
8632
7204
|
display: flex;
|
|
8633
7205
|
align-items: flex-start;
|
|
8634
7206
|
margin: ${size(-1)};
|
|
8635
7207
|
`;
|
|
8636
|
-
var TableColumnCell =
|
|
7208
|
+
var TableColumnCell = styled51.div`
|
|
8637
7209
|
flex: 1 0 50%;
|
|
8638
7210
|
padding: ${size(1)};
|
|
8639
7211
|
`;
|
|
8640
7212
|
|
|
8641
7213
|
// src/components/OpeningHours/index.tsx
|
|
8642
|
-
import
|
|
7214
|
+
import React73, { useMemo as useMemo4 } from "react";
|
|
8643
7215
|
|
|
8644
7216
|
// src/components/Badge/index.tsx
|
|
8645
|
-
import
|
|
7217
|
+
import React72 from "react";
|
|
8646
7218
|
|
|
8647
7219
|
// src/components/Badge/wrapper.tsx
|
|
8648
|
-
import
|
|
7220
|
+
import styled52 from "styled-components";
|
|
8649
7221
|
var getBg = (severity) => {
|
|
8650
7222
|
let bg = theme_default.color.textDark;
|
|
8651
7223
|
if (severity === "positive") {
|
|
@@ -8655,7 +7227,7 @@ var getBg = (severity) => {
|
|
|
8655
7227
|
}
|
|
8656
7228
|
return bg;
|
|
8657
7229
|
};
|
|
8658
|
-
var
|
|
7230
|
+
var Wrapper28 = styled52.div.attrs(() => ({
|
|
8659
7231
|
className: "wayke__theme wayke__font--bold"
|
|
8660
7232
|
}))`
|
|
8661
7233
|
display: inline-block;
|
|
@@ -8668,7 +7240,7 @@ var Wrapper32 = styled57.div.attrs(() => ({
|
|
|
8668
7240
|
`;
|
|
8669
7241
|
|
|
8670
7242
|
// src/components/Badge/index.tsx
|
|
8671
|
-
var Badge = ({ label, severity }) => /* @__PURE__ */
|
|
7243
|
+
var Badge = ({ label, severity }) => /* @__PURE__ */ React72.createElement(Wrapper28, {
|
|
8672
7244
|
severity
|
|
8673
7245
|
}, label);
|
|
8674
7246
|
var Badge_default = Badge;
|
|
@@ -8752,33 +7324,33 @@ var OpeningHours = ({ openingHours }) => {
|
|
|
8752
7324
|
if (!oh) {
|
|
8753
7325
|
return null;
|
|
8754
7326
|
}
|
|
8755
|
-
return /* @__PURE__ */
|
|
7327
|
+
return /* @__PURE__ */ React73.createElement(React73.Fragment, null, /* @__PURE__ */ React73.createElement(RepeatSmall, null, /* @__PURE__ */ React73.createElement(Badge_default, {
|
|
8756
7328
|
label: currentlyOpen ? "\xD6ppet" : "St\xE4ngt",
|
|
8757
7329
|
severity: currentlyOpen ? "positive" : "negative"
|
|
8758
|
-
})), /* @__PURE__ */
|
|
7330
|
+
})), /* @__PURE__ */ React73.createElement(RepeatSmall, null, /* @__PURE__ */ React73.createElement(TableColumn, null, /* @__PURE__ */ React73.createElement(TableColumnRow, null, /* @__PURE__ */ React73.createElement(TableColumnCell, null, /* @__PURE__ */ React73.createElement(UtilityTextBold, null, today?.title)), /* @__PURE__ */ React73.createElement(TableColumnCell, null, /* @__PURE__ */ React73.createElement(UtilityTextBold, null, today?.from ? `${today.from}-${today.until}` : "St\xE4ngt"))), oh.map((o) => /* @__PURE__ */ React73.createElement(TableColumnRow, {
|
|
8759
7331
|
key: o.titleFrom
|
|
8760
|
-
}, /* @__PURE__ */
|
|
7332
|
+
}, /* @__PURE__ */ React73.createElement(TableColumnCell, null, o.titleTo ? `${o.titleFrom}-${o.titleTo}` : o.titleFrom), /* @__PURE__ */ React73.createElement(TableColumnCell, null, o.from ? `${o.from}-${o.until}` : "St\xE4ngt"))))));
|
|
8761
7333
|
};
|
|
8762
7334
|
var OpeningHours_default = OpeningHours;
|
|
8763
7335
|
|
|
8764
7336
|
// src/components/PhoneNumber/index.tsx
|
|
8765
|
-
import
|
|
7337
|
+
import React74, { useState as useState22, useCallback as useCallback29 } from "react";
|
|
8766
7338
|
var PhoneNumber = ({ phoneNumber }) => {
|
|
8767
|
-
const [visible, setVisible] =
|
|
8768
|
-
const onClick =
|
|
8769
|
-
return /* @__PURE__ */
|
|
7339
|
+
const [visible, setVisible] = useState22(false);
|
|
7340
|
+
const onClick = useCallback29(() => !visible && setVisible(true), [visible]);
|
|
7341
|
+
return /* @__PURE__ */ React74.createElement(TableColumnRow, null, /* @__PURE__ */ React74.createElement(TableColumnCell, null, "Telefonnummer"), /* @__PURE__ */ React74.createElement(TableColumnCell, null, visible ? /* @__PURE__ */ React74.createElement(ButtonInlineBold, {
|
|
8770
7342
|
as: "a",
|
|
8771
7343
|
href: `tel:${phoneNumber}`,
|
|
8772
7344
|
title: `Ring ${phoneNumber}`
|
|
8773
|
-
}, /* @__PURE__ */
|
|
7345
|
+
}, /* @__PURE__ */ React74.createElement(ButtonContent, null, phoneNumber)) : /* @__PURE__ */ React74.createElement(ButtonInlineBold, {
|
|
8774
7346
|
onClick,
|
|
8775
7347
|
title: "Visa telefonnummer"
|
|
8776
|
-
}, /* @__PURE__ */
|
|
7348
|
+
}, /* @__PURE__ */ React74.createElement(ButtonContent, null, "Visa telefonnummer"))));
|
|
8777
7349
|
};
|
|
8778
7350
|
var PhoneNumber_default = PhoneNumber;
|
|
8779
7351
|
|
|
8780
7352
|
// src/components/Map/index.tsx
|
|
8781
|
-
import
|
|
7353
|
+
import React75, { useState as useState23, useCallback as useCallback30 } from "react";
|
|
8782
7354
|
|
|
8783
7355
|
// src/State/Settings/useSettings.ts
|
|
8784
7356
|
import { useContext as useContext5 } from "react";
|
|
@@ -8792,16 +7364,16 @@ var useSettings = () => useContext5(SettingsContext);
|
|
|
8792
7364
|
var useSettings_default = useSettings;
|
|
8793
7365
|
|
|
8794
7366
|
// src/components/Map/wrapper.tsx
|
|
8795
|
-
import
|
|
8796
|
-
var
|
|
7367
|
+
import styled53 from "styled-components";
|
|
7368
|
+
var Wrapper29 = styled53.a`
|
|
8797
7369
|
display: block;
|
|
8798
7370
|
`;
|
|
8799
|
-
var
|
|
7371
|
+
var Image3 = styled53.img`
|
|
8800
7372
|
display: block;
|
|
8801
7373
|
width: 100%;
|
|
8802
7374
|
border-radius: 3px;
|
|
8803
7375
|
`;
|
|
8804
|
-
var Placeholder =
|
|
7376
|
+
var Placeholder = styled53.a`
|
|
8805
7377
|
display: block;
|
|
8806
7378
|
position: relative;
|
|
8807
7379
|
width: 100%;
|
|
@@ -8811,7 +7383,7 @@ var Placeholder = styled58.a`
|
|
|
8811
7383
|
border-radius: 3px;
|
|
8812
7384
|
color: ${(props) => props.theme.color.textDark};
|
|
8813
7385
|
`;
|
|
8814
|
-
var PlaceholderAction =
|
|
7386
|
+
var PlaceholderAction = styled53.div`
|
|
8815
7387
|
position: absolute;
|
|
8816
7388
|
top: 50%;
|
|
8817
7389
|
left: 50%;
|
|
@@ -8821,8 +7393,8 @@ var PlaceholderAction = styled58.div`
|
|
|
8821
7393
|
// src/components/Map/index.tsx
|
|
8822
7394
|
var StaticMap = ({ position }) => {
|
|
8823
7395
|
const { googleMapsApiKey, googleMapsMarker } = useSettings_default();
|
|
8824
|
-
const [visible, setVisible] =
|
|
8825
|
-
const onShowMap =
|
|
7396
|
+
const [visible, setVisible] = useState23(false);
|
|
7397
|
+
const onShowMap = useCallback30((e) => {
|
|
8826
7398
|
if (googleMapsApiKey) {
|
|
8827
7399
|
e.preventDefault();
|
|
8828
7400
|
setVisible(true);
|
|
@@ -8833,33 +7405,33 @@ var StaticMap = ({ position }) => {
|
|
|
8833
7405
|
}
|
|
8834
7406
|
const { latitude, longitude } = position;
|
|
8835
7407
|
if (visible && googleMapsApiKey) {
|
|
8836
|
-
return /* @__PURE__ */
|
|
7408
|
+
return /* @__PURE__ */ React75.createElement(Wrapper29, {
|
|
8837
7409
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
8838
7410
|
title: "Visa p\xE5 Google Maps",
|
|
8839
7411
|
target: "_blank",
|
|
8840
7412
|
rel: "nofollow noopener noreferrer"
|
|
8841
|
-
}, /* @__PURE__ */
|
|
7413
|
+
}, /* @__PURE__ */ React75.createElement(Image3, {
|
|
8842
7414
|
src: `https://maps.googleapis.com/maps/api/staticmap?center=${latitude},${longitude}&zoom=10&size=640x280&maptype=roadmap&markers=${googleMapsMarker ? `icon:${encodeURIComponent(googleMapsMarker)}` : ""}%7C${latitude},${longitude}&key=${googleMapsApiKey}`,
|
|
8843
7415
|
alt: "Karta"
|
|
8844
7416
|
}));
|
|
8845
7417
|
}
|
|
8846
|
-
return /* @__PURE__ */
|
|
7418
|
+
return /* @__PURE__ */ React75.createElement(Placeholder, {
|
|
8847
7419
|
href: `http://maps.google.com/maps?q=${latitude},${longitude}`,
|
|
8848
7420
|
target: "_blank",
|
|
8849
7421
|
rel: "noopener noreferrer nofollow",
|
|
8850
7422
|
onClick: onShowMap
|
|
8851
|
-
}, /* @__PURE__ */
|
|
7423
|
+
}, /* @__PURE__ */ React75.createElement(PlaceholderAction, null, /* @__PURE__ */ React75.createElement(ButtonSecondary, {
|
|
8852
7424
|
as: "div"
|
|
8853
|
-
}, /* @__PURE__ */
|
|
7425
|
+
}, /* @__PURE__ */ React75.createElement(ButtonContent, null, "Visa karta"))));
|
|
8854
7426
|
};
|
|
8855
7427
|
var Map_default = StaticMap;
|
|
8856
7428
|
|
|
8857
7429
|
// src/layouts/searchItem/Branch.tsx
|
|
8858
7430
|
var Branch2 = ({ branch, loading }) => {
|
|
8859
|
-
const [modal, setModal] =
|
|
8860
|
-
const openModal =
|
|
8861
|
-
const closeModal =
|
|
8862
|
-
|
|
7431
|
+
const [modal, setModal] = useState24(false);
|
|
7432
|
+
const openModal = useCallback31(() => setModal(true), []);
|
|
7433
|
+
const closeModal = useCallback31(() => setModal(false), []);
|
|
7434
|
+
useEffect11(() => {
|
|
8863
7435
|
if (branch && modal) {
|
|
8864
7436
|
setModal(false);
|
|
8865
7437
|
}
|
|
@@ -8867,29 +7439,29 @@ var Branch2 = ({ branch, loading }) => {
|
|
|
8867
7439
|
if (!branch) {
|
|
8868
7440
|
return null;
|
|
8869
7441
|
}
|
|
8870
|
-
return /* @__PURE__ */
|
|
7442
|
+
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, modal && /* @__PURE__ */ React76.createElement(BranchModal_default, {
|
|
8871
7443
|
loading,
|
|
8872
7444
|
connections: branch?.connections,
|
|
8873
7445
|
onClose: closeModal
|
|
8874
|
-
}), /* @__PURE__ */
|
|
7446
|
+
}), /* @__PURE__ */ React76.createElement(Repeat, null, /* @__PURE__ */ React76.createElement(H2, {
|
|
8875
7447
|
noMargin: true
|
|
8876
|
-
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */
|
|
7448
|
+
}, branch?.location?.city ? `Den h\xE4r bilen finns p\xE5 v\xE5r anl\xE4ggning i ${branch?.location?.city}` : "Kontakt")), /* @__PURE__ */ React76.createElement(Repeat, null, /* @__PURE__ */ React76.createElement(Map_default, {
|
|
8877
7449
|
position: branch?.location?.position
|
|
8878
|
-
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */
|
|
7450
|
+
})), (branch?.connections?.length || 0) > 1 && /* @__PURE__ */ React76.createElement(Repeat, null, /* @__PURE__ */ React76.createElement(Content_default, null, /* @__PURE__ */ React76.createElement("p", null, "Denna bil tillh\xF6r ett centrallager och g\xE5r att k\xF6pa genom flera anl\xE4ggningar.", " ", /* @__PURE__ */ React76.createElement(ButtonInline, {
|
|
8879
7451
|
as: "span",
|
|
8880
7452
|
role: "button",
|
|
8881
7453
|
onClick: openModal,
|
|
8882
7454
|
inline: true
|
|
8883
|
-
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */
|
|
7455
|
+
}, "Klicka h\xE4r f\xF6r att visa kontaktuppgifter till en annan anl\xE4ggning"), "."))), /* @__PURE__ */ React76.createElement(Repeat, null, /* @__PURE__ */ React76.createElement(ProductPageContentLimit, null, /* @__PURE__ */ React76.createElement(Repeat, null, /* @__PURE__ */ React76.createElement(TableColumn, null, branch?.location?.streetAddress && branch?.location?.city && /* @__PURE__ */ React76.createElement(TableColumnRow, null, /* @__PURE__ */ React76.createElement(TableColumnCell, null, "Adress"), /* @__PURE__ */ React76.createElement(TableColumnCell, null, /* @__PURE__ */ React76.createElement(ButtonInlineBold, null, /* @__PURE__ */ React76.createElement(ButtonContent, null, `${branch?.location?.streetAddress}, ${branch?.location?.city}`)))), branch?.contact?.phonenumber && /* @__PURE__ */ React76.createElement(PhoneNumber_default, {
|
|
8884
7456
|
phoneNumber: formatPhonenumber(branch.contact.phonenumber)
|
|
8885
|
-
}))), branch?.openingHours && /* @__PURE__ */
|
|
7457
|
+
}))), branch?.openingHours && /* @__PURE__ */ React76.createElement(Repeat, null, /* @__PURE__ */ React76.createElement(OpeningHours_default, {
|
|
8886
7458
|
openingHours: branch.openingHours
|
|
8887
7459
|
})))));
|
|
8888
7460
|
};
|
|
8889
7461
|
var Branch_default = Branch2;
|
|
8890
7462
|
|
|
8891
7463
|
// src/State/CentralStorage/useCentralStorage.ts
|
|
8892
|
-
import { useContext as useContext6, useEffect as
|
|
7464
|
+
import { useContext as useContext6, useEffect as useEffect12 } from "react";
|
|
8893
7465
|
|
|
8894
7466
|
// src/hooks/useSearchItemBranch.ts
|
|
8895
7467
|
import { useQuery as useQuery4 } from "@apollo/client";
|
|
@@ -9026,7 +7598,7 @@ var useCentralStorage = (vehicle) => {
|
|
|
9026
7598
|
const connections = vehicle?.branch?.connections;
|
|
9027
7599
|
const branchId = centralStorageId ? connections?.find((x) => x.id === centralStorageId)?.id : void 0;
|
|
9028
7600
|
const { data, loading } = useSearchItemBranch_default(vehicle?.id, branchId);
|
|
9029
|
-
|
|
7601
|
+
useEffect12(() => {
|
|
9030
7602
|
if ((connections?.length || 0) > 0) {
|
|
9031
7603
|
const match = centralStorageId ? connections?.find((x) => x.id === centralStorageId) : void 0;
|
|
9032
7604
|
if (!match) {
|
|
@@ -9045,23 +7617,23 @@ var useCentralStorage = (vehicle) => {
|
|
|
9045
7617
|
var useCentralStorage_default = useCentralStorage;
|
|
9046
7618
|
|
|
9047
7619
|
// src/layouts/searchItem/Page404.tsx
|
|
9048
|
-
import
|
|
9049
|
-
var Page404 = () => /* @__PURE__ */
|
|
7620
|
+
import React77 from "react";
|
|
7621
|
+
var Page404 = () => /* @__PURE__ */ React77.createElement(Page, null, /* @__PURE__ */ React77.createElement(PageSection, {
|
|
9050
7622
|
large: true
|
|
9051
|
-
}, /* @__PURE__ */
|
|
7623
|
+
}, /* @__PURE__ */ React77.createElement(Container_default, null, /* @__PURE__ */ React77.createElement(H1, {
|
|
9052
7624
|
noMargin: true
|
|
9053
7625
|
}, "404"))));
|
|
9054
7626
|
var Page404_default = Page404;
|
|
9055
7627
|
|
|
9056
7628
|
// src/layouts/searchItem/PageLoading.tsx
|
|
9057
|
-
import
|
|
9058
|
-
var PageLoading = () => /* @__PURE__ */
|
|
7629
|
+
import React78 from "react";
|
|
7630
|
+
var PageLoading = () => /* @__PURE__ */ React78.createElement(Page, null, /* @__PURE__ */ React78.createElement(PageSection, {
|
|
9059
7631
|
large: true
|
|
9060
|
-
}, /* @__PURE__ */
|
|
7632
|
+
}, /* @__PURE__ */ React78.createElement(Container_default, null, /* @__PURE__ */ React78.createElement(Loader_default, null))));
|
|
9061
7633
|
var PageLoading_default = PageLoading;
|
|
9062
7634
|
|
|
9063
7635
|
// src/layouts/searchItem/Property.tsx
|
|
9064
|
-
import
|
|
7636
|
+
import React81, { useCallback as useCallback33, useEffect as useEffect13, useMemo as useMemo5, useState as useState26 } from "react";
|
|
9065
7637
|
|
|
9066
7638
|
// src/utils/vehicle-properties/property-tree-creator.ts
|
|
9067
7639
|
var _PropertyTreeCreator = class {
|
|
@@ -9554,11 +8126,11 @@ var property_remover_default = (properties) => {
|
|
|
9554
8126
|
};
|
|
9555
8127
|
|
|
9556
8128
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
9557
|
-
import
|
|
8129
|
+
import React79, { useState as useState25, useCallback as useCallback32 } from "react";
|
|
9558
8130
|
|
|
9559
8131
|
// src/components/TableList/index.tsx
|
|
9560
|
-
import
|
|
9561
|
-
var TableList =
|
|
8132
|
+
import styled54 from "styled-components";
|
|
8133
|
+
var TableList = styled54.ul`
|
|
9562
8134
|
list-style: none;
|
|
9563
8135
|
padding: 0;
|
|
9564
8136
|
margin: 0;
|
|
@@ -9566,7 +8138,7 @@ var TableList = styled59.ul`
|
|
|
9566
8138
|
border-bottom: 1px solid ${(props) => props.theme.color.border};
|
|
9567
8139
|
font-size: 0.875rem;
|
|
9568
8140
|
`;
|
|
9569
|
-
var TableListItem =
|
|
8141
|
+
var TableListItem = styled54.li`
|
|
9570
8142
|
display: flex;
|
|
9571
8143
|
align-items: center;
|
|
9572
8144
|
padding: ${size(1)} 0;
|
|
@@ -9575,30 +8147,30 @@ var TableListItem = styled59.li`
|
|
|
9575
8147
|
border-top: 1px solid ${(props) => props.theme.color.border};
|
|
9576
8148
|
}
|
|
9577
8149
|
`;
|
|
9578
|
-
var TableListKey =
|
|
8150
|
+
var TableListKey = styled54.div`
|
|
9579
8151
|
flex: 1 1 auto;
|
|
9580
8152
|
`;
|
|
9581
|
-
var TableListValue =
|
|
8153
|
+
var TableListValue = styled54.div`
|
|
9582
8154
|
flex-shrink: 0;
|
|
9583
8155
|
padding-left: ${size(1)};
|
|
9584
8156
|
`;
|
|
9585
|
-
var TableListBooleanPos =
|
|
8157
|
+
var TableListBooleanPos = styled54.div`
|
|
9586
8158
|
color: ${(props) => props.theme.color.ui.positive};
|
|
9587
8159
|
`;
|
|
9588
|
-
var TableListBooleanNeg =
|
|
8160
|
+
var TableListBooleanNeg = styled54.div`
|
|
9589
8161
|
color: ${(props) => props.theme.color.ui.negative};
|
|
9590
8162
|
`;
|
|
9591
8163
|
|
|
9592
8164
|
// src/layouts/searchItem/MetadataItem.tsx
|
|
9593
8165
|
var formatValue = (value, unit) => {
|
|
9594
8166
|
if (typeof value === "boolean") {
|
|
9595
|
-
return value ? /* @__PURE__ */
|
|
8167
|
+
return value ? /* @__PURE__ */ React79.createElement(TableListBooleanPos, {
|
|
9596
8168
|
title: "Ja"
|
|
9597
|
-
}, /* @__PURE__ */
|
|
8169
|
+
}, /* @__PURE__ */ React79.createElement(SrOnly, null, "Ja"), /* @__PURE__ */ React79.createElement(IconCheck, {
|
|
9598
8170
|
block: true
|
|
9599
|
-
})) : /* @__PURE__ */
|
|
8171
|
+
})) : /* @__PURE__ */ React79.createElement(TableListBooleanNeg, {
|
|
9600
8172
|
title: "Nej"
|
|
9601
|
-
}, /* @__PURE__ */
|
|
8173
|
+
}, /* @__PURE__ */ React79.createElement(SrOnly, null, "Nej"), /* @__PURE__ */ React79.createElement(IconCancel, {
|
|
9602
8174
|
block: true
|
|
9603
8175
|
}));
|
|
9604
8176
|
}
|
|
@@ -9611,27 +8183,27 @@ var formatValue = (value, unit) => {
|
|
|
9611
8183
|
return value;
|
|
9612
8184
|
};
|
|
9613
8185
|
var MetadataItem = ({ name, hint, value, unit }) => {
|
|
9614
|
-
const [foldout, setFoldout] =
|
|
9615
|
-
const onToggleFoldout =
|
|
8186
|
+
const [foldout, setFoldout] = useState25(false);
|
|
8187
|
+
const onToggleFoldout = useCallback32(() => setFoldout(!foldout), [foldout]);
|
|
9616
8188
|
const presentedValue = formatValue(value, unit);
|
|
9617
|
-
return /* @__PURE__ */
|
|
8189
|
+
return /* @__PURE__ */ React79.createElement(TableListItem, null, /* @__PURE__ */ React79.createElement(TableListKey, null, hint ? /* @__PURE__ */ React79.createElement(ButtonInline, {
|
|
9618
8190
|
onClick: onToggleFoldout,
|
|
9619
8191
|
title: `Mer information om ${name}`
|
|
9620
|
-
}, name) : name), /* @__PURE__ */
|
|
8192
|
+
}, name) : name), /* @__PURE__ */ React79.createElement(TableListValue, null, value !== void 0 ? presentedValue : "Uppgift saknas"), hint && foldout && /* @__PURE__ */ React79.createElement(Modal_default, {
|
|
9621
8193
|
title: name,
|
|
9622
8194
|
onClose: onToggleFoldout
|
|
9623
|
-
}, /* @__PURE__ */
|
|
8195
|
+
}, /* @__PURE__ */ React79.createElement(Content_default, {
|
|
9624
8196
|
dangerouslySetInnerHTML: { __html: hint }
|
|
9625
8197
|
})));
|
|
9626
8198
|
};
|
|
9627
8199
|
var MetadataItem_default = MetadataItem;
|
|
9628
8200
|
|
|
9629
8201
|
// src/components/Tabs/index.tsx
|
|
9630
|
-
import * as
|
|
8202
|
+
import * as React80 from "react";
|
|
9631
8203
|
|
|
9632
8204
|
// src/components/Tabs/wrapper.tsx
|
|
9633
|
-
import
|
|
9634
|
-
var
|
|
8205
|
+
import styled55, { css as css14 } from "styled-components";
|
|
8206
|
+
var Wrapper30 = styled55.div`
|
|
9635
8207
|
overflow: hidden;
|
|
9636
8208
|
margin-top: ${size(-1)};
|
|
9637
8209
|
margin-left: ${size(-1)};
|
|
@@ -9642,7 +8214,7 @@ var Wrapper34 = styled60.div`
|
|
|
9642
8214
|
margin-right: ${size(-2)};
|
|
9643
8215
|
}
|
|
9644
8216
|
`;
|
|
9645
|
-
var List10 =
|
|
8217
|
+
var List10 = styled55.ul`
|
|
9646
8218
|
list-style: none;
|
|
9647
8219
|
padding: 0;
|
|
9648
8220
|
margin: 0;
|
|
@@ -9656,12 +8228,12 @@ var List10 = styled60.ul`
|
|
|
9656
8228
|
padding-right: ${size(1)};
|
|
9657
8229
|
}
|
|
9658
8230
|
`;
|
|
9659
|
-
var
|
|
8231
|
+
var Item10 = styled55.li`
|
|
9660
8232
|
display: inline-block;
|
|
9661
8233
|
vertical-align: bottom;
|
|
9662
8234
|
font-size: 1rem;
|
|
9663
8235
|
`;
|
|
9664
|
-
var Action9 =
|
|
8236
|
+
var Action9 = styled55(ButtonReset).attrs(() => ({
|
|
9665
8237
|
role: "tab",
|
|
9666
8238
|
className: "wayke__theme wayke__font--bold"
|
|
9667
8239
|
}))`
|
|
@@ -9687,7 +8259,7 @@ var Action9 = styled60(ButtonReset).attrs(() => ({
|
|
|
9687
8259
|
z-index: 1;
|
|
9688
8260
|
}
|
|
9689
8261
|
|
|
9690
|
-
${(props) => props.active &&
|
|
8262
|
+
${(props) => props.active && css14`
|
|
9691
8263
|
color: ${(props2) => props2.theme.color.textDark};
|
|
9692
8264
|
|
|
9693
8265
|
:after {
|
|
@@ -9697,9 +8269,9 @@ var Action9 = styled60(ButtonReset).attrs(() => ({
|
|
|
9697
8269
|
`;
|
|
9698
8270
|
|
|
9699
8271
|
// src/components/Tabs/index.tsx
|
|
9700
|
-
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */
|
|
8272
|
+
var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React80.createElement(Wrapper30, null, /* @__PURE__ */ React80.createElement(List10, null, tabs.map((tab) => /* @__PURE__ */ React80.createElement(Item10, {
|
|
9701
8273
|
key: tab.name
|
|
9702
|
-
}, /* @__PURE__ */
|
|
8274
|
+
}, /* @__PURE__ */ React80.createElement(Action9, {
|
|
9703
8275
|
title: tab.displayName,
|
|
9704
8276
|
onClick: onClick ? () => onClick(tab.name) : void 0,
|
|
9705
8277
|
active: tab.name === active ? "true" : void 0
|
|
@@ -9707,30 +8279,30 @@ var Tabs = ({ tabs, active, onClick }) => /* @__PURE__ */ React94.createElement(
|
|
|
9707
8279
|
var Tabs_default = Tabs;
|
|
9708
8280
|
|
|
9709
8281
|
// src/layouts/searchItem/Property.tsx
|
|
9710
|
-
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */
|
|
8282
|
+
var MetadataSubCategory = ({ name, properties }) => /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(H5, {
|
|
9711
8283
|
as: "h3"
|
|
9712
|
-
}, name), /* @__PURE__ */
|
|
8284
|
+
}, name), /* @__PURE__ */ React81.createElement(TableList, null, !!properties.length && properties.map((property, index2) => /* @__PURE__ */ React81.createElement(MetadataItem_default, {
|
|
9713
8285
|
name: property.name,
|
|
9714
8286
|
hint: property.hint,
|
|
9715
8287
|
value: property.value,
|
|
9716
8288
|
unit: property.unit,
|
|
9717
8289
|
key: `${property.name}-${index2}`
|
|
9718
8290
|
}))));
|
|
9719
|
-
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */
|
|
8291
|
+
var MetadataCategory = ({ properties, subCategories }) => /* @__PURE__ */ React81.createElement("div", {
|
|
9720
8292
|
className: "tab-section"
|
|
9721
|
-
}, !!properties.length && /* @__PURE__ */
|
|
8293
|
+
}, !!properties.length && /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(TableList, null, properties.map((property, index2) => /* @__PURE__ */ React81.createElement(MetadataItem_default, {
|
|
9722
8294
|
name: property.name,
|
|
9723
8295
|
hint: property.hint,
|
|
9724
8296
|
value: property.value,
|
|
9725
8297
|
unit: property.unit,
|
|
9726
8298
|
key: `${property.name}-${index2}`
|
|
9727
|
-
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */
|
|
8299
|
+
})))), !!subCategories.length && subCategories.map((subCategory, index2) => /* @__PURE__ */ React81.createElement(MetadataSubCategory, {
|
|
9728
8300
|
name: subCategory.name,
|
|
9729
8301
|
properties: subCategory.properties,
|
|
9730
8302
|
key: `${subCategory.name}-${index2}`
|
|
9731
8303
|
})));
|
|
9732
8304
|
var PropertySet = ({ propertySet, vehicleData }) => {
|
|
9733
|
-
const [activeCategoryId, setActiveCategoryId] =
|
|
8305
|
+
const [activeCategoryId, setActiveCategoryId] = useState26(-1);
|
|
9734
8306
|
const mappedProperties = useMemo5(() => {
|
|
9735
8307
|
if (!propertySet) {
|
|
9736
8308
|
return void 0;
|
|
@@ -9742,24 +8314,24 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9742
8314
|
property_tree_sorter_default(tree);
|
|
9743
8315
|
return tree;
|
|
9744
8316
|
}, [propertySet]);
|
|
9745
|
-
|
|
8317
|
+
useEffect13(() => {
|
|
9746
8318
|
const categories = mappedProperties?.categories?.length !== void 0 ? mappedProperties?.categories : void 0;
|
|
9747
8319
|
if (activeCategoryId < 0 && categories !== void 0 && categories.length > 0) {
|
|
9748
8320
|
setActiveCategoryId(categories[0].id);
|
|
9749
8321
|
}
|
|
9750
8322
|
}, [mappedProperties]);
|
|
9751
|
-
const onTab =
|
|
8323
|
+
const onTab = useCallback33((id) => setActiveCategoryId(parseInt(id, 10)), []);
|
|
9752
8324
|
const activeCategory = mappedProperties?.categories?.find(
|
|
9753
8325
|
(category) => category.id === activeCategoryId
|
|
9754
8326
|
);
|
|
9755
|
-
return /* @__PURE__ */
|
|
8327
|
+
return /* @__PURE__ */ React81.createElement(React81.Fragment, null, /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(Tabs_default, {
|
|
9756
8328
|
tabs: mappedProperties?.categories?.map((category) => ({
|
|
9757
8329
|
name: `${category.id}`,
|
|
9758
8330
|
displayName: category.name
|
|
9759
8331
|
})) || [],
|
|
9760
8332
|
active: `${activeCategoryId}`,
|
|
9761
8333
|
onClick: onTab
|
|
9762
|
-
})), activeCategory && /* @__PURE__ */
|
|
8334
|
+
})), activeCategory && /* @__PURE__ */ React81.createElement(Repeat, null, /* @__PURE__ */ React81.createElement(MetadataCategory, {
|
|
9763
8335
|
properties: activeCategory.properties,
|
|
9764
8336
|
subCategories: activeCategory.subCategories
|
|
9765
8337
|
})));
|
|
@@ -9767,11 +8339,11 @@ var PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
9767
8339
|
var Property_default = PropertySet;
|
|
9768
8340
|
|
|
9769
8341
|
// src/components/Pdf/index.tsx
|
|
9770
|
-
import
|
|
8342
|
+
import React82 from "react";
|
|
9771
8343
|
|
|
9772
8344
|
// src/components/Pdf/wrapper.tsx
|
|
9773
|
-
import
|
|
9774
|
-
var PdfListItem =
|
|
8345
|
+
import styled56 from "styled-components";
|
|
8346
|
+
var PdfListItem = styled56.li.attrs(() => ({
|
|
9775
8347
|
className: "wayke__theme wayke__color--primary-text"
|
|
9776
8348
|
}))`
|
|
9777
8349
|
flex: 0 0 50%;
|
|
@@ -9781,14 +8353,14 @@ var PdfListItem = styled61.li.attrs(() => ({
|
|
|
9781
8353
|
flex: 0 0 100%;
|
|
9782
8354
|
}
|
|
9783
8355
|
`;
|
|
9784
|
-
var PdfContainer =
|
|
8356
|
+
var PdfContainer = styled56.ul`
|
|
9785
8357
|
list-style: none;
|
|
9786
8358
|
padding: 0;
|
|
9787
8359
|
display: flex;
|
|
9788
8360
|
flex-wrap: wrap;
|
|
9789
8361
|
margin: ${size(-1)};
|
|
9790
8362
|
`;
|
|
9791
|
-
var PdfLink =
|
|
8363
|
+
var PdfLink = styled56.a.attrs(() => ({
|
|
9792
8364
|
className: "wayke__theme wayke__color--primary-text wayke__font--bold"
|
|
9793
8365
|
}))`
|
|
9794
8366
|
text-decoration: none;
|
|
@@ -9802,19 +8374,19 @@ var PdfLink = styled61.a.attrs(() => ({
|
|
|
9802
8374
|
height: 100%;
|
|
9803
8375
|
}
|
|
9804
8376
|
`;
|
|
9805
|
-
var PdfTitle =
|
|
8377
|
+
var PdfTitle = styled56.div`
|
|
9806
8378
|
color: ${(props) => props.theme.color.textDark};
|
|
9807
8379
|
`;
|
|
9808
|
-
var PdfSubtitle =
|
|
8380
|
+
var PdfSubtitle = styled56.div`
|
|
9809
8381
|
color: ${(props) => props.theme.color.textDarkLighten};
|
|
9810
8382
|
`;
|
|
9811
|
-
var PdfColumn =
|
|
8383
|
+
var PdfColumn = styled56.div`
|
|
9812
8384
|
flex 0 0 auto;
|
|
9813
8385
|
&:first-child {
|
|
9814
8386
|
flex: 1 1 auto;
|
|
9815
8387
|
}
|
|
9816
8388
|
`;
|
|
9817
|
-
var PdfListInner =
|
|
8389
|
+
var PdfListInner = styled56.div`
|
|
9818
8390
|
position: relative;
|
|
9819
8391
|
border: 1px solid ${(props) => props.theme.color.border};
|
|
9820
8392
|
padding: ${size(1.5)};
|
|
@@ -9826,12 +8398,12 @@ var PdfListInner = styled61.div`
|
|
|
9826
8398
|
`;
|
|
9827
8399
|
|
|
9828
8400
|
// src/components/Pdf/index.tsx
|
|
9829
|
-
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */
|
|
8401
|
+
var PdfDownloadItem = ({ document: document2 }) => /* @__PURE__ */ React82.createElement(PdfListItem, null, /* @__PURE__ */ React82.createElement(PdfListInner, null, /* @__PURE__ */ React82.createElement(PdfColumn, null, /* @__PURE__ */ React82.createElement(PdfTitle, null, document2.name), /* @__PURE__ */ React82.createElement(PdfSubtitle, null, document2.contentType)), /* @__PURE__ */ React82.createElement(PdfColumn, null, /* @__PURE__ */ React82.createElement(PdfLink, {
|
|
9830
8402
|
href: document2.url,
|
|
9831
8403
|
rel: "noopener noreferrer nofollow",
|
|
9832
8404
|
target: "_blank"
|
|
9833
8405
|
}, "\xD6ppna"))));
|
|
9834
|
-
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */
|
|
8406
|
+
var PdfDownloadContainer = ({ documents }) => /* @__PURE__ */ React82.createElement(PdfContainer, null, documents.map((document2, i) => /* @__PURE__ */ React82.createElement(PdfDownloadItem, {
|
|
9835
8407
|
key: `${document2.url}-${i}`,
|
|
9836
8408
|
document: document2
|
|
9837
8409
|
})));
|
|
@@ -9848,10 +8420,10 @@ var WaykeSearchItem = ({
|
|
|
9848
8420
|
onClickSearchItem
|
|
9849
8421
|
}) => {
|
|
9850
8422
|
const { ecomSettings } = useSettings_default();
|
|
9851
|
-
const ecomContext =
|
|
8423
|
+
const ecomContext = useRef3();
|
|
9852
8424
|
const { loading, data: result } = useSearchItem_default(id);
|
|
9853
8425
|
const { vehicle: centralStorageVehicle, loading: loadingCentralStorageVehicle } = useCentralStorage_default(result?.vehicle);
|
|
9854
|
-
|
|
8426
|
+
useEffect14(() => {
|
|
9855
8427
|
if (ecomSettings) {
|
|
9856
8428
|
ecomContext.current = new WaykeEcomWeb({
|
|
9857
8429
|
id,
|
|
@@ -9873,12 +8445,12 @@ var WaykeSearchItem = ({
|
|
|
9873
8445
|
}
|
|
9874
8446
|
};
|
|
9875
8447
|
}, []);
|
|
9876
|
-
|
|
8448
|
+
useEffect14(() => {
|
|
9877
8449
|
if (!disableResetScrollOnInit) {
|
|
9878
8450
|
window.scrollTo(0, 0);
|
|
9879
8451
|
}
|
|
9880
8452
|
}, []);
|
|
9881
|
-
|
|
8453
|
+
useEffect14(() => {
|
|
9882
8454
|
if (result?.vehicle?.data && modifyDocumentTitleItem) {
|
|
9883
8455
|
const { vehicle: vehicle2 } = result;
|
|
9884
8456
|
const { registrationNumber } = vehicle2.data;
|
|
@@ -9889,12 +8461,12 @@ var WaykeSearchItem = ({
|
|
|
9889
8461
|
() => result?.vehicle?.data?.options?.filter(notEmpty).map((opt) => ({ title: opt })),
|
|
9890
8462
|
[result?.vehicle?.data?.options]
|
|
9891
8463
|
);
|
|
9892
|
-
const onShowMoreOptionsClick =
|
|
8464
|
+
const onShowMoreOptionsClick = useCallback34(() => pubsub_default.publish("OptionsClick"), []);
|
|
9893
8465
|
if (loading) {
|
|
9894
|
-
return /* @__PURE__ */
|
|
8466
|
+
return /* @__PURE__ */ React83.createElement(PageLoading_default, null);
|
|
9895
8467
|
}
|
|
9896
8468
|
if (!result?.vehicle?.data) {
|
|
9897
|
-
return /* @__PURE__ */
|
|
8469
|
+
return /* @__PURE__ */ React83.createElement(Page404_default, null);
|
|
9898
8470
|
}
|
|
9899
8471
|
const { vehicle } = result;
|
|
9900
8472
|
const contact = centralStorageVehicle?.contact;
|
|
@@ -9928,40 +8500,40 @@ var WaykeSearchItem = ({
|
|
|
9928
8500
|
if (fuelType) {
|
|
9929
8501
|
uspList.push({ title: fuelType });
|
|
9930
8502
|
}
|
|
9931
|
-
return /* @__PURE__ */
|
|
8503
|
+
return /* @__PURE__ */ React83.createElement(React83.Fragment, null, /* @__PURE__ */ React83.createElement(Page, null, /* @__PURE__ */ React83.createElement(PageSection, {
|
|
9932
8504
|
large: true
|
|
9933
|
-
}, /* @__PURE__ */
|
|
8505
|
+
}, /* @__PURE__ */ React83.createElement(Container_default, null, /* @__PURE__ */ React83.createElement(ProductPage, null, /* @__PURE__ */ React83.createElement(ProductPageAside, null, /* @__PURE__ */ React83.createElement(ProductPageAsideSection, {
|
|
9934
8506
|
mobileOrder: 1
|
|
9935
|
-
}, !pathRoute && hashRoute ? /* @__PURE__ */
|
|
8507
|
+
}, !pathRoute && hashRoute ? /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(UtilityFontSizeSmall, null, /* @__PURE__ */ React83.createElement(ButtonInlineLight, {
|
|
9936
8508
|
as: "a",
|
|
9937
8509
|
href: "#",
|
|
9938
8510
|
title: "Tillbaka till bils\xF6k"
|
|
9939
|
-
}, /* @__PURE__ */
|
|
8511
|
+
}, /* @__PURE__ */ React83.createElement(ButtonContent, null, /* @__PURE__ */ React83.createElement(IconChevronLeft, {
|
|
9940
8512
|
block: true
|
|
9941
|
-
})), /* @__PURE__ */
|
|
8513
|
+
})), /* @__PURE__ */ React83.createElement(ButtonContent, null, "Tillbaka till bils\xF6k")))) : null, manufacturer?.logotype && /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(LogoBox_default, {
|
|
9942
8514
|
logo: manufacturer.logotype,
|
|
9943
8515
|
alt: manufacturer.name
|
|
9944
|
-
})), /* @__PURE__ */
|
|
8516
|
+
})), /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(RepeatSmall, null, /* @__PURE__ */ React83.createElement(H1, {
|
|
9945
8517
|
noMargin: true
|
|
9946
|
-
}, title)), shortDescription && /* @__PURE__ */
|
|
8518
|
+
}, title)), shortDescription && /* @__PURE__ */ React83.createElement(RepeatSmall, null, /* @__PURE__ */ React83.createElement("div", null, shortDescription)), /* @__PURE__ */ React83.createElement(RepeatSmall, null, /* @__PURE__ */ React83.createElement(UspList_default, {
|
|
9947
8519
|
small: true,
|
|
9948
8520
|
items: uspList
|
|
9949
|
-
})))), /* @__PURE__ */
|
|
8521
|
+
})))), /* @__PURE__ */ React83.createElement(ProductPageAsideSection, {
|
|
9950
8522
|
mobileOrder: 2
|
|
9951
|
-
}, /* @__PURE__ */
|
|
8523
|
+
}, /* @__PURE__ */ React83.createElement(PriceTable_default, {
|
|
9952
8524
|
price
|
|
9953
|
-
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */
|
|
8525
|
+
})), (financialOptions.length > 0 || insuranceOptions.length > 0) && /* @__PURE__ */ React83.createElement(ProductPageAsideSection, {
|
|
9954
8526
|
mobileOrder: 4
|
|
9955
|
-
}, financialOptions.length > 0 && /* @__PURE__ */
|
|
8527
|
+
}, financialOptions.length > 0 && /* @__PURE__ */ React83.createElement(FinancialOptions_default, {
|
|
9956
8528
|
id,
|
|
9957
8529
|
financialOptions
|
|
9958
|
-
}), insuranceOptions.length > 0 && /* @__PURE__ */
|
|
8530
|
+
}), insuranceOptions.length > 0 && /* @__PURE__ */ React83.createElement(InsuranceOptions_default, {
|
|
9959
8531
|
id,
|
|
9960
8532
|
branch: centralStorageVehicle?.branch,
|
|
9961
8533
|
insuranceOptions
|
|
9962
|
-
})), /* @__PURE__ */
|
|
8534
|
+
})), /* @__PURE__ */ React83.createElement(ProductPageAsideSection, {
|
|
9963
8535
|
mobileOrder: 5
|
|
9964
|
-
}, /* @__PURE__ */
|
|
8536
|
+
}, /* @__PURE__ */ React83.createElement(CheckList_default, {
|
|
9965
8537
|
manufacturer,
|
|
9966
8538
|
packageOptions,
|
|
9967
8539
|
ecommerce,
|
|
@@ -9969,77 +8541,141 @@ var WaykeSearchItem = ({
|
|
|
9969
8541
|
contact: centralStorageVehicle?.contact,
|
|
9970
8542
|
loadingCentralStorageVehicle,
|
|
9971
8543
|
toggleEcomModal: () => ecomContext.current?.start()
|
|
9972
|
-
}))), /* @__PURE__ */
|
|
8544
|
+
}))), /* @__PURE__ */ React83.createElement(ProductPageMain, null, /* @__PURE__ */ React83.createElement(ProductPageAsideSection, {
|
|
9973
8545
|
mobileOrder: 3
|
|
9974
|
-
}, /* @__PURE__ */
|
|
8546
|
+
}, /* @__PURE__ */ React83.createElement(Gallery_default, {
|
|
9975
8547
|
media,
|
|
9976
8548
|
placeholderImage
|
|
9977
|
-
})), /* @__PURE__ */
|
|
8549
|
+
})), /* @__PURE__ */ React83.createElement(ProductPageMainSection, null, /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(H2, {
|
|
9978
8550
|
noMargin: true
|
|
9979
|
-
}, "Biluppgifter")), /* @__PURE__ */
|
|
8551
|
+
}, "Biluppgifter")), /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(Content_default, null, /* @__PURE__ */ React83.createElement("p", null, "Information direkt fr\xE5n Transportstyrelsen och tillverkaren."))), /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(Property_default, {
|
|
9980
8552
|
propertySet,
|
|
9981
8553
|
vehicleData: vehicle.data
|
|
9982
|
-
}))), description && /* @__PURE__ */
|
|
8554
|
+
}))), description && /* @__PURE__ */ React83.createElement(ProductPageMainSection, null, /* @__PURE__ */ React83.createElement(Blockquote_default, {
|
|
9983
8555
|
author: contact && contact.name ? contact.name : null,
|
|
9984
8556
|
date: publishedAt ? dateTimeFormat.format(publishedAt, dateTimeFormat.DayMonth) : void 0,
|
|
9985
8557
|
avatar: contact?.avatar || void 0
|
|
9986
|
-
}, !!description && /* @__PURE__ */
|
|
8558
|
+
}, !!description && /* @__PURE__ */ React83.createElement("p", null, description))), (options?.length || 0) > 0 && /* @__PURE__ */ React83.createElement(ProductPageMainSection, null, /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(H2, {
|
|
9987
8559
|
noMargin: true
|
|
9988
|
-
}, "Utrustning")), /* @__PURE__ */
|
|
8560
|
+
}, "Utrustning")), /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(Content_default, null, /* @__PURE__ */ React83.createElement("p", null, "Kompletterande uppgifter om bilen."))), /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(ExtendContent_default, {
|
|
9989
8561
|
actionTitle: "Visa mer",
|
|
9990
8562
|
onClick: onShowMoreOptionsClick
|
|
9991
|
-
}, /* @__PURE__ */
|
|
8563
|
+
}, /* @__PURE__ */ React83.createElement(UspList_default, {
|
|
9992
8564
|
items: options
|
|
9993
|
-
})))), (documents.length || 0) > 0 && /* @__PURE__ */
|
|
8565
|
+
})))), (documents.length || 0) > 0 && /* @__PURE__ */ React83.createElement(ProductPageMainSection, null, /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(H2, {
|
|
9994
8566
|
noMargin: true
|
|
9995
|
-
}, "Dokument")), /* @__PURE__ */
|
|
8567
|
+
}, "Dokument")), /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(Content_default, null, /* @__PURE__ */ React83.createElement("p", null, "Tillh\xF6rande dokument f\xF6r bilen."))), /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(Pdf_default, {
|
|
9996
8568
|
documents
|
|
9997
|
-
}))), /* @__PURE__ */
|
|
8569
|
+
}))), /* @__PURE__ */ React83.createElement(ProductPageMainSection, null, /* @__PURE__ */ React83.createElement(Branch_default, {
|
|
9998
8570
|
branch,
|
|
9999
8571
|
loading: loadingCentralStorageVehicle
|
|
10000
|
-
}), ecommerce && ecommerce.enabled && /* @__PURE__ */
|
|
8572
|
+
}), ecommerce && ecommerce.enabled && /* @__PURE__ */ React83.createElement(Repeat, null, /* @__PURE__ */ React83.createElement(ButtonPrimary, {
|
|
10001
8573
|
disabled: !!ecommerce.reserved,
|
|
10002
8574
|
title: "K\xF6p bilen online",
|
|
10003
8575
|
onClick: () => ecomContext.current?.start()
|
|
10004
|
-
}, "K\xF6p bilen online"))), /* @__PURE__ */
|
|
8576
|
+
}, "K\xF6p bilen online"))), /* @__PURE__ */ React83.createElement(PackageOptions_default, {
|
|
10005
8577
|
packageOptions
|
|
10006
|
-
}), /* @__PURE__ */
|
|
8578
|
+
}), /* @__PURE__ */ React83.createElement(ManufacturerPackagesOption_default, {
|
|
10007
8579
|
packageOption: manufacturer?.packageOption
|
|
10008
|
-
}))))), /* @__PURE__ */
|
|
8580
|
+
}))))), /* @__PURE__ */ React83.createElement(Related_default, {
|
|
10009
8581
|
id,
|
|
10010
8582
|
hashRoute,
|
|
10011
8583
|
pathRoute,
|
|
10012
8584
|
onClickSearchItem
|
|
10013
|
-
})), false, /* @__PURE__ */
|
|
8585
|
+
})), false, /* @__PURE__ */ React83.createElement(portal_element_default, {
|
|
10014
8586
|
id: portal_namespace_exports.DefaultPortal
|
|
10015
8587
|
}));
|
|
10016
8588
|
};
|
|
10017
8589
|
var searchItem_default = WaykeSearchItem;
|
|
10018
8590
|
|
|
10019
8591
|
// src/providers/WaykeProvider.tsx
|
|
10020
|
-
import
|
|
8592
|
+
import React91 from "react";
|
|
10021
8593
|
|
|
10022
8594
|
// src/providers/graphqlProvider.tsx
|
|
10023
|
-
import
|
|
8595
|
+
import React84 from "react";
|
|
10024
8596
|
import { ApolloProvider as ApolloProviderBase, ApolloClient, InMemoryCache } from "@apollo/client";
|
|
10025
8597
|
var GraphqlProvider = ({ uri, children }) => {
|
|
10026
8598
|
const client = new ApolloClient({ uri, cache: new InMemoryCache() });
|
|
10027
|
-
return /* @__PURE__ */
|
|
8599
|
+
return /* @__PURE__ */ React84.createElement(ApolloProviderBase, {
|
|
10028
8600
|
client
|
|
10029
8601
|
}, children);
|
|
10030
8602
|
};
|
|
10031
8603
|
var graphqlProvider_default = GraphqlProvider;
|
|
10032
8604
|
|
|
10033
8605
|
// src/providers/themeProvider.tsx
|
|
10034
|
-
import
|
|
8606
|
+
import React85 from "react";
|
|
10035
8607
|
import { ThemeProvider as ThemeProviderBase } from "styled-components";
|
|
10036
|
-
var ThemeProvider = ({ children }) => /* @__PURE__ */
|
|
8608
|
+
var ThemeProvider = ({ children }) => /* @__PURE__ */ React85.createElement(ThemeProviderBase, {
|
|
10037
8609
|
theme: theme_default
|
|
10038
8610
|
}, children);
|
|
10039
8611
|
var themeProvider_default = ThemeProvider;
|
|
10040
8612
|
|
|
10041
8613
|
// src/State/Search/SearchProvider.tsx
|
|
10042
|
-
import
|
|
8614
|
+
import React86, { useState as useState28, useEffect as useEffect16, useCallback as useCallback36 } from "react";
|
|
8615
|
+
|
|
8616
|
+
// src/hooks/useFetch.ts
|
|
8617
|
+
import { useEffect as useEffect15, useState as useState27, useCallback as useCallback35 } from "react";
|
|
8618
|
+
var cache = {};
|
|
8619
|
+
var getCachedResult = (key) => cache?.[key] || void 0;
|
|
8620
|
+
var setCachedResult = (key, value) => {
|
|
8621
|
+
cache[key] = value;
|
|
8622
|
+
};
|
|
8623
|
+
var pendingPromise = {};
|
|
8624
|
+
var isPendingPromise = (url) => !!pendingPromise[url];
|
|
8625
|
+
var setPendingPromise = (url, promise) => {
|
|
8626
|
+
pendingPromise = {
|
|
8627
|
+
...pendingPromise,
|
|
8628
|
+
[url]: promise
|
|
8629
|
+
};
|
|
8630
|
+
};
|
|
8631
|
+
var clearPendingPromise = (url) => {
|
|
8632
|
+
delete pendingPromise[url];
|
|
8633
|
+
};
|
|
8634
|
+
var useFetch = (path, options, skip, promiseCache) => {
|
|
8635
|
+
const [data, setData] = useState27();
|
|
8636
|
+
const [loading, setLoading] = useState27(false);
|
|
8637
|
+
const [error, setError] = useState27(false);
|
|
8638
|
+
const doFetch = useCallback35(async () => {
|
|
8639
|
+
const key = path.toString();
|
|
8640
|
+
const cached = getCachedResult(key);
|
|
8641
|
+
setError(false);
|
|
8642
|
+
if (cached) {
|
|
8643
|
+
setData(cached);
|
|
8644
|
+
return;
|
|
8645
|
+
}
|
|
8646
|
+
setLoading(true);
|
|
8647
|
+
try {
|
|
8648
|
+
const reusePromise = promiseCache && isPendingPromise(key);
|
|
8649
|
+
const request = reusePromise ? pendingPromise[key] : fetch(path, options);
|
|
8650
|
+
if (promiseCache) {
|
|
8651
|
+
setPendingPromise(key, request);
|
|
8652
|
+
}
|
|
8653
|
+
const result = await request;
|
|
8654
|
+
if (result.ok) {
|
|
8655
|
+
const json2 = await result.clone().json();
|
|
8656
|
+
setCachedResult(key, json2);
|
|
8657
|
+
setData(json2);
|
|
8658
|
+
}
|
|
8659
|
+
} catch (e) {
|
|
8660
|
+
setError(true);
|
|
8661
|
+
} finally {
|
|
8662
|
+
setLoading(false);
|
|
8663
|
+
clearPendingPromise(key);
|
|
8664
|
+
}
|
|
8665
|
+
return;
|
|
8666
|
+
}, [path, options]);
|
|
8667
|
+
useEffect15(() => {
|
|
8668
|
+
if (!skip) {
|
|
8669
|
+
doFetch();
|
|
8670
|
+
}
|
|
8671
|
+
}, [path, skip]);
|
|
8672
|
+
return {
|
|
8673
|
+
loading,
|
|
8674
|
+
data,
|
|
8675
|
+
error
|
|
8676
|
+
};
|
|
8677
|
+
};
|
|
8678
|
+
var useFetch_default = useFetch;
|
|
10043
8679
|
|
|
10044
8680
|
// src/utils/url.ts
|
|
10045
8681
|
var getUrlSearchParamsFromUrl = () => new URLSearchParams(window.location.search);
|
|
@@ -10056,12 +8692,12 @@ var SearchProvider = ({
|
|
|
10056
8692
|
children
|
|
10057
8693
|
}) => {
|
|
10058
8694
|
const { replaceState, pushState } = usePath_default();
|
|
10059
|
-
const [queryFilter, setQueryFilter] =
|
|
8695
|
+
const [queryFilter, setQueryFilter] = useState28({
|
|
10060
8696
|
searchParams: initialSearchParams
|
|
10061
8697
|
});
|
|
10062
|
-
const [initialFacets, setInitialFacets] =
|
|
10063
|
-
const [documents, setDocuments] =
|
|
10064
|
-
const [initialize, setInitialize] =
|
|
8698
|
+
const [initialFacets, setInitialFacets] = useState28();
|
|
8699
|
+
const [documents, setDocuments] = useState28();
|
|
8700
|
+
const [initialize, setInitialize] = useState28(false);
|
|
10065
8701
|
const { data: initialDataRepsonse } = useFetch_default(
|
|
10066
8702
|
`${url}?hits=0`,
|
|
10067
8703
|
{
|
|
@@ -10097,7 +8733,7 @@ var SearchProvider = ({
|
|
|
10097
8733
|
});
|
|
10098
8734
|
}
|
|
10099
8735
|
};
|
|
10100
|
-
|
|
8736
|
+
useEffect16(() => {
|
|
10101
8737
|
if (useQueryParamsFromUrl) {
|
|
10102
8738
|
window.addEventListener("popstate", popStateEvent);
|
|
10103
8739
|
}
|
|
@@ -10111,12 +8747,12 @@ var SearchProvider = ({
|
|
|
10111
8747
|
pubsub_default.unsubscribeAction(onFilterUpdateEvent);
|
|
10112
8748
|
};
|
|
10113
8749
|
}, []);
|
|
10114
|
-
|
|
8750
|
+
useEffect16(() => {
|
|
10115
8751
|
if (initialDataRepsonse) {
|
|
10116
8752
|
setInitialFacets(initialDataRepsonse.facets);
|
|
10117
8753
|
}
|
|
10118
8754
|
}, [initialDataRepsonse]);
|
|
10119
|
-
|
|
8755
|
+
useEffect16(() => {
|
|
10120
8756
|
if (useQueryParamsFromUrl) {
|
|
10121
8757
|
const nextSearchParams = new URLSearchParams(queryFilter.searchParams);
|
|
10122
8758
|
nextSearchParams.delete("hits");
|
|
@@ -10139,7 +8775,7 @@ var SearchProvider = ({
|
|
|
10139
8775
|
}
|
|
10140
8776
|
}
|
|
10141
8777
|
}, [queryFilter, initialize, useQueryParamsFromUrl]);
|
|
10142
|
-
|
|
8778
|
+
useEffect16(() => {
|
|
10143
8779
|
if (response) {
|
|
10144
8780
|
if (!initialFacets && !useQueryParamsFromUrl) {
|
|
10145
8781
|
setInitialFacets(response.facets);
|
|
@@ -10164,7 +8800,7 @@ var SearchProvider = ({
|
|
|
10164
8800
|
}
|
|
10165
8801
|
}
|
|
10166
8802
|
}, [response, useQueryParamsFromUrl]);
|
|
10167
|
-
const onFilterUpdate =
|
|
8803
|
+
const onFilterUpdate = useCallback36(
|
|
10168
8804
|
(nextQuery) => {
|
|
10169
8805
|
{
|
|
10170
8806
|
if (!initialize) {
|
|
@@ -10177,7 +8813,7 @@ var SearchProvider = ({
|
|
|
10177
8813
|
},
|
|
10178
8814
|
[initialize]
|
|
10179
8815
|
);
|
|
10180
|
-
const onLoadMore =
|
|
8816
|
+
const onLoadMore = useCallback36(() => {
|
|
10181
8817
|
if (response) {
|
|
10182
8818
|
setQueryFilter({
|
|
10183
8819
|
searchParams: new URLSearchParams(response?.documentList.pagination.nextPage?.query),
|
|
@@ -10185,7 +8821,7 @@ var SearchProvider = ({
|
|
|
10185
8821
|
});
|
|
10186
8822
|
}
|
|
10187
8823
|
}, [response]);
|
|
10188
|
-
const onInitialize =
|
|
8824
|
+
const onInitialize = useCallback36(
|
|
10189
8825
|
(_initialQueryParams) => {
|
|
10190
8826
|
if (!initialize) {
|
|
10191
8827
|
const searchParamsFromUrl = getUrlSearchParamsFromUrl();
|
|
@@ -10229,15 +8865,15 @@ var SearchProvider = ({
|
|
|
10229
8865
|
onLoadMore,
|
|
10230
8866
|
onInitialize
|
|
10231
8867
|
};
|
|
10232
|
-
return /* @__PURE__ */
|
|
8868
|
+
return /* @__PURE__ */ React86.createElement(SearchContext.Provider, {
|
|
10233
8869
|
value
|
|
10234
8870
|
}, children);
|
|
10235
8871
|
};
|
|
10236
8872
|
var SearchProvider_default = SearchProvider;
|
|
10237
8873
|
|
|
10238
8874
|
// src/components/Root/index.tsx
|
|
10239
|
-
import
|
|
10240
|
-
var Root =
|
|
8875
|
+
import styled57 from "styled-components";
|
|
8876
|
+
var Root = styled57.div.attrs(() => ({
|
|
10241
8877
|
className: "wayke__theme wayke__font--regular"
|
|
10242
8878
|
}))`
|
|
10243
8879
|
background-color: ${(props) => props.theme.color.bg};
|
|
@@ -10279,21 +8915,21 @@ var useEcom = (ecomSettings) => {
|
|
|
10279
8915
|
var useEcom_default = useEcom;
|
|
10280
8916
|
|
|
10281
8917
|
// src/State/Settings/SettingsProvider.tsx
|
|
10282
|
-
import
|
|
8918
|
+
import React87 from "react";
|
|
10283
8919
|
var SettingsProvider = ({
|
|
10284
8920
|
googleMapsApiKey,
|
|
10285
8921
|
googleMapsMarker,
|
|
10286
8922
|
ecomSettings,
|
|
10287
8923
|
children
|
|
10288
|
-
}) => /* @__PURE__ */
|
|
8924
|
+
}) => /* @__PURE__ */ React87.createElement(SettingsContext.Provider, {
|
|
10289
8925
|
value: { ecomSettings, googleMapsApiKey, googleMapsMarker }
|
|
10290
8926
|
}, children);
|
|
10291
8927
|
var SettingsProvider_default = SettingsProvider;
|
|
10292
8928
|
|
|
10293
8929
|
// src/State/RelatedSearch/RelatedSearchProvider.tsx
|
|
10294
|
-
import
|
|
8930
|
+
import React88, { useState as useState29, useCallback as useCallback37 } from "react";
|
|
10295
8931
|
var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
10296
|
-
const [queryFilter, setQueryFilter] =
|
|
8932
|
+
const [queryFilter, setQueryFilter] = useState29();
|
|
10297
8933
|
const query = queryFilter?.searchParams.toString();
|
|
10298
8934
|
const {
|
|
10299
8935
|
loading,
|
|
@@ -10308,7 +8944,7 @@ var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
|
10308
8944
|
},
|
|
10309
8945
|
!queryFilter
|
|
10310
8946
|
);
|
|
10311
|
-
const fetchRelated =
|
|
8947
|
+
const fetchRelated = useCallback37(
|
|
10312
8948
|
(searchParams) => setQueryFilter({
|
|
10313
8949
|
searchParams
|
|
10314
8950
|
}),
|
|
@@ -10322,31 +8958,31 @@ var RelatedSearchProvider = ({ url, urlMlt, apiKey, children }) => {
|
|
|
10322
8958
|
queryFilter,
|
|
10323
8959
|
fetchRelated
|
|
10324
8960
|
};
|
|
10325
|
-
return /* @__PURE__ */
|
|
8961
|
+
return /* @__PURE__ */ React88.createElement(RelatedSearchContext.Provider, {
|
|
10326
8962
|
value
|
|
10327
8963
|
}, children);
|
|
10328
8964
|
};
|
|
10329
8965
|
var RelatedSearchProvider_default = RelatedSearchProvider;
|
|
10330
8966
|
|
|
10331
8967
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
10332
|
-
import
|
|
8968
|
+
import React89, { useCallback as useCallback39 } from "react";
|
|
10333
8969
|
|
|
10334
8970
|
// src/hooks/useSessionStorage.ts
|
|
10335
|
-
import { useState as
|
|
8971
|
+
import { useState as useState30, useCallback as useCallback38 } from "react";
|
|
10336
8972
|
var useSessionStorage = (key) => {
|
|
10337
|
-
const [value, setValue] =
|
|
10338
|
-
const set =
|
|
8973
|
+
const [value, setValue] = useState30(sessionStorage.getItem(key));
|
|
8974
|
+
const set = useCallback38(
|
|
10339
8975
|
(v) => {
|
|
10340
8976
|
sessionStorage.setItem(key, v);
|
|
10341
8977
|
setValue(v);
|
|
10342
8978
|
},
|
|
10343
8979
|
[key]
|
|
10344
8980
|
);
|
|
10345
|
-
const remove =
|
|
8981
|
+
const remove = useCallback38(() => {
|
|
10346
8982
|
sessionStorage.removeItem(key);
|
|
10347
8983
|
setValue(null);
|
|
10348
8984
|
}, [key]);
|
|
10349
|
-
const clear =
|
|
8985
|
+
const clear = useCallback38(() => {
|
|
10350
8986
|
sessionStorage.clear();
|
|
10351
8987
|
setValue(null);
|
|
10352
8988
|
}, [key]);
|
|
@@ -10362,21 +8998,21 @@ var useSessionStorage_default = useSessionStorage;
|
|
|
10362
8998
|
// src/State/CentralStorage/CentralStorageProvider.tsx
|
|
10363
8999
|
var CentralStorageProvider = ({ children }) => {
|
|
10364
9000
|
const { value, set, remove } = useSessionStorage_default("centralStorage");
|
|
10365
|
-
const setCentralStorageId =
|
|
10366
|
-
return /* @__PURE__ */
|
|
9001
|
+
const setCentralStorageId = useCallback39((id) => id ? set(id) : remove(), []);
|
|
9002
|
+
return /* @__PURE__ */ React89.createElement(CentralStorageContext.Provider, {
|
|
10367
9003
|
value: { centralStorageId: value, setCentralStorageId }
|
|
10368
9004
|
}, children);
|
|
10369
9005
|
};
|
|
10370
9006
|
var CentralStorageProvider_default = CentralStorageProvider;
|
|
10371
9007
|
|
|
10372
9008
|
// src/State/Path/PathProvider.tsx
|
|
10373
|
-
import
|
|
9009
|
+
import React90, { useCallback as useCallback40, useEffect as useEffect18, useMemo as useMemo7, useReducer } from "react";
|
|
10374
9010
|
|
|
10375
9011
|
// src/hooks/usePrevious.ts
|
|
10376
|
-
import { useRef as
|
|
9012
|
+
import { useRef as useRef4, useEffect as useEffect17 } from "react";
|
|
10377
9013
|
var usePrevious = (value) => {
|
|
10378
|
-
const ref =
|
|
10379
|
-
|
|
9014
|
+
const ref = useRef4();
|
|
9015
|
+
useEffect17(() => {
|
|
10380
9016
|
ref.current = value;
|
|
10381
9017
|
});
|
|
10382
9018
|
return ref.current;
|
|
@@ -10406,7 +9042,7 @@ var POP_STATE = "popstate";
|
|
|
10406
9042
|
var PathProvider = ({ children }) => {
|
|
10407
9043
|
const [state, dispatch] = useReducer(reducer_default, initialState);
|
|
10408
9044
|
const previousPath = usePrevious_default(state.path);
|
|
10409
|
-
|
|
9045
|
+
useEffect18(() => {
|
|
10410
9046
|
const onPopState = () => {
|
|
10411
9047
|
dispatch({ type: SET_PATH, path: window.location.pathname });
|
|
10412
9048
|
};
|
|
@@ -10415,7 +9051,7 @@ var PathProvider = ({ children }) => {
|
|
|
10415
9051
|
window.removeEventListener(POP_STATE, onPopState);
|
|
10416
9052
|
};
|
|
10417
9053
|
}, []);
|
|
10418
|
-
const pushState =
|
|
9054
|
+
const pushState = useCallback40((path) => {
|
|
10419
9055
|
const h1 = window.location.hash;
|
|
10420
9056
|
history.pushState(null, "", `${path}`);
|
|
10421
9057
|
const h2 = window.location.hash;
|
|
@@ -10424,7 +9060,7 @@ var PathProvider = ({ children }) => {
|
|
|
10424
9060
|
}
|
|
10425
9061
|
dispatch({ type: SET_PATH, path });
|
|
10426
9062
|
}, []);
|
|
10427
|
-
const replaceState =
|
|
9063
|
+
const replaceState = useCallback40((path) => {
|
|
10428
9064
|
const h1 = window.location.hash;
|
|
10429
9065
|
history.replaceState(null, "", path);
|
|
10430
9066
|
const h2 = window.location.hash;
|
|
@@ -10444,7 +9080,7 @@ var PathProvider = ({ children }) => {
|
|
|
10444
9080
|
}),
|
|
10445
9081
|
[state]
|
|
10446
9082
|
);
|
|
10447
|
-
return /* @__PURE__ */
|
|
9083
|
+
return /* @__PURE__ */ React90.createElement(PathContext.Provider, {
|
|
10448
9084
|
value
|
|
10449
9085
|
}, children);
|
|
10450
9086
|
};
|
|
@@ -10464,33 +9100,33 @@ var WaykeProvider = ({
|
|
|
10464
9100
|
children
|
|
10465
9101
|
}) => {
|
|
10466
9102
|
useEcom_default(ecomSettings);
|
|
10467
|
-
return /* @__PURE__ */
|
|
9103
|
+
return /* @__PURE__ */ React91.createElement(PathProvider_default, null, /* @__PURE__ */ React91.createElement(SettingsProvider_default, {
|
|
10468
9104
|
googleMapsApiKey,
|
|
10469
9105
|
googleMapsMarker,
|
|
10470
9106
|
ecomSettings
|
|
10471
|
-
}, /* @__PURE__ */
|
|
9107
|
+
}, /* @__PURE__ */ React91.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React91.createElement(graphqlProvider_default, {
|
|
10472
9108
|
uri: graphQlUrl
|
|
10473
|
-
}, /* @__PURE__ */
|
|
9109
|
+
}, /* @__PURE__ */ React91.createElement(SearchProvider_default, {
|
|
10474
9110
|
url,
|
|
10475
9111
|
apiKey,
|
|
10476
9112
|
useQueryParamsFromUrl,
|
|
10477
9113
|
pathRoute
|
|
10478
|
-
}, /* @__PURE__ */
|
|
9114
|
+
}, /* @__PURE__ */ React91.createElement(RelatedSearchProvider_default, {
|
|
10479
9115
|
url,
|
|
10480
9116
|
urlMlt,
|
|
10481
9117
|
apiKey
|
|
10482
|
-
}, /* @__PURE__ */
|
|
9118
|
+
}, /* @__PURE__ */ React91.createElement(themeProvider_default, null, /* @__PURE__ */ React91.createElement(Root_default, null, children))))))));
|
|
10483
9119
|
};
|
|
10484
9120
|
var WaykeProvider_default = WaykeProvider;
|
|
10485
9121
|
|
|
10486
9122
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
10487
|
-
import
|
|
9123
|
+
import React93 from "react";
|
|
10488
9124
|
|
|
10489
9125
|
// src/layouts/WaykeComposite.tsx
|
|
10490
|
-
import
|
|
9126
|
+
import React92, { useEffect as useEffect20 } from "react";
|
|
10491
9127
|
|
|
10492
9128
|
// src/hooks/useHashGuid.ts
|
|
10493
|
-
import { useState as
|
|
9129
|
+
import { useState as useState31, useEffect as useEffect19 } from "react";
|
|
10494
9130
|
var regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
10495
9131
|
var HASH_CHANGE = "hashchange";
|
|
10496
9132
|
var getGuid = () => {
|
|
@@ -10498,7 +9134,7 @@ var getGuid = () => {
|
|
|
10498
9134
|
return regexGuid.test(guid) || !guid ? guid : void 0;
|
|
10499
9135
|
};
|
|
10500
9136
|
var useHashGuid = () => {
|
|
10501
|
-
const [id, setId] =
|
|
9137
|
+
const [id, setId] = useState31(() => getGuid());
|
|
10502
9138
|
const onHashChange = () => {
|
|
10503
9139
|
const guid = window.location.hash.substr(1, window.location.hash.length);
|
|
10504
9140
|
if (regexGuid.test(guid) || !guid) {
|
|
@@ -10507,7 +9143,7 @@ var useHashGuid = () => {
|
|
|
10507
9143
|
throw "Invalid Guid";
|
|
10508
9144
|
}
|
|
10509
9145
|
};
|
|
10510
|
-
|
|
9146
|
+
useEffect19(() => {
|
|
10511
9147
|
onHashChange();
|
|
10512
9148
|
window.addEventListener(HASH_CHANGE, onHashChange);
|
|
10513
9149
|
return () => {
|
|
@@ -10532,7 +9168,7 @@ var WaykeComposite = ({
|
|
|
10532
9168
|
}) => {
|
|
10533
9169
|
const hashId = useHashGuid_default();
|
|
10534
9170
|
const { id: pathId } = usePath_default();
|
|
10535
|
-
|
|
9171
|
+
useEffect20(() => {
|
|
10536
9172
|
if (!pathRoute) {
|
|
10537
9173
|
if (hashId) {
|
|
10538
9174
|
pubsub_default.publish("HashRouteChange", hashId);
|
|
@@ -10542,14 +9178,14 @@ var WaykeComposite = ({
|
|
|
10542
9178
|
}
|
|
10543
9179
|
}, [hashId]);
|
|
10544
9180
|
const id = pathId || hashId;
|
|
10545
|
-
return /* @__PURE__ */
|
|
9181
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, id ? /* @__PURE__ */ React92.createElement(searchItem_default, {
|
|
10546
9182
|
id,
|
|
10547
9183
|
hashRoute: !pathRoute,
|
|
10548
9184
|
disableResetScrollOnInit,
|
|
10549
9185
|
placeholderImage,
|
|
10550
9186
|
pathRoute,
|
|
10551
9187
|
modifyDocumentTitleItem
|
|
10552
|
-
}) : /* @__PURE__ */
|
|
9188
|
+
}) : /* @__PURE__ */ React92.createElement(search_default, {
|
|
10553
9189
|
filterList,
|
|
10554
9190
|
initialQueryParams,
|
|
10555
9191
|
removeSearchBar,
|
|
@@ -10563,15 +9199,15 @@ var WaykeComposite = ({
|
|
|
10563
9199
|
var WaykeComposite_default = WaykeComposite;
|
|
10564
9200
|
|
|
10565
9201
|
// src/layouts/WaykeCompositeWithProvider.tsx
|
|
10566
|
-
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */
|
|
9202
|
+
var WaykeCompositeWithProvider = ({ provider, composite }) => /* @__PURE__ */ React93.createElement(WaykeProvider_default, {
|
|
10567
9203
|
...provider
|
|
10568
|
-
}, /* @__PURE__ */
|
|
9204
|
+
}, /* @__PURE__ */ React93.createElement(WaykeComposite_default, {
|
|
10569
9205
|
...composite
|
|
10570
9206
|
}));
|
|
10571
9207
|
var WaykeCompositeWithProvider_default = WaykeCompositeWithProvider;
|
|
10572
9208
|
|
|
10573
9209
|
// src/providers/WaykeItemProvidet.tsx
|
|
10574
|
-
import
|
|
9210
|
+
import React94 from "react";
|
|
10575
9211
|
var WaykeItemProvider = ({
|
|
10576
9212
|
url,
|
|
10577
9213
|
urlMlt,
|
|
@@ -10583,17 +9219,17 @@ var WaykeItemProvider = ({
|
|
|
10583
9219
|
children
|
|
10584
9220
|
}) => {
|
|
10585
9221
|
useEcom_default(ecomSettings);
|
|
10586
|
-
return /* @__PURE__ */
|
|
9222
|
+
return /* @__PURE__ */ React94.createElement(PathProvider_default, null, /* @__PURE__ */ React94.createElement(SettingsProvider_default, {
|
|
10587
9223
|
googleMapsApiKey,
|
|
10588
9224
|
googleMapsMarker,
|
|
10589
9225
|
ecomSettings
|
|
10590
|
-
}, /* @__PURE__ */
|
|
9226
|
+
}, /* @__PURE__ */ React94.createElement(CentralStorageProvider_default, null, /* @__PURE__ */ React94.createElement(graphqlProvider_default, {
|
|
10591
9227
|
uri: graphQlUrl
|
|
10592
|
-
}, /* @__PURE__ */
|
|
9228
|
+
}, /* @__PURE__ */ React94.createElement(RelatedSearchProvider_default, {
|
|
10593
9229
|
url,
|
|
10594
9230
|
urlMlt,
|
|
10595
9231
|
apiKey
|
|
10596
|
-
}, /* @__PURE__ */
|
|
9232
|
+
}, /* @__PURE__ */ React94.createElement(themeProvider_default, null, /* @__PURE__ */ React94.createElement(Root_default, null, children)))))));
|
|
10597
9233
|
};
|
|
10598
9234
|
var WaykeItemProvidet_default = WaykeItemProvider;
|
|
10599
9235
|
|