@odynn/awayz-core 0.3.11 → 0.3.13
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/assets/_styles.css +1 -1
- package/dist/assets/_styles2.css +1 -1
- package/dist/assets/_styles3.css +1 -1
- package/dist/assets/_styles4.css +1 -1
- package/dist/assets/_styles5.css +1 -0
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +2 -2
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +2 -2
- package/dist/components/CashValue/CashValue.js +7 -5
- package/dist/components/CashValue/CashValue.stories.js +14 -13
- package/dist/components/Menu/Menu.js +11 -10
- package/dist/components/Wallet/Card/Card.js +35 -0
- package/dist/components/Wallet/Card/Card.stories.js +62 -0
- package/dist/components/index.js +6 -4
- package/dist/configs/endpoints.js +2 -2
- package/dist/hooks/useBookingManagement/useBookingManagement.js +57 -48
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +40 -39
- package/dist/hooks/useTripManagement/useTripManagement.js +4 -3
- package/dist/hooks/useTripManagement/useTripManagement.test.js +2 -1
- package/dist/hooks/useWallet/useWallet.js +52 -33
- package/dist/hooks/useWallet/useWallet.test.js +85 -15
- package/dist/hooks/useWallet/useWallet.types.js +1 -0
- package/dist/index-BC-KTkxU.js +1571 -0
- package/dist/index-CDh8vAM_.js +132 -0
- package/dist/lib/components/Wallet/Card/Card.d.ts +6 -0
- package/dist/lib/components/Wallet/Card/Card.stories.d.ts +14 -0
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/configs/endpoints.d.ts +2 -0
- package/dist/lib/hooks/useBookingManagement/mocks/HotelBooking200.json.d.ts +608 -67
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +8 -0
- package/dist/lib/hooks/useWallet/mocks/AllCardsResponse200.json.d.ts +177 -0
- package/dist/lib/hooks/useWallet/mocks/GetAllProgramsReponse200.json.d.ts +705 -0
- package/dist/lib/hooks/useWallet/mocks/UserCardsResponse200.json.d.ts +139 -0
- package/dist/lib/hooks/useWallet/useWallet.d.ts +2 -16
- package/dist/lib/hooks/useWallet/useWallet.types.d.ts +50 -0
- package/dist/lib/services/wallet/WalletService.d.ts +2 -0
- package/dist/lib/services/wallet/WalletService.types.d.ts +2 -5
- package/dist/main.js +20 -18
- package/dist/providers/AwayzProvider.js +4 -3
- package/dist/services/currency/CurrencyService.js +4 -3
- package/dist/services/wallet/WalletService.js +43 -63
- package/package.json +1 -1
- package/dist/index-COgXcb6p.js +0 -1696
- package/dist/lib/hooks/useWallet/mocks/CardsResponse.json.d.ts +0 -34
package/dist/assets/_styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.currency-conversion svg{fill:#1495f2;transform:scaleX(.75)}.tooltip-content{border-radius:.5rem;border:1px solid var(--border, #e7eef3);padding:1rem;
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.currency-conversion svg{fill:#1495f2;transform:scaleX(.75)}.tooltip-content{border-radius:.5rem;border:1px solid var(--border, #e7eef3);padding:1rem;line-height:1;background-color:var(--foreground, #fff);animation-duration:.4s;animation-timing-function:cubic-bezier(.16,1,.3,1);animation-fill-mode:both;will-change:transform,opacity;z-index:500;position:absolute}.currency-conversion-container{display:flex;flex-direction:column;justify-content:center;text-align:center;gap:1rem}.currency-conversion-container>p{font-weight:600}.currency-conversion-container .currency-conversion-amounts{position:relative;display:flex;align-items:center;width:100vw;max-width:300px;border:1px solid var(--border, #e7eef3);border-radius:.5rem}.currency-conversion-container .currency-conversion-amounts div{flex:1;width:50%;padding:1rem;font-weight:600}.currency-conversion-container .currency-conversion-amounts div:first-of-type{border-right:1px solid var(--border, #e7eef3)}.currency-conversion-container .currency-conversion-amounts .conversion-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:50%;background-color:var(--foreground, #fff);color:#1495f2;height:2rem;width:2rem;display:flex;align-items:center;justify-content:center;border:1px solid var(--border, #e7eef3)}.currency-conversion-container .currency-conversion-amounts .conversion-icon svg{fill:#1495f2;width:1rem;height:1rem;transform:scaleX(.75)}.currency-conversion-container .currency-conversion-rate{padding:.5rem 1rem;border-radius:.5rem;background-color:var(--border, #e7eef3);font-size:.8rem}.tooltip-arrow{fill:var(--foreground, #fff)}.tooltip-content[data-state=delayed-open][data-side=top]{animation-name:tooltip-down}.tooltip-content[data-state=delayed-open][data-side=right]{animation-name:tooltip-right}.tooltip-content[data-state=delayed-open][data-side=bottom]{animation-name:tooltip-up}.tooltip-content[data-state=delayed-open][data-side=left]{animation-name:tooltip-left}@keyframes tooltip-up{0%{opacity:0;transform:translateY(4px) translate(-50%)}to{opacity:1;transform:translateY(0) translate(-50%)}}@keyframes tooltip-down{0%{opacity:0;transform:translateY(calc(-100% - 4px)) translate(-50%)}to{opacity:1;transform:translateY(-100%) translate(-50%)}}@keyframes tooltip-left{0%{opacity:0;transform:translate(calc(-100% - 4px)) translateY(-50%)}to{opacity:1;transform:translate(-100%) translateY(-50%)}}@keyframes tooltip-right{0%{opacity:0;transform:translate(-4px) translateY(-50%)}to{opacity:1;transform:translate(0) translateY(-50%)}}
|
package/dist/assets/_styles2.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.card{background-color:#14181f;padding:1rem;border-radius:1rem;display:flex;justify-content:space-between;height:150px;aspect-ratio:1.8;position:relative;overflow:hidden}.card p{color:#f9fdff;font-weight:600;z-index:1}.card p.light{color:#14181f}.card .remove-button{cursor:pointer;z-index:5;display:none;border-radius:.5rem;position:absolute;top:0;right:0;transform:translate(-50%) translateY(50%);height:1.75rem;width:1.75rem;padding:0;background-color:#f9fdff;justify-content:center;align-items:center}.card .remove-button span{position:fixed;color:#14181f;display:flex;justify-content:center;align-items:center}.card:hover .remove-button{display:flex}.card .logo{height:50px;max-width:100px}.card>.logo-watermark-container{position:absolute;left:0;top:0;bottom:0;right:0;overflow:hidden}.card>.logo-watermark-container>.logo-watermark{position:absolute;right:-5%;height:100%;max-width:200px;transform:scale(2);opacity:.1}
|
package/dist/assets/_styles3.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.selected-flight-card{width:380px;padding:1px;border-radius:.5rem;position:relative;overflow:hidden;background:linear-gradient(90deg,transparent 0%,transparent 10%,var(--border, #e7eef3) 10%,var(--border, #e7eef3) 90%,transparent 90%,transparent 100%);animation:fade-in .3s ease-in-out both;transition:all .2s ease-in-out;cursor:pointer}.selected-flight-card:nth-child(1){animation-delay:.1s}.selected-flight-card:nth-child(2){animation-delay:.2s}.selected-flight-card:nth-child(3){animation-delay:.3s}.selected-flight-card:nth-child(4){animation-delay:.4s}.selected-flight-card:nth-child(5){animation-delay:.5s}.selected-flight-card:nth-child(6){animation-delay:.6s}.selected-flight-card:nth-child(7){animation-delay:.7s}.selected-flight-card:nth-child(8){animation-delay:.8s}.selected-flight-card:nth-child(9){animation-delay:.9s}.selected-flight-card:nth-child(10){animation-delay:1s}.selected-flight-card:hover{filter:drop-shadow(0px 0px 20px rgba(2,66,109,.1))}.selected-flight-card:before{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:30px;width:30px;border-radius:100%;border:14rem solid var(--border, #e7eef3);top:180px;left:0;transform:translate(-50%,-50%)}.selected-flight-card:after{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:30px;width:30px;border-radius:100%;border:14rem solid var(--border, #e7eef3);top:180px;right:0;transform:translate(50%,-50%)}.selected-flight-card .cancelled-notice{background-color:#ff7f2f1a;font-weight:600;padding:.25rem;border-radius:.5rem;border:2px solid #ff7f2f;color:#ff7f2f;font-size:.8rem;text-align:center;width:fit-content}.selected-flight-card .content{overflow:hidden;padding:1rem;padding-bottom:0;border-radius:.4rem;width:100%;margin:0 auto;position:relative;height:100%;z-index:1;display:flex;flex-direction:column;gap:1rem;background:linear-gradient(90deg,transparent 0%,transparent 10%,var(--foreground, #fff) 10%,var(--foreground, #fff) 90%,transparent 90%,transparent 100%)}.selected-flight-card .content *{z-index:2}.selected-flight-card .content:before{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:31px;width:31px;border-radius:100%;border:14rem solid var(--foreground, #fff);top:179px;left:-1.5px;transform:translate(-50%,-50%)}.selected-flight-card .content:after{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:31px;width:31px;border-radius:100%;border:14rem solid var(--foreground, #fff);top:179px;right:-1px;transform:translate(49.99%,-50%)}.selected-flight-card .top-section{flex:1;min-height:calc(160px - 1rem)}.selected-flight-card .top-section .header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}.selected-flight-card .top-section .header>div{display:flex;align-items:center;gap:.5rem}.selected-flight-card .top-section .header .airline-logo,.selected-flight-card .top-section .header .airline-logo img{max-height:20px}.selected-flight-card .top-section .header .id-and-icon{display:flex;align-items:center;gap:1rem}.selected-flight-card .top-section .header .id-and-icon>span{font-weight:700}.selected-flight-card .top-section .header .id-and-icon .context-button{display:flex;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem;color:var(--text-light, rgba(37, 46, 52, .2509803922));cursor:pointer}.selected-flight-card .top-section .header .id-and-icon .context-button:hover{background-color:var(--border, #e7eef3)}.selected-flight-card .top-section .flight{display:flex;align-items:center;font-size:1.8rem;position:relative;justify-content:space-between}.selected-flight-card .top-section .flight *{z-index:2}.selected-flight-card .top-section .flight .flight-trail{margin:5px 0;height:2px;background:repeating-linear-gradient(90deg,var(--border, #e7eef3) 0 20px,rgba(0,0,0,0) 0 30px);width:80%;position:absolute;left:50%;transform:translate(-50%);z-index:1}.selected-flight-card .top-section .flight svg{fill:#d8e3ea}.selected-flight-card .top-section .flight>p{font-weight:600;background-color:var(--foreground, #fff)}.selected-flight-card .top-section .flight .departure-title{padding-right:.5rem}.selected-flight-card .top-section .flight .arrival-title{padding-left:.5rem}.selected-flight-card .top-section .flight-details .destination span{font-size:1rem;font-weight:400}.selected-flight-card .top-section .flight-details .destination span:last-child{text-align:right}.selected-flight-card .top-section .flight-details .time p{color:var(--text-light, rgba(37, 46, 52, .2509803922))}.selected-flight-card .top-section .flight-details .destination,.selected-flight-card .top-section .flight-details .time{display:flex;justify-content:space-between}.selected-flight-card .mid-section{height:10px}.selected-flight-card .mid-section .dashes{position:absolute;top:179px;left:20px;right:20px;border:dashed 2px var(--border, #e7eef3)}.selected-flight-card .bottom-section{display:flex;flex-direction:column;gap:1rem;font-size:.8rem}.selected-flight-card .bottom-section .bottom-header{display:flex;justify-content:space-between;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem}.selected-flight-card .bottom-section .bottom-header .id-and-icon{display:flex;gap:1rem}.selected-flight-card .bottom-section .bottom-header .id-and-icon>span{font-weight:700}.selected-flight-card .bottom-section .bottom-header .id-and-icon .copy-icon{font-size:larger}.selected-flight-card .bottom-section .bottom-section-details{display:flex;gap:1rem}.selected-flight-card .bottom-section .bottom-section-details>div{display:flex;width:50%;justify-content:space-between;margin-bottom:1rem;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem}.selected-flight-card .bottom-section .bottom-section-details>div>span{font-weight:700}
|
package/dist/assets/_styles4.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}button{all:unset}.menubar-root{display:flex;background-color:var(--foreground, #fff);border-radius:.25rem}.menubar-trigger{border:1px solid var(--border, #e7eef3);padding:.5rem;outline:none;-webkit-user-select:none;user-select:none;font-weight:500;line-height:1;border-radius:4px;font-size:13px;display:flex;align-items:center;justify-content:space-between;gap:2px}.menubar-trigger[data-highlighted],.menubar-trigger[data-state=open]{background-color:var(--background, #f9fdff)}.menubar-content,.menubar-sub-content{min-width:220px;background-color:var(--foreground, #fff);border-radius:.25rem;padding:.5rem;animation-duration:.2s;animation-timing-function:cubic-bezier(.16,1,.3,1);will-change:transform,opacity;border:1px solid var(--border, #e7eef3)}.menubar-sub-content{position:inherit;right:0;transform:translate(8px,35px)}.menubar-item,.menubar-sub-trigger,.menubar-checkbox-item,.menubar-radio-item{all:unset;font-size:13px;line-height:1;border-radius:4px;display:flex;align-items:center;height:25px;padding:0 10px;position:relative;-webkit-user-select:none;user-select:none}.menubar-item.inset,.menubar-sub-trigger.inset,.menubar-checkbox-item.inset,.menubar-radio-item.inset{padding-left:20px}.menubar-item[data-state=open],.menubar-sub-trigger[data-state=open]{background-color:var(--background, #f9fdff)}.menubar-item[data-highlighted],.menubar-sub-trigger[data-highlighted],.menubar-checkbox-item[data-highlighted],.menubar-radio-item[data-highlighted]{background-color:var(--background, #f9fdff);cursor:pointer}.menubar-item[data-disabled],.menubar-sub-trigger[data-disabled],.menubar-checkbox-item[data-disabled],.menubar-radio-item[data-disabled]{pointer-events:none;opacity:.3}.menubar-item-indicator{position:absolute;left:0;width:20px;display:inline-flex;align-items:center;justify-content:center}.menubar-separator{height:1px;margin:5px}.right-slot{margin-left:auto;padding-left:20px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.selected-hotel-card{width:380px;height:auto;border:1px solid var(--border, #e7eef3);border-radius:.5rem;display:flex;flex-direction:column;background-color:var(--foreground, #fff);overflow:hidden;transition:all .2s ease-in-out;animation:fade-in .3s ease-in-out both}.selected-hotel-card:nth-child(1){animation-delay:.1s}.selected-hotel-card:nth-child(2){animation-delay:.2s}.selected-hotel-card:nth-child(3){animation-delay:.3s}.selected-hotel-card:nth-child(4){animation-delay:.4s}.selected-hotel-card:nth-child(5){animation-delay:.5s}.selected-hotel-card:nth-child(6){animation-delay:.6s}.selected-hotel-card:nth-child(7){animation-delay:.7s}.selected-hotel-card:nth-child(8){animation-delay:.8s}.selected-hotel-card:nth-child(9){animation-delay:.9s}.selected-hotel-card:nth-child(10){animation-delay:1s}.selected-hotel-card .cancelled-notice{background-color:#ff7f2f1a;font-weight:600;padding:.25rem;border-radius:.5rem;border:2px solid #ff7f2f;color:#ff7f2f;font-size:.8rem;text-align:center;width:fit-content}.selected-hotel-card:hover{box-shadow:0 0 20px #02426d1a;cursor:pointer}.selected-hotel-card:hover .hotel-image{background-size:105%}.selected-hotel-card .hotel-image{width:100%;height:200px;padding:.5rem;background-repeat:no-repeat;background-position:center;background-size:100%;display:flex;justify-content:space-between;align-items:flex-start;transition:all .2s ease-in-out}.selected-hotel-card .hotel-image .hotel-chain{display:flex;justify-content:center;gap:.5rem;border:2px solid #fff;padding:.25rem;border-radius:.25rem;background-color:#fffc;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}.selected-hotel-card .hotel-image .context-button{display:flex;right:0;color:var(--text-light, rgba(37, 46, 52, .2509803922));background-color:var(--foreground, #fff);padding:.5rem;border-radius:.25rem;transition:all .3s ease-in-out;cursor:pointer}.selected-hotel-card .hotel-image .context-button:hover{background-color:var(--border, #e7eef3)}.selected-hotel-card .bottom-content{display:flex;flex-direction:column;padding:1rem;flex:1;gap:.5rem}.selected-hotel-card .bottom-content .hotel-title{display:flex;flex-direction:column;gap:.25rem;flex:1}.selected-hotel-card .bottom-content .hotel-title>p{font-size:1rem;font-weight:600}.selected-hotel-card .bottom-content .hotel-title>div{display:flex;align-items:center;gap:.5rem;font-size:.8rem;opacity:.6}.selected-hotel-card .bottom-content span{border-left:1px solid var(--border, #e7eef3);height:100%}.selected-hotel-card .bottom-content .hotel-details{display:flex;justify-content:space-between;font-size:.8rem}.selected-hotel-card .bottom-content .hotel-details>div{display:flex;gap:1rem;align-items:center}.selected-hotel-card .bottom-content .hotel-details>div>hr{height:1rem;border:1px solid var(--border, #e7eef3)}.selected-hotel-card .bottom-content .hotel-details .id-and-icon{font-weight:700}.selected-hotel-card .bottom-content .hotel-details .id-and-icon .copy-icon{font-size:larger}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { F as g } from "../../../index-
|
|
3
|
-
import '../../../assets/
|
|
2
|
+
import { F as g } from "../../../index-CDh8vAM_.js";
|
|
3
|
+
import '../../../assets/_styles3.css';/* empty css */
|
|
4
4
|
import { h as n } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
5
5
|
import { E as t } from "../../../DateFormats-DZD30Nea.js";
|
|
6
6
|
import "react";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { G as g } from "../../../index-
|
|
2
|
+
import { G as g } from "../../../index-CDh8vAM_.js";
|
|
3
3
|
import { h as k } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { E as N } from "../../../DateFormats-DZD30Nea.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import '../../../assets/
|
|
6
|
+
import '../../../assets/_styles5.css';/* empty css */
|
|
7
7
|
import u from "../../Menu/Menu.js";
|
|
8
8
|
const c = (r, o, t = o + "s") => r === 1 ? o : t;
|
|
9
9
|
function $(r) {
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsx as d, Fragment as tt, jsxs as R } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { useMemo as rt } from "react";
|
|
4
|
-
import { u as N, a as nt, c as A, b as Z, d as he, e as ot, f as st, g as G, o as it, s as at, h as lt, i as ct, j as dt, k as ut, l as pt, m as ft, n as ht, p as vt, P as ve
|
|
4
|
+
import { u as N, a as nt, c as A, b as Z, d as he, e as ot, f as st, g as G, o as it, s as at, h as lt, i as ct, j as dt, k as ut, l as pt, m as ft, n as ht, p as vt, P as ve } from "../../index-BC-KTkxU.js";
|
|
5
5
|
import { r as mt, R as yt } from "../../index-Cv-wvFlM.js";
|
|
6
|
+
import { b as ue } from "../../index-CDh8vAM_.js";
|
|
6
7
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
7
8
|
import { E as gt } from "../../AccountService-D_6U8vP6.js";
|
|
8
9
|
import { useQuery as wt } from "@tanstack/react-query";
|
|
9
10
|
import { CurrencyService as Ct } from "../../services/currency/CurrencyService.js";
|
|
10
|
-
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
11
|
+
import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
11
12
|
import "../../context/AwayzContext.js";
|
|
12
13
|
import "../../configs/awayzClient.js";
|
|
13
14
|
import { useAwayzContext as Et } from "../../hooks/useAwayzContext.js";
|
|
14
15
|
import "../../services/noRetryInstance.js";
|
|
15
16
|
import { EInvalidAmountDisplayOption as M, EToolTipPosition as Pt } from "./CashValueTypes.js";
|
|
17
|
+
/* empty css */
|
|
16
18
|
/* empty css */
|
|
17
19
|
/* empty css */
|
|
18
20
|
/* empty css */
|
|
@@ -469,7 +471,7 @@ var Qt = Object.freeze({
|
|
|
469
471
|
)
|
|
470
472
|
);
|
|
471
473
|
_e.displayName = Jt;
|
|
472
|
-
var er = _e, [V,
|
|
474
|
+
var er = _e, [V, Vr] = he("Tooltip", [
|
|
473
475
|
Pe
|
|
474
476
|
]), Y = Pe(), Le = "TooltipProvider", tr = 700, X = "tooltip.open", [rr, J] = V(Le), Ie = (e) => {
|
|
475
477
|
const {
|
|
@@ -780,7 +782,7 @@ function vr(e) {
|
|
|
780
782
|
return r.pop(), t.length === 1 && r.length === 1 && t[0].x === r[0].x && t[0].y === r[0].y ? t : t.concat(r);
|
|
781
783
|
}
|
|
782
784
|
var mr = Ie, yr = Me, gr = He, wr = ke, Cr = Fe, Er = Be;
|
|
783
|
-
const Pr = 1e3 * 60 * 60,
|
|
785
|
+
const Pr = 1e3 * 60 * 60, Yr = ({
|
|
784
786
|
amount: e,
|
|
785
787
|
currency: t,
|
|
786
788
|
position: r = Pt.RIGHT,
|
|
@@ -868,6 +870,6 @@ const Pr = 1e3 * 60 * 60, Ur = ({
|
|
|
868
870
|
) })
|
|
869
871
|
] }) });
|
|
870
872
|
export {
|
|
871
|
-
|
|
873
|
+
Yr as CashValue,
|
|
872
874
|
Pr as CurrencyCallStaleTimeMs
|
|
873
875
|
};
|
|
@@ -10,10 +10,11 @@ import "@tanstack/react-query";
|
|
|
10
10
|
import { EAuthFlow as i } from "../../types/EAuthFlow.js";
|
|
11
11
|
import "../../services/noRetryInstance.js";
|
|
12
12
|
import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
|
|
13
|
-
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';/* empty css
|
|
13
|
+
import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';/* empty css */
|
|
14
|
+
/* empty css */
|
|
14
15
|
/* empty css */
|
|
15
16
|
/* empty css */
|
|
16
|
-
const
|
|
17
|
+
const h = {
|
|
17
18
|
title: "Core/Cash Value",
|
|
18
19
|
component: n,
|
|
19
20
|
parameters: {
|
|
@@ -55,32 +56,32 @@ const b = {
|
|
|
55
56
|
}
|
|
56
57
|
)
|
|
57
58
|
]
|
|
58
|
-
},
|
|
59
|
+
}, R = {
|
|
59
60
|
name: "Euro to Dollar Cash Value",
|
|
60
61
|
args: {
|
|
61
62
|
amount: 100,
|
|
62
63
|
currency: "EUR"
|
|
63
64
|
}
|
|
64
|
-
},
|
|
65
|
+
}, j = {
|
|
65
66
|
name: "Invalid Amount",
|
|
66
67
|
args: {
|
|
67
68
|
amount: "invalid",
|
|
68
69
|
currency: "EUR"
|
|
69
70
|
}
|
|
70
|
-
},
|
|
71
|
+
}, C = {
|
|
71
72
|
name: "Zero Amount with Display as Zero",
|
|
72
73
|
args: {
|
|
73
74
|
amount: 0,
|
|
74
75
|
zeroDisplayOption: o.DISPLAY_AS_ZERO,
|
|
75
76
|
currency: "EUR"
|
|
76
77
|
}
|
|
77
|
-
},
|
|
78
|
+
}, T = {
|
|
78
79
|
name: "Negative Amount",
|
|
79
80
|
args: {
|
|
80
81
|
amount: -100,
|
|
81
82
|
currency: "EUR"
|
|
82
83
|
}
|
|
83
|
-
},
|
|
84
|
+
}, U = {
|
|
84
85
|
name: "Custom Zero Amount",
|
|
85
86
|
args: {
|
|
86
87
|
amount: 0,
|
|
@@ -90,10 +91,10 @@ const b = {
|
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
93
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
U as CustomZeroAmount,
|
|
95
|
+
R as Default,
|
|
96
|
+
j as InvalidAmount,
|
|
97
|
+
T as NegativeAmount,
|
|
98
|
+
C as ZeroAmount,
|
|
99
|
+
h as default
|
|
99
100
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as f, jsxs as Fe } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import Z, { useState as or } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import '../../assets/
|
|
4
|
+
import { q as ie, d as me, u as T, a as ar, c as R, b as U, e as ir, f as cr, g as Ue, o as sr, s as ur, h as lr, i as dr, j as fr, k as pr, l as vr, m as mr, n as oe, p as Qe, P as Oe } from "../../index-BC-KTkxU.js";
|
|
5
|
+
import { r as hr, R as gr } from "../../index-Cv-wvFlM.js";
|
|
6
|
+
import '../../assets/_styles4.css';/* empty css */
|
|
7
|
+
import { c as br, d as yr } from "../../index-CDh8vAM_.js";
|
|
7
8
|
// @__NO_SIDE_EFFECTS__
|
|
8
9
|
function ht(e) {
|
|
9
10
|
const t = /* @__PURE__ */ Cr(e), n = a.forwardRef((r, o) => {
|
|
@@ -163,7 +164,7 @@ var Or = [
|
|
|
163
164
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
164
165
|
}, {});
|
|
165
166
|
function Tt(e, t) {
|
|
166
|
-
e &&
|
|
167
|
+
e && hr.flushSync(() => e.dispatchEvent(t));
|
|
167
168
|
}
|
|
168
169
|
var Nr = "DismissableLayer", He = "dismissableLayer.update", Tr = "dismissableLayer.pointerDownOutside", Dr = "dismissableLayer.focusOutside", gt, Dt = a.createContext({
|
|
169
170
|
layers: /* @__PURE__ */ new Set(),
|
|
@@ -709,7 +710,7 @@ var Zt = Gt, uo = Ht, lo = jt, fo = Xt, po = "Portal", qt = a.forwardRef((e, t)
|
|
|
709
710
|
const { container: n, ...r } = e, [o, i] = a.useState(!1);
|
|
710
711
|
Ue(() => i(!0), []);
|
|
711
712
|
const s = n || o && ((c = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : c.body);
|
|
712
|
-
return s ?
|
|
713
|
+
return s ? gr.createPortal(/* @__PURE__ */ f(B.div, { ...r, ref: t }), s) : null;
|
|
713
714
|
});
|
|
714
715
|
qt.displayName = po;
|
|
715
716
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -2129,7 +2130,7 @@ var pi = [
|
|
|
2129
2130
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: i });
|
|
2130
2131
|
});
|
|
2131
2132
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
2132
|
-
}, {}), Ce = "Menubar", [ze, vi, mi] = Je(Ce), [Kn,
|
|
2133
|
+
}, {}), Ce = "Menubar", [ze, vi, mi] = Je(Ce), [Kn, Qi] = me(Ce, [
|
|
2133
2134
|
mi,
|
|
2134
2135
|
Ne
|
|
2135
2136
|
]), A = wa(), Vn = Ne(), [hi, dt] = Kn(Ce), Gn = a.forwardRef(
|
|
@@ -2437,8 +2438,8 @@ function $i(e, t) {
|
|
|
2437
2438
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
2438
2439
|
}
|
|
2439
2440
|
var Bi = Gn, Wi = Hn, Ki = jn, xt = Yn, Vi = Xn, Ot = zn, Gi = qn, Ui = Qn, Hi = Jn;
|
|
2440
|
-
const
|
|
2441
|
-
/* @__PURE__ */ f(Ki, { className: "menubar-trigger", children: /* @__PURE__ */ f(
|
|
2441
|
+
const Ji = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root", children: /* @__PURE__ */ Fe(Wi, { children: [
|
|
2442
|
+
/* @__PURE__ */ f(Ki, { className: "menubar-trigger", children: /* @__PURE__ */ f(br, {}) }),
|
|
2442
2443
|
/* @__PURE__ */ f(xt, { children: /* @__PURE__ */ f(
|
|
2443
2444
|
Vi,
|
|
2444
2445
|
{
|
|
@@ -2455,7 +2456,7 @@ const Qi = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root"
|
|
|
2455
2456
|
onPointerLeave: (r) => r.preventDefault(),
|
|
2456
2457
|
children: [
|
|
2457
2458
|
t.label,
|
|
2458
|
-
/* @__PURE__ */ f("div", { className: "right-slot", children: /* @__PURE__ */ f(
|
|
2459
|
+
/* @__PURE__ */ f("div", { className: "right-slot", children: /* @__PURE__ */ f(yr, {}) })
|
|
2459
2460
|
]
|
|
2460
2461
|
}
|
|
2461
2462
|
),
|
|
@@ -2488,5 +2489,5 @@ const Qi = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root"
|
|
|
2488
2489
|
) })
|
|
2489
2490
|
] }) });
|
|
2490
2491
|
export {
|
|
2491
|
-
|
|
2492
|
+
Ji as default
|
|
2492
2493
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import '../../../assets/_styles2.css';/* empty css */
|
|
3
|
+
import { a as l } from "../../../index-CDh8vAM_.js";
|
|
4
|
+
import "../../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
+
import "react";
|
|
6
|
+
const t = (r) => {
|
|
7
|
+
if (!r)
|
|
8
|
+
return !0;
|
|
9
|
+
var a = r.substring(1), c = parseInt(a, 16), m = c >> 16 & 255, n = c >> 8 & 255, s = c >> 0 & 255, e = 0.2126 * m + 0.7152 * n + 0.0722 * s;
|
|
10
|
+
return e < 200;
|
|
11
|
+
}, b = ({ details: r, onCardDelete: a }) => /* @__PURE__ */ i(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: "card",
|
|
15
|
+
style: {
|
|
16
|
+
backgroundImage: `linear-gradient(90deg, ${r.colour}90 0%, ${r.colour} 100%)`
|
|
17
|
+
},
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ o("p", { className: t(r.colour) ? "dark" : "light", children: r.name }),
|
|
20
|
+
/* @__PURE__ */ o("img", { className: "logo", color: "#000", src: r.logoUrl }),
|
|
21
|
+
/* @__PURE__ */ o("div", { className: "logo-watermark-container", children: /* @__PURE__ */ o("img", { className: "logo-watermark", src: r.logoUrl }) }),
|
|
22
|
+
a && r.id && /* @__PURE__ */ o(
|
|
23
|
+
"button",
|
|
24
|
+
{
|
|
25
|
+
className: "remove-button",
|
|
26
|
+
onClick: () => a(r.id),
|
|
27
|
+
children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(l, {}) })
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
export {
|
|
34
|
+
b as Card
|
|
35
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Card as r } from "./Card.js";
|
|
3
|
+
import { AwayzProvider as a } from "../../../providers/AwayzProvider.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../../../context/AwayzContext.js";
|
|
6
|
+
import "../../../arrayExtensions-DlcBOj5a.js";
|
|
7
|
+
import "../../../AccountService-D_6U8vP6.js";
|
|
8
|
+
import "../../../configs/awayzClient.js";
|
|
9
|
+
import "@tanstack/react-query";
|
|
10
|
+
import { EAuthFlow as e } from "../../../types/EAuthFlow.js";
|
|
11
|
+
import "../../../services/noRetryInstance.js";
|
|
12
|
+
import '../../../assets/_styles5.css';import '../../../assets/_styles4.css';import '../../../assets/_styles3.css';import '../../../assets/_styles.css';/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
16
|
+
const v = {
|
|
17
|
+
title: "Wallet/Card",
|
|
18
|
+
component: r,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered"
|
|
21
|
+
},
|
|
22
|
+
tags: ["autodocs"],
|
|
23
|
+
decorators: [
|
|
24
|
+
(o) => /* @__PURE__ */ t(
|
|
25
|
+
a,
|
|
26
|
+
{
|
|
27
|
+
config: {
|
|
28
|
+
testMode: !0,
|
|
29
|
+
authFlow: e.STANDARD,
|
|
30
|
+
trustedOrigins: ["*"],
|
|
31
|
+
clientId: "6790e7c295a102749a33795e"
|
|
32
|
+
},
|
|
33
|
+
children: /* @__PURE__ */ t(o, {})
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
]
|
|
37
|
+
}, y = {
|
|
38
|
+
args: {
|
|
39
|
+
details: {
|
|
40
|
+
id: "12345",
|
|
41
|
+
name: "AAdvantage Aviator Business",
|
|
42
|
+
logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/barclays-white.svg",
|
|
43
|
+
colour: "#0E1C31"
|
|
44
|
+
},
|
|
45
|
+
onCardDelete: (o) => {
|
|
46
|
+
console.log("Card deleted:", o);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, z = {
|
|
50
|
+
args: {
|
|
51
|
+
details: {
|
|
52
|
+
name: "IHG Rewards Club Premier",
|
|
53
|
+
colour: "#C8C8C8",
|
|
54
|
+
logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/chase-black.svg"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
y as DarkCard,
|
|
60
|
+
z as LightCard,
|
|
61
|
+
v as default
|
|
62
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { CashValue as t } from "./CashValue/CashValue.js";
|
|
2
2
|
import { EInvalidAmountDisplayOption as p, EToolTipPosition as e } from "./CashValue/CashValueTypes.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Card as m } from "./Wallet/Card/Card.js";
|
|
4
|
+
import { FlightBooking as a } from "./Bookings/FlightBooking/FlightBooking.js";
|
|
5
|
+
import { HotelBooking as x } from "./Bookings/HotelBooking/HotelBooking.js";
|
|
5
6
|
export {
|
|
7
|
+
m as Card,
|
|
6
8
|
t as CashValue,
|
|
7
9
|
p as EInvalidAmountDisplayOption,
|
|
8
10
|
e as EToolTipPosition,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
a as FlightBooking,
|
|
12
|
+
x as HotelBooking
|
|
11
13
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var r = /* @__PURE__ */ ((e) => (e.SIGN_IN = "auth/user-login", e.SIGN_UP = "auth/sign-up", e.ME = "user", e.RESEND_VERIFICATION_EMAIL = "auth/resend-verification-email", e.UPDATE_USER_DETAILS = "account/update/user", e.CONFIRM_EMAIL = "account/verifyAccount", e.FORGOT_PASSWORD = "email/sendVeri", e.RESEND_OTP = "email/sendForgotPasswordVerification", e.RESET_PASSWORD = "account/updateUserPassword", e.REQUEST_LIMIT = "user/request-limit", e.APPLE_SOCIAL_SIGN_UP = "tp/apple/get/user", e.GOOGLE_SOCIAL_SIGN_UP = "tp/google/get/user", e.UPDATE_USER = "account/details/addUserDetails", e.ACKNOWLEDGEMENT = "account/update/userAcknowledgement", e.REGIONS = "user/region", e.UPDATE_USER_REGION = "/account/update/userRegion", e.UPDATE_PASSENGER_DETAILS = "/account/awayz", e.REFRESH_TOKEN = "auth/refresh-token", e.EXCHANGE_TOKEN = "user/exchange-token", e.REFRESH_EMBED_TOKEN = "user/refresh-token", e.OAUTH_INITIATE = "user/oauth2/initiate", e.OAUTH_CALLBACK = "user/oauth2/callback", e))(r || {}), a = /* @__PURE__ */ ((e) => (e.CURRENCY_CONVERSION = "currency/convert", e))(a || {}), _ = /* @__PURE__ */ ((e) => (e.USER_AWARDS = "user/rewards", e.USER_CARDS = "user/cards", e.BANKS = "banks", e.CARDS = "cards", e))(_ || {}),
|
|
1
|
+
var r = /* @__PURE__ */ ((e) => (e.SIGN_IN = "auth/user-login", e.SIGN_UP = "auth/sign-up", e.ME = "user", e.RESEND_VERIFICATION_EMAIL = "auth/resend-verification-email", e.UPDATE_USER_DETAILS = "account/update/user", e.CONFIRM_EMAIL = "account/verifyAccount", e.FORGOT_PASSWORD = "email/sendVeri", e.RESEND_OTP = "email/sendForgotPasswordVerification", e.RESET_PASSWORD = "account/updateUserPassword", e.REQUEST_LIMIT = "user/request-limit", e.APPLE_SOCIAL_SIGN_UP = "tp/apple/get/user", e.GOOGLE_SOCIAL_SIGN_UP = "tp/google/get/user", e.UPDATE_USER = "account/details/addUserDetails", e.ACKNOWLEDGEMENT = "account/update/userAcknowledgement", e.REGIONS = "user/region", e.UPDATE_USER_REGION = "/account/update/userRegion", e.UPDATE_PASSENGER_DETAILS = "/account/awayz", e.REFRESH_TOKEN = "auth/refresh-token", e.EXCHANGE_TOKEN = "user/exchange-token", e.REFRESH_EMBED_TOKEN = "user/refresh-token", e.OAUTH_INITIATE = "user/oauth2/initiate", e.OAUTH_CALLBACK = "user/oauth2/callback", e))(r || {}), a = /* @__PURE__ */ ((e) => (e.CURRENCY_CONVERSION = "currency/convert", e))(a || {}), _ = /* @__PURE__ */ ((e) => (e.USER_AWARDS = "user/rewards", e.USER_CARDS = "user/cards", e.ADD_USER_CARDS = "user/cards/add", e.REMOVE_USER_CARDS = "user/cards/remove", e.BANKS = "banks", e.CARDS = "cards", e))(_ || {}), S = /* @__PURE__ */ ((e) => (e.TRIPS = "user/trips", e.ADD_BOOKING = "user/trips/add-booking-to-trip", e.REMOVE_BOOKING = "user/trips/remove-booking-from-trip", e.UNCATEGORISED_BOOKINGS = "/user/trips/get-uncategorized-bookings", e))(S || {}), O = /* @__PURE__ */ ((e) => (e.USER_HOTEL_BOOKINGS = "/user/bookings/hotels", e.USER_FLIGHT_BOOKINGS = "/user/bookings/flights", e.INITIATE_FLIGHT_CANCEL = "/duffel/flights/initiate-order-cancellation", e.CONFIRM_FLIGHT_CANCEL = "/duffel/flights/confirm-order-cancellation", e.CANCEL_HOTEL_BOOKING = "/duffel/hotels/cancel", e))(O || {});
|
|
2
2
|
export {
|
|
3
3
|
r as EAuthEndpoints,
|
|
4
4
|
O as EBookingEndpoints,
|
|
5
5
|
a as ECurrencyEndpoints,
|
|
6
|
-
|
|
6
|
+
S as EMyTripsEndpoints,
|
|
7
7
|
_ as EWalletEndpoints
|
|
8
8
|
};
|
|
@@ -1,82 +1,91 @@
|
|
|
1
|
-
import { useQuery as
|
|
2
|
-
import { EBookingType as
|
|
1
|
+
import { useQuery as a, useMutation as s } from "@tanstack/react-query";
|
|
2
|
+
import { EBookingType as e } from "../../services/trips/TripService.types.js";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as
|
|
4
|
+
import { E as t } from "../../AccountService-D_6U8vP6.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { BookingService as
|
|
6
|
+
import { BookingService as o } from "../../services/bookings/BookingService.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
import "../../context/AwayzContext.js";
|
|
9
|
-
import { awayzClient as
|
|
9
|
+
import { awayzClient as n } from "../../configs/awayzClient.js";
|
|
10
10
|
import "../../services/noRetryInstance.js";
|
|
11
|
-
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
11
|
+
import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
12
|
+
/* empty css */
|
|
12
13
|
/* empty css */
|
|
13
14
|
/* empty css */
|
|
14
15
|
/* empty css */
|
|
15
|
-
const
|
|
16
|
+
const A = (r, i) => {
|
|
16
17
|
const {
|
|
17
18
|
data: l,
|
|
18
19
|
isError: c,
|
|
19
|
-
error:
|
|
20
|
-
} =
|
|
21
|
-
queryKey: [
|
|
22
|
-
queryFn: () =>
|
|
23
|
-
enabled:
|
|
20
|
+
error: u
|
|
21
|
+
} = a({
|
|
22
|
+
queryKey: [t.BOOKING, r, i],
|
|
23
|
+
queryFn: () => o.getHotelBooking(r),
|
|
24
|
+
enabled: i === e.HOTEL && !!r
|
|
24
25
|
}), {
|
|
25
|
-
data:
|
|
26
|
+
data: m,
|
|
26
27
|
isError: B,
|
|
27
28
|
error: E
|
|
28
|
-
} =
|
|
29
|
-
queryKey: [
|
|
30
|
-
queryFn: () =>
|
|
31
|
-
enabled:
|
|
29
|
+
} = a({
|
|
30
|
+
queryKey: [t.BOOKING, r, i],
|
|
31
|
+
queryFn: () => o.getFlightBooking(r),
|
|
32
|
+
enabled: i === e.FLIGHT && !!r
|
|
32
33
|
}), {
|
|
33
34
|
mutate: g,
|
|
34
|
-
isPending:
|
|
35
|
-
isError:
|
|
36
|
-
error:
|
|
37
|
-
|
|
35
|
+
isPending: O,
|
|
36
|
+
isError: f,
|
|
37
|
+
error: y,
|
|
38
|
+
isSuccess: C
|
|
39
|
+
} = s({
|
|
38
40
|
mutationFn: async () => {
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
41
|
+
if (i === e.FLIGHT)
|
|
42
|
+
return o.initiateCancelFlightBooking(r);
|
|
41
43
|
throw new Error("Not supported for hotel bookings");
|
|
42
44
|
},
|
|
43
45
|
onSuccess: () => {
|
|
44
|
-
|
|
45
|
-
queryKey: [
|
|
46
|
+
n.invalidateQueries({
|
|
47
|
+
queryKey: [t.BOOKING, r, i]
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
50
|
}), {
|
|
49
|
-
mutate:
|
|
50
|
-
isPending:
|
|
51
|
-
isError:
|
|
52
|
-
error:
|
|
53
|
-
|
|
51
|
+
mutate: K,
|
|
52
|
+
isPending: F,
|
|
53
|
+
isError: h,
|
|
54
|
+
error: p,
|
|
55
|
+
isSuccess: S
|
|
56
|
+
} = s({
|
|
54
57
|
mutationFn: async () => {
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
58
|
+
if (i === e.FLIGHT)
|
|
59
|
+
return o.confirmCancelFlightBooking(r);
|
|
60
|
+
if (i === e.HOTEL)
|
|
61
|
+
return o.cancelHotelBooking(r);
|
|
59
62
|
},
|
|
60
63
|
onSuccess: () => {
|
|
61
|
-
|
|
62
|
-
queryKey: [
|
|
64
|
+
n.invalidateQueries({
|
|
65
|
+
queryKey: [t.BOOKING, r, i]
|
|
66
|
+
}), n.invalidateQueries({
|
|
67
|
+
queryKey: [t.TRIPS]
|
|
68
|
+
}), n.invalidateQueries({
|
|
69
|
+
queryKey: [t.UNCATEGORISED_BOOKINGS]
|
|
63
70
|
});
|
|
64
71
|
}
|
|
65
|
-
}),
|
|
72
|
+
}), G = c || B, H = u || E;
|
|
66
73
|
return {
|
|
67
|
-
details:
|
|
68
|
-
isError:
|
|
69
|
-
error:
|
|
74
|
+
details: i === e.HOTEL ? l : m,
|
|
75
|
+
isError: G,
|
|
76
|
+
error: H,
|
|
70
77
|
initiateCancellation: g,
|
|
71
|
-
isInitiatingCancellation:
|
|
72
|
-
isInitiateCancellationError:
|
|
73
|
-
initiateCancellationError:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
isInitiatingCancellation: O,
|
|
79
|
+
isInitiateCancellationError: f,
|
|
80
|
+
initiateCancellationError: y,
|
|
81
|
+
isInitiateCancellationSuccess: C,
|
|
82
|
+
cancelBooking: K,
|
|
83
|
+
isCancelingBooking: F,
|
|
84
|
+
isCancelBookingError: h,
|
|
85
|
+
cancelBookingError: p,
|
|
86
|
+
isCancelBookingSuccess: S
|
|
78
87
|
};
|
|
79
88
|
};
|
|
80
89
|
export {
|
|
81
|
-
|
|
90
|
+
A as useBookingManagement
|
|
82
91
|
};
|