@admin-layout/tailwind-design-pro 12.0.16-alpha.4 → 12.0.16-alpha.41

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.
Files changed (215) hide show
  1. package/README.md +30 -0
  2. package/lib/cdm-locales/en/menu.json +2 -1
  3. package/lib/cdm-locales/es/menu.json +2 -1
  4. package/lib/cdm-locales/index.d.ts +2 -0
  5. package/lib/cdm-locales/index.d.ts.map +1 -0
  6. package/lib/cdm-locales/index.ts +1 -0
  7. package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
  8. package/lib/components/Layout/BasicLayout/index.d.ts +1 -1
  9. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  10. package/lib/components/Layout/BasicLayout/index.js +39 -9
  11. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  12. package/lib/components/Layout/BasicLayout/utils.d.ts +2 -0
  13. package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
  14. package/lib/components/Layout/BasicLayout/utils.js +12 -9
  15. package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
  16. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
  17. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +4 -2
  18. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
  19. package/lib/components/Layout/GlobalHeader/Header.js +1 -1
  20. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  21. package/lib/components/Layout/GlobalHeader/Logo.js.map +1 -1
  22. package/lib/components/Layout/GlobalHeader/MainHeader.js +2 -2
  23. package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
  24. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +1 -1
  25. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
  26. package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -0
  27. package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
  28. package/lib/components/Layout/GlobalHeader/RightContent.js +73 -6
  29. package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
  30. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
  31. package/lib/components/Layout/GlobalHeader/RightMenu.js +2 -4
  32. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
  33. package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
  34. package/lib/components/Layout/ProTailwindLayout.d.ts +2 -2
  35. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  36. package/lib/components/Layout/ProTailwindLayout.js +69 -7
  37. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  38. package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
  39. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
  40. package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
  41. package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
  42. package/lib/components/Layout/Sidebar/{Sidebar.js → MainSidebar.js} +4 -5
  43. package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
  44. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +4 -0
  45. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
  46. package/lib/components/Layout/Sidebar/MainSidebarMenu.js +294 -0
  47. package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
  48. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +5 -0
  49. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
  50. package/lib/components/Layout/Sidebar/PerplexSidebar.js +173 -0
  51. package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
  52. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
  53. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
  54. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +342 -0
  55. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
  56. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  57. package/lib/components/Layout/TailwindLayout.js +8 -5
  58. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  59. package/lib/components/Layout/getPageTitle.js.map +1 -1
  60. package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -1
  61. package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
  62. package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -1
  63. package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -1
  64. package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
  65. package/lib/components/Layout/util.js +1 -1
  66. package/lib/components/Layout/util.js.map +1 -1
  67. package/lib/components/SettingDrawer/CheckBoxTheme.js.map +1 -1
  68. package/lib/components/SettingDrawer/InvitationSettings.js +1 -1
  69. package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -1
  70. package/lib/components/SettingDrawer/LayoutChange.js +1 -1
  71. package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
  72. package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts +20 -0
  73. package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts.map +1 -0
  74. package/lib/components/SettingDrawer/MenuVisibilitySettings.js +120 -0
  75. package/lib/components/SettingDrawer/MenuVisibilitySettings.js.map +1 -0
  76. package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
  77. package/lib/components/SettingDrawer/NavigationsModes.js +91 -5
  78. package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
  79. package/lib/components/SettingDrawer/RegionalSettings.js +1 -1
  80. package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
  81. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  82. package/lib/components/SettingDrawer/SettingDrawer.js +54 -6
  83. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  84. package/lib/components/SettingDrawer/Switch/index.js.map +1 -1
  85. package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
  86. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.d.ts +2 -1
  87. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.d.ts.map +1 -1
  88. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.js +3 -1
  89. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.js.map +1 -1
  90. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
  91. package/lib/components/index.d.ts +0 -1
  92. package/lib/components/index.d.ts.map +1 -1
  93. package/lib/components/index.js +1 -1
  94. package/lib/components/typings.d.ts +11 -6
  95. package/lib/components/typings.d.ts.map +1 -1
  96. package/lib/compute.d.ts.map +1 -1
  97. package/lib/compute.js +1 -0
  98. package/lib/compute.js.map +1 -1
  99. package/lib/config/constants.js.map +1 -1
  100. package/lib/config/env-config.d.ts +1 -0
  101. package/lib/config/env-config.d.ts.map +1 -1
  102. package/lib/config/env-config.js +4 -0
  103. package/lib/config/env-config.js.map +1 -1
  104. package/lib/helpers/DynamicIcon.js.map +1 -1
  105. package/lib/hooks/index.d.ts +0 -3
  106. package/lib/hooks/index.d.ts.map +1 -1
  107. package/lib/hooks/useMediaQuery.js.map +1 -1
  108. package/lib/hooks/useScrollThreshold.js.map +1 -1
  109. package/lib/hooks/useTailwindTheme.js.map +1 -1
  110. package/lib/icons.d.ts +2 -0
  111. package/lib/icons.d.ts.map +1 -1
  112. package/lib/icons.js +4 -2
  113. package/lib/icons.js.map +1 -1
  114. package/lib/index.d.ts +1 -0
  115. package/lib/index.d.ts.map +1 -1
  116. package/lib/index.js +1 -1
  117. package/lib/index.js.map +1 -1
  118. package/lib/machines/settingsMachine.d.ts.map +1 -1
  119. package/lib/machines/settingsMachine.js +27 -3
  120. package/lib/machines/settingsMachine.js.map +1 -1
  121. package/lib/machines/types.d.ts +7 -1
  122. package/lib/machines/types.d.ts.map +1 -1
  123. package/lib/machines/types.js.map +1 -1
  124. package/lib/module.js.map +1 -1
  125. package/lib/redux/searchReducer.js.map +1 -1
  126. package/lib/routes.json +1 -0
  127. package/lib/tailwindConfig.js.map +1 -1
  128. package/lib/utils/isBrowser/index.js.map +1 -1
  129. package/lib/utils/utils/index.js.map +1 -1
  130. package/package.json +7 -21
  131. package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -5
  132. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
  133. package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
  134. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -4
  135. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
  136. package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -176
  137. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
  138. package/lib/components/UI/CardList.d.ts +0 -61
  139. package/lib/components/UI/CardList.d.ts.map +0 -1
  140. package/lib/components/UI/CardList.js +0 -43
  141. package/lib/components/UI/CardList.js.map +0 -1
  142. package/lib/components/UI/CategoriesTypeList.d.ts +0 -29
  143. package/lib/components/UI/CategoriesTypeList.d.ts.map +0 -1
  144. package/lib/components/UI/CategoriesTypeList.js +0 -139
  145. package/lib/components/UI/CategoriesTypeList.js.map +0 -1
  146. package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +0 -83
  147. package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +0 -1
  148. package/lib/components/UI/LazyLoadingGoogleMarker.js +0 -107
  149. package/lib/components/UI/LazyLoadingGoogleMarker.js.map +0 -1
  150. package/lib/components/UI/Pagination.d.ts +0 -6
  151. package/lib/components/UI/Pagination.d.ts.map +0 -1
  152. package/lib/components/UI/Pagination.js +0 -56
  153. package/lib/components/UI/Pagination.js.map +0 -1
  154. package/lib/components/UI/ParamSearchResultContainer.d.ts +0 -99
  155. package/lib/components/UI/ParamSearchResultContainer.d.ts.map +0 -1
  156. package/lib/components/UI/ParamSearchResultContainer.js +0 -120
  157. package/lib/components/UI/ParamSearchResultContainer.js.map +0 -1
  158. package/lib/components/UI/PropertyCard.d.ts +0 -24
  159. package/lib/components/UI/PropertyCard.d.ts.map +0 -1
  160. package/lib/components/UI/PropertyCard.js +0 -420
  161. package/lib/components/UI/PropertyCard.js.map +0 -1
  162. package/lib/components/UI/PropertyCardOnMap.d.ts +0 -10
  163. package/lib/components/UI/PropertyCardOnMap.d.ts.map +0 -1
  164. package/lib/components/UI/PropertyCardOnMap.js +0 -108
  165. package/lib/components/UI/PropertyCardOnMap.js.map +0 -1
  166. package/lib/components/UI/VehicleCard/PricePopover.d.ts +0 -8
  167. package/lib/components/UI/VehicleCard/PricePopover.d.ts.map +0 -1
  168. package/lib/components/UI/VehicleCard/PricePopover.js +0 -98
  169. package/lib/components/UI/VehicleCard/PricePopover.js.map +0 -1
  170. package/lib/components/UI/VehicleCard/VehicleBadge.d.ts +0 -7
  171. package/lib/components/UI/VehicleCard/VehicleBadge.d.ts.map +0 -1
  172. package/lib/components/UI/VehicleCard/VehicleFeature.d.ts +0 -9
  173. package/lib/components/UI/VehicleCard/VehicleFeature.d.ts.map +0 -1
  174. package/lib/components/UI/VehicleCard/VehicleFeature.js +0 -22
  175. package/lib/components/UI/VehicleCard/VehicleFeature.js.map +0 -1
  176. package/lib/components/UI/VehicleCard/types.d.ts +0 -59
  177. package/lib/components/UI/VehicleCard/types.d.ts.map +0 -1
  178. package/lib/components/UI/VehicleCard.d.ts +0 -15
  179. package/lib/components/UI/VehicleCard.d.ts.map +0 -1
  180. package/lib/components/UI/VehicleCard.js +0 -166
  181. package/lib/components/UI/VehicleCard.js.map +0 -1
  182. package/lib/components/UI/VehicleCardList.d.ts +0 -14
  183. package/lib/components/UI/VehicleCardList.d.ts.map +0 -1
  184. package/lib/components/UI/VehicleCardList.js +0 -38
  185. package/lib/components/UI/VehicleCardList.js.map +0 -1
  186. package/lib/components/UI/VehicleParamSearchResultContainer.d.ts +0 -90
  187. package/lib/components/UI/VehicleParamSearchResultContainer.d.ts.map +0 -1
  188. package/lib/components/UI/icons/LocationIcon.d.ts +0 -7
  189. package/lib/components/UI/icons/LocationIcon.d.ts.map +0 -1
  190. package/lib/components/UI/icons/LocationIcon.js +0 -18
  191. package/lib/components/UI/icons/LocationIcon.js.map +0 -1
  192. package/lib/components/UI/icons/index.d.ts +0 -2
  193. package/lib/components/UI/icons/index.d.ts.map +0 -1
  194. package/lib/components/UI/index.d.ts +0 -10
  195. package/lib/components/UI/index.d.ts.map +0 -1
  196. package/lib/components/typings.js +0 -6
  197. package/lib/components/typings.js.map +0 -1
  198. package/lib/hooks/use-get-current-lat-long.d.ts +0 -18
  199. package/lib/hooks/use-get-current-lat-long.d.ts.map +0 -1
  200. package/lib/hooks/use-get-current-lat-long.js +0 -29
  201. package/lib/hooks/use-get-current-lat-long.js.map +0 -1
  202. package/lib/hooks/useWindowSize.d.ts +0 -6
  203. package/lib/hooks/useWindowSize.d.ts.map +0 -1
  204. package/lib/hooks/useWindowSize.js +0 -20
  205. package/lib/hooks/useWindowSize.js.map +0 -1
  206. package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts +0 -6
  207. package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts.map +0 -1
  208. package/lib/middlewares/bookingCarRentalMiddleware.d.ts +0 -6
  209. package/lib/middlewares/bookingCarRentalMiddleware.d.ts.map +0 -1
  210. package/lib/middlewares/bookingDatasourcesMiddleware.d.ts +0 -7
  211. package/lib/middlewares/bookingDatasourcesMiddleware.d.ts.map +0 -1
  212. package/lib/middlewares/datasourcesMiddleware.d.ts +0 -6
  213. package/lib/middlewares/datasourcesMiddleware.d.ts.map +0 -1
  214. package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts +0 -7
  215. package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts.map +0 -1
@@ -1,420 +0,0 @@
1
- import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {useMemo,useState,useEffect,useCallback}from'react';import {BsHeart}from'@react-icons/all-files/bs/BsHeart.js';import {BsStarFill}from'@react-icons/all-files/bs/BsStarFill.js';import {FaUserAlt}from'@react-icons/all-files/fa/FaUserAlt.js';import {useTranslation}from'react-i18next';import {WithAuthentication}from'@adminide-stack/user-auth0-browser/lib/index.component.js';import {Splide,SplideSlide}from'@cdmbase/react-splide';import {useLocation}from'@remix-run/react';import {startCase}from'lodash-es';import {useTailwindTheme}from'../../hooks/useTailwindTheme.js';import {useGetCurrentLongLat}from'../../hooks/use-get-current-lat-long.js';import {LocationIcon}from'./icons/LocationIcon.js';import {renderDynamicIcon}from'../../helpers/DynamicIcon.js';import {config}from'../../config/env-config.js';// const generateHref = async (room, from, to, adults, children) => {
2
- // if (!room) return null;
3
- // switch (room.__typename) {
4
- // case 'AirbnbProperty':
5
- // // Airbnb doesn't need API call, just construct URL directly
6
- // return `/deep-link/property/${room.id}?redirectUrl=${encodeURIComponent(
7
- // `https://www.airbnb.com/rooms/${room.id}?check_in=${from}&check_out=${to}&guests=${
8
- // adults + children || 1
9
- // }`,
10
- // )}&partnerName=${encodeURIComponent('Airbnb.com')}&partnerLogo=${airbnbLogo}`;
11
- // case 'BookingProperty':
12
- // // Call Booking.com API
13
- // try {
14
- // const hotelDetails = await fetchBookingHotelDetails(room.id, from, to, adults, children);
15
- // console.log('hotelDetails--->', hotelDetails);
16
- // if (hotelDetails && hotelDetails?.data?.url) {
17
- // return `/deep-link/property/${room.id}?redirectUrl=${encodeURIComponent(
18
- // hotelDetails?.data?.url,
19
- // )}&partnerName=${encodeURIComponent('Booking.com')}&partnerLogo=${bookingLogo}`;
20
- // }
21
- // } catch (error) {
22
- // console.error('Error getting Booking.com URL:', error);
23
- // }
24
- // return null;
25
- // case 'PricelineProperty':
26
- // // Call Priceline API
27
- // try {
28
- // const pricelineDetails = await fetchPricelineHotelDetails(room.id);
29
- // console.log('pricelineDetails--->', pricelineDetails);
30
- // if (pricelineDetails && pricelineDetails.getHotelHotelDetails) {
31
- // const hotelInfo = pricelineDetails.getHotelHotelDetails?.results?.hotel_data?.hotel_0;
32
- // if (hotelInfo && hotelInfo.priceline_url) {
33
- // return `/deep-link/property/${room.id}?redirectUrl=${encodeURIComponent(
34
- // hotelInfo.priceline_url,
35
- // )}&partnerName=${encodeURIComponent('Priceline.com')}&partnerLogo=${pricelineLogo}`;
36
- // }
37
- // }
38
- // } catch (error) {
39
- // console.error('Error getting Priceline URL:', error);
40
- // }
41
- // // If API call fails, construct a fallback URL
42
- // const propertyId = room.metadata?.id_t;
43
- // const cityId = room?.metadata?.city?.id || '';
44
- // const checkInDate = typeof from === 'string' ? from : format(new Date(from), 'yyyyMMdd');
45
- // const checkOutDate = typeof to === 'string' ? to : format(new Date(to), 'yyyyMMdd');
46
- // const roomCount = 1;
47
- // const adultCount = adults || 1;
48
- // return `/deep-link/property/${room.id}?redirectUrl=${encodeURIComponent(
49
- // `https://www.priceline.com/relax/at/${propertyId}/from/${checkInDate}/to/${checkOutDate}/rooms/${roomCount}/adults/${adultCount}?cityId=${cityId}&cur=USD&psl=${propertyId}`,
50
- // )}&partnerName=${encodeURIComponent('Priceline.com')}&partnerLogo=${pricelineLogo}`;
51
- // default:
52
- // return `/property/${room.id}`;
53
- // }
54
- // };
55
- const DealCard = ({
56
- site,
57
- price
58
- }) => jsxs("div", {
59
- className: "flex flex-col items-center p-2 rounded-themed",
60
- children: [jsx("span", {
61
- className: "text-xs font-bold text-muted-foreground",
62
- children: site
63
- }), jsx("span", {
64
- className: "text-base font-bold text-foreground",
65
- children: typeof price === 'number' ? price.toLocaleString() : price
66
- })]
67
- });
68
- function calculateDuration(checkIn, checkOut) {
69
- const checkInDate = new Date(checkIn);
70
- const checkOutDate = new Date(checkOut);
71
- const duration = Math.ceil((checkOutDate.getTime() - checkInDate.getTime()) / (1000 * 60 * 60 * 24));
72
- return duration;
73
- }
74
- function formatDuration(days) {
75
- if (days < 7) {
76
- return `${days} ${days === 1 ? 'day' : 'days'}`;
77
- } else {
78
- const weeks = Math.floor(days / 7);
79
- const remainingDays = days % 7;
80
- let result = `${weeks} ${weeks === 1 ? 'week' : 'weeks'}`;
81
- if (remainingDays > 0) {
82
- result += `, ${remainingDays} ${remainingDays === 1 ? 'day' : 'days'}`;
83
- }
84
- return result;
85
- }
86
- }
87
- const PropertyCard = ({
88
- item,
89
- isSaved,
90
- setFocus,
91
- setBlur,
92
- handleLike,
93
- likeBtnLoading,
94
- categoryTypes,
95
- authenticated,
96
- extraIcons = [],
97
- ...props
98
- }) => {
99
- const images = useMemo(() => item?.images?.data.map(({
100
- url
101
- }) => ({
102
- src: url
103
- })), [item]);
104
- const [didLike, setDidLike] = useState(false);
105
- useMemo(() => item?.totalReview == 0 ? 0 : item?.totalStar / item?.totalReview || 0, [item]);
106
- const {
107
- grayColor
108
- } = useTailwindTheme();
109
- const {
110
- t
111
- } = useTranslation(['common', 'property-types']);
112
- const types = useMemo(() => categoryTypes?.filter(type => item?.types?.includes(type.id)), [item, categoryTypes]);
113
- const {
114
- fetchCurrentLatLong,
115
- location} = useGetCurrentLongLat();
116
- const locationUrl = useLocation();
117
- const params = new URLSearchParams(locationUrl.search);
118
- const checkIn = params.get('checkIn') || params.get('from') || '';
119
- const checkOut = params.get('checkOut') || params.get('to') || '';
120
- const duration = calculateDuration(checkIn, checkOut);
121
- const formattedDuration = formatDuration(duration);
122
- const [isRedirecting, setIsRedirecting] = useState(false);
123
- useEffect(() => {
124
- fetchCurrentLatLong();
125
- }, []);
126
- const handleRedirect = async e => {
127
- if (e) e.preventDefault();
128
- setIsRedirecting(true);
129
- // Open the waiting page immediately with a temporary placeholder
130
- const intermediateUrl = `/deep-link/property/${item.id}?redirectUrl=pending&partnerName=Loading...&partnerLogo=/images/loading.png&propertyType=${item.__typename}&checkIn=${checkIn}&checkOut=${checkOut}&adults=${adults}&children=${children}`;
131
- window.open(intermediateUrl, '_blank');
132
- // No need to make API calls here anymore as they will be handled by DeepLinkWaitingPage
133
- setIsRedirecting(false);
134
- };
135
- const getPriceType = useCallback(room => {
136
- const type = room.preferences?.property?.pricing?.option?.priceType;
137
- if (type === 'HOUR') {
138
- return t('property.hr');
139
- }
140
- return t('property.night');
141
- }, [t]);
142
- useCallback(address => {
143
- if (!location || !address) return null;
144
- if (typeof window !== 'undefined' && window.google && window.google.maps && window.google.maps.LatLng) {
145
- const point1 = new window.google.maps.LatLng(location.latitude, location.longitude);
146
- const point2 = new window.google.maps.LatLng(address.latitude_around, address.longitude_around);
147
- if (window.google.maps.geometry && window.google.maps.geometry.spherical) {
148
- const distance = window.google.maps.geometry.spherical.computeDistanceBetween(point1, point2);
149
- const distanceInMiles = distance * 0.000621371;
150
- return Math.floor(distanceInMiles);
151
- } else {
152
- console.error('Google Maps geometry library is not loaded.');
153
- return null;
154
- }
155
- } else {
156
- return null;
157
- }
158
- }, [location]);
159
- const searchParams = new URLSearchParams(window.location.search);
160
- const adults = parseInt(searchParams.get('adults') || '0', 10) || 1;
161
- const children = parseInt(searchParams.get('children') || '0', 10);
162
- const amenities = item?.preferences?.property?.amenities;
163
- const displayedIcons = amenities ? Object.entries(amenities)?.flatMap(([key, value]) => {
164
- const enabledAmenities = Object.entries(value ?? {})?.filter(([key1, value1]) => value1?.enable && value1?.icon);
165
- const displayedAmenities = enabledAmenities.slice(0, 8);
166
- return displayedAmenities.length > 0 ? displayedAmenities.map(([key1, value1]) => renderDynamicIcon({
167
- name: value1.icon,
168
- style: {
169
- iconColor: grayColor,
170
- w: '20px',
171
- h: '20px'
172
- }
173
- })) : [];
174
- }) : [];
175
- const LikeButton = () => jsx(Fragment, {
176
- children: likeBtnLoading ? jsx("div", {
177
- className: "w-12 h-12 border-4 border-t-primary rounded-full animate-spin border-muted"
178
- }) : jsx("button", {
179
- className: `w-7 h-9.5 rounded-full flex items-center justify-center ${didLike ? 'bg-primary' : 'bg-background'}`,
180
- onClick: () => handleLike(item.id),
181
- "aria-label": "Select as your favourite",
182
- children: jsx(BsHeart, {
183
- className: didLike ? 'text-primary-foreground' : 'text-muted-foreground'
184
- })
185
- })
186
- });
187
- WithAuthentication(LikeButton);
188
- return jsx(Fragment, {
189
- children: jsxs("div", {
190
- className: "flex flex-row p-2 relative w-[370px]",
191
- onMouseEnter: () => setFocus(item.id),
192
- onMouseLeave: () => setBlur(item.id),
193
- ...props,
194
- children: [item?.status === 'pending' && jsxs(Fragment, {
195
- children: [jsx("div", {
196
- className: "absolute w-full h-full bg-background/60 rounded-2xl z-10"
197
- }), jsx("div", {
198
- className: "absolute left-1/2 top-1/2 transform -translate-x-1/2 translate-y-1/2 text-foreground z-20",
199
- children: jsx("p", {
200
- className: "text-lg font-normal",
201
- children: t('property.coming_soon')
202
- })
203
- })]
204
- }), jsx("div", {
205
- className: "w-full max-w-[100%] border border-solid border-border rounded-2xl shadow-themed-md transition-all duration-300 hover:transform hover:-translate-y-1 hover:shadow-themed-lg themed-card",
206
- children: jsxs("div", {
207
- className: "w-full h-full flex flex-col justify-between space-y-4",
208
- children: [jsxs("div", {
209
- className: "relative w-full h-full rounded-xl",
210
- children: [jsx("div", {
211
- className: "absolute top-2 left-2 bg-success text-success-foreground px-3 py-1 rounded-themed text-sm font-bold shadow-themed-md z-10",
212
- children: "Breakfast included"
213
- }), jsxs(Splide, {
214
- "aria-label": "Property Images",
215
- options: {
216
- type: 'slide',
217
- drag: 'free',
218
- perPage: 1,
219
- perMove: 1,
220
- lazyLoad: 'sequential',
221
- wheel: true,
222
- releaseWheel: true,
223
- pagination: false,
224
- speed: 800
225
- },
226
- children: [jsx("div", {
227
- className: "absolute top-2.5 right-2.5 z-10",
228
- children: jsx(LikeButton, {})
229
- }), images.map((image, i) => jsx(SplideSlide, {
230
- children: jsx("a", {
231
- href: "#",
232
- onClick: handleRedirect,
233
- rel: "noopener noreferrer",
234
- children: jsx("div", {
235
- className: "w-full h-full rounded-xl",
236
- children: jsx("img", {
237
- src: image.src,
238
- className: "rounded-xl h-[250px] w-full max-w-full object-cover cursor-pointer transition-all duration-500 hover:brightness-50",
239
- loading: "lazy",
240
- alt: `Property ${i + 1}`
241
- }, 'image_' + i)
242
- }, 'sliderImage_' + i)
243
- })
244
- }, 'sliderslide_' + i))]
245
- })]
246
- }), jsxs("div", {
247
- className: "w-full px-4 flex flex-col pt-2",
248
- children: [jsxs("div", {
249
- className: "flex flex-wrap items-center space-x-2 mb-2",
250
- children: [jsxs("span", {
251
- className: "text-sm font-medium text-foreground",
252
- children: [t('property.property_type'), ":"]
253
- }), types?.map((item, index) => jsx("span", {
254
- className: "bg-muted text-muted-foreground text-xs px-2 py-1 rounded-themed capitalize",
255
- children: t(`property-types:${item.description}`)
256
- }, index))]
257
- }), jsx("h3", {
258
- className: "text-lg font-medium mb-2 line-clamp-2 text-foreground",
259
- children: item?.title
260
- }), item?.address && item?.address.city && item?.address.city.state && jsxs("div", {
261
- className: "flex items-center text-sm text-muted-foreground mb-2",
262
- children: [jsx(LocationIcon, {
263
- w: "16px",
264
- h: "20px"
265
- }), jsxs("span", {
266
- className: "truncate",
267
- children: [item?.address.city.name + ', ' + item?.address.city.state.name, item?.address?.number ? ' · ' + item?.address?.number : '']
268
- })]
269
- }), displayedIcons.length > 0 && jsx("div", {
270
- className: "flex space-x-3 mt-2 mb-3",
271
- children: displayedIcons
272
- }), jsxs("div", {
273
- className: "flex flex-wrap space-x-2 mt-1 mb-3",
274
- children: [item?.preferences?.property?.booking?.policy?.instantBookingEnabled && jsx("span", {
275
- className: "bg-primary/10 text-primary px-2 py-1 rounded-themed text-xs capitalize",
276
- children: t('property.instant_book')
277
- }), item?.preferences?.property?.booking?.policy?.cancellation && jsx("span", {
278
- className: "bg-success/10 text-success px-2 py-1 rounded-themed text-xs capitalize",
279
- children: t('property.cancellation_policy')
280
- })]
281
- }), jsxs("div", {
282
- className: "flex items-center mb-4",
283
- children: [jsx(FaUserAlt, {
284
- className: "text-muted-foreground"
285
- }), jsxs("span", {
286
- className: "text-sm text-muted-foreground ml-2",
287
- children: [item?.preferences?.property?.boarding?.maxPeople, " ", t('property.guests')]
288
- })]
289
- })]
290
- }), config.ENABLE_PROPERTY_PRICE_COMPARISON && jsx("div", {
291
- className: "px-4 w-full",
292
- children: jsxs("div", {
293
- className: "w-fit flex gap-4",
294
- children: [jsx("hr", {
295
- className: "w-full border-t border-border"
296
- }), jsxs("div", {
297
- className: "flex flex-row",
298
- children: [jsx(DealCard, {
299
- site: "Vio.com",
300
- price: 41387
301
- }), jsx(DealCard, {
302
- site: "Expedia.com",
303
- price: 46369
304
- }), jsx(DealCard, {
305
- site: "More Deals",
306
- price: 'View all'
307
- })]
308
- }), jsx("hr", {
309
- className: "w-full border-t border-border"
310
- })]
311
- })
312
- }), jsxs("div", {
313
- className: "flex flex-col sm:flex-row px-4 pb-4 w-full justify-between items-start sm:items-center",
314
- children: [jsxs("div", {
315
- className: "flex flex-col space-y-1 mb-3 sm:mb-0 w-full sm:w-auto",
316
- children: [jsxs("div", {
317
- className: "flex items-center",
318
- children: [jsx(BsStarFill, {
319
- className: "text-warning w-3 h-3 mr-1"
320
- }), jsxs("span", {
321
- className: "text-[0.832rem] font-bold text-muted-foreground",
322
- children: [item?.reviewsOverview ? item.reviewsOverview.rating : 0, " (", item.reviewsOverview ? item.reviewsOverview.ratingCount : 0, ' ', t('property.reviews'), ")"]
323
- })]
324
- }), item?.__typename && jsxs("span", {
325
- className: "text-[0.832rem] text-muted-foreground",
326
- children: ["Booking through ", startCase(item.__typename.replace('Property', ''))]
327
- })]
328
- }), jsxs("div", {
329
- className: "flex flex-col items-end space-y-2 w-full sm:w-auto",
330
- children: [jsxs("div", {
331
- className: "flex flex-col items-end space-y-1 w-full",
332
- children: [jsxs("span", {
333
- className: "text-[0.688rem] text-muted-foreground text-right w-full",
334
- children: [formattedDuration, ", ", adults + children, ' ', adults + children === 1 ? 'guest' : 'guests']
335
- }), jsxs("div", {
336
- className: "flex flex-col items-end space-y-0 w-full",
337
- children: [item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.total !== item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.totalBeforeDiscount && jsxs("div", {
338
- className: "flex items-center group relative",
339
- children: [jsx("span", {
340
- className: "text-xs text-muted-foreground",
341
- children: "from"
342
- }), jsx("span", {
343
- className: "text-sm font-semibold text-muted-foreground line-through ml-1 cursor-help hover:text-foreground group-hover:text-foreground",
344
- children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.totalBeforeDiscount
345
- }), jsx("div", {
346
- className: "hidden group-hover:block absolute top-0 right-0 transform -translate-y-full mt-2 w-[300px] shadow-themed-lg bg-card rounded-themed p-4 z-50",
347
- children: jsxs("div", {
348
- className: "flex flex-col space-y-2",
349
- children: [item.preferences?.property?.pricing?.price?.price_breakdown?.details?.discounts?.items.map((charge, index) => jsxs("div", {
350
- className: "flex flex-col",
351
- children: [jsxs("div", {
352
- className: "flex justify-between",
353
- children: [jsx("span", {
354
- className: "mr-4 text-foreground",
355
- children: charge.name
356
- }), jsx("span", {
357
- className: "font-medium text-foreground",
358
- children: charge?.amount_rounded
359
- })]
360
- }), charge.details && jsx("span", {
361
- className: "text-sm font-normal text-muted-foreground",
362
- children: charge?.details
363
- })]
364
- }, index)), jsxs("div", {
365
- className: "flex justify-between pt-2 border-t border-border font-bold",
366
- children: [jsx("span", {
367
- className: "text-foreground",
368
- children: "Total discount"
369
- }), jsx("span", {
370
- className: "text-foreground",
371
- children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.savings
372
- })]
373
- })]
374
- })
375
- })]
376
- }), jsxs("div", {
377
- className: "relative group",
378
- children: [jsx("span", {
379
- className: "text-2xl font-semibold text-right underline cursor-help text-foreground",
380
- children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.summary?.total
381
- }), jsxs("div", {
382
- className: "hidden group-hover:block absolute top-0 right-0 transform -translate-y-full mt-2 w-[300px] shadow-themed-lg bg-card rounded-themed z-50",
383
- children: [jsx("div", {
384
- className: "font-bold border-b border-border p-3 text-center text-foreground",
385
- children: "Price breakdown"
386
- }), jsx("div", {
387
- className: "p-4",
388
- children: jsx("div", {
389
- className: "flex flex-col space-y-2",
390
- children: item.preferences?.property?.pricing?.price?.price_breakdown?.details?.charges?.items?.map((item, index) => jsxs("div", {
391
- className: "flex justify-between",
392
- children: [jsx("span", {
393
- className: "text-foreground",
394
- children: item.name
395
- }), jsx("span", {
396
- className: "text-foreground",
397
- children: item?.amount_rounded
398
- })]
399
- }, index))
400
- })
401
- })]
402
- })]
403
- })]
404
- }), jsxs("span", {
405
- className: "text-xs text-muted-foreground text-right w-full",
406
- children: [item?.preferences?.property?.pricing?.price?.price_breakdown?.details?.pricing?.basePrice?.perNight, ' ', "per ", getPriceType(item)]
407
- })]
408
- }), jsx("button", {
409
- className: `themed-button w-full ${isRedirecting ? 'opacity-75 cursor-wait' : ''}`,
410
- onClick: handleRedirect,
411
- disabled: isRedirecting,
412
- children: isRedirecting ? 'Loading...' : 'View deal'
413
- })]
414
- })]
415
- })]
416
- })
417
- })]
418
- }, item.id)
419
- });
420
- };export{PropertyCard};//# sourceMappingURL=PropertyCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyCard.js","sources":["../../../src/components/UI/PropertyCard.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"41BAwCS;AACA;AACA;AACT;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA,MAAmB,QAAA,GAAA,CAAA;AACnB,EAA6C,IAAA;AAC7C,EAAQ;AACR,CAAK,KAAAA,IAAA,CAAA,KAAA,EAAA;AAEL,EAAM,SAAA,EAAA,+CACG;AAQT,EAAA,QAA0B,EAAA,CAAAC,GAAA,CAAA,MAAA,EAAA;AACtB,IAAA,oDAAsC;AACtC,IAAA;AACA,GAAA,CAAA,EAAAA,GAAM,CAAQ,MAA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,IAAA,MAAA,kBAAA,GAAA,gBAAA,CAAA,KAAA,CAAA,CAAA,EAAA,CAAA,CAAA;iEACI,CAAA,CAAA,CAAA,IAAY,EAAA,MAAA,CAAA,KAAU,iBAAgB,CAAA;AACtC,MAAA,IAAA,EAAA,MAAA,CAAA,IAAA;;AAmCwB,QAAA,SAAA,EAAA,SAAA;;;AA+DxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +0,0 @@
1
- import { Options } from '@cdmbase/react-splide';
2
- type PropertyCardOnMapProps = {
3
- room: any;
4
- isSaved: boolean;
5
- sliderOptions?: Options;
6
- className?: string;
7
- };
8
- export declare const PropertyCardOnMap: ({ room, isSaved, sliderOptions, className, ...props }: PropertyCardOnMapProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
10
- //# sourceMappingURL=PropertyCardOnMap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyCardOnMap.d.ts","sourceRoot":"","sources":["../../../src/components/UI/PropertyCardOnMap.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAuB,MAAM,uBAAuB,CAAC;AAIrE,KAAK,sBAAsB,GAAG;IAC1B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,uDAM/B,sBAAsB,4CA0FxB,CAAC"}
@@ -1,108 +0,0 @@
1
- import {jsxs,jsx}from'react/jsx-runtime';import {useMemo,useState,useEffect}from'react';import {useTranslation}from'react-i18next';import {Link}from'@remix-run/react';import {BsStarFill}from'@react-icons/all-files/bs/BsStarFill.js';import {Splide,SplideSlide}from'@cdmbase/react-splide';import {useLayoutSettings}from'@admin-layout/client';const PropertyCardOnMap = ({
2
- room,
3
- isSaved,
4
- sliderOptions = {},
5
- className = '',
6
- ...props
7
- }) => {
8
- const images = useMemo(() => room?.images?.data.map(({
9
- url
10
- }) => ({
11
- src: url
12
- })), [room]);
13
- const {
14
- t
15
- } = useTranslation();
16
- const {
17
- settings
18
- } = useLayoutSettings();
19
- const [star, setStar] = useState(0);
20
- useEffect(() => {
21
- let temp = room?.totalReview == 0 ? 0 : room?.totalStar / room?.totalReview;
22
- setStar(temp);
23
- }, [room?.totalReview, room?.totalStar]);
24
- // const { color, grayColor } = useColorTheme();
25
- return jsxs("div", {
26
- className: `flex flex-col flex-wrap mt-4 ${className}`,
27
- children: [jsx("div", {
28
- className: "w-full",
29
- children: jsxs(Splide, {
30
- "aria-label": t('property.property_images'),
31
- options: {
32
- type: 'loop',
33
- drag: 'free',
34
- height: '230px',
35
- perPage: 1,
36
- perMove: 1,
37
- wheel: true,
38
- releaseWheel: true,
39
- pagination: false,
40
- speed: 500,
41
- ...sliderOptions
42
- },
43
- children: [images && images.length == 0 && jsx(SplideSlide, {
44
- children: jsx("div", {
45
- className: "w-full h-full",
46
- children: jsx("img", {
47
- src: room.thumbnailUrl,
48
- className: "w-full h-full object-cover cursor-pointer transition-all duration-500 hover:brightness-50",
49
- loading: "lazy",
50
- alt: room.title || 'Property'
51
- })
52
- })
53
- }), images.map((image, i) => {
54
- return jsx(SplideSlide, {
55
- children: jsx(Link, {
56
- to: '/property/' + room.id,
57
- className: "w-full",
58
- children: jsx("div", {
59
- className: "w-full h-full",
60
- children: jsx("img", {
61
- src: image.src,
62
- className: "w-full h-full object-cover cursor-pointer transition-all duration-500 hover:brightness-50",
63
- loading: "lazy",
64
- alt: room.title || 'Property'
65
- })
66
- })
67
- })
68
- }, 'sliderImage1_' + i);
69
- })]
70
- })
71
- }), jsxs("div", {
72
- className: "w-full flex flex-col mt-2",
73
- children: [jsx("div", {
74
- className: "font-semibold text-sm",
75
- style: {
76
- color: settings?.primaryColor
77
- },
78
- children: room?.title
79
- }), jsxs("div", {
80
- className: "flex flex-row justify-between",
81
- children: [jsxs("div", {
82
- className: "flex flex-col",
83
- children: [jsx("div", {
84
- className: "mt-1 flex text-[9px] font-semibold",
85
- style: {
86
- color: settings?.primaryColor
87
- },
88
- children: room?.address && room?.address.city && room?.address.city.state ? room?.address.city.name + ', ' + room?.address.city.state.name : ''
89
- }), jsxs("div", {
90
- className: "flex items-center",
91
- children: [jsx(BsStarFill, {
92
- className: "text-yellow-500 w-3 h-3 mr-1"
93
- }), jsxs("span", {
94
- className: "text-[0.832rem] font-bold",
95
- style: {
96
- color: settings?.secondaryColor
97
- },
98
- children: [room?.reviewsOverview ? room.reviewsOverview.rating : 0, " (", room.reviewsOverview ? room.reviewsOverview.ratingCount : 0, " ", t('property.reviews'), ")"]
99
- })]
100
- })]
101
- }), jsx("div", {
102
- className: "text-lg font-bold mt-auto mb-[-2px]",
103
- children: room.preferences?.property?.pricing?.price?.price_breakdown?.details?.pricing?.finalPrice?.total
104
- })]
105
- })]
106
- })]
107
- });
108
- };export{PropertyCardOnMap};//# sourceMappingURL=PropertyCardOnMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyCardOnMap.js","sources":["../../../src/components/UI/PropertyCardOnMap.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"0VAkBa,iBAAiB,GAAG,CAAC;AAO9B,EAAA,IAAA;AACA,EAAA,OAAA;AACA,EAAA,aAAgB,GAAA,EAAA;WAET,GAAI,EAAA;KACF;;QAEL,MAAO,GAAK,OAAE,CAAA,MAAA,IAAA,EAAA,MAAA,EAAA,IAAA,CAAA,GAAA,CAAA,CAAA;IAClB;SAEgD;IAEhD,GAAO,EAAA;AAMa,GAAA,CAAA,CAAA,EAAA,CAAA,IAAA,CAAA,CAAA;AACA,EAAA,MAAA;AACA,IAAA;AACA,GAAA,GAAA,cAAA,EAAA;AACA,EAAA,MAAA;AACA,IAAA;AACA,GAAA,GAAA,iBAAA,EAAA;AACA,EAAA,MAAA,CAAA,IAAA,EAAA,OAAA,CAAA,GAAA,QAAU,EAAE,CAAK;AACjB,EAAA,SAAA,CAAA,MAAA;AACA,IAAA,IAAA,IAAA,GAAA,IAAA,EAAA,WAAgB,IAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAAA,SAAA,GAAA,IAAA,EAAA,WAAA;;6BAgBT,EAAA,SACF,CAAA,CAAA;AAaT;AAWY,EAAA,OAAAA,IAAA,CAAA,KAAA,EAAA;6CACC;AAaD,IAAA,QAAA,EAAA,CAAAC,GAAA,CAAA,KAAA,EAAA;AAOhC,MAAE,SAAA,EAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { CarPricing } from './types';
3
- interface PricePopoverProps {
4
- pricing: CarPricing;
5
- }
6
- declare const PricePopover: React.FC<PricePopoverProps>;
7
- export default PricePopover;
8
- //# sourceMappingURL=PricePopover.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PricePopover.d.ts","sourceRoot":"","sources":["../../../../src/components/UI/VehicleCard/PricePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,UAAU,iBAAiB;IACvB,OAAO,EAAE,UAAU,CAAC;CACvB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA2F7C,CAAC;AAEF,eAAe,YAAY,CAAC"}