@sikka/hawa 0.0.32 → 0.0.33
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/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/elements/HawaPopMenu.js +5 -1
- package/src/layout/HawaAppBar.js +37 -64
- package/src/layout/HawaAppLayout.js +31 -29
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.2511f65a.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.a7262b49.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.924b4d3c.iframe.bundle.js.LICENSE.txt → vendors~main.a7262b49.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.a7262b49.iframe.bundle.js.map +1 -0
- package/storybook-static/main.c86d0451.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.924b4d3c.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.924b4d3c.iframe.bundle.js.map +0 -1
package/es/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import t,{useState as r}from"react";import n from"@mui/material/Button";import i from"@mui/material/Tooltip";import a from"prop-types";import{jsxs as l,jsx as o,Fragment as s}from"react/jsx-runtime";import d from"@mui/material/Snackbar";import c from"@mui/material/AlertTitle";import u from"@mui/material/Alert";import m from"@mui/material/FormControlLabel";import p from"@mui/material/Checkbox";import h from"@mui/material/Container";import g from"@mui/material/Typography";import f from"@mui/icons-material/CheckCircleOutlined";import v from"@mui/material/Chip";import x from"@mui/material/Input";import b from"@mui/material/InputLabel";import y from"@mui/material/Switch";import w from"@emotion/styled";import T from"@mui/material/Slider";import C from"@mui/material/Stack";import P from"@mui/icons-material/GitHub";import k from"@mui/icons-material/Twitter";import L from"@mui/icons-material/AccountBalanceWallet";import S from"@mui/material/Select";import W from"@mui/material/Table";import O from"@mui/material/TableBody";import N from"@mui/material/TableCell";import I from"@mui/material/TableContainer";import A from"@mui/material/TableHead";import q from"@mui/material/TableRow";import{Button as R,InputAdornment as j,useTheme as E,Menu as z,MenuItem as B,Typography as D,BottomNavigation as M,BottomNavigationAction as G}from"@mui/material";import{Search as U,RestoreOutlined as $}from"@mui/icons-material";import _ from"@mui/icons-material/ExpandMore";import V from"@mui/material/Accordion";import F from"@mui/material/AccordionSummary";import Z from"@mui/material/AccordionDetails";import{useForm as H,FormProvider as X,Controller as Y}from"react-hook-form";import J from"@mui/material/InputAdornment";import Q from"@mui/icons-material/HttpsOutlined";import K from"@mui/icons-material/MailOutline";import ee from"@mui/icons-material/PermIdentityOutlined";import te from"@mui/material/Divider";import{styled as re,useTheme as ne}from"@mui/material/styles";import ie from"@mui/material/Box";import ae from"@mui/material/Drawer";import le from"@mui/material/AppBar";import oe from"@mui/material/Toolbar";import se from"@mui/material/List";import de from"@mui/material/IconButton";import ce from"@mui/icons-material/Menu";import ue from"@mui/icons-material/ChevronLeft";import me from"@mui/icons-material/ChevronRight";import pe from"@mui/material/ListItemButton";import he from"@mui/material/ListItemText";import ge from"@mui/material/Avatar";import fe from"@mui/material/useMediaQuery";import ve from"@mui/icons-material/Close";import xe from"@mui/material/Dialog";import be from"@mui/material/DialogActions";import ye from"@mui/material/DialogContent";import we from"@mui/material/DialogTitle";import Te from"@mui/material/Menu";import Ce from"@mui/material/MenuItem";function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(r),!0).forEach((function(t){Le(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Se(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function We(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,a=[],l=!0,o=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){o=!0,i=e}finally{try{l||null==r.return||r.return()}finally{if(o)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ne(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ie=function(e){return e.showText?l(n,{variant:"adaptive-dark",onClick:e.onClick,children:[e.icon,o("div",{style:{width:10}}),e.buttonText]}):o(i,{title:e.buttonText,placement:"top",children:o(n,{variant:"adaptive-dark",onClick:e.onClick,children:e.icon})})};Ie.propTypes={buttonText:a.string,onClick:a.func,showText:a.bool};var Ae=function(e){return o(n,ke(ke({},e),{},{children:e.text}))},qe=function(e){return o(d,{open:e.open,onClose:e.handleClose,children:l(u,{icon:!1,severity:e.severity,children:[e.title&&o(c,{children:e.title}),e.text]})})},Re=function(e){return console.log("props : ",e),o(t.Fragment,{children:o(m,{label:e.label,control:o(p,{style:{color:e.color||null},defaultChecked:e.defaultValue})})})},je=function(e){var t=Oe(r(e.defaultValue),2),i=t[0],a=t[1];return o(h,{variant:e.location||"panelTabs",children:e.options.map((function(t,r){var l;return o(n,{onClick:function(){e.handleChange(t.value),a(t.value)},fullWidth:!0,variant:(null==i?void 0:i.toLowerCase())===(null===(l=t.value)||void 0===l?void 0:l.toLowerCase())?"selected":"unselected",children:t.label},r)}))})};je.propTypes={lang:a.string,options:a.arrayOf(a.shape({label:a.string,value:a.string})),defaultValue:a.string,handleChange:a.func,location:a.string};var Ee=function(e){var t="ar"===e.lang;return l(h,{onClick:function(t){t.stopPropagation(),e.onCardClick()},maxWidth:"xs",variant:"card-container",dataValue:"parent",style:{direction:t?"rtl":"ltr"},children:[e.header&&l(h,{style:{zIndex:20},variant:"card-header",children:[e.headerActions&&o("div",{style:{margin:0,marginRight:-20,marginLeft:-20,marginBottom:-20,display:"flex",paddingTop:5,paddingLeft:5,paddingRight:5,justifyContent:"flex-end"},children:e.headerActions}),e.header]}),e.content&&o(h,{style:{zIndex:20},variant:"card-content",children:e.content}),e.actions&&o(h,{style:{zIndex:20},variant:"card-actions",children:e.actions})]})};Ee.propTypes={lang:a.string,onCardClick:a.func};var ze=function(e){var t,r,i="ar"===e.lang,a={monthly:"شهرياً","3-months":"كل 3 أشهر","6-months":"كل 6 أشهر",annually:"سنوياً"},s={monthly:"Monthly","3-months":"3 Months","6-months":"6 Months",annually:"Annually"},d={usd:i?"دولار":"$",sar:i?"ريال":"SAR"},c=i?e.features_ar:e.features,u=i?{left:10}:{right:10};return l(h,{maxWidth:"xs",variant:e.selectedPlan?"selected-plan-card":"plan-card",style:{direction:i?"rtl":"ltr"},children:[l(h,{variant:"plan-header",children:[e.discount&&o(v,{label:e.discount,variant:"standard",style:ke({maxWidth:"fit-content",position:"absolute",bottom:10},u),color:"success"}),o(g,{variant:"h3",fontWeight:500,children:i?e.title_ar:e.title}),o(g,{variant:"caption",children:i?e.subtitle_ar:e.subtitle}),o("br",{}),o(g,{variant:"h4",fontWeight:500,style:{display:"flex",alignItems:"center"},children:"ar"===e.lang?l("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l("div",{style:{display:"flex",flexDirection:"row"},children:[e.price,o("div",{style:{width:5}}),o(g,{children:d[null===(t=e.currency)||void 0===t?void 0:t.toLowerCase()]})]}),o(g,{style:{fontSize:14,margin:5},children:i?a[e.cycleText]:s[e.cycleText]})]}):l("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l("div",{style:{display:"flex",flexDirection:"row"},children:[o(g,{children:d[null===(r=e.currency)||void 0===r?void 0:r.toLowerCase()]}),o("div",{style:{width:5}}),e.price]}),o(g,{style:{fontSize:14,margin:5},children:"ar"===e.lang?a[e.cycleText]:s[e.cycleText]})]})})]}),o("div",{style:{padding:20,color:e.selectedPlan?"white":"black"},children:null==c?void 0:c.map((function(e){return l("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",marginTop:10,width:"100%"},children:[o("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",width:"10%"},children:o(f,{fontSize:"small"})}),o("div",{style:{width:10}}),o(g,{variant:"subtitle2",children:e})]})}))}),o(n,{onClick:e.selectPlan,variant:e.selectedPlan?"outlined":"contained",style:{margin:20},children:e.buttonText})]})};ze.propTypes={lang:a.string,buttonText:a.string,selectedPlan:a.string,title:a.string,title_ar:a.string,subtitle:a.string,subtitle_ar:a.string,features:a.array,features_ar:a.array,currency:a.oneOf(["sar","usd"]),cycleText:a.oneOf(["monthly","3-months","6-months","annually"])};var Be=function(e){return o(g,ke(ke({},e),{},{children:e.children}))},De=function(e){return o("div",{style:e.inForm&&{width:"100%"},children:l("div",{style:{width:e.fullWidth?"100%":"fit-content"},children:[l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&o(b,{children:e.label}),e.helperText&&o(g,{style:{marginBottom:!e.label&&10},variant:"validation",children:e.helperText})]}),o(x,ke({disableUnderline:!0},e))]})})},Me=function(e){return o(y,ke({},e))};var Ge="production"!==process.env.NODE_ENV?a.oneOfType([a.number,a.string,a.object,a.array]):{};function Ue(){return Ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ue.apply(this,arguments)}function $e(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function _e(e,t,r={clone:!0}){const n=r.clone?Ue({},e):e;return $e(e)&&$e(t)&&Object.keys(t).forEach((i=>{"__proto__"!==i&&($e(t[i])&&i in e&&$e(e[i])?n[i]=_e(e[i],t[i],r):n[i]=t[i])})),n}const Ve=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Fe=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Ze=[...Ve,...Fe];function He(e){return function(e,t,r,n){const i=(a=e,((l=t)&&"string"==typeof l?l.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),a):null)||r);var a,l;return"number"==typeof i?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${e}.`),i*e):Array.isArray(i)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>i.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${e} > ${i.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join("\n"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}(e,"spacing",8,"spacing")}function Xe(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}"production"===process.env.NODE_ENV||Ve.reduce(((e,t)=>(e[t]=Ge,e)),{}),"production"===process.env.NODE_ENV||Fe.reduce(((e,t)=>(e[t]=Ge,e)),{}),"production"===process.env.NODE_ENV||Ze.reduce(((e,t)=>(e[t]=Ge,e)),{});const Ye=["values","unit","step"];function Je(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,i=Xe(e,Ye),a=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>Ue({},e,{[t.key]:t.val})),{})})(t),l=Object.keys(a);function o(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-n/100}${r})`}function d(e,i){const a=l.indexOf(i);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==a&&"number"==typeof t[l[a]]?t[l[a]]:i)-n/100}${r})`}return Ue({keys:l,values:a,up:o,down:s,between:d,only:function(e){return l.indexOf(e)+1<l.length?d(e,l[l.indexOf(e)+1]):o(e)},not:function(e){const t=l.indexOf(e);return 0===t?o(l[1]):t===l.length-1?s(l[t]):d(e,l[l.indexOf(e)+1]).replace("@media","@media not all and")},unit:r},i)}var Qe={borderRadius:4};const Ke=["breakpoints","palette","spacing","shape"];const et=e.createContext(null);"production"!==process.env.NODE_ENV&&(et.displayName="ThemeContext");var tt=et;function rt(t=null){const r=function(){const t=e.useContext(tt);return"production"!==process.env.NODE_ENV&&e.useDebugValue(t),t}();return r&&(n=r,0!==Object.keys(n).length)?r:t;var n}const nt=function(e={},...t){const{breakpoints:r={},palette:n={},spacing:i,shape:a={}}=e,l=Xe(e,Ke),o=Je(r),s=function(e=8){if(e.mui)return e;const t=He({spacing:e}),r=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map((e=>{const r=t(e);return"number"==typeof r?`${r}px`:r})).join(" "));return r.mui=!0,r}(i);let d=_e({breakpoints:o,direction:"ltr",components:{},palette:Ue({mode:"light"},n),spacing:s,shape:Ue({},Qe,a)},l);return d=t.reduce(((e,t)=>_e(e,t)),d),d}();function it(e=nt){return rt(e)}var at,lt,ot=w.input(at||(at=We(["\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n cursor: pointer;\n height: 35px;\n border-radius: ","px;\n background-color: ",";\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius}),(function(e){return e.value})),st=w.input(lt||(lt=We(["\n max-width: 70px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n // height: 30px;\n padding: 10px;\n border-radius: ","px;\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius})),dt=function(e){var t=it();return l("div",{style:{display:"flex",flexDirection:"row"},children:[o(st,{type:"text",value:e.color,borderRadius:t.allBorderRadius,onChange:e.handleChange}),o("div",{style:{width:10}}),o(ot,{type:"color",value:e.color,onChange:e.handleChange,borderRadius:t.allBorderRadius})]})};dt.propTypes={color:a.string,handleChange:a.func};var ct=function(e){return l(C,{spacing:2,direction:"row",alignItems:"center",style:e.style,children:[e.startElement,o(T,{size:"small","aria-label":"Volume",value:e.value,onChange:e.handleChange}),e.endElement]})};ct.propTypes={startElement:a.element,endElement:a.element,handleChange:a.func};var ut=function(e){return l(h,{variant:"settingsRow",children:[o(Be,{children:e.settingsLabel}),"checkbox"===e.settingsType&&o(p,ke({},e)),"text"===e.settingsType&&o(De,ke({},e)),"boolean"===e.settingsType&&o(Me,ke({},e)),"range"===e.settingsType&&o(ct,ke({},e)),"color"===e.settingsType&&o(dt,ke({},e)),"radio"===e.settingsType&&o(je,ke({location:"inSettings"},e))]})};ut.propTypes={settingsLabel:a.string,settingsType:a.oneOf(["checkbox","text","radio","boolean","color"])};var mt=function(e){var t,r="ar"===e.lang,i="";switch(null===(t=e.logo)||void 0===t?void 0:t.toLowerCase()){case"google":i=o("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":i=o(P,{});break;case"twitter":i=o(k,{});break;case"mada":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":i=o(L,{})}return l(n,ke(ke({style:{direction:r?"rtl":"ltr"}},e),{},{variant:"withLogo",children:[i,o("div",{style:{width:10}}),o(g,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))};mt.propTypes={lang:a.string,logo:a.oneOf(["google","github","twitter","wallet","googlepay","applepay","stcpay","visa/master","paypal","mada"]),buttonText:a.string};var pt=function(e){return o(n,ke(ke({},e),{},{children:e.children}))},ht=function(e){return l("div",{style:{width:"100%"},children:[l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o(b,{children:e.label}),e.helperText&&o(g,{variant:"validation",children:e.helperText})]}),o(S,ke(ke({},e),{},{children:e.children}))]})},gt=function(e){var t=it();return console.log("theme is ",t),o("label",{children:o("textarea",{style:{color:"black",backgroundColor:e.bgColor||"white",borderBottom:"none",border:"none",width:"100%",padding:0,margin:0,marginBottom:0,resize:e.resize||"vertical"}})})},ft=function(e){return o(b,{children:o("div",{style:{fontSize:15},children:e.label})})},vt=function(e){return l(u,{severity:e.severity,icon:e.hideIcon,children:[e.title&&o(c,{children:e.title}),e.text]})};vt.propTypes={severity:a.oneOf(["error","info","success","warning"]),title:a.string,text:a.string,hideIcon:a.bool};var xt=function(e){var t="ar"===e.lang;return o(I,{style:{direction:t?"rtl":"ltr"},children:l(W,{"aria-label":"a dense table",children:[o(A,{children:l(q,{children:[e.columns.map((function(e,r){return o(N,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&o(N,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:"Actions"})]})}),o(O,{children:e.rows?e.rows.map((function(r,n){return l(q,{children:[r.map((function(e,r){return o(N,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&o(N,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:e.actions.map((function(t){return o(R,{style:{margin:2},variant:"outlined",size:"small",onClick:function(){return e.handleActionClick(r)},children:t})}))})]},n)})):o(q,{align:"center",children:o(N,{align:"center",component:"th",colSpan:6,children:e.noDataText})})}),e.end&&o(q,{children:e.end.map((function(e,r){return o(N,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})};xt.propTypes={handleActionClick:a.func,noDataText:a.string,lang:a.string,columns:a.array,rows:a.array,end:a.array};var bt=function(e){return o(De,ke({endAdornment:o(j,{position:"start",children:o(U,{})})},e))},yt=function(e){return l(V,{elevation:0,children:[o(F,{expandIcon:o(_,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:o(g,{children:e.title})}),o(Z,{children:l(g,{children:[e.content," "]})})]})};yt.propTypes={title:a.string,content:a.string};var wt=function(e){var t=H(),r=t.formState.errors,i=t.handleSubmit,a=t.control;return o(h,{maxWidth:"sm",children:o(X,ke(ke({},t),{},{children:l("form",{onSubmit:i(e.handleUpdateProfile),children:[o(Y,{control:a,name:"fullName",render:function(t){var n,i,a=t.field;return o(De,ke({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=r.fullName)||void 0===i?void 0:i.message},a))}}),o(Y,{control:a,name:"phoneNumber",render:function(e){var t=e.field;return o(De,ke({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),o(Y,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(De,ke({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder},a))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(Y,{control:a,name:"password",render:function(t){var n,i,a=t.field;return o(De,ke({fullWidth:!0,type:"password",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message},a))},rules:{required:e.texts.passwordRequiredText}}),o(Y,{control:a,name:"confirmPassword",render:function(t){var n,i,a=t.field;return o(De,ke({fullWidth:!0,type:"password",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(i=r.confirmPassword)||void 0===i?void 0:i.message},a))},rules:{required:e.texts.confirmPasswordRequiredText}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.updateProfile})]})}))})},Tt=function(e){return l(h,{maxWidth:"sm",children:[e.children,o(n,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})},Ct=function(e){var t=Oe(r(!1),2),i=t[0],a=t[1],s=H(),d=s.formState.errors,c=s.handleSubmit,u=s.control;return l(h,{maxWidth:"xs",variant:"auth",children:[i&&o(vt,{text:e.texts.passwordMatchError,severity:"error"}),e.passwordChanged?o(Be,{style:{textAlign:"center",margin:5},children:e.texts.passwordChanged}):o(X,ke(ke({},s),{},{children:l("form",{onSubmit:c((function(t){console.log("handling subb",t),t.password===t.confirmPassword?e.handleNewPassword():a(!0)})),children:[o(Y,{control:u,name:"password",render:function(t){var r,n,i=t.field;return o(De,ke({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=d.password)||void 0===n?void 0:n.message,startAdornment:o(J,{position:"start",children:o(Q,{})})},i))},rules:{required:e.texts.passwordRequiredText}}),o(Y,{control:u,name:"confirmPassword",render:function(t){var r,n,i=t.field;return o(De,ke({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(n=d.confirmPassword)||void 0===n?void 0:n.message,startAdornment:o(J,{position:"start",children:o(Q,{})})},i))},rules:{required:e.texts.confirmPasswordRequiredText}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.updatePassword})]})}))]})};Ct.propTypes={texts:a.shape({emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,passwordPlaceholder:a.string,updatePassword:a.string,passwordRequiredText:a.string,passwordLabel:a.string,confirmPasswordPlaceholder:a.string,confirmPasswordLabel:a.string,confirmPasswordRequiredText:a.string,passwordMatchError:a.string,forgotPasswordText:a.string,passwordChanged:a.string}),passwordChanged:a.bool,handleNewPassword:a.func};var Pt=function(e){var t=H(),r=t.formState.errors,i=t.handleSubmit;t.register;var a=t.control;return o(h,{maxWidth:"xs",variant:"auth",children:e.sent?o(Be,{style:{textAlign:"center",margin:5},children:e.texts.emailSentText}):l("form",{onSubmit:i(e.handleResetPassword),children:[o(Y,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(De,ke({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:o(J,{position:"start",children:o(K,{})})},a))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})})};Pt.propTypes={texts:a.shape({emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,emailInvalidText:a.string,emailSentText:a.string,resetPassword:a.string}),sent:a.bool,handleResetPassword:a.func};var kt=function(e){var t=H(),r=t.formState.errors,i=t.handleSubmit,a=t.control;return l(h,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&o(vt,{title:e.errorTitle,text:e.errorText,severity:"error"}),o(X,ke(ke({},t),{},{children:l("form",{onSubmit:i(e.handleSignUp),children:[o(Y,{control:a,name:"fullName",render:function(t){var n,i,a=t.field;return o(De,{fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=r.fullName)||void 0===i?void 0:i.message,startAdornment:o(J,{position:"start",children:o(ee,{})})})},rules:{required:e.texts.fullNameRequiredText}}),o(Y,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(De,{fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:o(J,{position:"start",children:o(K,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(Y,{control:a,name:"password",render:function(t){var n,i,a,l=t.field;return o(De,ke({fullWidth:!0,type:"password",defaultValue:null!==(n=l.value)&&void 0!==n?n:"",value:null!==(i=l.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(a=r.password)||void 0===a?void 0:a.message,startAdornment:o(J,{position:"start",children:o(Q,{})})},l))},rules:{required:e.texts.passwordRequiredText}}),o(n,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),l(g,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",o("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),o(te,{}),l("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&o(mt,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&o(mt,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&o(mt,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};kt.propTypes={texts:a.shape({fullNameLabel:a.string,fullNamePlaceholder:a.string,fullNameRequiredText:a.string,emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,emailInvalidText:a.string,passwordLabel:a.string,passwordPlaceholder:a.string,passwordRequiredText:a.string,passwordTooShortText:a.string,forgotPasswordText:a.string,newUserText:a.string,signUpText:a.string,signInText:a.string,existingUserText:a.string,googleButtonLabel:a.string,githubButtonLabel:a.string,twitterButtonLabel:a.string}),viaGoogle:a.bool,viaGithub:a.bool,viaTwitter:a.bool,handleSignUp:a.func,handleRouteToSignIn:a.func,handleGoogleSignUp:a.func,handleGithubSignUp:a.func,handleTwitterSignUp:a.func};var Lt=function(e){var t=H(),r=t.formState.errors,i=t.handleSubmit,a=t.control;return l(h,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&o(vt,{title:e.errorTitle,text:e.errorText,severity:"error"}),l("form",{onSubmit:i(e.handleSignIn),children:[o(Y,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(De,ke({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:o(J,{position:"start",children:o(K,{})})},a))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(Y,{control:a,name:"password",render:function(t){var n,i,a,l=t.field;return o(De,ke({fullWidth:!0,type:"password",defaultValue:null!==(n=l.value)&&void 0!==n?n:"",value:null!==(i=l.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(a=r.password)||void 0===a?void 0:a.message,startAdornment:o(J,{position:"start",children:o(Q,{})})},l))},rules:{required:e.texts.passwordRequiredText}}),o(g,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),l(g,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",o("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),o(te,{}),l("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&o(mt,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&o(mt,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&o(mt,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})};Lt.propTypes={texts:a.shape({emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,emailInvalidText:a.string,passwordLabel:a.string,passwordPlaceholder:a.string,passwordRequiredText:a.string,forgotPasswordText:a.string,newUserText:a.string,signUpText:a.string,signInText:a.string,googleButtonLabel:a.string,githubButtonLabel:a.string,twitterButtonLabel:a.string}),viaGoogle:a.bool,viaGithub:a.bool,viaTwitter:a.bool,handleSignIn:a.func,handleRouteToSignUp:a.func,handleGoogleSignIn:a.func,handleGithubSignIn:a.func,handleTwitterSignIn:a.func};var St=function(e){return l(h,{maxWidth:"xs",children:[o(Be,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&o(mt,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&o(mt,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&o(mt,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&o(mt,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&o(mt,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&o(mt,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&o(mt,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})};St.propTypes={viaMada:a.bool,viaWallet:a.bool,viaSTCPay:a.bool,viaPayPal:a.bool,viaApplePay:a.bool,viaCreditCard:a.bool,madaLabel:a.string,stcPayLabel:a.string,paypalLabel:a.string,walletLabel:a.string,applePayLabel:a.string,visaMasterLabel:a.string,handleMada:a.func,handleWallet:a.func,handleSTCPay:a.func,handlePayPal:a.func,handleApplePay:a.func,handleCreditCard:a.func};var Wt=function(e){var t,r=H(),i=r.formState.errors,a=r.handleSubmit,s=r.control;return o(h,{maxWidth:"xs",children:l("form",{onSubmit:a(e.handle),children:[o(De,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message}),o(Y,{control:s,name:"cardName",render:function(e){var t;return e.field,o(De,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),o(Y,{control:s,name:"cardName",render:function(e){var t;return e.field,o(De,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Expiry Date",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),o(Y,{control:s,name:"cardName",render:function(e){var t;return e.field,o(De,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"CCV",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),o(n,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})})},Ot=function(e){var t=Oe(r(0),2),i=t[0],a=t[1],s=H(),d=s.formState.errors,c=s.handleSubmit,u=s.control;return l(h,{maxWidth:"xs",children:[l(g,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(i).toLocaleString("en")||"0",o(g,{children:e.currency||"SAR"})]}),o(X,ke(ke({},s),{},{children:l("form",{onSubmit:c(e.handleChargeWallet),children:[o(Y,{control:u,name:"amount",render:function(t){var r,n,i=t.field;return o(De,ke(ke({fullWidth:!0,placeholder:e.texts.amountLabel,type:"number",value:null!==(r=i.value)&&void 0!==r?r:""},i),{},{inputProps:{inputMode:"numeric",min:"1",max:"9999999",step:"0.01"},onChange:function(e){i.onChange(parseFloat(e.target.value)),a(e.target.value)},helperText:null===(n=d.amount)||void 0===n?void 0:n.message}))},rules:{required:e.texts.amountRequired}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.chargeWallet})]})}))]})};Ot.propTypes={texts:a.shape({amountLabel:a.string,chargeWallet:a.string,amountRequired:a.string}),handleChargeWallet:a.func,currency:a.string};var Nt=function(e){return l(h,{maxWidth:"xs",children:[o(g,{align:"center",children:"Wallet Balance"}),l(g,{align:"center",variant:"h1",children:[e.walletBalance||"0",o(g,{children:e.currency||"SAR"})]}),o(n,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},It=function(e){var t,r,i,a,s,d,c,u,m,p,f="ar"===e.lang,v=H(),x=v.formState.errors,b=v.handleSubmit;v.register;var y=v.control,w={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return l(h,{maxWidth:"sm",style:{direction:f?"rtl":"ltr"},children:[o(g,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),o(xt,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),o(te,{variant:"middle"}),o(g,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),o(X,ke(ke({},v),{},{children:l("form",{onSubmit:b(e.handlePayNow),children:[l(h,{sx:w,children:[o(Y,{control:y,name:"firstName",rules:{required:null===(t=e.texts)||void 0===t?void 0:t.required},render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.firstNameLabel)+" *",helperText:null===(i=x.firstName)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(Y,{control:y,name:"lastName",rules:{required:null===(r=e.texts)||void 0===r?void 0:r.required},render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.lastNameLabel)+" *",helperText:null===(i=x.lastName)||void 0===i?void 0:i.message},a))}})]}),o(Y,{control:y,name:"email",render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.emailLabel)+" *",helperText:null===(i=x.email)||void 0===i?void 0:i.message},a))},rules:{required:null===(i=e.texts)||void 0===i?void 0:i.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(a=e.texts)||void 0===a?void 0:a.emailInvalidText}}}),l(h,{sx:w,children:[o(Y,{control:y,name:"streetAddress",rules:{required:null===(s=e.texts)||void 0===s?void 0:s.required},render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.streetAddressLabel)+" *",helperText:null===(i=x.streetAddress)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(Y,{control:y,name:"buildingNumber",rules:{required:null===(d=e.texts)||void 0===d?void 0:d.required},render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.buildingNumberLabel)+" *",helperText:null===(i=x.buildingNumber)||void 0===i?void 0:i.message},a))}})]}),l(h,{sx:w,children:[o(Y,{control:y,name:"province",rules:{required:null===(c=e.texts)||void 0===c?void 0:c.required},render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.stateLabel)+" *",helperText:null===(i=x.province)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(Y,{control:y,name:"city",rules:{required:null===(u=e.texts)||void 0===u?void 0:u.required},render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.cityLabel)+" *",helperText:null===(i=x.city)||void 0===i?void 0:i.message},a))}})]}),l(h,{sx:w,children:[o(Y,{control:y,name:"zipCode",rules:{required:null===(m=e.texts)||void 0===m?void 0:m.required},render:function(t){var r,n,i,a=t.field;return o(De,ke({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.zipCodeLabel)+" *",helperText:null===(i=x.zipCode)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(Y,{control:y,name:"country",rules:{required:null===(p=e.texts)||void 0===p?void 0:p.required},render:function(t){var r,n,i,a=t.field;return l(ht,ke(ke({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(n=a.value)&&void 0!==n?n:"",helperText:null===(i=x.country)||void 0===i?void 0:i.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},a),{},{children:[o("option",{}),e.countriesList.map((function(e,t){return o("option",{children:e},t)}))]}))}})]}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})};It.propTypes={texts:a.shape({orderDetails:a.string,billingAddress:a.string,payNow:a.string,emailLabel:a.string,emailRequiredText:a.string,emailInvalidText:a.string,firstNameLabel:a.string,required:a.string,lastNameLabel:a.string,streetAddressLabel:a.string,buildingNumberLabel:a.string,cityLabel:a.string,stateLabel:a.string,countryLabel:a.string,zipCodeLabel:a.string}),lang:a.string,countriesList:a.array,products:a.array,total:a.string,handlePayNow:a.func};var At=function(e){var t="ar"===e.lang;return l("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[l(h,{maxWidth:"sm",style:{direction:t?"rtl":"ltr"},children:[o(g,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),o(te,{variant:"middle"}),l(g,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",o("strong",{children:e.userEmail})]}),o(g,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),o(g,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),o(te,{variant:"middle"}),e.products&&l(s,{children:[o(g,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),o(xt,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),o(te,{variant:"middle"})]}),o(n,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),o(n,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),o(n,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),o(g,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),o("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:o(g,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})};At.propTypes={texts:a.shape({print:a.string,history:a.string,homePage:a.string,successMessage:a.string,orderDetails:a.string,fasterPaymentNote:a.string,billingAddress:a.string,payNow:a.string,yourOrderNumber:a.string,emailLabel:a.string,emailRequiredText:a.string,emailInvalidText:a.string,firstNameLabel:a.string,required:a.string,lastNameLabel:a.string,streetAddressLabel:a.string,buildingNumberLabel:a.string,cityLabel:a.string,stateLabel:a.string,countryLabel:a.string,zipCodeLabel:a.string,refundPolicy:a.string}),products:a.array,countriesList:a.array,lang:a.string,total:a.string,userEmail:a.string,orderNumber:a.string,confirmationTitle:a.string,handleHome:a.func,handlePrint:a.func,handleHistory:a.func,handleRefundPolicyLink:a.func};var qt=function(e){return o("div",{children:e.children})},Rt=function(e){var t=E();return o(z,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:e.anchor,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(e.anchor),onClose:e.handleClose,variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:t.allBorderRadius,border:"1px solid ".concat(t.primaryActionColor)}},children:e.menuItems.map((function(e){return l(B,{onClick:e.action,children:[e.icon&&o(e.icon,{}),o("div",{style:{width:10}}),o(D,{textAlign:"center",children:e.label})]},e.label)}))})};Rt.propTypes={handleClose:a.func,menuItems:a.arrayOf(a.shape({icon:a.element,label:a.string,action:a.func}))};var jt=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},Et=function(e){return Le({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(8)," + 1px)")},e.breakpoints.up("sm"),{width:"calc(".concat(e.spacing(8)," + 1px)")})},zt=re("div")((function(e){var t=e.theme;return ke({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),Bt=re(le,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return ke({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},r&&{marginLeft:240,width:"calc(100% - ".concat(240,"px)"),transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})})})),Dt=re(ae,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return ke(ke({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box"},r&&ke(ke({},jt(t)),{},{"& .MuiDrawer-paper":jt(t)})),!r&&ke(ke({},Et(t)),{},{"& .MuiDrawer-paper":Et(t)}))}));function Mt(e){var r=ne(),n=Oe(t.useState(!0),2),a=n[0],s=n[1],d=fe("(max-width:600px)"),c=Oe(t.useState(null),2);c[0],c[1];var u=Oe(t.useState(null),2),m=u[0],p=u[1];console.log("match is ",d);return l(ie,{sx:{display:"flex"},children:[d&&l(M,{showLabels:!0,children:[o(G,{label:"Recents",icon:o($,{})}),o(G,{label:"Favorites",icon:o($,{})}),o(G,{label:"Nearby",icon:o($,{})})]})," ",o(Bt,{variant:"appbar",position:"fixed",open:a,children:l(oe,{variant:"appbar",children:[o(de,{color:"inherit","aria-label":"open drawer",onClick:function(){return s(!0)},edge:"start",sx:ke({marginRight:5},a&&{display:"none"}),children:o(ce,{})}),l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:0},children:[o(g,{variant:"h6",noWrap:!0,component:"div",children:e.pageTitle}),l(ie,{children:[o(i,{title:"Open settings",children:o(de,{onClick:function(e){return p(e.currentTarget)},sx:{p:0},children:o(ge,{})})}),o(Rt,{menuItems:e.accountMenu,anchor:m,handleClose:function(){return p(null)}})]})]})]})}),l(Dt,{variant:"permanent",open:a,children:[l(zt,{children:[e.logo,o(de,{onClick:function(){return s(!1)},children:"rtl"===r.direction?o(me,{}):o(ue,{})})]}),o(te,{}),o(se,{children:e.pages.map((function(t,r){var n,s;return o(i,{title:t.text,placement:"right",arrow:!0,PopperProps:{style:{opacity:a?0:1}},children:l(pe,{variant:(null===(n=e.pageName)||void 0===n?void 0:n.toLowerCase())===(null===(s=t.slug)||void 0===s?void 0:s.toLowerCase())&&"clicked",onClick:t.action,sx:{minHeight:48,justifyContent:a?"initial":"center",px:2.5},children:[o(t.icon,{}),o("div",{style:{width:20}}),o(he,{primary:t.text,sx:{opacity:a?1:0}})]},t.text)},r)}))})]}),l(ie,{sx:{flexGrow:1,p:3},children:[o(zt,{}),e.children]})]})}var Gt=["children","onClose","hideClose"],Ut=function(e){var t=e.children,r=e.onClose,n=e.hideClose,i=Se(e,Gt);return l(we,ke(ke({sx:{m:0,p:2}},i),{},{children:[t,n?null:o(de,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}},children:o(ve,{})})]}))};function $t(e){var t=Oe(r(!1),2);return t[0],t[1],l(xe,ke(ke({},e),{},{variant:"main",children:[o(Ut,{onClose:e.onClose,hideClose:e.hideClose,children:e.title}),o(ye,{children:e.children}),o(be,{children:e.actions})]}))}var _t=["Products","Pricing","Blog"],Vt=function(e){var r=E(),a=Oe(t.useState(null),2),s=a[0],d=a[1],c=Oe(t.useState(null),2),u=c[0],m=c[1],p=function(){d(null)};return console.log("theme is ",r),o(le,{position:"static",variant:"appbar",children:o(h,{maxWidth:"xl",variant:"appbar",children:l(oe,{disableGutters:!0,children:[o(g,{variant:"h6",noWrap:!0,component:"div",sx:{mr:2,display:{xs:"none",md:"flex"}},children:"LOGO"}),l(ie,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:[o(de,{size:"large","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e.handleOpenSideMenu,color:"inherit",children:o(ce,{})}),o(Te,{id:"menu-appbar",anchorEl:s,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"left"},open:Boolean(s),onClose:p,sx:{display:{xs:"block",md:"none"}},children:_t.map((function(e){return o(Ce,{onClick:p,children:o(g,{textAlign:"center",children:e})},e)}))})]}),o(g,{variant:"h6",noWrap:!0,component:"div",sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:"LOGO"}),o(ie,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:_t.map((function(e){return o(n,{onClick:p,sx:{my:2,display:"block"},children:e},e)}))}),l(ie,{sx:{flexGrow:0},children:[o(i,{title:"Open settings",children:o(de,{onClick:function(e){m(e.currentTarget)},sx:{p:0},children:o(ge,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),o(Rt,{anchor:u,handleClose:function(e){return m(null)},menuItems:e.accountMenu})]})]})})})};export{Ae as ActionButton,Ie as AdaptiveButton,qt as Box,Ot as ChargeWalletForm,It as CheckoutForm,At as ConfirmationPage,Wt as CreditCardForm,yt as HawaAccordian,vt as HawaAlert,Vt as HawaAppBar,Mt as HawaAppLayout,pt as HawaButton,Re as HawaCheckbox,dt as HawaColorPicker,$t as HawaDialog,ft as HawaInputLabel,Ee as HawaItemCard,mt as HawaLogoButton,ze as HawaPricingCard,je as HawaRadio,ct as HawaRange,bt as HawaSearchBar,ht as HawaSelect,ut as HawaSettingsRow,qe as HawaSnackbar,xt as HawaTable,gt as HawaTextArea,De as HawaTextField,Be as HawaTypography,Ct as NewPasswordForm,Nt as PayWithWallet,Pt as ResetPasswordForm,St as SelectPayment,Lt as SignInForm,kt as SignUpForm,wt as UserProfileForm,Tt as UserSettingsForm};
|
|
1
|
+
import*as e from"react";import t,{useState as r}from"react";import n from"@mui/material/Button";import i from"@mui/material/Tooltip";import a from"prop-types";import{jsxs as l,jsx as o,Fragment as s}from"react/jsx-runtime";import d from"@mui/material/Snackbar";import u from"@mui/material/AlertTitle";import c from"@mui/material/Alert";import m from"@mui/material/FormControlLabel";import p from"@mui/material/Checkbox";import h from"@mui/material/Container";import g from"@mui/material/Typography";import f from"@mui/icons-material/CheckCircleOutlined";import v from"@mui/material/Chip";import x from"@mui/material/Input";import b from"@mui/material/InputLabel";import y from"@mui/material/Switch";import w from"@emotion/styled";import T from"@mui/material/Slider";import C from"@mui/material/Stack";import P from"@mui/icons-material/GitHub";import k from"@mui/icons-material/Twitter";import L from"@mui/icons-material/AccountBalanceWallet";import S from"@mui/material/Select";import W from"@mui/material/Table";import O from"@mui/material/TableBody";import N from"@mui/material/TableCell";import I from"@mui/material/TableContainer";import A from"@mui/material/TableHead";import q from"@mui/material/TableRow";import{Button as R,InputAdornment as j,useTheme as E}from"@mui/material";import{Search as z}from"@mui/icons-material";import B from"@mui/icons-material/ExpandMore";import D from"@mui/material/Accordion";import M from"@mui/material/AccordionSummary";import G from"@mui/material/AccordionDetails";import{useForm as U,FormProvider as $,Controller as _}from"react-hook-form";import V from"@mui/material/InputAdornment";import F from"@mui/icons-material/HttpsOutlined";import Z from"@mui/icons-material/MailOutline";import H from"@mui/icons-material/PermIdentityOutlined";import X from"@mui/material/Divider";import{styled as Y,useTheme as J}from"@mui/material/styles";import K from"@mui/material/Box";import Q from"@mui/material/Drawer";import ee from"@mui/material/AppBar";import te from"@mui/material/Toolbar";import re from"@mui/material/List";import ne from"@mui/material/IconButton";import ie from"@mui/icons-material/Menu";import ae from"@mui/icons-material/ChevronLeft";import le from"@mui/icons-material/ChevronRight";import oe from"@mui/material/ListItemButton";import se from"@mui/material/ListItemText";import de from"@mui/material/Avatar";import ue from"@mui/material/Menu";import ce from"@mui/material/MenuItem";import me from"@mui/icons-material/Close";import pe from"@mui/material/Dialog";import he from"@mui/material/DialogActions";import ge from"@mui/material/DialogContent";import fe from"@mui/material/DialogTitle";function ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(r),!0).forEach((function(t){be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function we(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,a=[],l=!0,o=!1;try{for(r=r.call(e);!(l=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){o=!0,i=e}finally{try{l||null==r.return||r.return()}finally{if(o)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ce(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ce(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Pe=function(e){return e.showText?l(n,{variant:"adaptive-dark",onClick:e.onClick,children:[e.icon,o("div",{style:{width:10}}),e.buttonText]}):o(i,{title:e.buttonText,placement:"top",children:o(n,{variant:"adaptive-dark",onClick:e.onClick,children:e.icon})})};Pe.propTypes={buttonText:a.string,onClick:a.func,showText:a.bool};var ke=function(e){return o(n,xe(xe({},e),{},{children:e.text}))},Le=function(e){return o(d,{open:e.open,onClose:e.handleClose,children:l(c,{icon:!1,severity:e.severity,children:[e.title&&o(u,{children:e.title}),e.text]})})},Se=function(e){return console.log("props : ",e),o(t.Fragment,{children:o(m,{label:e.label,control:o(p,{style:{color:e.color||null},defaultChecked:e.defaultValue})})})},We=function(e){var t=Te(r(e.defaultValue),2),i=t[0],a=t[1];return o(h,{variant:e.location||"panelTabs",children:e.options.map((function(t,r){var l;return o(n,{onClick:function(){e.handleChange(t.value),a(t.value)},fullWidth:!0,variant:(null==i?void 0:i.toLowerCase())===(null===(l=t.value)||void 0===l?void 0:l.toLowerCase())?"selected":"unselected",children:t.label},r)}))})};We.propTypes={lang:a.string,options:a.arrayOf(a.shape({label:a.string,value:a.string})),defaultValue:a.string,handleChange:a.func,location:a.string};var Oe=function(e){var t="ar"===e.lang;return l(h,{onClick:function(t){t.stopPropagation(),e.onCardClick()},maxWidth:"xs",variant:"card-container",dataValue:"parent",style:{direction:t?"rtl":"ltr"},children:[e.header&&l(h,{style:{zIndex:20},variant:"card-header",children:[e.headerActions&&o("div",{style:{margin:0,marginRight:-20,marginLeft:-20,marginBottom:-20,display:"flex",paddingTop:5,paddingLeft:5,paddingRight:5,justifyContent:"flex-end"},children:e.headerActions}),e.header]}),e.content&&o(h,{style:{zIndex:20},variant:"card-content",children:e.content}),e.actions&&o(h,{style:{zIndex:20},variant:"card-actions",children:e.actions})]})};Oe.propTypes={lang:a.string,onCardClick:a.func};var Ne=function(e){var t,r,i="ar"===e.lang,a={monthly:"شهرياً","3-months":"كل 3 أشهر","6-months":"كل 6 أشهر",annually:"سنوياً"},s={monthly:"Monthly","3-months":"3 Months","6-months":"6 Months",annually:"Annually"},d={usd:i?"دولار":"$",sar:i?"ريال":"SAR"},u=i?e.features_ar:e.features,c=i?{left:10}:{right:10};return l(h,{maxWidth:"xs",variant:e.selectedPlan?"selected-plan-card":"plan-card",style:{direction:i?"rtl":"ltr"},children:[l(h,{variant:"plan-header",children:[e.discount&&o(v,{label:e.discount,variant:"standard",style:xe({maxWidth:"fit-content",position:"absolute",bottom:10},c),color:"success"}),o(g,{variant:"h3",fontWeight:500,children:i?e.title_ar:e.title}),o(g,{variant:"caption",children:i?e.subtitle_ar:e.subtitle}),o("br",{}),o(g,{variant:"h4",fontWeight:500,style:{display:"flex",alignItems:"center"},children:"ar"===e.lang?l("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l("div",{style:{display:"flex",flexDirection:"row"},children:[e.price,o("div",{style:{width:5}}),o(g,{children:d[null===(t=e.currency)||void 0===t?void 0:t.toLowerCase()]})]}),o(g,{style:{fontSize:14,margin:5},children:i?a[e.cycleText]:s[e.cycleText]})]}):l("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l("div",{style:{display:"flex",flexDirection:"row"},children:[o(g,{children:d[null===(r=e.currency)||void 0===r?void 0:r.toLowerCase()]}),o("div",{style:{width:5}}),e.price]}),o(g,{style:{fontSize:14,margin:5},children:"ar"===e.lang?a[e.cycleText]:s[e.cycleText]})]})})]}),o("div",{style:{padding:20,color:e.selectedPlan?"white":"black"},children:null==u?void 0:u.map((function(e){return l("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",marginTop:10,width:"100%"},children:[o("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",width:"10%"},children:o(f,{fontSize:"small"})}),o("div",{style:{width:10}}),o(g,{variant:"subtitle2",children:e})]})}))}),o(n,{onClick:e.selectPlan,variant:e.selectedPlan?"outlined":"contained",style:{margin:20},children:e.buttonText})]})};Ne.propTypes={lang:a.string,buttonText:a.string,selectedPlan:a.string,title:a.string,title_ar:a.string,subtitle:a.string,subtitle_ar:a.string,features:a.array,features_ar:a.array,currency:a.oneOf(["sar","usd"]),cycleText:a.oneOf(["monthly","3-months","6-months","annually"])};var Ie=function(e){return o(g,xe(xe({},e),{},{children:e.children}))},Ae=function(e){return o("div",{style:e.inForm&&{width:"100%"},children:l("div",{style:{width:e.fullWidth?"100%":"fit-content"},children:[l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&o(b,{children:e.label}),e.helperText&&o(g,{style:{marginBottom:!e.label&&10},variant:"validation",children:e.helperText})]}),o(x,xe({disableUnderline:!0},e))]})})},qe=function(e){return o(y,xe({},e))};var Re="production"!==process.env.NODE_ENV?a.oneOfType([a.number,a.string,a.object,a.array]):{};function je(){return je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},je.apply(this,arguments)}function Ee(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function ze(e,t,r={clone:!0}){const n=r.clone?je({},e):e;return Ee(e)&&Ee(t)&&Object.keys(t).forEach((i=>{"__proto__"!==i&&(Ee(t[i])&&i in e&&Ee(e[i])?n[i]=ze(e[i],t[i],r):n[i]=t[i])})),n}const Be=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],De=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Me=[...Be,...De];function Ge(e){return function(e,t,r,n){const i=(a=e,((l=t)&&"string"==typeof l?l.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),a):null)||r);var a,l;return"number"==typeof i?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${e}.`),i*e):Array.isArray(i)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>i.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${e} > ${i.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join("\n"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}(e,"spacing",8,"spacing")}function Ue(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}"production"===process.env.NODE_ENV||Be.reduce(((e,t)=>(e[t]=Re,e)),{}),"production"===process.env.NODE_ENV||De.reduce(((e,t)=>(e[t]=Re,e)),{}),"production"===process.env.NODE_ENV||Me.reduce(((e,t)=>(e[t]=Re,e)),{});const $e=["values","unit","step"];function _e(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,i=Ue(e,$e),a=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>je({},e,{[t.key]:t.val})),{})})(t),l=Object.keys(a);function o(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-n/100}${r})`}function d(e,i){const a=l.indexOf(i);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==a&&"number"==typeof t[l[a]]?t[l[a]]:i)-n/100}${r})`}return je({keys:l,values:a,up:o,down:s,between:d,only:function(e){return l.indexOf(e)+1<l.length?d(e,l[l.indexOf(e)+1]):o(e)},not:function(e){const t=l.indexOf(e);return 0===t?o(l[1]):t===l.length-1?s(l[t]):d(e,l[l.indexOf(e)+1]).replace("@media","@media not all and")},unit:r},i)}var Ve={borderRadius:4};const Fe=["breakpoints","palette","spacing","shape"];const Ze=e.createContext(null);"production"!==process.env.NODE_ENV&&(Ze.displayName="ThemeContext");var He=Ze;function Xe(t=null){const r=function(){const t=e.useContext(He);return"production"!==process.env.NODE_ENV&&e.useDebugValue(t),t}();return r&&(n=r,0!==Object.keys(n).length)?r:t;var n}const Ye=function(e={},...t){const{breakpoints:r={},palette:n={},spacing:i,shape:a={}}=e,l=Ue(e,Fe),o=_e(r),s=function(e=8){if(e.mui)return e;const t=Ge({spacing:e}),r=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map((e=>{const r=t(e);return"number"==typeof r?`${r}px`:r})).join(" "));return r.mui=!0,r}(i);let d=ze({breakpoints:o,direction:"ltr",components:{},palette:je({mode:"light"},n),spacing:s,shape:je({},Ve,a)},l);return d=t.reduce(((e,t)=>ze(e,t)),d),d}();function Je(e=Ye){return Xe(e)}var Ke,Qe,et=w.input(Ke||(Ke=we(["\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n cursor: pointer;\n height: 35px;\n border-radius: ","px;\n background-color: ",";\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius}),(function(e){return e.value})),tt=w.input(Qe||(Qe=we(["\n max-width: 70px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n // height: 30px;\n padding: 10px;\n border-radius: ","px;\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius})),rt=function(e){var t=Je();return l("div",{style:{display:"flex",flexDirection:"row"},children:[o(tt,{type:"text",value:e.color,borderRadius:t.allBorderRadius,onChange:e.handleChange}),o("div",{style:{width:10}}),o(et,{type:"color",value:e.color,onChange:e.handleChange,borderRadius:t.allBorderRadius})]})};rt.propTypes={color:a.string,handleChange:a.func};var nt=function(e){return l(C,{spacing:2,direction:"row",alignItems:"center",style:e.style,children:[e.startElement,o(T,{size:"small","aria-label":"Volume",value:e.value,onChange:e.handleChange}),e.endElement]})};nt.propTypes={startElement:a.element,endElement:a.element,handleChange:a.func};var it=function(e){return l(h,{variant:"settingsRow",children:[o(Ie,{children:e.settingsLabel}),"checkbox"===e.settingsType&&o(p,xe({},e)),"text"===e.settingsType&&o(Ae,xe({},e)),"boolean"===e.settingsType&&o(qe,xe({},e)),"range"===e.settingsType&&o(nt,xe({},e)),"color"===e.settingsType&&o(rt,xe({},e)),"radio"===e.settingsType&&o(We,xe({location:"inSettings"},e))]})};it.propTypes={settingsLabel:a.string,settingsType:a.oneOf(["checkbox","text","radio","boolean","color"])};var at=function(e){var t,r="ar"===e.lang,i="";switch(null===(t=e.logo)||void 0===t?void 0:t.toLowerCase()){case"google":i=o("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":i=o(P,{});break;case"twitter":i=o(k,{});break;case"mada":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":i=o("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":i=o(L,{})}return l(n,xe(xe({style:{direction:r?"rtl":"ltr"}},e),{},{variant:"withLogo",children:[i,o("div",{style:{width:10}}),o(g,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))};at.propTypes={lang:a.string,logo:a.oneOf(["google","github","twitter","wallet","googlepay","applepay","stcpay","visa/master","paypal","mada"]),buttonText:a.string};var lt=function(e){return o(n,xe(xe({},e),{},{children:e.children}))},ot=function(e){return l("div",{style:{width:"100%"},children:[l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o(b,{children:e.label}),e.helperText&&o(g,{variant:"validation",children:e.helperText})]}),o(S,xe(xe({},e),{},{children:e.children}))]})},st=function(e){var t=Je();return console.log("theme is ",t),o("label",{children:o("textarea",{style:{color:"black",backgroundColor:e.bgColor||"white",borderBottom:"none",border:"none",width:"100%",padding:0,margin:0,marginBottom:0,resize:e.resize||"vertical"}})})},dt=function(e){return o(b,{children:o("div",{style:{fontSize:15},children:e.label})})},ut=function(e){return l(c,{severity:e.severity,icon:e.hideIcon,children:[e.title&&o(u,{children:e.title}),e.text]})};ut.propTypes={severity:a.oneOf(["error","info","success","warning"]),title:a.string,text:a.string,hideIcon:a.bool};var ct=function(e){var t="ar"===e.lang;return o(I,{style:{direction:t?"rtl":"ltr"},children:l(W,{"aria-label":"a dense table",children:[o(A,{children:l(q,{children:[e.columns.map((function(e,r){return o(N,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&o(N,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:"Actions"})]})}),o(O,{children:e.rows?e.rows.map((function(r,n){return l(q,{children:[r.map((function(e,r){return o(N,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&o(N,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:e.actions.map((function(t){return o(R,{style:{margin:2},variant:"outlined",size:"small",onClick:function(){return e.handleActionClick(r)},children:t})}))})]},n)})):o(q,{align:"center",children:o(N,{align:"center",component:"th",colSpan:6,children:e.noDataText})})}),e.end&&o(q,{children:e.end.map((function(e,r){return o(N,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})};ct.propTypes={handleActionClick:a.func,noDataText:a.string,lang:a.string,columns:a.array,rows:a.array,end:a.array};var mt=function(e){return o(Ae,xe({endAdornment:o(j,{position:"start",children:o(z,{})})},e))},pt=function(e){return l(D,{elevation:0,children:[o(M,{expandIcon:o(B,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:o(g,{children:e.title})}),o(G,{children:l(g,{children:[e.content," "]})})]})};pt.propTypes={title:a.string,content:a.string};var ht=function(e){var t=U(),r=t.formState.errors,i=t.handleSubmit,a=t.control;return o(h,{maxWidth:"sm",children:o($,xe(xe({},t),{},{children:l("form",{onSubmit:i(e.handleUpdateProfile),children:[o(_,{control:a,name:"fullName",render:function(t){var n,i,a=t.field;return o(Ae,xe({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=r.fullName)||void 0===i?void 0:i.message},a))}}),o(_,{control:a,name:"phoneNumber",render:function(e){var t=e.field;return o(Ae,xe({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),o(_,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(Ae,xe({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder},a))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(_,{control:a,name:"password",render:function(t){var n,i,a=t.field;return o(Ae,xe({fullWidth:!0,type:"password",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message},a))},rules:{required:e.texts.passwordRequiredText}}),o(_,{control:a,name:"confirmPassword",render:function(t){var n,i,a=t.field;return o(Ae,xe({fullWidth:!0,type:"password",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(i=r.confirmPassword)||void 0===i?void 0:i.message},a))},rules:{required:e.texts.confirmPasswordRequiredText}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.updateProfile})]})}))})},gt=function(e){return l(h,{maxWidth:"sm",children:[e.children,o(n,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})},ft=function(e){var t=Te(r(!1),2),i=t[0],a=t[1],s=U(),d=s.formState.errors,u=s.handleSubmit,c=s.control;return l(h,{maxWidth:"xs",variant:"auth",children:[i&&o(ut,{text:e.texts.passwordMatchError,severity:"error"}),e.passwordChanged?o(Ie,{style:{textAlign:"center",margin:5},children:e.texts.passwordChanged}):o($,xe(xe({},s),{},{children:l("form",{onSubmit:u((function(t){console.log("handling subb",t),t.password===t.confirmPassword?e.handleNewPassword():a(!0)})),children:[o(_,{control:c,name:"password",render:function(t){var r,n,i=t.field;return o(Ae,xe({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=d.password)||void 0===n?void 0:n.message,startAdornment:o(V,{position:"start",children:o(F,{})})},i))},rules:{required:e.texts.passwordRequiredText}}),o(_,{control:c,name:"confirmPassword",render:function(t){var r,n,i=t.field;return o(Ae,xe({fullWidth:!0,type:"password",value:null!==(r=i.value)&&void 0!==r?r:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(n=d.confirmPassword)||void 0===n?void 0:n.message,startAdornment:o(V,{position:"start",children:o(F,{})})},i))},rules:{required:e.texts.confirmPasswordRequiredText}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.updatePassword})]})}))]})};ft.propTypes={texts:a.shape({emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,passwordPlaceholder:a.string,updatePassword:a.string,passwordRequiredText:a.string,passwordLabel:a.string,confirmPasswordPlaceholder:a.string,confirmPasswordLabel:a.string,confirmPasswordRequiredText:a.string,passwordMatchError:a.string,forgotPasswordText:a.string,passwordChanged:a.string}),passwordChanged:a.bool,handleNewPassword:a.func};var vt=function(e){var t=U(),r=t.formState.errors,i=t.handleSubmit;t.register;var a=t.control;return o(h,{maxWidth:"xs",variant:"auth",children:e.sent?o(Ie,{style:{textAlign:"center",margin:5},children:e.texts.emailSentText}):l("form",{onSubmit:i(e.handleResetPassword),children:[o(_,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(Ae,xe({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:o(V,{position:"start",children:o(Z,{})})},a))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})})};vt.propTypes={texts:a.shape({emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,emailInvalidText:a.string,emailSentText:a.string,resetPassword:a.string}),sent:a.bool,handleResetPassword:a.func};var xt=function(e){var t=U(),r=t.formState.errors,i=t.handleSubmit,a=t.control;return l(h,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&o(ut,{title:e.errorTitle,text:e.errorText,severity:"error"}),o($,xe(xe({},t),{},{children:l("form",{onSubmit:i(e.handleSignUp),children:[o(_,{control:a,name:"fullName",render:function(t){var n,i,a=t.field;return o(Ae,{fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(i=r.fullName)||void 0===i?void 0:i.message,startAdornment:o(V,{position:"start",children:o(H,{})})})},rules:{required:e.texts.fullNameRequiredText}}),o(_,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(Ae,{fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:o(V,{position:"start",children:o(Z,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(_,{control:a,name:"password",render:function(t){var n,i,a,l=t.field;return o(Ae,xe({fullWidth:!0,type:"password",defaultValue:null!==(n=l.value)&&void 0!==n?n:"",value:null!==(i=l.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(a=r.password)||void 0===a?void 0:a.message,startAdornment:o(V,{position:"start",children:o(F,{})})},l))},rules:{required:e.texts.passwordRequiredText}}),o(n,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),l(g,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",o("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),o(X,{}),l("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&o(at,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&o(at,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&o(at,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};xt.propTypes={texts:a.shape({fullNameLabel:a.string,fullNamePlaceholder:a.string,fullNameRequiredText:a.string,emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,emailInvalidText:a.string,passwordLabel:a.string,passwordPlaceholder:a.string,passwordRequiredText:a.string,passwordTooShortText:a.string,forgotPasswordText:a.string,newUserText:a.string,signUpText:a.string,signInText:a.string,existingUserText:a.string,googleButtonLabel:a.string,githubButtonLabel:a.string,twitterButtonLabel:a.string}),viaGoogle:a.bool,viaGithub:a.bool,viaTwitter:a.bool,handleSignUp:a.func,handleRouteToSignIn:a.func,handleGoogleSignUp:a.func,handleGithubSignUp:a.func,handleTwitterSignUp:a.func};var bt=function(e){var t=U(),r=t.formState.errors,i=t.handleSubmit,a=t.control;return l(h,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&o(ut,{title:e.errorTitle,text:e.errorText,severity:"error"}),l("form",{onSubmit:i(e.handleSignIn),children:[o(_,{control:a,name:"email",render:function(t){var n,i,a=t.field;return o(Ae,xe({fullWidth:!0,type:"text",value:null!==(n=a.value)&&void 0!==n?n:"",label:e.texts.emailLabel,helperText:null===(i=r.email)||void 0===i?void 0:i.message,placeholder:e.texts.emailPlaceholder,startAdornment:o(V,{position:"start",children:o(Z,{})})},a))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),o(_,{control:a,name:"password",render:function(t){var n,i,a,l=t.field;return o(Ae,xe({fullWidth:!0,type:"password",defaultValue:null!==(n=l.value)&&void 0!==n?n:"",value:null!==(i=l.value)&&void 0!==i?i:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(a=r.password)||void 0===a?void 0:a.message,startAdornment:o(V,{position:"start",children:o(F,{})})},l))},rules:{required:e.texts.passwordRequiredText}}),o(g,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),l(g,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",o("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),o(X,{}),l("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&o(at,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&o(at,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&o(at,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})};bt.propTypes={texts:a.shape({emailLabel:a.string,emailPlaceholder:a.string,emailRequiredText:a.string,emailInvalidText:a.string,passwordLabel:a.string,passwordPlaceholder:a.string,passwordRequiredText:a.string,forgotPasswordText:a.string,newUserText:a.string,signUpText:a.string,signInText:a.string,googleButtonLabel:a.string,githubButtonLabel:a.string,twitterButtonLabel:a.string}),viaGoogle:a.bool,viaGithub:a.bool,viaTwitter:a.bool,handleSignIn:a.func,handleRouteToSignUp:a.func,handleGoogleSignIn:a.func,handleGithubSignIn:a.func,handleTwitterSignIn:a.func};var yt=function(e){return l(h,{maxWidth:"xs",children:[o(Ie,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&o(at,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&o(at,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&o(at,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&o(at,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&o(at,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&o(at,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&o(at,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})};yt.propTypes={viaMada:a.bool,viaWallet:a.bool,viaSTCPay:a.bool,viaPayPal:a.bool,viaApplePay:a.bool,viaCreditCard:a.bool,madaLabel:a.string,stcPayLabel:a.string,paypalLabel:a.string,walletLabel:a.string,applePayLabel:a.string,visaMasterLabel:a.string,handleMada:a.func,handleWallet:a.func,handleSTCPay:a.func,handlePayPal:a.func,handleApplePay:a.func,handleCreditCard:a.func};var wt=function(e){var t,r=U(),i=r.formState.errors,a=r.handleSubmit,s=r.control;return o(h,{maxWidth:"xs",children:l("form",{onSubmit:a(e.handle),children:[o(Ae,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message}),o(_,{control:s,name:"cardName",render:function(e){var t;return e.field,o(Ae,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),o(_,{control:s,name:"cardName",render:function(e){var t;return e.field,o(Ae,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Expiry Date",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),o(_,{control:s,name:"cardName",render:function(e){var t;return e.field,o(Ae,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"CCV",rules:{required:"Password is rquired"},helperText:null===(t=i.password)||void 0===t?void 0:t.message})}}),o(n,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})})},Tt=function(e){var t=Te(r(0),2),i=t[0],a=t[1],s=U(),d=s.formState.errors,u=s.handleSubmit,c=s.control;return l(h,{maxWidth:"xs",children:[l(g,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(i).toLocaleString("en")||"0",o(g,{children:e.currency||"SAR"})]}),o($,xe(xe({},s),{},{children:l("form",{onSubmit:u(e.handleChargeWallet),children:[o(_,{control:c,name:"amount",render:function(t){var r,n,i=t.field;return o(Ae,xe(xe({fullWidth:!0,placeholder:e.texts.amountLabel,type:"number",value:null!==(r=i.value)&&void 0!==r?r:""},i),{},{inputProps:{inputMode:"numeric",min:"1",max:"9999999",step:"0.01"},onChange:function(e){i.onChange(parseFloat(e.target.value)),a(e.target.value)},helperText:null===(n=d.amount)||void 0===n?void 0:n.message}))},rules:{required:e.texts.amountRequired}}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.chargeWallet})]})}))]})};Tt.propTypes={texts:a.shape({amountLabel:a.string,chargeWallet:a.string,amountRequired:a.string}),handleChargeWallet:a.func,currency:a.string};var Ct=function(e){return l(h,{maxWidth:"xs",children:[o(g,{align:"center",children:"Wallet Balance"}),l(g,{align:"center",variant:"h1",children:[e.walletBalance||"0",o(g,{children:e.currency||"SAR"})]}),o(n,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},Pt=function(e){var t,r,i,a,s,d,u,c,m,p,f="ar"===e.lang,v=U(),x=v.formState.errors,b=v.handleSubmit;v.register;var y=v.control,w={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return l(h,{maxWidth:"sm",style:{direction:f?"rtl":"ltr"},children:[o(g,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),o(ct,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),o(X,{variant:"middle"}),o(g,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),o($,xe(xe({},v),{},{children:l("form",{onSubmit:b(e.handlePayNow),children:[l(h,{sx:w,children:[o(_,{control:y,name:"firstName",rules:{required:null===(t=e.texts)||void 0===t?void 0:t.required},render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.firstNameLabel)+" *",helperText:null===(i=x.firstName)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(_,{control:y,name:"lastName",rules:{required:null===(r=e.texts)||void 0===r?void 0:r.required},render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.lastNameLabel)+" *",helperText:null===(i=x.lastName)||void 0===i?void 0:i.message},a))}})]}),o(_,{control:y,name:"email",render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.emailLabel)+" *",helperText:null===(i=x.email)||void 0===i?void 0:i.message},a))},rules:{required:null===(i=e.texts)||void 0===i?void 0:i.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(a=e.texts)||void 0===a?void 0:a.emailInvalidText}}}),l(h,{sx:w,children:[o(_,{control:y,name:"streetAddress",rules:{required:null===(s=e.texts)||void 0===s?void 0:s.required},render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.streetAddressLabel)+" *",helperText:null===(i=x.streetAddress)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(_,{control:y,name:"buildingNumber",rules:{required:null===(d=e.texts)||void 0===d?void 0:d.required},render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.buildingNumberLabel)+" *",helperText:null===(i=x.buildingNumber)||void 0===i?void 0:i.message},a))}})]}),l(h,{sx:w,children:[o(_,{control:y,name:"province",rules:{required:null===(u=e.texts)||void 0===u?void 0:u.required},render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.stateLabel)+" *",helperText:null===(i=x.province)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(_,{control:y,name:"city",rules:{required:null===(c=e.texts)||void 0===c?void 0:c.required},render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.cityLabel)+" *",helperText:null===(i=x.city)||void 0===i?void 0:i.message},a))}})]}),l(h,{sx:w,children:[o(_,{control:y,name:"zipCode",rules:{required:null===(m=e.texts)||void 0===m?void 0:m.required},render:function(t){var r,n,i,a=t.field;return o(Ae,xe({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=a.value)&&void 0!==r?r:"",label:(null===(n=e.texts)||void 0===n?void 0:n.zipCodeLabel)+" *",helperText:null===(i=x.zipCode)||void 0===i?void 0:i.message},a))}}),o("div",{style:{width:20}}),o(_,{control:y,name:"country",rules:{required:null===(p=e.texts)||void 0===p?void 0:p.required},render:function(t){var r,n,i,a=t.field;return l(ot,xe(xe({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(n=a.value)&&void 0!==n?n:"",helperText:null===(i=x.country)||void 0===i?void 0:i.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},a),{},{children:[o("option",{}),e.countriesList.map((function(e,t){return o("option",{children:e},t)}))]}))}})]}),o(n,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})};Pt.propTypes={texts:a.shape({orderDetails:a.string,billingAddress:a.string,payNow:a.string,emailLabel:a.string,emailRequiredText:a.string,emailInvalidText:a.string,firstNameLabel:a.string,required:a.string,lastNameLabel:a.string,streetAddressLabel:a.string,buildingNumberLabel:a.string,cityLabel:a.string,stateLabel:a.string,countryLabel:a.string,zipCodeLabel:a.string}),lang:a.string,countriesList:a.array,products:a.array,total:a.string,handlePayNow:a.func};var kt=function(e){var t="ar"===e.lang;return l("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[l(h,{maxWidth:"sm",style:{direction:t?"rtl":"ltr"},children:[o(g,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),o(X,{variant:"middle"}),l(g,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",o("strong",{children:e.userEmail})]}),o(g,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),o(g,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),o(X,{variant:"middle"}),e.products&&l(s,{children:[o(g,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),o(ct,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),o(X,{variant:"middle"})]}),o(n,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),o(n,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),o(n,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),o(g,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),o("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:o(g,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})};kt.propTypes={texts:a.shape({print:a.string,history:a.string,homePage:a.string,successMessage:a.string,orderDetails:a.string,fasterPaymentNote:a.string,billingAddress:a.string,payNow:a.string,yourOrderNumber:a.string,emailLabel:a.string,emailRequiredText:a.string,emailInvalidText:a.string,firstNameLabel:a.string,required:a.string,lastNameLabel:a.string,streetAddressLabel:a.string,buildingNumberLabel:a.string,cityLabel:a.string,stateLabel:a.string,countryLabel:a.string,zipCodeLabel:a.string,refundPolicy:a.string}),products:a.array,countriesList:a.array,lang:a.string,total:a.string,userEmail:a.string,orderNumber:a.string,confirmationTitle:a.string,handleHome:a.func,handlePrint:a.func,handleHistory:a.func,handleRefundPolicyLink:a.func};var Lt=function(e){return o("div",{children:e.children})},St=function(e){var t=E();return o(ue,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:e.anchor,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(e.anchor),onClose:e.handleClose,variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:t.allBorderRadius,border:"1px solid ".concat(t.primaryActionColor)}},children:e.menuItems.map((function(e){return l(ce,{onClick:e.action,children:[e.icon&&o(e.icon,{}),o("div",{style:{width:10}}),o(g,{textAlign:"center",children:e.label})]},e.label)}))})};St.propTypes={anchor:a.any,handleClose:a.func,menuItems:a.arrayOf(a.shape({icon:a.element,label:a.string,action:a.func}))};var Wt=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},Ot=function(e){return be({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(8)," + 1px)")},e.breakpoints.up("sm"),{width:"calc(".concat(e.spacing(8)," + 1px)")})},Nt=Y("div")((function(e){var t=e.theme;return xe({display:"flex",alignItems:"center",justifyContent:"rtl"===e.direction?"flex-start":"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),It=Y(ee,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open,n=e.direction;return xe({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},r&&{marginLeft:"rtl"===n?0:240,marginRight:"rtl"===n?240:0,width:"calc(100% - ".concat(240,"px)"),transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})})})),At=Y(Q,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return xe(xe({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box"},r&&xe(xe({},Wt(t)),{},{"& .MuiDrawer-paper":Wt(t)})),!r&&xe(xe({},Ot(t)),{},{"& .MuiDrawer-paper":Ot(t)}))}));function qt(e){var r=J(),n=Te(t.useState(!0),2),a=n[0],s=n[1],d="ar"===e.lang,u=Te(t.useState(null),2);u[0],u[1];var c=Te(t.useState(null),2),m=c[0],p=c[1];return l(K,{sx:{display:"flex",direction:d?"rtl":"ltr"},children:[o(It,{variant:"appbar",position:"fixed",open:a,direction:d?"rtl":"ltr",children:l(te,{variant:"appbar",sx:{paddingLeft:{xs:3},paddingRight:{xs:3}},children:[o(ne,{color:"inherit","aria-label":"open drawer",onClick:function(){return s(!0)},edge:"start",s:!0,sx:xe({marginRight:5},a&&{display:"none"}),children:o(ie,{})}),l("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:0},children:[o(g,{variant:"h6",noWrap:!0,component:"div",children:e.pageTitle}),l(K,{children:[o(i,{title:"Open settings",children:o(ne,{onClick:function(e){return p(e.currentTarget)},sx:{p:0},size:"small",children:o(de,{})})}),o(St,{menuItems:e.accountMenu,anchor:m,handleClose:function(){return p(null)}})]})]})]})}),l(At,{variant:"permanent",open:a,children:[l(Nt,{direction:d?"rtl":"ltr",children:[e.logo,o(ne,{onClick:function(){return s(!1)},children:"rtl"===r.direction?o(le,{}):o(ae,{})})]}),o(X,{}),o(re,{children:e.pages.map((function(t,r){var n,s;return o(i,{title:t.text,placement:"right",arrow:!0,PopperProps:{style:{opacity:a?0:1}},children:l(oe,{variant:(null===(n=e.pageName)||void 0===n?void 0:n.toLowerCase())===(null===(s=t.slug)||void 0===s?void 0:s.toLowerCase())&&"clicked",onClick:t.action,sx:{minHeight:48,justifyContent:a?"initial":"center",px:2.5},children:[o(t.icon,{}),o("div",{style:{width:20}}),o(se,{primary:t.text,sx:{opacity:a?1:0}})]},t.text)},r)}))})]}),l(K,{sx:{flexGrow:1,p:3},children:[o(Nt,{}),e.children]})]})}var Rt=["children","onClose","hideClose"],jt=function(e){var t=e.children,r=e.onClose,n=e.hideClose,i=ye(e,Rt);return l(fe,xe(xe({sx:{m:0,p:2}},i),{},{children:[t,n?null:o(ne,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}},children:o(me,{})})]}))};function Et(e){var t=Te(r(!1),2);return t[0],t[1],l(pe,xe(xe({},e),{},{variant:"main",children:[o(jt,{onClose:e.onClose,hideClose:e.hideClose,children:e.title}),o(ge,{children:e.children}),o(he,{children:e.actions})]}))}var zt=function(e){var r=E(),a=Te(t.useState(null),2),s=a[0],d=a[1],u=Te(t.useState(null),2),c=u[0],m=u[1],p=function(){return d(null)};return console.log("theme is ",r),o(ee,{position:"static",variant:"appbar",children:o(h,{variant:"appbar",children:l(te,{disableGutters:!0,children:[o(K,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:e.logo}),l(K,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:[o(ne,{size:"large","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:function(e){return d(e.currentTarget)},color:"inherit",children:o(ie,{})}),o(St,{anchor:s,handleClose:p,menuItems:e.pages})]}),o(K,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:e.logo}),o(K,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:e.pages.map((function(e){return o(n,{onClick:p,sx:{my:2,display:"block"},children:e.label},e)}))}),l(K,{sx:{flexGrow:0},children:[o(i,{title:"Open settings",children:o(ne,{onClick:function(e){return m(e.currentTarget)},sx:{p:0},children:o(de,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),o(St,{anchor:c,handleClose:function(e){return m(null)},menuItems:e.accountMenu})]})]})})})};zt.propTypes={pages:a.arrayOf(a.shape({icon:a.element,label:a.string,action:a.func})),accountMenu:a.arrayOf(a.shape({icon:a.element,label:a.string,action:a.func}))};export{ke as ActionButton,Pe as AdaptiveButton,Lt as Box,Tt as ChargeWalletForm,Pt as CheckoutForm,kt as ConfirmationPage,wt as CreditCardForm,pt as HawaAccordian,ut as HawaAlert,zt as HawaAppBar,qt as HawaAppLayout,lt as HawaButton,Se as HawaCheckbox,rt as HawaColorPicker,Et as HawaDialog,dt as HawaInputLabel,Oe as HawaItemCard,at as HawaLogoButton,Ne as HawaPricingCard,We as HawaRadio,nt as HawaRange,mt as HawaSearchBar,ot as HawaSelect,it as HawaSettingsRow,Le as HawaSnackbar,ct as HawaTable,st as HawaTextArea,Ae as HawaTextField,Ie as HawaTypography,ft as NewPasswordForm,Ct as PayWithWallet,vt as ResetPasswordForm,yt as SelectPayment,bt as SignInForm,xt as SignUpForm,ht as UserProfileForm,gt as UserSettingsForm};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Button"),r=require("@mui/material/Tooltip"),a=require("prop-types"),l=require("react/jsx-runtime"),n=require("@mui/material/Snackbar"),i=require("@mui/material/AlertTitle"),o=require("@mui/material/Alert"),s=require("@mui/material/FormControlLabel"),d=require("@mui/material/Checkbox"),u=require("@mui/material/Container"),c=require("@mui/material/Typography"),f=require("@mui/icons-material/CheckCircleOutlined"),x=require("@mui/material/Chip"),p=require("@mui/material/Input"),h=require("@mui/material/InputLabel"),m=require("@mui/material/Switch"),g=require("@emotion/styled"),v=require("@mui/material/Slider"),b=require("@mui/material/Stack"),y=require("@mui/icons-material/GitHub"),j=require("@mui/icons-material/Twitter"),w=require("@mui/icons-material/AccountBalanceWallet"),T=require("@mui/material/Select"),C=require("@mui/material/Table"),P=require("@mui/material/TableBody"),q=require("@mui/material/TableCell"),k=require("@mui/material/TableContainer"),L=require("@mui/material/TableHead"),S=require("@mui/material/TableRow"),O=require("@mui/material"),W=require("@mui/icons-material"),A=require("@mui/icons-material/ExpandMore"),N=require("@mui/material/Accordion"),I=require("@mui/material/AccordionSummary"),R=require("@mui/material/AccordionDetails"),B=require("react-hook-form"),E=require("@mui/material/InputAdornment"),z=require("@mui/icons-material/HttpsOutlined"),D=require("@mui/icons-material/MailOutline"),F=require("@mui/icons-material/PermIdentityOutlined"),M=require("@mui/material/Divider"),U=require("@mui/material/styles"),H=require("@mui/material/Box"),G=require("@mui/material/Drawer"),$=require("@mui/material/AppBar"),_=require("@mui/material/Toolbar"),V=require("@mui/material/List"),Z=require("@mui/material/IconButton"),X=require("@mui/icons-material/Menu"),Y=require("@mui/icons-material/ChevronLeft"),J=require("@mui/icons-material/ChevronRight"),Q=require("@mui/material/ListItemButton"),K=require("@mui/material/ListItemText"),ee=require("@mui/material/Avatar"),te=require("@mui/material/useMediaQuery"),re=require("@mui/icons-material/Close"),ae=require("@mui/material/Dialog"),le=require("@mui/material/DialogActions"),ne=require("@mui/material/DialogContent"),ie=require("@mui/material/DialogTitle"),oe=require("@mui/material/Menu"),se=require("@mui/material/MenuItem");function de(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function ue(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var ce=de(e),fe=ue(e),xe=de(t),pe=de(r),he=de(a),me=de(n),ge=de(i),ve=de(o),be=de(s),ye=de(d),je=de(u),we=de(c),Te=de(f),Ce=de(x),Pe=de(p),qe=de(h),ke=de(m),Le=de(g),Se=de(v),Oe=de(b),We=de(y),Ae=de(j),Ne=de(w),Ie=de(T),Re=de(C),Be=de(P),Ee=de(q),ze=de(k),De=de(L),Fe=de(S),Me=de(A),Ue=de(N),He=de(I),Ge=de(R),$e=de(E),_e=de(z),Ve=de(D),Ze=de(F),Xe=de(M),Ye=de(H),Je=de(G),Qe=de($),Ke=de(_),et=de(V),tt=de(Z),rt=de(X),at=de(Y),lt=de(J),nt=de(Q),it=de(K),ot=de(ee),st=de(te),dt=de(re),ut=de(ae),ct=de(le),ft=de(ne),xt=de(ie),pt=de(oe),ht=de(se);function mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function gt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(r),!0).forEach((function(t){vt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bt(e,t){if(null==e)return{};var r,a,l=function(e,t){if(null==e)return{};var r,a,l={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}function yt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function jt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var a,l,n=[],i=!0,o=!1;try{for(r=r.call(e);!(i=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){o=!0,l=e}finally{try{i||null==r.return||r.return()}finally{if(o)throw l}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var Tt=function(e){return e.showText?l.jsxs(xe.default,{variant:"adaptive-dark",onClick:e.onClick,children:[e.icon,l.jsx("div",{style:{width:10}}),e.buttonText]}):l.jsx(pe.default,{title:e.buttonText,placement:"top",children:l.jsx(xe.default,{variant:"adaptive-dark",onClick:e.onClick,children:e.icon})})};Tt.propTypes={buttonText:he.default.string,onClick:he.default.func,showText:he.default.bool};var Ct=function(t){var r=jt(e.useState(t.defaultValue),2),a=r[0],n=r[1];return l.jsx(je.default,{variant:t.location||"panelTabs",children:t.options.map((function(e,r){var i;return l.jsx(xe.default,{onClick:function(){t.handleChange(e.value),n(e.value)},fullWidth:!0,variant:(null==a?void 0:a.toLowerCase())===(null===(i=e.value)||void 0===i?void 0:i.toLowerCase())?"selected":"unselected",children:e.label},r)}))})};Ct.propTypes={lang:he.default.string,options:he.default.arrayOf(he.default.shape({label:he.default.string,value:he.default.string})),defaultValue:he.default.string,handleChange:he.default.func,location:he.default.string};var Pt=function(e){var t="ar"===e.lang;return l.jsxs(je.default,{onClick:function(t){t.stopPropagation(),e.onCardClick()},maxWidth:"xs",variant:"card-container",dataValue:"parent",style:{direction:t?"rtl":"ltr"},children:[e.header&&l.jsxs(je.default,{style:{zIndex:20},variant:"card-header",children:[e.headerActions&&l.jsx("div",{style:{margin:0,marginRight:-20,marginLeft:-20,marginBottom:-20,display:"flex",paddingTop:5,paddingLeft:5,paddingRight:5,justifyContent:"flex-end"},children:e.headerActions}),e.header]}),e.content&&l.jsx(je.default,{style:{zIndex:20},variant:"card-content",children:e.content}),e.actions&&l.jsx(je.default,{style:{zIndex:20},variant:"card-actions",children:e.actions})]})};Pt.propTypes={lang:he.default.string,onCardClick:he.default.func};var qt=function(e){var t,r,a="ar"===e.lang,n={monthly:"شهرياً","3-months":"كل 3 أشهر","6-months":"كل 6 أشهر",annually:"سنوياً"},i={monthly:"Monthly","3-months":"3 Months","6-months":"6 Months",annually:"Annually"},o={usd:a?"دولار":"$",sar:a?"ريال":"SAR"},s=a?e.features_ar:e.features,d=a?{left:10}:{right:10};return l.jsxs(je.default,{maxWidth:"xs",variant:e.selectedPlan?"selected-plan-card":"plan-card",style:{direction:a?"rtl":"ltr"},children:[l.jsxs(je.default,{variant:"plan-header",children:[e.discount&&l.jsx(Ce.default,{label:e.discount,variant:"standard",style:gt({maxWidth:"fit-content",position:"absolute",bottom:10},d),color:"success"}),l.jsx(we.default,{variant:"h3",fontWeight:500,children:a?e.title_ar:e.title}),l.jsx(we.default,{variant:"caption",children:a?e.subtitle_ar:e.subtitle}),l.jsx("br",{}),l.jsx(we.default,{variant:"h4",fontWeight:500,style:{display:"flex",alignItems:"center"},children:"ar"===e.lang?l.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.price,l.jsx("div",{style:{width:5}}),l.jsx(we.default,{children:o[null===(t=e.currency)||void 0===t?void 0:t.toLowerCase()]})]}),l.jsx(we.default,{style:{fontSize:14,margin:5},children:a?n[e.cycleText]:i[e.cycleText]})]}):l.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[l.jsx(we.default,{children:o[null===(r=e.currency)||void 0===r?void 0:r.toLowerCase()]}),l.jsx("div",{style:{width:5}}),e.price]}),l.jsx(we.default,{style:{fontSize:14,margin:5},children:"ar"===e.lang?n[e.cycleText]:i[e.cycleText]})]})})]}),l.jsx("div",{style:{padding:20,color:e.selectedPlan?"white":"black"},children:null==s?void 0:s.map((function(e){return l.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",marginTop:10,width:"100%"},children:[l.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",width:"10%"},children:l.jsx(Te.default,{fontSize:"small"})}),l.jsx("div",{style:{width:10}}),l.jsx(we.default,{variant:"subtitle2",children:e})]})}))}),l.jsx(xe.default,{onClick:e.selectPlan,variant:e.selectedPlan?"outlined":"contained",style:{margin:20},children:e.buttonText})]})};qt.propTypes={lang:he.default.string,buttonText:he.default.string,selectedPlan:he.default.string,title:he.default.string,title_ar:he.default.string,subtitle:he.default.string,subtitle_ar:he.default.string,features:he.default.array,features_ar:he.default.array,currency:he.default.oneOf(["sar","usd"]),cycleText:he.default.oneOf(["monthly","3-months","6-months","annually"])};var kt=function(e){return l.jsx(we.default,gt(gt({},e),{},{children:e.children}))},Lt=function(e){return l.jsx("div",{style:e.inForm&&{width:"100%"},children:l.jsxs("div",{style:{width:e.fullWidth?"100%":"fit-content"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&l.jsx(qe.default,{children:e.label}),e.helperText&&l.jsx(we.default,{style:{marginBottom:!e.label&&10},variant:"validation",children:e.helperText})]}),l.jsx(Pe.default,gt({disableUnderline:!0},e))]})})},St=function(e){return l.jsx(ke.default,gt({},e))};var Ot="production"!==process.env.NODE_ENV?he.default.oneOfType([he.default.number,he.default.string,he.default.object,he.default.array]):{};function Wt(){return Wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Wt.apply(this,arguments)}function At(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Nt(e,t,r={clone:!0}){const a=r.clone?Wt({},e):e;return At(e)&&At(t)&&Object.keys(t).forEach((l=>{"__proto__"!==l&&(At(t[l])&&l in e&&At(e[l])?a[l]=Nt(e[l],t[l],r):a[l]=t[l])})),a}const It=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Rt=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Bt=[...It,...Rt];function Et(e){return function(e,t,r,a){const l=(n=e,((i=t)&&"string"==typeof i?i.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),n):null)||r);var n,i;return"number"==typeof l?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${a} argument to be a number or a string, got ${e}.`),l*e):Array.isArray(l)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>l.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(l)}.`,`${e} > ${l.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join("\n"))),l[e]):"function"==typeof l?l:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${l}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}(e,"spacing",8,"spacing")}function zt(e,t){if(null==e)return{};var r,a,l={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(l[r]=e[r]);return l}"production"===process.env.NODE_ENV||It.reduce(((e,t)=>(e[t]=Ot,e)),{}),"production"===process.env.NODE_ENV||Rt.reduce(((e,t)=>(e[t]=Ot,e)),{}),"production"===process.env.NODE_ENV||Bt.reduce(((e,t)=>(e[t]=Ot,e)),{});const Dt=["values","unit","step"];function Ft(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:a=5}=e,l=zt(e,Dt),n=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>Wt({},e,{[t.key]:t.val})),{})})(t),i=Object.keys(n);function o(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-a/100}${r})`}function d(e,l){const n=i.indexOf(l);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==n&&"number"==typeof t[i[n]]?t[i[n]]:l)-a/100}${r})`}return Wt({keys:i,values:n,up:o,down:s,between:d,only:function(e){return i.indexOf(e)+1<i.length?d(e,i[i.indexOf(e)+1]):o(e)},not:function(e){const t=i.indexOf(e);return 0===t?o(i[1]):t===i.length-1?s(i[t]):d(e,i[i.indexOf(e)+1]).replace("@media","@media not all and")},unit:r},l)}var Mt={borderRadius:4};const Ut=["breakpoints","palette","spacing","shape"];const Ht=fe.createContext(null);"production"!==process.env.NODE_ENV&&(Ht.displayName="ThemeContext");var Gt=Ht;function $t(e=null){const t=function(){const e=fe.useContext(Gt);return"production"!==process.env.NODE_ENV&&fe.useDebugValue(e),e}();return t&&(r=t,0!==Object.keys(r).length)?t:e;var r}const _t=function(e={},...t){const{breakpoints:r={},palette:a={},spacing:l,shape:n={}}=e,i=zt(e,Ut),o=Ft(r),s=function(e=8){if(e.mui)return e;const t=Et({spacing:e}),r=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map((e=>{const r=t(e);return"number"==typeof r?`${r}px`:r})).join(" "));return r.mui=!0,r}(l);let d=Nt({breakpoints:o,direction:"ltr",components:{},palette:Wt({mode:"light"},a),spacing:s,shape:Wt({},Mt,n)},i);return d=t.reduce(((e,t)=>Nt(e,t)),d),d}();function Vt(e=_t){return $t(e)}var Zt,Xt,Yt=Le.default.input(Zt||(Zt=yt(["\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n cursor: pointer;\n height: 35px;\n border-radius: ","px;\n background-color: ",";\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius}),(function(e){return e.value})),Jt=Le.default.input(Xt||(Xt=yt(["\n max-width: 70px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n // height: 30px;\n padding: 10px;\n border-radius: ","px;\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius})),Qt=function(e){var t=Vt();return l.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[l.jsx(Jt,{type:"text",value:e.color,borderRadius:t.allBorderRadius,onChange:e.handleChange}),l.jsx("div",{style:{width:10}}),l.jsx(Yt,{type:"color",value:e.color,onChange:e.handleChange,borderRadius:t.allBorderRadius})]})};Qt.propTypes={color:he.default.string,handleChange:he.default.func};var Kt=function(e){return l.jsxs(Oe.default,{spacing:2,direction:"row",alignItems:"center",style:e.style,children:[e.startElement,l.jsx(Se.default,{size:"small","aria-label":"Volume",value:e.value,onChange:e.handleChange}),e.endElement]})};Kt.propTypes={startElement:he.default.element,endElement:he.default.element,handleChange:he.default.func};var er=function(e){return l.jsxs(je.default,{variant:"settingsRow",children:[l.jsx(kt,{children:e.settingsLabel}),"checkbox"===e.settingsType&&l.jsx(ye.default,gt({},e)),"text"===e.settingsType&&l.jsx(Lt,gt({},e)),"boolean"===e.settingsType&&l.jsx(St,gt({},e)),"range"===e.settingsType&&l.jsx(Kt,gt({},e)),"color"===e.settingsType&&l.jsx(Qt,gt({},e)),"radio"===e.settingsType&&l.jsx(Ct,gt({location:"inSettings"},e))]})};er.propTypes={settingsLabel:he.default.string,settingsType:he.default.oneOf(["checkbox","text","radio","boolean","color"])};var tr=function(e){var t,r="ar"===e.lang,a="";switch(null===(t=e.logo)||void 0===t?void 0:t.toLowerCase()){case"google":a=l.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":a=l.jsx(We.default,{});break;case"twitter":a=l.jsx(Ae.default,{});break;case"mada":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":a=l.jsx(Ne.default,{})}return l.jsxs(xe.default,gt(gt({style:{direction:r?"rtl":"ltr"}},e),{},{variant:"withLogo",children:[a,l.jsx("div",{style:{width:10}}),l.jsx(we.default,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))};tr.propTypes={lang:he.default.string,logo:he.default.oneOf(["google","github","twitter","wallet","googlepay","applepay","stcpay","visa/master","paypal","mada"]),buttonText:he.default.string};var rr=function(e){return l.jsxs("div",{style:{width:"100%"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[l.jsx(qe.default,{children:e.label}),e.helperText&&l.jsx(we.default,{variant:"validation",children:e.helperText})]}),l.jsx(Ie.default,gt(gt({},e),{},{children:e.children}))]})},ar=function(e){return l.jsxs(ve.default,{severity:e.severity,icon:e.hideIcon,children:[e.title&&l.jsx(ge.default,{children:e.title}),e.text]})};ar.propTypes={severity:he.default.oneOf(["error","info","success","warning"]),title:he.default.string,text:he.default.string,hideIcon:he.default.bool};var lr=function(e){var t="ar"===e.lang;return l.jsx(ze.default,{style:{direction:t?"rtl":"ltr"},children:l.jsxs(Re.default,{"aria-label":"a dense table",children:[l.jsx(De.default,{children:l.jsxs(Fe.default,{children:[e.columns.map((function(e,r){return l.jsx(Ee.default,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&l.jsx(Ee.default,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:"Actions"})]})}),l.jsx(Be.default,{children:e.rows?e.rows.map((function(r,a){return l.jsxs(Fe.default,{children:[r.map((function(e,r){return l.jsx(Ee.default,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&l.jsx(Ee.default,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:e.actions.map((function(t){return l.jsx(O.Button,{style:{margin:2},variant:"outlined",size:"small",onClick:function(){return e.handleActionClick(r)},children:t})}))})]},a)})):l.jsx(Fe.default,{align:"center",children:l.jsx(Ee.default,{align:"center",component:"th",colSpan:6,children:e.noDataText})})}),e.end&&l.jsx(Fe.default,{children:e.end.map((function(e,r){return l.jsx(Ee.default,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})};lr.propTypes={handleActionClick:he.default.func,noDataText:he.default.string,lang:he.default.string,columns:he.default.array,rows:he.default.array,end:he.default.array};var nr=function(e){return l.jsxs(Ue.default,{elevation:0,children:[l.jsx(He.default,{expandIcon:l.jsx(Me.default,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:l.jsx(we.default,{children:e.title})}),l.jsx(Ge.default,{children:l.jsxs(we.default,{children:[e.content," "]})})]})};nr.propTypes={title:he.default.string,content:he.default.string};var ir=function(t){var r=jt(e.useState(!1),2),a=r[0],n=r[1],i=B.useForm(),o=i.formState.errors,s=i.handleSubmit,d=i.control;return l.jsxs(je.default,{maxWidth:"xs",variant:"auth",children:[a&&l.jsx(ar,{text:t.texts.passwordMatchError,severity:"error"}),t.passwordChanged?l.jsx(kt,{style:{textAlign:"center",margin:5},children:t.texts.passwordChanged}):l.jsx(B.FormProvider,gt(gt({},i),{},{children:l.jsxs("form",{onSubmit:s((function(e){console.log("handling subb",e),e.password===e.confirmPassword?t.handleNewPassword():n(!0)})),children:[l.jsx(B.Controller,{control:d,name:"password",render:function(e){var r,a,n=e.field;return l.jsx(Lt,gt({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:t.texts.passwordLabel,placeholder:t.texts.passwordPlaceholder,helperText:null===(a=o.password)||void 0===a?void 0:a.message,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(_e.default,{})})},n))},rules:{required:t.texts.passwordRequiredText}}),l.jsx(B.Controller,{control:d,name:"confirmPassword",render:function(e){var r,a,n=e.field;return l.jsx(Lt,gt({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:t.texts.confirmPasswordLabel,placeholder:t.texts.confirmPasswordPlaceholder,helperText:null===(a=o.confirmPassword)||void 0===a?void 0:a.message,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(_e.default,{})})},n))},rules:{required:t.texts.confirmPasswordRequiredText}}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",children:t.texts.updatePassword})]})}))]})};ir.propTypes={texts:he.default.shape({emailLabel:he.default.string,emailPlaceholder:he.default.string,emailRequiredText:he.default.string,passwordPlaceholder:he.default.string,updatePassword:he.default.string,passwordRequiredText:he.default.string,passwordLabel:he.default.string,confirmPasswordPlaceholder:he.default.string,confirmPasswordLabel:he.default.string,confirmPasswordRequiredText:he.default.string,passwordMatchError:he.default.string,forgotPasswordText:he.default.string,passwordChanged:he.default.string}),passwordChanged:he.default.bool,handleNewPassword:he.default.func};var or=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit;t.register;var n=t.control;return l.jsx(je.default,{maxWidth:"xs",variant:"auth",children:e.sent?l.jsx(kt,{style:{textAlign:"center",margin:5},children:e.texts.emailSentText}):l.jsxs("form",{onSubmit:a(e.handleResetPassword),children:[l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(Ve.default,{})})},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})})};or.propTypes={texts:he.default.shape({emailLabel:he.default.string,emailPlaceholder:he.default.string,emailRequiredText:he.default.string,emailInvalidText:he.default.string,emailSentText:he.default.string,resetPassword:he.default.string}),sent:he.default.bool,handleResetPassword:he.default.func};var sr=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit,n=t.control;return l.jsxs(je.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&l.jsx(ar,{title:e.errorTitle,text:e.errorText,severity:"error"}),l.jsx(B.FormProvider,gt(gt({},t),{},{children:l.jsxs("form",{onSubmit:a(e.handleSignUp),children:[l.jsx(B.Controller,{control:n,name:"fullName",render:function(t){var a,n,i=t.field;return l.jsx(Lt,{fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(n=r.fullName)||void 0===n?void 0:n.message,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(Ze.default,{})})})},rules:{required:e.texts.fullNameRequiredText}}),l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(Lt,{fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(Ve.default,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(B.Controller,{control:n,name:"password",render:function(t){var a,n,i,o=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"password",defaultValue:null!==(a=o.value)&&void 0!==a?a:"",value:null!==(n=o.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(_e.default,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(xe.default,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),l.jsxs(we.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",l.jsx("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),l.jsx(Xe.default,{}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l.jsx(tr,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&l.jsx(tr,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&l.jsx(tr,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};sr.propTypes={texts:he.default.shape({fullNameLabel:he.default.string,fullNamePlaceholder:he.default.string,fullNameRequiredText:he.default.string,emailLabel:he.default.string,emailPlaceholder:he.default.string,emailRequiredText:he.default.string,emailInvalidText:he.default.string,passwordLabel:he.default.string,passwordPlaceholder:he.default.string,passwordRequiredText:he.default.string,passwordTooShortText:he.default.string,forgotPasswordText:he.default.string,newUserText:he.default.string,signUpText:he.default.string,signInText:he.default.string,existingUserText:he.default.string,googleButtonLabel:he.default.string,githubButtonLabel:he.default.string,twitterButtonLabel:he.default.string}),viaGoogle:he.default.bool,viaGithub:he.default.bool,viaTwitter:he.default.bool,handleSignUp:he.default.func,handleRouteToSignIn:he.default.func,handleGoogleSignUp:he.default.func,handleGithubSignUp:he.default.func,handleTwitterSignUp:he.default.func};var dr=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit,n=t.control;return l.jsxs(je.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&l.jsx(ar,{title:e.errorTitle,text:e.errorText,severity:"error"}),l.jsxs("form",{onSubmit:a(e.handleSignIn),children:[l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(Ve.default,{})})},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(B.Controller,{control:n,name:"password",render:function(t){var a,n,i,o=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"password",defaultValue:null!==(a=o.value)&&void 0!==a?a:"",value:null!==(n=o.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message,startAdornment:l.jsx($e.default,{position:"start",children:l.jsx(_e.default,{})})},o))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(we.default,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),l.jsxs(we.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",l.jsx("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),l.jsx(Xe.default,{}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l.jsx(tr,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&l.jsx(tr,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&l.jsx(tr,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})};dr.propTypes={texts:he.default.shape({emailLabel:he.default.string,emailPlaceholder:he.default.string,emailRequiredText:he.default.string,emailInvalidText:he.default.string,passwordLabel:he.default.string,passwordPlaceholder:he.default.string,passwordRequiredText:he.default.string,forgotPasswordText:he.default.string,newUserText:he.default.string,signUpText:he.default.string,signInText:he.default.string,googleButtonLabel:he.default.string,githubButtonLabel:he.default.string,twitterButtonLabel:he.default.string}),viaGoogle:he.default.bool,viaGithub:he.default.bool,viaTwitter:he.default.bool,handleSignIn:he.default.func,handleRouteToSignUp:he.default.func,handleGoogleSignIn:he.default.func,handleGithubSignIn:he.default.func,handleTwitterSignIn:he.default.func};var ur=function(e){return l.jsxs(je.default,{maxWidth:"xs",children:[l.jsx(kt,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&l.jsx(tr,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&l.jsx(tr,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&l.jsx(tr,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&l.jsx(tr,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&l.jsx(tr,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&l.jsx(tr,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&l.jsx(tr,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})};ur.propTypes={viaMada:he.default.bool,viaWallet:he.default.bool,viaSTCPay:he.default.bool,viaPayPal:he.default.bool,viaApplePay:he.default.bool,viaCreditCard:he.default.bool,madaLabel:he.default.string,stcPayLabel:he.default.string,paypalLabel:he.default.string,walletLabel:he.default.string,applePayLabel:he.default.string,visaMasterLabel:he.default.string,handleMada:he.default.func,handleWallet:he.default.func,handleSTCPay:he.default.func,handlePayPal:he.default.func,handleApplePay:he.default.func,handleCreditCard:he.default.func};var cr=function(t){var r=jt(e.useState(0),2),a=r[0],n=r[1],i=B.useForm(),o=i.formState.errors,s=i.handleSubmit,d=i.control;return l.jsxs(je.default,{maxWidth:"xs",children:[l.jsxs(we.default,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(a).toLocaleString("en")||"0",l.jsx(we.default,{children:t.currency||"SAR"})]}),l.jsx(B.FormProvider,gt(gt({},i),{},{children:l.jsxs("form",{onSubmit:s(t.handleChargeWallet),children:[l.jsx(B.Controller,{control:d,name:"amount",render:function(e){var r,a,i=e.field;return l.jsx(Lt,gt(gt({fullWidth:!0,placeholder:t.texts.amountLabel,type:"number",value:null!==(r=i.value)&&void 0!==r?r:""},i),{},{inputProps:{inputMode:"numeric",min:"1",max:"9999999",step:"0.01"},onChange:function(e){i.onChange(parseFloat(e.target.value)),n(e.target.value)},helperText:null===(a=o.amount)||void 0===a?void 0:a.message}))},rules:{required:t.texts.amountRequired}}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",children:t.texts.chargeWallet})]})}))]})};cr.propTypes={texts:he.default.shape({amountLabel:he.default.string,chargeWallet:he.default.string,amountRequired:he.default.string}),handleChargeWallet:he.default.func,currency:he.default.string};var fr=function(e){var t,r,a,n,i,o,s,d,u,c,f="ar"===e.lang,x=B.useForm(),p=x.formState.errors,h=x.handleSubmit;x.register;var m=x.control,g={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return l.jsxs(je.default,{maxWidth:"sm",style:{direction:f?"rtl":"ltr"},children:[l.jsx(we.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l.jsx(lr,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l.jsx(Xe.default,{variant:"middle"}),l.jsx(we.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),l.jsx(B.FormProvider,gt(gt({},x),{},{children:l.jsxs("form",{onSubmit:h(e.handlePayNow),children:[l.jsxs(je.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"firstName",rules:{required:null===(t=e.texts)||void 0===t?void 0:t.required},render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.firstNameLabel)+" *",helperText:null===(n=p.firstName)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"lastName",rules:{required:null===(r=e.texts)||void 0===r?void 0:r.required},render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.lastNameLabel)+" *",helperText:null===(n=p.lastName)||void 0===n?void 0:n.message},i))}})]}),l.jsx(B.Controller,{control:m,name:"email",render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.emailLabel)+" *",helperText:null===(n=p.email)||void 0===n?void 0:n.message},i))},rules:{required:null===(a=e.texts)||void 0===a?void 0:a.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(n=e.texts)||void 0===n?void 0:n.emailInvalidText}}}),l.jsxs(je.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"streetAddress",rules:{required:null===(i=e.texts)||void 0===i?void 0:i.required},render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.streetAddressLabel)+" *",helperText:null===(n=p.streetAddress)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"buildingNumber",rules:{required:null===(o=e.texts)||void 0===o?void 0:o.required},render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.buildingNumberLabel)+" *",helperText:null===(n=p.buildingNumber)||void 0===n?void 0:n.message},i))}})]}),l.jsxs(je.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"province",rules:{required:null===(s=e.texts)||void 0===s?void 0:s.required},render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.stateLabel)+" *",helperText:null===(n=p.province)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"city",rules:{required:null===(d=e.texts)||void 0===d?void 0:d.required},render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.cityLabel)+" *",helperText:null===(n=p.city)||void 0===n?void 0:n.message},i))}})]}),l.jsxs(je.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"zipCode",rules:{required:null===(u=e.texts)||void 0===u?void 0:u.required},render:function(t){var r,a,n,i=t.field;return l.jsx(Lt,gt({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.zipCodeLabel)+" *",helperText:null===(n=p.zipCode)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"country",rules:{required:null===(c=e.texts)||void 0===c?void 0:c.required},render:function(t){var r,a,n,i=t.field;return l.jsxs(rr,gt(gt({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(a=i.value)&&void 0!==a?a:"",helperText:null===(n=p.country)||void 0===n?void 0:n.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},i),{},{children:[l.jsx("option",{}),e.countriesList.map((function(e,t){return l.jsx("option",{children:e},t)}))]}))}})]}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})};fr.propTypes={texts:he.default.shape({orderDetails:he.default.string,billingAddress:he.default.string,payNow:he.default.string,emailLabel:he.default.string,emailRequiredText:he.default.string,emailInvalidText:he.default.string,firstNameLabel:he.default.string,required:he.default.string,lastNameLabel:he.default.string,streetAddressLabel:he.default.string,buildingNumberLabel:he.default.string,cityLabel:he.default.string,stateLabel:he.default.string,countryLabel:he.default.string,zipCodeLabel:he.default.string}),lang:he.default.string,countriesList:he.default.array,products:he.default.array,total:he.default.string,handlePayNow:he.default.func};var xr=function(e){var t="ar"===e.lang;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[l.jsxs(je.default,{maxWidth:"sm",style:{direction:t?"rtl":"ltr"},children:[l.jsx(we.default,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),l.jsx(Xe.default,{variant:"middle"}),l.jsxs(we.default,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",l.jsx("strong",{children:e.userEmail})]}),l.jsx(we.default,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),l.jsx(we.default,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),l.jsx(Xe.default,{variant:"middle"}),e.products&&l.jsxs(l.Fragment,{children:[l.jsx(we.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l.jsx(lr,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l.jsx(Xe.default,{variant:"middle"})]}),l.jsx(xe.default,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),l.jsx(xe.default,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),l.jsx(xe.default,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),l.jsx(we.default,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),l.jsx("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:l.jsx(we.default,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})};xr.propTypes={texts:he.default.shape({print:he.default.string,history:he.default.string,homePage:he.default.string,successMessage:he.default.string,orderDetails:he.default.string,fasterPaymentNote:he.default.string,billingAddress:he.default.string,payNow:he.default.string,yourOrderNumber:he.default.string,emailLabel:he.default.string,emailRequiredText:he.default.string,emailInvalidText:he.default.string,firstNameLabel:he.default.string,required:he.default.string,lastNameLabel:he.default.string,streetAddressLabel:he.default.string,buildingNumberLabel:he.default.string,cityLabel:he.default.string,stateLabel:he.default.string,countryLabel:he.default.string,zipCodeLabel:he.default.string,refundPolicy:he.default.string}),products:he.default.array,countriesList:he.default.array,lang:he.default.string,total:he.default.string,userEmail:he.default.string,orderNumber:he.default.string,confirmationTitle:he.default.string,handleHome:he.default.func,handlePrint:he.default.func,handleHistory:he.default.func,handleRefundPolicyLink:he.default.func};var pr=function(e){var t=O.useTheme();return l.jsx(O.Menu,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:e.anchor,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(e.anchor),onClose:e.handleClose,variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:t.allBorderRadius,border:"1px solid ".concat(t.primaryActionColor)}},children:e.menuItems.map((function(e){return l.jsxs(O.MenuItem,{onClick:e.action,children:[e.icon&&l.jsx(e.icon,{}),l.jsx("div",{style:{width:10}}),l.jsx(O.Typography,{textAlign:"center",children:e.label})]},e.label)}))})};pr.propTypes={handleClose:he.default.func,menuItems:he.default.arrayOf(he.default.shape({icon:he.default.element,label:he.default.string,action:he.default.func}))};var hr=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},mr=function(e){return vt({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(8)," + 1px)")},e.breakpoints.up("sm"),{width:"calc(".concat(e.spacing(8)," + 1px)")})},gr=U.styled("div")((function(e){var t=e.theme;return gt({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),vr=U.styled(Qe.default,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return gt({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},r&&{marginLeft:240,width:"calc(100% - ".concat(240,"px)"),transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})})})),br=U.styled(Je.default,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return gt(gt({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box"},r&>(gt({},hr(t)),{},{"& .MuiDrawer-paper":hr(t)})),!r&>(gt({},mr(t)),{},{"& .MuiDrawer-paper":mr(t)}))}));var yr=["children","onClose","hideClose"],jr=function(e){var t=e.children,r=e.onClose,a=e.hideClose,n=bt(e,yr);return l.jsxs(xt.default,gt(gt({sx:{m:0,p:2}},n),{},{children:[t,a?null:l.jsx(tt.default,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}},children:l.jsx(dt.default,{})})]}))};var wr=["Products","Pricing","Blog"];exports.ActionButton=function(e){return l.jsx(xe.default,gt(gt({},e),{},{children:e.text}))},exports.AdaptiveButton=Tt,exports.Box=function(e){return l.jsx("div",{children:e.children})},exports.ChargeWalletForm=cr,exports.CheckoutForm=fr,exports.ConfirmationPage=xr,exports.CreditCardForm=function(e){var t,r=B.useForm(),a=r.formState.errors,n=r.handleSubmit,i=r.control;return l.jsx(je.default,{maxWidth:"xs",children:l.jsxs("form",{onSubmit:n(e.handle),children:[l.jsx(Lt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message}),l.jsx(B.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,l.jsx(Lt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message})}}),l.jsx(B.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,l.jsx(Lt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Expiry Date",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message})}}),l.jsx(B.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,l.jsx(Lt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"CCV",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message})}}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})})},exports.HawaAccordian=nr,exports.HawaAlert=ar,exports.HawaAppBar=function(e){var t=O.useTheme(),r=jt(ce.default.useState(null),2),a=r[0],n=r[1],i=jt(ce.default.useState(null),2),o=i[0],s=i[1],d=function(){n(null)};return console.log("theme is ",t),l.jsx(Qe.default,{position:"static",variant:"appbar",children:l.jsx(je.default,{maxWidth:"xl",variant:"appbar",children:l.jsxs(Ke.default,{disableGutters:!0,children:[l.jsx(we.default,{variant:"h6",noWrap:!0,component:"div",sx:{mr:2,display:{xs:"none",md:"flex"}},children:"LOGO"}),l.jsxs(Ye.default,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:[l.jsx(tt.default,{size:"large","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:e.handleOpenSideMenu,color:"inherit",children:l.jsx(rt.default,{})}),l.jsx(pt.default,{id:"menu-appbar",anchorEl:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"left"},open:Boolean(a),onClose:d,sx:{display:{xs:"block",md:"none"}},children:wr.map((function(e){return l.jsx(ht.default,{onClick:d,children:l.jsx(we.default,{textAlign:"center",children:e})},e)}))})]}),l.jsx(we.default,{variant:"h6",noWrap:!0,component:"div",sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:"LOGO"}),l.jsx(Ye.default,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:wr.map((function(e){return l.jsx(xe.default,{onClick:d,sx:{my:2,display:"block"},children:e},e)}))}),l.jsxs(Ye.default,{sx:{flexGrow:0},children:[l.jsx(pe.default,{title:"Open settings",children:l.jsx(tt.default,{onClick:function(e){s(e.currentTarget)},sx:{p:0},children:l.jsx(ot.default,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),l.jsx(pr,{anchor:o,handleClose:function(e){return s(null)},menuItems:e.accountMenu})]})]})})})},exports.HawaAppLayout=function(e){var t=U.useTheme(),r=jt(ce.default.useState(!0),2),a=r[0],n=r[1],i=st.default("(max-width:600px)"),o=jt(ce.default.useState(null),2);o[0],o[1];var s=jt(ce.default.useState(null),2),d=s[0],u=s[1];return console.log("match is ",i),l.jsxs(Ye.default,{sx:{display:"flex"},children:[i&&l.jsxs(O.BottomNavigation,{showLabels:!0,children:[l.jsx(O.BottomNavigationAction,{label:"Recents",icon:l.jsx(W.RestoreOutlined,{})}),l.jsx(O.BottomNavigationAction,{label:"Favorites",icon:l.jsx(W.RestoreOutlined,{})}),l.jsx(O.BottomNavigationAction,{label:"Nearby",icon:l.jsx(W.RestoreOutlined,{})})]})," ",l.jsx(vr,{variant:"appbar",position:"fixed",open:a,children:l.jsxs(Ke.default,{variant:"appbar",children:[l.jsx(tt.default,{color:"inherit","aria-label":"open drawer",onClick:function(){return n(!0)},edge:"start",sx:gt({marginRight:5},a&&{display:"none"}),children:l.jsx(rt.default,{})}),l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:0},children:[l.jsx(we.default,{variant:"h6",noWrap:!0,component:"div",children:e.pageTitle}),l.jsxs(Ye.default,{children:[l.jsx(pe.default,{title:"Open settings",children:l.jsx(tt.default,{onClick:function(e){return u(e.currentTarget)},sx:{p:0},children:l.jsx(ot.default,{})})}),l.jsx(pr,{menuItems:e.accountMenu,anchor:d,handleClose:function(){return u(null)}})]})]})]})}),l.jsxs(br,{variant:"permanent",open:a,children:[l.jsxs(gr,{children:[e.logo,l.jsx(tt.default,{onClick:function(){return n(!1)},children:"rtl"===t.direction?l.jsx(lt.default,{}):l.jsx(at.default,{})})]}),l.jsx(Xe.default,{}),l.jsx(et.default,{children:e.pages.map((function(t,r){var n,i;return l.jsx(pe.default,{title:t.text,placement:"right",arrow:!0,PopperProps:{style:{opacity:a?0:1}},children:l.jsxs(nt.default,{variant:(null===(n=e.pageName)||void 0===n?void 0:n.toLowerCase())===(null===(i=t.slug)||void 0===i?void 0:i.toLowerCase())&&"clicked",onClick:t.action,sx:{minHeight:48,justifyContent:a?"initial":"center",px:2.5},children:[l.jsx(t.icon,{}),l.jsx("div",{style:{width:20}}),l.jsx(it.default,{primary:t.text,sx:{opacity:a?1:0}})]},t.text)},r)}))})]}),l.jsxs(Ye.default,{sx:{flexGrow:1,p:3},children:[l.jsx(gr,{}),e.children]})]})},exports.HawaButton=function(e){return l.jsx(xe.default,gt(gt({},e),{},{children:e.children}))},exports.HawaCheckbox=function(e){return console.log("props : ",e),l.jsx(ce.default.Fragment,{children:l.jsx(be.default,{label:e.label,control:l.jsx(ye.default,{style:{color:e.color||null},defaultChecked:e.defaultValue})})})},exports.HawaColorPicker=Qt,exports.HawaDialog=function(t){var r=jt(e.useState(!1),2);return r[0],r[1],l.jsxs(ut.default,gt(gt({},t),{},{variant:"main",children:[l.jsx(jr,{onClose:t.onClose,hideClose:t.hideClose,children:t.title}),l.jsx(ft.default,{children:t.children}),l.jsx(ct.default,{children:t.actions})]}))},exports.HawaInputLabel=function(e){return l.jsx(qe.default,{children:l.jsx("div",{style:{fontSize:15},children:e.label})})},exports.HawaItemCard=Pt,exports.HawaLogoButton=tr,exports.HawaPricingCard=qt,exports.HawaRadio=Ct,exports.HawaRange=Kt,exports.HawaSearchBar=function(e){return l.jsx(Lt,gt({endAdornment:l.jsx(O.InputAdornment,{position:"start",children:l.jsx(W.Search,{})})},e))},exports.HawaSelect=rr,exports.HawaSettingsRow=er,exports.HawaSnackbar=function(e){return l.jsx(me.default,{open:e.open,onClose:e.handleClose,children:l.jsxs(ve.default,{icon:!1,severity:e.severity,children:[e.title&&l.jsx(ge.default,{children:e.title}),e.text]})})},exports.HawaTable=lr,exports.HawaTextArea=function(e){var t=Vt();return console.log("theme is ",t),l.jsx("label",{children:l.jsx("textarea",{style:{color:"black",backgroundColor:e.bgColor||"white",borderBottom:"none",border:"none",width:"100%",padding:0,margin:0,marginBottom:0,resize:e.resize||"vertical"}})})},exports.HawaTextField=Lt,exports.HawaTypography=kt,exports.NewPasswordForm=ir,exports.PayWithWallet=function(e){return l.jsxs(je.default,{maxWidth:"xs",children:[l.jsx(we.default,{align:"center",children:"Wallet Balance"}),l.jsxs(we.default,{align:"center",variant:"h1",children:[e.walletBalance||"0",l.jsx(we.default,{children:e.currency||"SAR"})]}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},exports.ResetPasswordForm=or,exports.SelectPayment=ur,exports.SignInForm=dr,exports.SignUpForm=sr,exports.UserProfileForm=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit,n=t.control;return l.jsx(je.default,{maxWidth:"sm",children:l.jsx(B.FormProvider,gt(gt({},t),{},{children:l.jsxs("form",{onSubmit:a(e.handleUpdateProfile),children:[l.jsx(B.Controller,{control:n,name:"fullName",render:function(t){var a,n,i=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(n=r.fullName)||void 0===n?void 0:n.message},i))}}),l.jsx(B.Controller,{control:n,name:"phoneNumber",render:function(e){var t=e.field;return l.jsx(Lt,gt({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(B.Controller,{control:n,name:"password",render:function(t){var a,n,i=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"password",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=r.password)||void 0===n?void 0:n.message},i))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(B.Controller,{control:n,name:"confirmPassword",render:function(t){var a,n,i=t.field;return l.jsx(Lt,gt({fullWidth:!0,type:"password",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(n=r.confirmPassword)||void 0===n?void 0:n.message},i))},rules:{required:e.texts.confirmPasswordRequiredText}}),l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.updateProfile})]})}))})},exports.UserSettingsForm=function(e){return l.jsxs(je.default,{maxWidth:"sm",children:[e.children,l.jsx(xe.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material/Button"),r=require("@mui/material/Tooltip"),a=require("prop-types"),l=require("react/jsx-runtime"),n=require("@mui/material/Snackbar"),i=require("@mui/material/AlertTitle"),s=require("@mui/material/Alert"),o=require("@mui/material/FormControlLabel"),d=require("@mui/material/Checkbox"),u=require("@mui/material/Container"),c=require("@mui/material/Typography"),f=require("@mui/icons-material/CheckCircleOutlined"),x=require("@mui/material/Chip"),p=require("@mui/material/Input"),h=require("@mui/material/InputLabel"),m=require("@mui/material/Switch"),g=require("@emotion/styled"),v=require("@mui/material/Slider"),b=require("@mui/material/Stack"),y=require("@mui/icons-material/GitHub"),j=require("@mui/icons-material/Twitter"),w=require("@mui/icons-material/AccountBalanceWallet"),T=require("@mui/material/Select"),C=require("@mui/material/Table"),P=require("@mui/material/TableBody"),q=require("@mui/material/TableCell"),k=require("@mui/material/TableContainer"),S=require("@mui/material/TableHead"),L=require("@mui/material/TableRow"),O=require("@mui/material"),W=require("@mui/icons-material"),A=require("@mui/icons-material/ExpandMore"),I=require("@mui/material/Accordion"),N=require("@mui/material/AccordionSummary"),R=require("@mui/material/AccordionDetails"),B=require("react-hook-form"),E=require("@mui/material/InputAdornment"),z=require("@mui/icons-material/HttpsOutlined"),D=require("@mui/icons-material/MailOutline"),F=require("@mui/icons-material/PermIdentityOutlined"),M=require("@mui/material/Divider"),U=require("@mui/material/styles"),H=require("@mui/material/Box"),G=require("@mui/material/Drawer"),$=require("@mui/material/AppBar"),_=require("@mui/material/Toolbar"),V=require("@mui/material/List"),Z=require("@mui/material/IconButton"),X=require("@mui/icons-material/Menu"),Y=require("@mui/icons-material/ChevronLeft"),J=require("@mui/icons-material/ChevronRight"),K=require("@mui/material/ListItemButton"),Q=require("@mui/material/ListItemText"),ee=require("@mui/material/Avatar"),te=require("@mui/material/Menu"),re=require("@mui/material/MenuItem"),ae=require("@mui/icons-material/Close"),le=require("@mui/material/Dialog"),ne=require("@mui/material/DialogActions"),ie=require("@mui/material/DialogContent"),se=require("@mui/material/DialogTitle");function oe(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function de(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var ue=oe(e),ce=de(e),fe=oe(t),xe=oe(r),pe=oe(a),he=oe(n),me=oe(i),ge=oe(s),ve=oe(o),be=oe(d),ye=oe(u),je=oe(c),we=oe(f),Te=oe(x),Ce=oe(p),Pe=oe(h),qe=oe(m),ke=oe(g),Se=oe(v),Le=oe(b),Oe=oe(y),We=oe(j),Ae=oe(w),Ie=oe(T),Ne=oe(C),Re=oe(P),Be=oe(q),Ee=oe(k),ze=oe(S),De=oe(L),Fe=oe(A),Me=oe(I),Ue=oe(N),He=oe(R),Ge=oe(E),$e=oe(z),_e=oe(D),Ve=oe(F),Ze=oe(M),Xe=oe(H),Ye=oe(G),Je=oe($),Ke=oe(_),Qe=oe(V),et=oe(Z),tt=oe(X),rt=oe(Y),at=oe(J),lt=oe(K),nt=oe(Q),it=oe(ee),st=oe(te),ot=oe(re),dt=oe(ae),ut=oe(le),ct=oe(ne),ft=oe(ie),xt=oe(se);function pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function ht(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(r),!0).forEach((function(t){mt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function mt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gt(e,t){if(null==e)return{};var r,a,l=function(e,t){if(null==e)return{};var r,a,l={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}function vt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function bt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var a,l,n=[],i=!0,s=!1;try{for(r=r.call(e);!(i=(a=r.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){s=!0,l=e}finally{try{i||null==r.return||r.return()}finally{if(s)throw l}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var jt=function(e){return e.showText?l.jsxs(fe.default,{variant:"adaptive-dark",onClick:e.onClick,children:[e.icon,l.jsx("div",{style:{width:10}}),e.buttonText]}):l.jsx(xe.default,{title:e.buttonText,placement:"top",children:l.jsx(fe.default,{variant:"adaptive-dark",onClick:e.onClick,children:e.icon})})};jt.propTypes={buttonText:pe.default.string,onClick:pe.default.func,showText:pe.default.bool};var wt=function(t){var r=bt(e.useState(t.defaultValue),2),a=r[0],n=r[1];return l.jsx(ye.default,{variant:t.location||"panelTabs",children:t.options.map((function(e,r){var i;return l.jsx(fe.default,{onClick:function(){t.handleChange(e.value),n(e.value)},fullWidth:!0,variant:(null==a?void 0:a.toLowerCase())===(null===(i=e.value)||void 0===i?void 0:i.toLowerCase())?"selected":"unselected",children:e.label},r)}))})};wt.propTypes={lang:pe.default.string,options:pe.default.arrayOf(pe.default.shape({label:pe.default.string,value:pe.default.string})),defaultValue:pe.default.string,handleChange:pe.default.func,location:pe.default.string};var Tt=function(e){var t="ar"===e.lang;return l.jsxs(ye.default,{onClick:function(t){t.stopPropagation(),e.onCardClick()},maxWidth:"xs",variant:"card-container",dataValue:"parent",style:{direction:t?"rtl":"ltr"},children:[e.header&&l.jsxs(ye.default,{style:{zIndex:20},variant:"card-header",children:[e.headerActions&&l.jsx("div",{style:{margin:0,marginRight:-20,marginLeft:-20,marginBottom:-20,display:"flex",paddingTop:5,paddingLeft:5,paddingRight:5,justifyContent:"flex-end"},children:e.headerActions}),e.header]}),e.content&&l.jsx(ye.default,{style:{zIndex:20},variant:"card-content",children:e.content}),e.actions&&l.jsx(ye.default,{style:{zIndex:20},variant:"card-actions",children:e.actions})]})};Tt.propTypes={lang:pe.default.string,onCardClick:pe.default.func};var Ct=function(e){var t,r,a="ar"===e.lang,n={monthly:"شهرياً","3-months":"كل 3 أشهر","6-months":"كل 6 أشهر",annually:"سنوياً"},i={monthly:"Monthly","3-months":"3 Months","6-months":"6 Months",annually:"Annually"},s={usd:a?"دولار":"$",sar:a?"ريال":"SAR"},o=a?e.features_ar:e.features,d=a?{left:10}:{right:10};return l.jsxs(ye.default,{maxWidth:"xs",variant:e.selectedPlan?"selected-plan-card":"plan-card",style:{direction:a?"rtl":"ltr"},children:[l.jsxs(ye.default,{variant:"plan-header",children:[e.discount&&l.jsx(Te.default,{label:e.discount,variant:"standard",style:ht({maxWidth:"fit-content",position:"absolute",bottom:10},d),color:"success"}),l.jsx(je.default,{variant:"h3",fontWeight:500,children:a?e.title_ar:e.title}),l.jsx(je.default,{variant:"caption",children:a?e.subtitle_ar:e.subtitle}),l.jsx("br",{}),l.jsx(je.default,{variant:"h4",fontWeight:500,style:{display:"flex",alignItems:"center"},children:"ar"===e.lang?l.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[e.price,l.jsx("div",{style:{width:5}}),l.jsx(je.default,{children:s[null===(t=e.currency)||void 0===t?void 0:t.toLowerCase()]})]}),l.jsx(je.default,{style:{fontSize:14,margin:5},children:a?n[e.cycleText]:i[e.cycleText]})]}):l.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[l.jsx(je.default,{children:s[null===(r=e.currency)||void 0===r?void 0:r.toLowerCase()]}),l.jsx("div",{style:{width:5}}),e.price]}),l.jsx(je.default,{style:{fontSize:14,margin:5},children:"ar"===e.lang?n[e.cycleText]:i[e.cycleText]})]})})]}),l.jsx("div",{style:{padding:20,color:e.selectedPlan?"white":"black"},children:null==o?void 0:o.map((function(e){return l.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",marginTop:10,width:"100%"},children:[l.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",width:"10%"},children:l.jsx(we.default,{fontSize:"small"})}),l.jsx("div",{style:{width:10}}),l.jsx(je.default,{variant:"subtitle2",children:e})]})}))}),l.jsx(fe.default,{onClick:e.selectPlan,variant:e.selectedPlan?"outlined":"contained",style:{margin:20},children:e.buttonText})]})};Ct.propTypes={lang:pe.default.string,buttonText:pe.default.string,selectedPlan:pe.default.string,title:pe.default.string,title_ar:pe.default.string,subtitle:pe.default.string,subtitle_ar:pe.default.string,features:pe.default.array,features_ar:pe.default.array,currency:pe.default.oneOf(["sar","usd"]),cycleText:pe.default.oneOf(["monthly","3-months","6-months","annually"])};var Pt=function(e){return l.jsx(je.default,ht(ht({},e),{},{children:e.children}))},qt=function(e){return l.jsx("div",{style:e.inForm&&{width:"100%"},children:l.jsxs("div",{style:{width:e.fullWidth?"100%":"fit-content"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.label&&l.jsx(Pe.default,{children:e.label}),e.helperText&&l.jsx(je.default,{style:{marginBottom:!e.label&&10},variant:"validation",children:e.helperText})]}),l.jsx(Ce.default,ht({disableUnderline:!0},e))]})})},kt=function(e){return l.jsx(qe.default,ht({},e))};var St="production"!==process.env.NODE_ENV?pe.default.oneOfType([pe.default.number,pe.default.string,pe.default.object,pe.default.array]):{};function Lt(){return Lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Lt.apply(this,arguments)}function Ot(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Wt(e,t,r={clone:!0}){const a=r.clone?Lt({},e):e;return Ot(e)&&Ot(t)&&Object.keys(t).forEach((l=>{"__proto__"!==l&&(Ot(t[l])&&l in e&&Ot(e[l])?a[l]=Wt(e[l],t[l],r):a[l]=t[l])})),a}const At=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],It=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Nt=[...At,...It];function Rt(e){return function(e,t,r,a){const l=(n=e,((i=t)&&"string"==typeof i?i.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),n):null)||r);var n,i;return"number"==typeof l?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${a} argument to be a number or a string, got ${e}.`),l*e):Array.isArray(l)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>l.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(l)}.`,`${e} > ${l.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join("\n"))),l[e]):"function"==typeof l?l:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${l}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}(e,"spacing",8,"spacing")}function Bt(e,t){if(null==e)return{};var r,a,l={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(l[r]=e[r]);return l}"production"===process.env.NODE_ENV||At.reduce(((e,t)=>(e[t]=St,e)),{}),"production"===process.env.NODE_ENV||It.reduce(((e,t)=>(e[t]=St,e)),{}),"production"===process.env.NODE_ENV||Nt.reduce(((e,t)=>(e[t]=St,e)),{});const Et=["values","unit","step"];function zt(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:a=5}=e,l=Bt(e,Et),n=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>Lt({},e,{[t.key]:t.val})),{})})(t),i=Object.keys(n);function s(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function o(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-a/100}${r})`}function d(e,l){const n=i.indexOf(l);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==n&&"number"==typeof t[i[n]]?t[i[n]]:l)-a/100}${r})`}return Lt({keys:i,values:n,up:s,down:o,between:d,only:function(e){return i.indexOf(e)+1<i.length?d(e,i[i.indexOf(e)+1]):s(e)},not:function(e){const t=i.indexOf(e);return 0===t?s(i[1]):t===i.length-1?o(i[t]):d(e,i[i.indexOf(e)+1]).replace("@media","@media not all and")},unit:r},l)}var Dt={borderRadius:4};const Ft=["breakpoints","palette","spacing","shape"];const Mt=ce.createContext(null);"production"!==process.env.NODE_ENV&&(Mt.displayName="ThemeContext");var Ut=Mt;function Ht(e=null){const t=function(){const e=ce.useContext(Ut);return"production"!==process.env.NODE_ENV&&ce.useDebugValue(e),e}();return t&&(r=t,0!==Object.keys(r).length)?t:e;var r}const Gt=function(e={},...t){const{breakpoints:r={},palette:a={},spacing:l,shape:n={}}=e,i=Bt(e,Ft),s=zt(r),o=function(e=8){if(e.mui)return e;const t=Rt({spacing:e}),r=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map((e=>{const r=t(e);return"number"==typeof r?`${r}px`:r})).join(" "));return r.mui=!0,r}(l);let d=Wt({breakpoints:s,direction:"ltr",components:{},palette:Lt({mode:"light"},a),spacing:o,shape:Lt({},Dt,n)},i);return d=t.reduce(((e,t)=>Wt(e,t)),d),d}();function $t(e=Gt){return Ht(e)}var _t,Vt,Zt=ke.default.input(_t||(_t=vt(["\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n cursor: pointer;\n height: 35px;\n border-radius: ","px;\n background-color: ",";\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius}),(function(e){return e.value})),Xt=ke.default.input(Vt||(Vt=vt(["\n max-width: 70px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border: none;\n // height: 30px;\n padding: 10px;\n border-radius: ","px;\n &::-webkit-color-swatch {\n border: none;\n }\n &::-moz-color-swatch {\n border: none;\n }\n"])),(function(e){return e.borderRadius})),Yt=function(e){var t=$t();return l.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[l.jsx(Xt,{type:"text",value:e.color,borderRadius:t.allBorderRadius,onChange:e.handleChange}),l.jsx("div",{style:{width:10}}),l.jsx(Zt,{type:"color",value:e.color,onChange:e.handleChange,borderRadius:t.allBorderRadius})]})};Yt.propTypes={color:pe.default.string,handleChange:pe.default.func};var Jt=function(e){return l.jsxs(Le.default,{spacing:2,direction:"row",alignItems:"center",style:e.style,children:[e.startElement,l.jsx(Se.default,{size:"small","aria-label":"Volume",value:e.value,onChange:e.handleChange}),e.endElement]})};Jt.propTypes={startElement:pe.default.element,endElement:pe.default.element,handleChange:pe.default.func};var Kt=function(e){return l.jsxs(ye.default,{variant:"settingsRow",children:[l.jsx(Pt,{children:e.settingsLabel}),"checkbox"===e.settingsType&&l.jsx(be.default,ht({},e)),"text"===e.settingsType&&l.jsx(qt,ht({},e)),"boolean"===e.settingsType&&l.jsx(kt,ht({},e)),"range"===e.settingsType&&l.jsx(Jt,ht({},e)),"color"===e.settingsType&&l.jsx(Yt,ht({},e)),"radio"===e.settingsType&&l.jsx(wt,ht({location:"inSettings"},e))]})};Kt.propTypes={settingsLabel:pe.default.string,settingsType:pe.default.oneOf(["checkbox","text","radio","boolean","color"])};var Qt=function(e){var t,r="ar"===e.lang,a="";switch(null===(t=e.logo)||void 0===t?void 0:t.toLowerCase()){case"google":a=l.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg"});break;case"github":a=l.jsx(Oe.default,{});break;case"twitter":a=l.jsx(We.default,{});break;case"mada":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/mada.png",height:20});break;case"stcpay":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/stc-pay.png",height:20});break;case"visa/master":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/visa-master.png",height:30});break;case"paypal":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/paypal.png",height:25});break;case"googlepay":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/google-pay.png",height:20});break;case"applepay":a=l.jsx("img",{src:"https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png",height:40});break;case"wallet":a=l.jsx(Ae.default,{})}return l.jsxs(fe.default,ht(ht({style:{direction:r?"rtl":"ltr"}},e),{},{variant:"withLogo",children:[a,l.jsx("div",{style:{width:10}}),l.jsx(je.default,{style:{color:"black",fontSize:14,textAlign:"center",letterSpacing:.4,fontFamily:"Roboto",fontWeight:500},children:e.buttonText})]}))};Qt.propTypes={lang:pe.default.string,logo:pe.default.oneOf(["google","github","twitter","wallet","googlepay","applepay","stcpay","visa/master","paypal","mada"]),buttonText:pe.default.string};var er=function(e){return l.jsxs("div",{style:{width:"100%"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[l.jsx(Pe.default,{children:e.label}),e.helperText&&l.jsx(je.default,{variant:"validation",children:e.helperText})]}),l.jsx(Ie.default,ht(ht({},e),{},{children:e.children}))]})},tr=function(e){return l.jsxs(ge.default,{severity:e.severity,icon:e.hideIcon,children:[e.title&&l.jsx(me.default,{children:e.title}),e.text]})};tr.propTypes={severity:pe.default.oneOf(["error","info","success","warning"]),title:pe.default.string,text:pe.default.string,hideIcon:pe.default.bool};var rr=function(e){var t="ar"===e.lang;return l.jsx(Ee.default,{style:{direction:t?"rtl":"ltr"},children:l.jsxs(Ne.default,{"aria-label":"a dense table",children:[l.jsx(ze.default,{children:l.jsxs(De.default,{children:[e.columns.map((function(e,r){return l.jsx(Be.default,{align:t?"right":"left",style:{fontWeight:700},variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&l.jsx(Be.default,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:"Actions"})]})}),l.jsx(Re.default,{children:e.rows?e.rows.map((function(r,a){return l.jsxs(De.default,{children:[r.map((function(e,r){return l.jsx(Be.default,{align:t?"right":"left",component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)})),e.actions&&l.jsx(Be.default,{align:t?"right":"left",style:{fontWeight:700},variant:t?"borderedRight":"borderedLeft",children:e.actions.map((function(t){return l.jsx(O.Button,{style:{margin:2},variant:"outlined",size:"small",onClick:function(){return e.handleActionClick(r)},children:t})}))})]},a)})):l.jsx(De.default,{align:"center",children:l.jsx(Be.default,{align:"center",component:"th",colSpan:6,children:e.noDataText})})}),e.end&&l.jsx(De.default,{children:e.end.map((function(e,r){return l.jsx(Be.default,{align:t?"right":"left",style:{fontWeight:700},component:"th",scope:"row",variant:r>0?t?"borderedRight":"borderedLeft":"body",children:e},r)}))})]})})};rr.propTypes={handleActionClick:pe.default.func,noDataText:pe.default.string,lang:pe.default.string,columns:pe.default.array,rows:pe.default.array,end:pe.default.array};var ar=function(e){return l.jsxs(Me.default,{elevation:0,children:[l.jsx(Ue.default,{expandIcon:l.jsx(Fe.default,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:l.jsx(je.default,{children:e.title})}),l.jsx(He.default,{children:l.jsxs(je.default,{children:[e.content," "]})})]})};ar.propTypes={title:pe.default.string,content:pe.default.string};var lr=function(t){var r=bt(e.useState(!1),2),a=r[0],n=r[1],i=B.useForm(),s=i.formState.errors,o=i.handleSubmit,d=i.control;return l.jsxs(ye.default,{maxWidth:"xs",variant:"auth",children:[a&&l.jsx(tr,{text:t.texts.passwordMatchError,severity:"error"}),t.passwordChanged?l.jsx(Pt,{style:{textAlign:"center",margin:5},children:t.texts.passwordChanged}):l.jsx(B.FormProvider,ht(ht({},i),{},{children:l.jsxs("form",{onSubmit:o((function(e){console.log("handling subb",e),e.password===e.confirmPassword?t.handleNewPassword():n(!0)})),children:[l.jsx(B.Controller,{control:d,name:"password",render:function(e){var r,a,n=e.field;return l.jsx(qt,ht({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:t.texts.passwordLabel,placeholder:t.texts.passwordPlaceholder,helperText:null===(a=s.password)||void 0===a?void 0:a.message,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx($e.default,{})})},n))},rules:{required:t.texts.passwordRequiredText}}),l.jsx(B.Controller,{control:d,name:"confirmPassword",render:function(e){var r,a,n=e.field;return l.jsx(qt,ht({fullWidth:!0,type:"password",value:null!==(r=n.value)&&void 0!==r?r:"",label:t.texts.confirmPasswordLabel,placeholder:t.texts.confirmPasswordPlaceholder,helperText:null===(a=s.confirmPassword)||void 0===a?void 0:a.message,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx($e.default,{})})},n))},rules:{required:t.texts.confirmPasswordRequiredText}}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",children:t.texts.updatePassword})]})}))]})};lr.propTypes={texts:pe.default.shape({emailLabel:pe.default.string,emailPlaceholder:pe.default.string,emailRequiredText:pe.default.string,passwordPlaceholder:pe.default.string,updatePassword:pe.default.string,passwordRequiredText:pe.default.string,passwordLabel:pe.default.string,confirmPasswordPlaceholder:pe.default.string,confirmPasswordLabel:pe.default.string,confirmPasswordRequiredText:pe.default.string,passwordMatchError:pe.default.string,forgotPasswordText:pe.default.string,passwordChanged:pe.default.string}),passwordChanged:pe.default.bool,handleNewPassword:pe.default.func};var nr=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit;t.register;var n=t.control;return l.jsx(ye.default,{maxWidth:"xs",variant:"auth",children:e.sent?l.jsx(Pt,{style:{textAlign:"center",margin:5},children:e.texts.emailSentText}):l.jsxs("form",{onSubmit:a(e.handleResetPassword),children:[l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx(_e.default,{})})},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.resetPassword})]})})};nr.propTypes={texts:pe.default.shape({emailLabel:pe.default.string,emailPlaceholder:pe.default.string,emailRequiredText:pe.default.string,emailInvalidText:pe.default.string,emailSentText:pe.default.string,resetPassword:pe.default.string}),sent:pe.default.bool,handleResetPassword:pe.default.func};var ir=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit,n=t.control;return l.jsxs(ye.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&l.jsx(tr,{title:e.errorTitle,text:e.errorText,severity:"error"}),l.jsx(B.FormProvider,ht(ht({},t),{},{children:l.jsxs("form",{onSubmit:a(e.handleSignUp),children:[l.jsx(B.Controller,{control:n,name:"fullName",render:function(t){var a,n,i=t.field;return l.jsx(qt,{fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(n=r.fullName)||void 0===n?void 0:n.message,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx(Ve.default,{})})})},rules:{required:e.texts.fullNameRequiredText}}),l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(qt,{fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx(_e.default,{})})})},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(B.Controller,{control:n,name:"password",render:function(t){var a,n,i,s=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"password",defaultValue:null!==(a=s.value)&&void 0!==a?a:"",value:null!==(n=s.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx($e.default,{})})},s))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(fe.default,{fullWidth:!0,variant:"last",type:"submit",children:e.texts.signUpText})]})})),l.jsxs(je.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.existingUserText," ",l.jsx("span",{onClick:e.handleRouteToSignIn,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signInText})]}),l.jsx(Ze.default,{}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l.jsx(Qt,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignUp}),e.viaGithub&&l.jsx(Qt,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignUp}),e.viaTwitter&&l.jsx(Qt,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignUp})]})]})};ir.propTypes={texts:pe.default.shape({fullNameLabel:pe.default.string,fullNamePlaceholder:pe.default.string,fullNameRequiredText:pe.default.string,emailLabel:pe.default.string,emailPlaceholder:pe.default.string,emailRequiredText:pe.default.string,emailInvalidText:pe.default.string,passwordLabel:pe.default.string,passwordPlaceholder:pe.default.string,passwordRequiredText:pe.default.string,passwordTooShortText:pe.default.string,forgotPasswordText:pe.default.string,newUserText:pe.default.string,signUpText:pe.default.string,signInText:pe.default.string,existingUserText:pe.default.string,googleButtonLabel:pe.default.string,githubButtonLabel:pe.default.string,twitterButtonLabel:pe.default.string}),viaGoogle:pe.default.bool,viaGithub:pe.default.bool,viaTwitter:pe.default.bool,handleSignUp:pe.default.func,handleRouteToSignIn:pe.default.func,handleGoogleSignUp:pe.default.func,handleGithubSignUp:pe.default.func,handleTwitterSignUp:pe.default.func};var sr=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit,n=t.control;return l.jsxs(ye.default,{maxWidth:"xs",variant:"auth",style:{direction:"ar"===e.lang?"rtl":"ltr"},children:[e.showError&&l.jsx(tr,{title:e.errorTitle,text:e.errorText,severity:"error"}),l.jsxs("form",{onSubmit:a(e.handleSignIn),children:[l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx(_e.default,{})})},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(B.Controller,{control:n,name:"password",render:function(t){var a,n,i,s=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"password",defaultValue:null!==(a=s.value)&&void 0!==a?a:"",value:null!==(n=s.value)&&void 0!==n?n:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(i=r.password)||void 0===i?void 0:i.message,startAdornment:l.jsx(Ge.default,{position:"start",children:l.jsx($e.default,{})})},s))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(je.default,{style:{cursor:"pointer",marginTop:5,width:"max-content",fontSize:15,padding:5},onClick:e.handleForgotPassword,children:e.texts.forgotPasswordText}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.signInText})]}),l.jsxs(je.default,{variant:"subtitle2",style:{marginTop:5,textAlign:"center",padding:5},children:[e.texts.newUserText," ",l.jsx("span",{onClick:e.handleRouteToSignUp,style:{cursor:"pointer",color:"blue",textAlign:"center"},children:e.texts.signUpText})]}),l.jsx(Ze.default,{}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.viaGoogle&&l.jsx(Qt,{logo:"google",buttonText:e.texts.googleButtonLabel,onClick:e.handleGoogleSignIn}),e.viaGithub&&l.jsx(Qt,{logo:"github",buttonText:e.texts.githubButtonLabel,onClick:e.handleGithubSignIn}),e.viaTwitter&&l.jsx(Qt,{logo:"twitter",buttonText:e.texts.twitterButtonLabel,onClick:e.handleTwitterSignIn})]})]})};sr.propTypes={texts:pe.default.shape({emailLabel:pe.default.string,emailPlaceholder:pe.default.string,emailRequiredText:pe.default.string,emailInvalidText:pe.default.string,passwordLabel:pe.default.string,passwordPlaceholder:pe.default.string,passwordRequiredText:pe.default.string,forgotPasswordText:pe.default.string,newUserText:pe.default.string,signUpText:pe.default.string,signInText:pe.default.string,googleButtonLabel:pe.default.string,githubButtonLabel:pe.default.string,twitterButtonLabel:pe.default.string}),viaGoogle:pe.default.bool,viaGithub:pe.default.bool,viaTwitter:pe.default.bool,handleSignIn:pe.default.func,handleRouteToSignUp:pe.default.func,handleGoogleSignIn:pe.default.func,handleGithubSignIn:pe.default.func,handleTwitterSignIn:pe.default.func};var or=function(e){return l.jsxs(ye.default,{maxWidth:"xs",children:[l.jsx(Pt,{align:"center",children:"Choose Payment Method"}),e.viaWallet&&l.jsx(Qt,{logo:"wallet",buttonText:e.walletLabel,onClick:e.handleWallet}),e.viaCreditCard&&l.jsx(Qt,{logo:"visa/master",buttonText:e.visaMasterLabel,onClick:e.handleCreditCard}),e.viaMada&&l.jsx(Qt,{logo:"mada",buttonText:e.madaLabel,onClick:e.handleMada}),e.viaSTCPay&&l.jsx(Qt,{logo:"stcpay",buttonText:e.stcPayLabel,onClick:e.handleSTCPay}),e.viaPayPal&&l.jsx(Qt,{logo:"paypal",buttonText:e.paypalLabel,onClick:e.handlePayPal}),e.viaGooglePay&&l.jsx(Qt,{logo:"googlepay",buttonText:e.googlePayLabel,onClick:e.handleGooglePay}),e.viaApplePay&&l.jsx(Qt,{logo:"applepay",buttonText:e.applePayLabel,onClick:e.handleApplePay})]})};or.propTypes={viaMada:pe.default.bool,viaWallet:pe.default.bool,viaSTCPay:pe.default.bool,viaPayPal:pe.default.bool,viaApplePay:pe.default.bool,viaCreditCard:pe.default.bool,madaLabel:pe.default.string,stcPayLabel:pe.default.string,paypalLabel:pe.default.string,walletLabel:pe.default.string,applePayLabel:pe.default.string,visaMasterLabel:pe.default.string,handleMada:pe.default.func,handleWallet:pe.default.func,handleSTCPay:pe.default.func,handlePayPal:pe.default.func,handleApplePay:pe.default.func,handleCreditCard:pe.default.func};var dr=function(t){var r=bt(e.useState(0),2),a=r[0],n=r[1],i=B.useForm(),s=i.formState.errors,o=i.handleSubmit,d=i.control;return l.jsxs(ye.default,{maxWidth:"xs",children:[l.jsxs(je.default,{align:"center",variant:"h2",fontWeight:500,style:{marginBottom:20},children:[Number(a).toLocaleString("en")||"0",l.jsx(je.default,{children:t.currency||"SAR"})]}),l.jsx(B.FormProvider,ht(ht({},i),{},{children:l.jsxs("form",{onSubmit:o(t.handleChargeWallet),children:[l.jsx(B.Controller,{control:d,name:"amount",render:function(e){var r,a,i=e.field;return l.jsx(qt,ht(ht({fullWidth:!0,placeholder:t.texts.amountLabel,type:"number",value:null!==(r=i.value)&&void 0!==r?r:""},i),{},{inputProps:{inputMode:"numeric",min:"1",max:"9999999",step:"0.01"},onChange:function(e){i.onChange(parseFloat(e.target.value)),n(e.target.value)},helperText:null===(a=s.amount)||void 0===a?void 0:a.message}))},rules:{required:t.texts.amountRequired}}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",children:t.texts.chargeWallet})]})}))]})};dr.propTypes={texts:pe.default.shape({amountLabel:pe.default.string,chargeWallet:pe.default.string,amountRequired:pe.default.string}),handleChargeWallet:pe.default.func,currency:pe.default.string};var ur=function(e){var t,r,a,n,i,s,o,d,u,c,f="ar"===e.lang,x=B.useForm(),p=x.formState.errors,h=x.handleSubmit;x.register;var m=x.control,g={display:"flex",padding:0,paddingRight:"0px !important",paddingLeft:"0px !important",flexDirection:{xs:"column",sm:"row",md:"row",lg:"row",xl:"row"}};return l.jsxs(ye.default,{maxWidth:"sm",style:{direction:f?"rtl":"ltr"},children:[l.jsx(je.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l.jsx(rr,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l.jsx(Ze.default,{variant:"middle"}),l.jsx(je.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.billingAddress}),l.jsx(B.FormProvider,ht(ht({},x),{},{children:l.jsxs("form",{onSubmit:h(e.handlePayNow),children:[l.jsxs(ye.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"firstName",rules:{required:null===(t=e.texts)||void 0===t?void 0:t.required},render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.firstNameLabel)+" *",helperText:null===(n=p.firstName)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"lastName",rules:{required:null===(r=e.texts)||void 0===r?void 0:r.required},render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.lastNameLabel)+" *",helperText:null===(n=p.lastName)||void 0===n?void 0:n.message},i))}})]}),l.jsx(B.Controller,{control:m,name:"email",render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.emailLabel)+" *",helperText:null===(n=p.email)||void 0===n?void 0:n.message},i))},rules:{required:null===(a=e.texts)||void 0===a?void 0:a.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:null===(n=e.texts)||void 0===n?void 0:n.emailInvalidText}}}),l.jsxs(ye.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"streetAddress",rules:{required:null===(i=e.texts)||void 0===i?void 0:i.required},render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.streetAddressLabel)+" *",helperText:null===(n=p.streetAddress)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"buildingNumber",rules:{required:null===(s=e.texts)||void 0===s?void 0:s.required},render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.buildingNumberLabel)+" *",helperText:null===(n=p.buildingNumber)||void 0===n?void 0:n.message},i))}})]}),l.jsxs(ye.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"province",rules:{required:null===(o=e.texts)||void 0===o?void 0:o.required},render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.stateLabel)+" *",helperText:null===(n=p.province)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"city",rules:{required:null===(d=e.texts)||void 0===d?void 0:d.required},render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"text",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.cityLabel)+" *",helperText:null===(n=p.city)||void 0===n?void 0:n.message},i))}})]}),l.jsxs(ye.default,{sx:g,children:[l.jsx(B.Controller,{control:m,name:"zipCode",rules:{required:null===(u=e.texts)||void 0===u?void 0:u.required},render:function(t){var r,a,n,i=t.field;return l.jsx(qt,ht({inForm:!0,fullWidth:!0,type:"number",variant:"unscrollable",value:null!==(r=i.value)&&void 0!==r?r:"",label:(null===(a=e.texts)||void 0===a?void 0:a.zipCodeLabel)+" *",helperText:null===(n=p.zipCode)||void 0===n?void 0:n.message},i))}}),l.jsx("div",{style:{width:20}}),l.jsx(B.Controller,{control:m,name:"country",rules:{required:null===(c=e.texts)||void 0===c?void 0:c.required},render:function(t){var r,a,n,i=t.field;return l.jsxs(er,ht(ht({fullWidth:!0,native:!0,label:(null===(r=e.texts)||void 0===r?void 0:r.countryLabel)+" *",variant:"standard",value:null!==(a=i.value)&&void 0!==a?a:"",helperText:null===(n=p.country)||void 0===n?void 0:n.message,displayEmpty:!0,disableUnderline:!0,validators:["required"]},i),{},{children:[l.jsx("option",{}),e.countriesList.map((function(e,t){return l.jsx("option",{children:e},t)}))]}))}})]}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.payNow})]})}))]})};ur.propTypes={texts:pe.default.shape({orderDetails:pe.default.string,billingAddress:pe.default.string,payNow:pe.default.string,emailLabel:pe.default.string,emailRequiredText:pe.default.string,emailInvalidText:pe.default.string,firstNameLabel:pe.default.string,required:pe.default.string,lastNameLabel:pe.default.string,streetAddressLabel:pe.default.string,buildingNumberLabel:pe.default.string,cityLabel:pe.default.string,stateLabel:pe.default.string,countryLabel:pe.default.string,zipCodeLabel:pe.default.string}),lang:pe.default.string,countriesList:pe.default.array,products:pe.default.array,total:pe.default.string,handlePayNow:pe.default.func};var cr=function(e){var t="ar"===e.lang;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[l.jsxs(ye.default,{maxWidth:"sm",style:{direction:t?"rtl":"ltr"},children:[l.jsx(je.default,{align:"center",variant:"h3",fontWeight:400,style:{marginBottom:10},children:e.confirmationTitle}),l.jsx(Ze.default,{variant:"middle"}),l.jsxs(je.default,{align:"center",variant:"body1",style:{marginBottom:10},children:[e.texts.successMessage," ",l.jsx("strong",{children:e.userEmail})]}),l.jsx(je.default,{align:"center",variant:"body1",children:e.texts.yourOrderNumber}),l.jsx(je.default,{align:"center",variant:"body1",fontWeight:700,style:{marginBottom:10},children:e.orderNumber}),l.jsx(Ze.default,{variant:"middle"}),e.products&&l.jsxs(l.Fragment,{children:[l.jsx(je.default,{align:"center",variant:"h5",fontWeight:500,style:{marginBottom:10},children:e.texts.orderDetails}),l.jsx(rr,{lang:e.lang,columns:["Product","Price"],rows:e.products,end:["Total",e.total]}),l.jsx(Ze.default,{variant:"middle"})]}),l.jsx(fe.default,{onClick:e.handlePrint,variant:"contained",children:e.texts.print}),l.jsx(fe.default,{onClick:e.handleHistory,variant:"last",children:e.texts.history}),l.jsx(fe.default,{onClick:e.handleHome,variant:"last",children:e.texts.homePage}),l.jsx(je.default,{align:"center",variant:"body2",style:{marginTop:10},children:e.texts.fasterPaymentNote})]}),l.jsx("a",{style:{marginTop:10,paddingTop:10,padding:5,cursor:"pointer"},onClick:e.handleRefundPolicyLink,children:l.jsx(je.default,{align:"center",variant:"caption",fontWeight:500,children:e.texts.refundPolicy})})]})};cr.propTypes={texts:pe.default.shape({print:pe.default.string,history:pe.default.string,homePage:pe.default.string,successMessage:pe.default.string,orderDetails:pe.default.string,fasterPaymentNote:pe.default.string,billingAddress:pe.default.string,payNow:pe.default.string,yourOrderNumber:pe.default.string,emailLabel:pe.default.string,emailRequiredText:pe.default.string,emailInvalidText:pe.default.string,firstNameLabel:pe.default.string,required:pe.default.string,lastNameLabel:pe.default.string,streetAddressLabel:pe.default.string,buildingNumberLabel:pe.default.string,cityLabel:pe.default.string,stateLabel:pe.default.string,countryLabel:pe.default.string,zipCodeLabel:pe.default.string,refundPolicy:pe.default.string}),products:pe.default.array,countriesList:pe.default.array,lang:pe.default.string,total:pe.default.string,userEmail:pe.default.string,orderNumber:pe.default.string,confirmationTitle:pe.default.string,handleHome:pe.default.func,handlePrint:pe.default.func,handleHistory:pe.default.func,handleRefundPolicyLink:pe.default.func};var fr=function(e){var t=O.useTheme();return l.jsx(st.default,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:e.anchor,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(e.anchor),onClose:e.handleClose,variant:"themed",PaperProps:{style:{boxShadow:"none",borderRadius:t.allBorderRadius,border:"1px solid ".concat(t.primaryActionColor)}},children:e.menuItems.map((function(e){return l.jsxs(ot.default,{onClick:e.action,children:[e.icon&&l.jsx(e.icon,{}),l.jsx("div",{style:{width:10}}),l.jsx(je.default,{textAlign:"center",children:e.label})]},e.label)}))})};fr.propTypes={anchor:pe.default.any,handleClose:pe.default.func,menuItems:pe.default.arrayOf(pe.default.shape({icon:pe.default.element,label:pe.default.string,action:pe.default.func}))};var xr=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},pr=function(e){return mt({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(8)," + 1px)")},e.breakpoints.up("sm"),{width:"calc(".concat(e.spacing(8)," + 1px)")})},hr=U.styled("div")((function(e){var t=e.theme;return ht({display:"flex",alignItems:"center",justifyContent:"rtl"===e.direction?"flex-start":"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),mr=U.styled(Je.default,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open,a=e.direction;return ht({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},r&&{marginLeft:"rtl"===a?0:240,marginRight:"rtl"===a?240:0,width:"calc(100% - ".concat(240,"px)"),transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})})})),gr=U.styled(Ye.default,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,r=e.open;return ht(ht({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box"},r&&ht(ht({},xr(t)),{},{"& .MuiDrawer-paper":xr(t)})),!r&&ht(ht({},pr(t)),{},{"& .MuiDrawer-paper":pr(t)}))}));var vr=["children","onClose","hideClose"],br=function(e){var t=e.children,r=e.onClose,a=e.hideClose,n=gt(e,vr);return l.jsxs(xt.default,ht(ht({sx:{m:0,p:2}},n),{},{children:[t,a?null:l.jsx(et.default,{"aria-label":"close",onClick:r,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}},children:l.jsx(dt.default,{})})]}))};var yr=function(e){var t=O.useTheme(),r=bt(ue.default.useState(null),2),a=r[0],n=r[1],i=bt(ue.default.useState(null),2),s=i[0],o=i[1],d=function(){return n(null)};return console.log("theme is ",t),l.jsx(Je.default,{position:"static",variant:"appbar",children:l.jsx(ye.default,{variant:"appbar",children:l.jsxs(Ke.default,{disableGutters:!0,children:[l.jsx(Xe.default,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:e.logo}),l.jsxs(Xe.default,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:[l.jsx(et.default,{size:"large","aria-label":"account of current user","aria-controls":"menu-appbar","aria-haspopup":"true",onClick:function(e){return n(e.currentTarget)},color:"inherit",children:l.jsx(tt.default,{})}),l.jsx(fr,{anchor:a,handleClose:d,menuItems:e.pages})]}),l.jsx(Xe.default,{sx:{flexGrow:1,display:{xs:"flex",md:"none"}},children:e.logo}),l.jsx(Xe.default,{sx:{flexGrow:1,display:{xs:"none",md:"flex"}},children:e.pages.map((function(e){return l.jsx(fe.default,{onClick:d,sx:{my:2,display:"block"},children:e.label},e)}))}),l.jsxs(Xe.default,{sx:{flexGrow:0},children:[l.jsx(xe.default,{title:"Open settings",children:l.jsx(et.default,{onClick:function(e){return o(e.currentTarget)},sx:{p:0},children:l.jsx(it.default,{alt:"Remy Sharp",src:"/static/images/avatar/2.jpg"})})}),l.jsx(fr,{anchor:s,handleClose:function(e){return o(null)},menuItems:e.accountMenu})]})]})})})};yr.propTypes={pages:pe.default.arrayOf(pe.default.shape({icon:pe.default.element,label:pe.default.string,action:pe.default.func})),accountMenu:pe.default.arrayOf(pe.default.shape({icon:pe.default.element,label:pe.default.string,action:pe.default.func}))},exports.ActionButton=function(e){return l.jsx(fe.default,ht(ht({},e),{},{children:e.text}))},exports.AdaptiveButton=jt,exports.Box=function(e){return l.jsx("div",{children:e.children})},exports.ChargeWalletForm=dr,exports.CheckoutForm=ur,exports.ConfirmationPage=cr,exports.CreditCardForm=function(e){var t,r=B.useForm(),a=r.formState.errors,n=r.handleSubmit,i=r.control;return l.jsx(ye.default,{maxWidth:"xs",children:l.jsxs("form",{onSubmit:n(e.handle),children:[l.jsx(qt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"tel",label:"Card Number",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message}),l.jsx(B.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,l.jsx(qt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Name On Card",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message})}}),l.jsx(B.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,l.jsx(qt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"Expiry Date",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message})}}),l.jsx(B.Controller,{control:i,name:"cardName",render:function(e){var t;return e.field,l.jsx(qt,{fullWidth:!0,name:"password",placeholder:"Enter password",type:"password",label:"CCV",rules:{required:"Password is rquired"},helperText:null===(t=a.password)||void 0===t?void 0:t.message})}}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithCreditCard,children:"Pay with Credit Card"})]})})},exports.HawaAccordian=ar,exports.HawaAlert=tr,exports.HawaAppBar=yr,exports.HawaAppLayout=function(e){var t=U.useTheme(),r=bt(ue.default.useState(!0),2),a=r[0],n=r[1],i="ar"===e.lang,s=bt(ue.default.useState(null),2);s[0],s[1];var o=bt(ue.default.useState(null),2),d=o[0],u=o[1];return l.jsxs(Xe.default,{sx:{display:"flex",direction:i?"rtl":"ltr"},children:[l.jsx(mr,{variant:"appbar",position:"fixed",open:a,direction:i?"rtl":"ltr",children:l.jsxs(Ke.default,{variant:"appbar",sx:{paddingLeft:{xs:3},paddingRight:{xs:3}},children:[l.jsx(et.default,{color:"inherit","aria-label":"open drawer",onClick:function(){return n(!0)},edge:"start",s:!0,sx:ht({marginRight:5},a&&{display:"none"}),children:l.jsx(tt.default,{})}),l.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:0},children:[l.jsx(je.default,{variant:"h6",noWrap:!0,component:"div",children:e.pageTitle}),l.jsxs(Xe.default,{children:[l.jsx(xe.default,{title:"Open settings",children:l.jsx(et.default,{onClick:function(e){return u(e.currentTarget)},sx:{p:0},size:"small",children:l.jsx(it.default,{})})}),l.jsx(fr,{menuItems:e.accountMenu,anchor:d,handleClose:function(){return u(null)}})]})]})]})}),l.jsxs(gr,{variant:"permanent",open:a,children:[l.jsxs(hr,{direction:i?"rtl":"ltr",children:[e.logo,l.jsx(et.default,{onClick:function(){return n(!1)},children:"rtl"===t.direction?l.jsx(at.default,{}):l.jsx(rt.default,{})})]}),l.jsx(Ze.default,{}),l.jsx(Qe.default,{children:e.pages.map((function(t,r){var n,i;return l.jsx(xe.default,{title:t.text,placement:"right",arrow:!0,PopperProps:{style:{opacity:a?0:1}},children:l.jsxs(lt.default,{variant:(null===(n=e.pageName)||void 0===n?void 0:n.toLowerCase())===(null===(i=t.slug)||void 0===i?void 0:i.toLowerCase())&&"clicked",onClick:t.action,sx:{minHeight:48,justifyContent:a?"initial":"center",px:2.5},children:[l.jsx(t.icon,{}),l.jsx("div",{style:{width:20}}),l.jsx(nt.default,{primary:t.text,sx:{opacity:a?1:0}})]},t.text)},r)}))})]}),l.jsxs(Xe.default,{sx:{flexGrow:1,p:3},children:[l.jsx(hr,{}),e.children]})]})},exports.HawaButton=function(e){return l.jsx(fe.default,ht(ht({},e),{},{children:e.children}))},exports.HawaCheckbox=function(e){return console.log("props : ",e),l.jsx(ue.default.Fragment,{children:l.jsx(ve.default,{label:e.label,control:l.jsx(be.default,{style:{color:e.color||null},defaultChecked:e.defaultValue})})})},exports.HawaColorPicker=Yt,exports.HawaDialog=function(t){var r=bt(e.useState(!1),2);return r[0],r[1],l.jsxs(ut.default,ht(ht({},t),{},{variant:"main",children:[l.jsx(br,{onClose:t.onClose,hideClose:t.hideClose,children:t.title}),l.jsx(ft.default,{children:t.children}),l.jsx(ct.default,{children:t.actions})]}))},exports.HawaInputLabel=function(e){return l.jsx(Pe.default,{children:l.jsx("div",{style:{fontSize:15},children:e.label})})},exports.HawaItemCard=Tt,exports.HawaLogoButton=Qt,exports.HawaPricingCard=Ct,exports.HawaRadio=wt,exports.HawaRange=Jt,exports.HawaSearchBar=function(e){return l.jsx(qt,ht({endAdornment:l.jsx(O.InputAdornment,{position:"start",children:l.jsx(W.Search,{})})},e))},exports.HawaSelect=er,exports.HawaSettingsRow=Kt,exports.HawaSnackbar=function(e){return l.jsx(he.default,{open:e.open,onClose:e.handleClose,children:l.jsxs(ge.default,{icon:!1,severity:e.severity,children:[e.title&&l.jsx(me.default,{children:e.title}),e.text]})})},exports.HawaTable=rr,exports.HawaTextArea=function(e){var t=$t();return console.log("theme is ",t),l.jsx("label",{children:l.jsx("textarea",{style:{color:"black",backgroundColor:e.bgColor||"white",borderBottom:"none",border:"none",width:"100%",padding:0,margin:0,marginBottom:0,resize:e.resize||"vertical"}})})},exports.HawaTextField=qt,exports.HawaTypography=Pt,exports.NewPasswordForm=lr,exports.PayWithWallet=function(e){return l.jsxs(ye.default,{maxWidth:"xs",children:[l.jsx(je.default,{align:"center",children:"Wallet Balance"}),l.jsxs(je.default,{align:"center",variant:"h1",children:[e.walletBalance||"0",l.jsx(je.default,{children:e.currency||"SAR"})]}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handlePayWithWallet,children:"Pay Now"})]})},exports.ResetPasswordForm=nr,exports.SelectPayment=or,exports.SignInForm=sr,exports.SignUpForm=ir,exports.UserProfileForm=function(e){var t=B.useForm(),r=t.formState.errors,a=t.handleSubmit,n=t.control;return l.jsx(ye.default,{maxWidth:"sm",children:l.jsx(B.FormProvider,ht(ht({},t),{},{children:l.jsxs("form",{onSubmit:a(e.handleUpdateProfile),children:[l.jsx(B.Controller,{control:n,name:"fullName",render:function(t){var a,n,i=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.fullNameLabel,placeholder:e.texts.fullNamePlaceholder,helperText:null===(n=r.fullName)||void 0===n?void 0:n.message},i))}}),l.jsx(B.Controller,{control:n,name:"phoneNumber",render:function(e){var t=e.field;return l.jsx(qt,ht({fullWidth:!0,type:"tel",label:"Phone Number",placeholder:"+966"},t))}}),l.jsx(B.Controller,{control:n,name:"email",render:function(t){var a,n,i=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"text",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.emailLabel,helperText:null===(n=r.email)||void 0===n?void 0:n.message,placeholder:e.texts.emailPlaceholder},i))},rules:{required:e.texts.emailRequiredText,pattern:{value:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,message:e.texts.emailInvalidText}}}),l.jsx(B.Controller,{control:n,name:"password",render:function(t){var a,n,i=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"password",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.passwordLabel,placeholder:e.texts.passwordPlaceholder,helperText:null===(n=r.password)||void 0===n?void 0:n.message},i))},rules:{required:e.texts.passwordRequiredText}}),l.jsx(B.Controller,{control:n,name:"confirmPassword",render:function(t){var a,n,i=t.field;return l.jsx(qt,ht({fullWidth:!0,type:"password",value:null!==(a=i.value)&&void 0!==a?a:"",label:e.texts.confirmPasswordLabel,placeholder:e.texts.confirmPasswordPlaceholder,helperText:null===(n=r.confirmPassword)||void 0===n?void 0:n.message},i))},rules:{required:e.texts.confirmPasswordRequiredText}}),l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",children:e.texts.updateProfile})]})}))})},exports.UserSettingsForm=function(e){return l.jsxs(ye.default,{maxWidth:"sm",children:[e.children,l.jsx(fe.default,{type:"submit",fullWidth:!0,variant:"last",onClick:e.handleSaveSettings,children:e.saveSettingsText})]})};
|