@campxdev/campx-web-utils 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +3 -3
- package/src/utils/constants.ts +1 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),n=require("react"),r=require("react-hook-form"),o=require("@campxdev/react-blueprint"),i=require("@mui/icons-material"),s=require("react-toastify"),a=require("axios"),c=require("pullstate"),u=require("react-query"),l=require("react-router-dom"),d=require("@hookform/resolvers"),p=require("device-detector-js"),f=require("yup"),h=require("@mui/x-date-pickers"),m=require("@mui/x-date-pickers/AdapterDateFns"),v=require("react-redux"),y=require("framer-motion"),b=require("@mui/material/Box"),g=require("@mui/material/SpeedDial"),x=require("@mui/material/SpeedDialAction");function w(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var E=w(n),k=w(f),j=function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},j.apply(this,arguments)};function S(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})}function O(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function N(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}"function"==typeof SuppressedError&&SuppressedError;var C=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=_({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var s in o)o[s]&&(i+="; "+s,!0!==o[s]&&(i+="="+o[s].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(r[a]=t.read(s,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",_({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,_({},this.attributes,t))},withConverter:function(t){return e(_({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),P={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institutionInfo:void 0,asset:void 0},A=new c.Store(P),D=window.location.hostname.includes("localhost"),I=window.location.hostname.split(".")[0],T=window.location.pathname.split("/")[1],R=window.location.pathname.split("/")[2],V={"student-workspace":"/student-api","faculty-workspace":"/faculty-api","department-workspace":"/department-api","academic-coordinator-workspace":"/academic-coordinator-api","academic-admin-workspace":"/academic-admin-api","hostel-admin-workspace":"/hostel-admin-api","transport-coordinator-workspace":"/transport-coordinator-api","employee-workspace":"/employee-api"},B=a.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,headers:{"x-tenant-id":I,"x-institution-code":T}});B.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params);if(!1!==e.workspace&&R&&V[R]&&"common-workspace"!==R){var n=V[R];e.url="".concat(n).concat(e.url)}var r=C.get("campx_session_key"),o=C.get("campx_open_payments_key"),i=C.get("campx_student_key");return D&&r&&e.headers.set("campx_session_key",r),D&&i&&e.headers.set("campx_student_key",i),o&&e.headers.set("campx_open_payments_key",o),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),j(j({},e),{params:t})},function(e){return Promise.reject(e)}),B.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,r,o,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422,413].includes(null===(r=e.response)||void 0===r?void 0:r.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(o=e.response)||void 0===o?void 0:o.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var L=t.styled(t.MenuItem)(function(){return{display:"flex",alignItems:"center",gap:"5px","& .MuiListItemIcon-root":{minWidth:"24px"},"& .MuiSvgIcon-root":{height:"14px",width:"14px"}}});function F(a){var c=this,u=a.close,l=n.useState({oldPassword:!1,newPassword:!1,confirmPassword:!1}),d=l[0],p=l[1],f=n.useState(!1),h=f[0],m=f[1],v=r.useForm(),y=v.handleSubmit,b=v.control,g=v.reset;return e.jsx("form",{onSubmit:y(function(e){return S(c,void 0,void 0,function(){var t,n,r;return O(this,function(o){switch(o.label){case 0:if(m(!0),t=e.oldPassword,n=e.newPassword,r=e.confirmPassword,n!==r)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,B.post(D?"https://api.campx.dev/auth-server/auth/change-password":"https://api.campx.in/auth-server/auth/change-password",{oldPassword:t,newPassword:n})];case 2:return o.sent(),s.toast.success("Password Changed Successfully"),m(!1),g(),u(),[3,4];case 3:return o.sent(),m(!1),[3,4];case 4:return[3,6];case 5:s.toast.error("New Password, Confirm Password must be same"),m(!1),o.label=6;case 6:return[2]}})})}),children:e.jsx(o.FormControlWrapper,{control:b,children:e.jsxs(t.Stack,{gap:1,direction:"column",children:[[{label:"Old Password",name:"oldPassword"},{label:"New Password",name:"newPassword"},{label:"Confirm Password",name:"confirmPassword"}].map(function(n){return e.jsx(e.Fragment,{children:e.jsx(o.TextField,{label:n.label,name:n.name,type:d[n.name]?"text":"password",required:!0,InputProps:{endAdornment:e.jsx(t.InputAdornment,{position:"end",children:e.jsx(t.IconButton,{size:"small",onClick:function(){return p(function(e){var t;return j(j({},e),((t={})[n.name]=!e[n.name],t))})},edge:"end",children:d[n.name]?e.jsx(i.Visibility,{}):e.jsx(i.VisibilityOff,{})})})}})})}),e.jsxs(t.Stack,{direction:"row",gap:2,sx:{marginTop:"15px"},children:[e.jsx(o.Button,{variant:"outlined",onClick:u,children:"Cancel"}),e.jsx(o.Button,{type:"submit",variant:"contained",endIcon:h&&e.jsx(t.CircularProgress,{style:{color:"white"},size:"30px",thickness:1.7}),children:"Submit"})]})]})})})}var q=function(){return e.jsx(e.Fragment,{children:e.jsx(o.DialogButton,{anchor:function(t){var n=t.open;return e.jsx(L,{onClick:function(){n()},children:"Change Password"})},content:function(t){var n=t.close;return e.jsx(F,{close:n})},title:"Change Password"})})};var K=a.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,workspace:!1,headers:{"x-tenant-id":I,"x-institution-code":T}});K.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params),n=C.get("campx_session_key"),r=C.get("campx_open_payments_key"),o=C.get("campx_student_key");return D&&n&&e.headers.set("campx_session_key",n),D&&o&&e.headers.set("campx_student_key",o),r&&e.headers.set("campx_open_payments_key",r),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),j(j({},e),{params:t})},function(e){return Promise.reject(e)}),K.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,r,o,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422].includes(null===(r=e.response)||void 0===r?void 0:r.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(o=e.response)||void 0===o?void 0:o.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var M=n.createContext({showConfirmDialog:function(){}}),$=function(t){var n=t.children,r=A.useState(function(e){return e.confirmDialog}),i=function(){A.update(function(e){e.confirmDialog.isOpen=!1})};return e.jsxs(M.Provider,{value:{showConfirmDialog:function(e,t,n,r,o,i,s){void 0===o&&(o="confirm"),A.update(function(a){a.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:r,type:o,confirmButtonText:i,cancelButtonText:s}})}},children:[n,e.jsx(o.ConfirmDialog,{isOpen:r.isOpen,title:r.title,message:r.message,type:r.type,confirmButtonText:r.confirmButtonText,cancelButtonText:r.cancelButtonText,onConfirm:function(){r.onConfirm(),i()},onCancel:function(){r.onCancel(),i()}})]})};function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},U(e,t)}var z={error:null},W=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=z,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(z)},n.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},n.componentDidUpdate=function(e,t){var n,r,o,i,s=this.state.error,a=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=a)&&(i=[]),o.length!==i.length||o.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,a),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(E.isValidElement(o))return o;if("function"==typeof n)return n(i);if(r)return E.createElement(r,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(E.Component),Y=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(o,i,s){try{return Promise.resolve(function(r,a){try{var c=(t.context&&process.env.NODE_ENV,Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:i}))).then(function(e){return s.shouldUseNativeValidation&&d.validateFieldsNatively({},s),{values:n.rawValues?o:e,errors:{}}}))}catch(e){return a(e)}return c&&c.then?c.then(void 0,a):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:d.toNestError((t=e,n=!s.shouldUseNativeValidation&&"all"===s.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,i=o&&o[t.type];e[t.path]=r.appendErrors(t.path,n,e,t.type,i?[].concat(i,t.message):t.message)}return e},{})),s)};var t,n}))}catch(e){return Promise.reject(e)}}},H=function(e){return S(void 0,void 0,void 0,function(){var t;return O(this,function(n){switch(n.label){case 0:return e.latitude&&e.longitude?[3,3]:[4,fetch("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB2YCpo1yi107RYj1LdZu2DCcpcO93reFY",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({considerIp:"true"})})];case 1:return[4,n.sent().json()];case 2:t=n.sent(),e.latitude=t.location.lat,e.longitude=t.location.lng,n.label=3;case 3:return[2,B.post("/auth-server/auth-v2/login",e,{workspace:!1}).then(function(e){return e.data})]}})})},Q=k.object().shape({username:k.string().required("Username is required"),password:k.string().required("Password is required")}),X=function(i){var s=i.close,a=n.useState({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),c=a[0],d=a[1],f=l.useNavigate();n.useEffect(function(){navigator.geolocation.getCurrentPosition(function(e){d(function(t){return j(j({},t),{deviceInformation:j(j({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})})}),navigator.permissions.query({name:"geolocation"}).then(function(e){"denied"===e.state&&d(function(e){return j(j({},e),{isLocationAllowed:!1})})});var e=(new p).parse(navigator.userAgent);d(function(t){var n,r,o;return j(j({},t),{deviceInformation:j(j({},t.deviceInformation),{clientName:(null===(n=e.client)||void 0===n?void 0:n.name)||t.deviceInformation.clientName,os:(null===(r=e.os)||void 0===r?void 0:r.name)||t.deviceInformation.os,osVersion:(null===(o=e.os)||void 0===o?void 0:o.version)||t.deviceInformation.osVersion})})})},[]);var h=r.useForm({resolver:Y(Q)}),m=h.handleSubmit,v=h.control,y=h.formState.errors,b=u.useMutation(H,{onSuccess:function(e){D&&(C.remove("campx_session_key"),C.set("campx_session_key",e.session.token),s(),f("/".concat(e.session.institutionCode,"/workspace")),window.location.reload())}}),g=b.mutate,x=b.isLoading;return e.jsx(e.Fragment,{children:e.jsxs(t.Stack,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t.Box,{height:"36px",width:"194.8px",children:e.jsx(o.Icons.CampxFullLogoIcon,{})}),e.jsxs(t.Stack,{gap:"10px",justifyContent:"center",alignItems:"center",children:[e.jsx(r.Controller,{control:v,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"username",sx:{width:"400px"},placeholder:"Enter Username or Email",containerProps:{my:"0"},onChange:n.onChange,label:"Username or Email",error:!!y.username,required:!0})},name:"username"}),e.jsx(r.Controller,{control:v,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"password",sx:{width:"400px"},placeholder:"Enter password",onChange:n.onChange,containerProps:{my:"0"},label:"Password",type:"password",error:!!y.password,required:!0})},name:"password"}),e.jsx(o.Button,{type:"submit",color:"primary",variant:"contained",sx:{width:"400px"},onClick:m(function(e){return S(void 0,void 0,void 0,function(){return O(this,function(t){return g(j(j(j({},e),c.deviceInformation),{loginId:e.username,loginType:"USER"})),[2]})})}),disabled:x,loading:x,children:"Login"})]})]})})},G=t.styled(t.Alert)(function(e){var t=e.theme;return{height:"60px",border:"1px solid ".concat(t.palette.error.main),display:"flex",alignItems:"center","& .MuiAlert-message":{padding:0},"& .MuiTypography-root":{margin:0},position:"relative","& .retryBtn":{color:"#661B2A",position:"absolute",right:8,top:8}}}),J=function(t){var n=l.useLocation();return e.jsx(u.QueryErrorResetBoundary,{children:function(r){var o=r.reset;return e.jsx(W,{onReset:o,FallbackComponent:Z,children:t.children},null==n?void 0:n.pathname)}})},Z=function(n){var r,i,s,a,c,u,l,d=n.error,p=n.resetErrorBoundary;if(null===(r=null==d?void 0:d.response)||void 0===r?void 0:r.status)switch(null===(i=null==d?void 0:d.response)||void 0===i?void 0:i.status){case 401:return e.jsx(ee,{});case 500:return e.jsx(o.InternalServerError,{resetBoundary:p});case 404:return e.jsx(o.ResourceNotFound,{message:null===(a=null===(s=null==d?void 0:d.response)||void 0===s?void 0:s.data)||void 0===a?void 0:a.message})}return"ERR_NETWORK"===(null==d?void 0:d.code)?e.jsx(o.NoInterneConnection,{resetBoundary:p}):e.jsx(t.Box,{sx:{marginTop:"16px",padding:"20px"},children:e.jsxs(G,{severity:"error",children:[null!==(l=null===(u=null===(c=null==d?void 0:d.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)&&void 0!==l?l:null==d?void 0:d.message,e.jsx(o.Button,{className:"retryBtn",onClick:function(){return p()},size:"small",color:"error",variant:"outlined",children:"Try Again"})]})})},ee=function(){var t=l.useNavigate(),r=n.useState(!1),i=r[0],s=r[1],a=C.get("campx_session_key");return e.jsx(o.UnAuthorized,{component:e.jsxs(e.Fragment,{children:[e.jsx(o.Button,{sx:{marginTop:"20px"},variant:"contained",onClick:function(){"localhost"===window.location.hostname.split(".")[1]?s(!0):a||t("/auth/login")},children:"Click Here To Login"}),e.jsx(o.Dialog,{open:i,onClose:function(){return s(!1)},content:function(t){var n=t.close;return e.jsx(X,{close:n})}})]})})};function te(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ne=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),re=()=>Math.random().toString(36).substring(7).split("").join("."),oe={INIT:`@@redux/INIT${re()}`,REPLACE:`@@redux/REPLACE${re()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${re()}`};function ie(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function se(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ae(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=se(e)),t}function ce(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?te(2):`Expected the root reducer to be a function. Instead, received: '${ae(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?te(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?te(1):`Expected the enhancer to be a function. Instead, received: '${ae(n)}'`);return n(ce)(e,t)}let r=e,o=t,i=new Map,s=i,a=0,c=!1;function u(){s===i&&(s=new Map,i.forEach((e,t)=>{s.set(t,e)}))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?te(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?te(4):`Expected the listener to be a function. Instead, received: '${ae(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?te(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;u();const n=a++;return s.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?te(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),s.delete(n),i=null}}}function p(e){if(!ie(e))throw new Error("production"===process.env.NODE_ENV?te(7):`Actions must be plain objects. Instead, the actual type was: '${ae(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?te(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?te(17):`Action "type" property must be a string. Instead, the actual type was: '${ae(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?te(9):"Reducers may not dispatch actions.");try{c=!0,o=r(o,e)}finally{c=!1}return(i=s).forEach(e=>{e()}),e}p({type:oe.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?te(10):`Expected the nextReducer to be a function. Instead, received: '${ae(e)}`);r=e,p({type:oe.REPLACE})},[ne]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?te(11):`Expected the observer to be an object. Instead, received: '${ae(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[ne](){return this}}}}}function ue(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}function le(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"production"!==process.env.NODE_ENV&&void 0===e[o]&&ue(`No reducer provided for key "${o}"`),"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o,i;"production"!==process.env.NODE_ENV&&(o={});try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:oe.INIT}))throw new Error("production"===process.env.NODE_ENV?te(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:oe.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?te(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${oe.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const r=function(e,t,n,r){const o=Object.keys(t),i=n&&n.type===oe.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!ie(e))return`The ${i} has unexpected type of "${ae(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const s=Object.keys(e).filter(e=>!t.hasOwnProperty(e)&&!r[e]);return s.forEach(e=>{r[e]=!0}),n&&n.type===oe.REPLACE?void 0:s.length>0?`Unexpected ${s.length>1?"keys":"key"} "${s.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,o);r&&ue(r)}let s=!1;const a={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],u=e[i],l=c(u,t);if(void 0===l){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?te(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}a[i]=l,s=s||l!==u}return s=s||r.length!==Object.keys(e).length,s?a:e}}function de(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function pe(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var fe=pe(),he=pe,me="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?de:de.apply(null,arguments)};function ve(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function ye(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){}}}var be=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ge(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function xe(e,t,n){const r=we(e,t,n);return{detectMutations:()=>Ee(e,t,r,n)}}function we(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const s=r?r+"."+o:o;t.length&&-1!==t.indexOf(s)||(i.children[o]=we(e,t,n[o],s))}}return i}function Ee(e,t=[],n,r,o=!1,i=""){const s=n?n.value:void 0,a=s===r;if(o&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(s)||e(r))return{wasMutated:!1};const c={};for(let e in n.children)c[e]=!0;for(let e in r)c[e]=!0;const u=t.length>0;for(let o in c){const s=i?i+"."+o:o;if(u){if(t.some(e=>e instanceof RegExp?e.test(s):s===e))continue}const c=Ee(e,t,n.children[o],r[o],a,s);if(c.wasMutated)return c}return{wasMutated:!1}}function ke(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||ie(e)}function je(e,t="",n=ke,r,o=[],i){let s;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const a=null!=r?r(e):Object.entries(e),c=o.length>0;for(const[e,u]of a){const a=t?t+"."+e:e;if(c){if(o.some(e=>e instanceof RegExp?e.test(a):a===e))continue}if(!n(u))return{keyPath:a,value:u};if("object"==typeof u&&(s=je(u,a,n,r,o,i),s))return s}return i&&Se(e)&&i.add(e),!1}function Se(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!Se(t))return!1;return!0}function Oe(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=ke,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>s=>u=>{if(!function(e){return ie(e)&&"type"in e&&"string"==typeof e.type}(u))return s(u);const d=s(u),p=ye();return c||r.length&&-1!==r.indexOf(u.type)||p.measureTime(()=>{const e=je(u,"",t,n,o,l);if(e){const{keyPath:t,value:n}=e}}),a||(p.measureTime(()=>{const r=je(e.getState(),"",t,n,i,l);if(r){const{keyPath:e,value:t}=r}}),p.warnIfExceeded()),d}}}function Ne(e){return"boolean"==typeof e}var _e=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new be;if(t&&(Ne(t)?i.push(fe):i.push(he(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};Ne(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=ge,ignoredPaths:o,warnAfter:i=32}=e;const s=xe.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=s(r);return i=>a=>{const c=ye();c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?De(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const u=i(a);return c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?De(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(a)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),c.warnIfExceeded(),u}}}}(e))}if(r){let e={};Ne(r)||(e=r),i.push(Oe(e))}if(o){let e={};Ne(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=ve}=e;return()=>e=>n=>(t(n),e(n))}(e))}}return i},Ce=e=>t=>{setTimeout(t,e)},Pe=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new be(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,s=!1;const a=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ce(10):"callback"===e.type?e.queueNotification:Ce(e.timeout),u=()=>{s=!1,i&&(i=!1,a.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(s||(s=!0,c(u))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function Ae(e){const t=_e(),{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s,enhancers:a}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!ie(n))throw new Error("production"===process.env.NODE_ENV?De(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=le(n)}if("production"!==process.env.NODE_ENV&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?De(2):"`middleware` field must be a callback");if("function"==typeof r){if(u=r(t),"production"!==process.env.NODE_ENV&&!Array.isArray(u))throw new Error("production"===process.env.NODE_ENV?De(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if("production"!==process.env.NODE_ENV&&u.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?De(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;u.forEach(t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?De(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)})}let l=de;o&&(l=me({trace:"production"!==process.env.NODE_ENV,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"===process.env.NODE_ENV?te(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},a=e.map(e=>e(s));return i=de(...a)(o.dispatch),{...o,dispatch:i}}}(...u),p=Pe(d);if("production"!==process.env.NODE_ENV&&a&&"function"!=typeof a)throw new Error("production"===process.env.NODE_ENV?De(5):"`enhancers` field must be a callback");let f="function"==typeof a?a(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?De(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&f.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?De(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&f.includes(d);return ce(c,s,l(...f))}function De(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ie=n.createContext(void 0),Te=function(t){var n=t.children,r=A.useState(function(e){return e.snackbar});return e.jsxs(Ie.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),A.update(function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t})}},children:[n,e.jsx(o.Snackbar,{open:r.open,message:r.message,severity:r.severity,autoHideDuration:1500,onClose:function(){A.update(function(e){e.snackbar.open=!1})}})]})},Re={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},Ve=function(n){var r=n.actions,i=t.useTheme(),s=E.useState(!1),a=s[0],c=s[1],u=function(){return c(!1)};return e.jsxs(b,{sx:{position:"fixed",bottom:26,right:0,zIndex:1e3},children:[e.jsx(t.Backdrop,{open:a}),e.jsx(g,{ariaLabel:"Custom Help Docs",sx:{position:"absolute",bottom:0,right:40,display:"flex",alignItems:"flex-end","& .MuiFab-primary":{backgroundColor:i.palette.highlight.highlightBlue,borderRadius:"8px",width:"50px",height:"50px",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:i.palette.highlight.highlightBlue}},"& .MuiSpeedDialAction-fab":{margin:"0 0 16px 0","&:not(:last-child)":{marginBottom:"8px"}}},icon:e.jsx(o.Icons.HelpDocsIcon,{size:20}),onClose:u,onOpen:function(){return c(!0)},open:a,direction:"up",children:r.map(function(t){return e.jsx(x,{onClick:function(){var e;null===(e=t.onClick)||void 0===e||e.call(t),u()},icon:e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),FabProps:{sx:{width:"auto",minWidth:"180px",maxWidth:"280px",padding:"8px 12px",boxShadow:"none",height:"40px",borderRadius:"8px",backgroundColor:i.palette.surface.defaultBackground,color:i.palette.text.primary,fontWeight:500,fontFamily:"Heebo",fontSize:"12px",whiteSpace:"nowrap",textAlign:"right",display:"flex",justifyContent:"flex-end",alignItems:"center","&:hover":{backgroundColor:i.palette.surface.defaultBackground}}}},t.name)})})]})},Be=t.styled(t.Stack)(function(e){var t,n=e.theme;return(t={flexDirection:"row",backgroundColor:n.palette.surface.defaultBackground})[n.breakpoints.down("md")]={flexWrap:"wrap"},t}),Le=t.styled(t.Box)(function(e){var t,n=e.theme;return(t={borderRadius:"8px",height:"calc(100vh - 96px)",overflowY:"scroll",width:"100%","&::-webkit-scrollbar":{width:"0.5em",height:"0.2em",backgroundColor:n.palette.surface.defaultBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.primary.light,borderRadius:"3px","&:hover":{backgroundColor:n.palette.primary.main}}})[n.breakpoints.down("md")]={margin:"0px 12px 12px 12px",height:"calc(100vh - 118px)","&::-webkit-scrollbar":{display:"none"}},t}),Fe=[{label:"All",value:null},{label:"REGULAR",value:"R"},{label:"SUPPLEMENTARY",value:"S"}],qe=[{label:"Tuition Fee",value:"tuition_fee"},{label:"Admission Fee",value:"admission_fee"},{label:"Hostel Fee",value:"hostel_fee"},{label:"Transport Fee",value:"transport_fee"},{label:"Exam Fee",value:"exam_fee"},{label:"Other Fee",value:"other_fee"}],Ke=Array.from({length:6},function(e,t){return(new Date).getFullYear()-t});Array.from({length:12},function(e,t){return{label:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1),value:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1)}});Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:function(){return l.BrowserRouter}}),exports.AppLayout=function(r){var i,s=r.actions,a=void 0===s?[]:s,c=r.profileActions,u=void 0===c?[]:c,l=r.children,d=r.institutionData,p=void 0===d?[]:d,f=r.menu,h=r.mainContainerSx,m=r.handleLogout,v=r.userName,b=void 0===v?"":v,g=r.designation,x=void 0===g?"":g,w=r.clientName,E=void 0===w?"":w,k=r.defaultCollapsed,S=void 0===k||k,O=r.helpDocsConfig,_=n.useState(S),P=_[0],A=_[1],D=t.useTheme(),I=t.useMediaQuery(D.breakpoints.down("md"));var T=window.location.pathname.split("/").filter(Boolean).slice(1).join("/").replace(/\/\d+/g,"/:id"),R=(null===(i=null==O?void 0:O["/".concat(T)])||void 0===i?void 0:i.actions)||[];return e.jsxs(Be,{children:[e.jsx(o.Sidebar,{menu:f,collapsed:P,setCollapsed:A}),e.jsxs(y.motion.div,{animate:{width:P?"calc(100% - 84px)":"calc(100% - 278px)"},transition:{duration:.3,ease:"circOut"},style:{margin:"12px 12px 12px 0px",width:I?"100%":"calc(100% - 84px)",display:I?"contents":"block"},children:[e.jsx(o.AppHeader,j({clientName:E,userFullName:b,designation:x,actions:a,profileActions:N([e.jsx(q,{})],u,!0),collapsed:P,showActiveDevices:!1,onLogoutClick:null!=m?m:function(){B.post("/auth-server/auth/logout").then(function(e){C.remove("campx_tenant"),C.remove("campx_session_key"),C.remove("campx_institution"),window.location.href="/"}).catch(function(e){})},institutionsData:p},I&&{profileSx:{width:32,height:32,fontSize:"12px"}})),O&&R.length>0&&e.jsx(Ve,{actions:R}),e.jsx(Le,{sx:j({margin:"12px 0px 0px 0px",backgroundColor:D.palette.surface.paperBackground},h),onClick:function(){A(!0)},children:e.jsx(n.Suspense,{fallback:e.jsx(o.Spinner,{}),children:e.jsx(J,{children:l})})})]})]})},exports.ApplicationStore=A,exports.BatchSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Batch"},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/batches"}))},exports.ChangePassword=F,exports.ChangePasswordDialog=q,exports.ConfirmDialogProvider=$,exports.CourseSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/courses"}))},exports.DepartmentSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"_id",isObjectId:!0}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/departments"}))},exports.EmployeesSelector=function(t){return e.jsx(o.SingleSelect,j({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/employees"}))},exports.ErrorBoundary=J,exports.ExamTypeSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Exam Type",options:Fe},t))},exports.ExamsRegulationSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Regulation"},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/exam-regulations",dbLabelProps:{labelKey:"r.name"},dbValueProps:{valueKey:"r.name"}}))},exports.FeeTypeSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Fee Type",options:null==qe?void 0:qe.map(function(e){return{label:e.label,value:e.value}})},t))},exports.HelpDocs=Ve,exports.HostelBlockSelector=function(t){return e.jsx(o.SingleSelect,j({dbValueProps:{valueKey:"id",isInt:!0},dbLabelProps:{labelKey:"name",subLabelKey:"type",useLabelStartCase:!0,useSubLabelStartCase:!0}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/hostel-blocks"}))},exports.HostelFloorSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},t,{externalAxios:K,optionsApiEndPoint:"dropdowns/floors"}))},exports.HostelRoomSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Hostel Room",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",useLabelStartCase:!0}},t,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:K}))},exports.MonthYearSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Month & Year"},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/month-years"}))},exports.PrintFormatSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/print-formats"}))},exports.ProgramSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/programs"}))},exports.Providers=function(t){var r=t.children,i=t.basename,s=t.theme,a=void 0===s?o.lightTheme:s,c=t.reducers,d=void 0===c?{}:c,p=new u.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),f=I&&T&&R?"/".concat(T,"/").concat(R):"/";n.useEffect(function(){"/"===window.location.pathname&&T&&R&&I&&window.location.replace(window.location.origin+"/".concat(T,"/").concat(R))},[T,I,R]);var y=Ae({reducer:le(d)});return e.jsx(v.Provider,{store:y,children:e.jsx(l.BrowserRouter,{basename:null!=i?i:f,children:e.jsx(u.QueryClientProvider,{client:p,children:e.jsx(o.MuiThemeProvider,{theme:a,children:e.jsx(Te,{children:e.jsx(h.LocalizationProvider,{dateAdapter:m.AdapterDateFns,children:e.jsx($,{children:r})})})})})})})},exports.RegulationSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},t,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:K}))},exports.SemesterSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},t,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:K}))},exports.SnackbarProvider=Te,exports.StudentSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/students"}))},exports.StudentServicesSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/student-services"}))},exports.StyledMenuItem=L,exports.YearRangeSelector=function(t){var n=t.suffix,r=void 0===n?null:n,i=t.valueKey,s=void 0===i?"yearRange":i,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["suffix","valueKey"]);return e.jsx(o.SingleSelect,j({label:"Year Range",options:null==Ke?void 0:Ke.map(function(e){return{label:r?"".concat(r," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===s?"".concat(e," - ").concat(e+1):e}})},a))},exports.axios=B,exports.createRsbuildSharedConfig=function(e,t,n){return n.reduce(function(n,r){var o=e[r];return o&&(n[r]=j({singleton:!0,requiredVersion:o,version:o.replace(/^[\^~]/,"")},t.includes(r)?{eager:!0}:{})),n},{})},exports.initialApplicationState=P,exports.institutionCode=T,exports.isDevelopment=D,exports.nonWorkspaceAxios=K,exports.openInNewTab=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=window.location.pathname.split("/"),o=[];!t&&r[1]&&o.push(r[1]),!n&&r[2]&&o.push(r[2]);var i=o.length>0?"/"+o.join("/"):"",s="".concat(window.location.origin).concat(i,"/").concat(e);window.open(s,"_blank")},exports.tenantCode=I,exports.useConfirm=function(){var e=function(){A.update(function(e){e.confirmDialog=Re})};return function(t){var n=t.title,r=t.message,o=t.confirmButtonText,i=t.cancelButtonText,s=t.type,a=void 0===s?"confirm":s;return new Promise(function(t){A.update(function(s){s.confirmDialog={isOpen:!0,title:n,message:r,confirmButtonText:o,cancelButtonText:i,type:a,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}})})}},exports.workspace=R,exports.workspaceApiMapping=V;
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),n=require("react"),r=require("react-hook-form"),o=require("@campxdev/react-blueprint"),i=require("@mui/icons-material"),a=require("react-toastify"),s=require("axios"),c=require("pullstate"),u=require("react-query"),l=require("react-router-dom"),d=require("@hookform/resolvers"),p=require("device-detector-js"),f=require("yup"),h=require("@mui/x-date-pickers"),m=require("@mui/x-date-pickers/AdapterDateFns"),v=require("react-redux"),y=require("framer-motion"),b=require("@mui/material/Box"),g=require("@mui/material/SpeedDial"),x=require("@mui/material/SpeedDialAction");function w(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var E=w(n),k=w(f),j=function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},j.apply(this,arguments)};function S(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})}function O(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function N(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}"function"==typeof SuppressedError&&SuppressedError;var C=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=_({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",_({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,_({},this.attributes,t))},withConverter:function(t){return e(_({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),P={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institutionInfo:void 0,asset:void 0},A=new c.Store(P),D=window.location.hostname.includes("localhost"),I=window.location.hostname.split(".")[0],T=window.location.pathname.split("/")[1],R=window.location.pathname.split("/")[2],V={"student-workspace":"/student-api","faculty-workspace":"/faculty-api","department-workspace":"/department-api","academic-coordinator-workspace":"/academic-coordinator-api","academic-admin-workspace":"/academic-admin-api","hostel-admin-workspace":"/hostel-admin-api","transport-coordinator-workspace":"/transport-coordinator-api","employee-workspace":"/employee-api","librarian-workspace":"/librarian-api"},B=s.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,headers:{"x-tenant-id":I,"x-institution-code":T}});B.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params);if(!1!==e.workspace&&R&&V[R]&&"common-workspace"!==R){var n=V[R];e.url="".concat(n).concat(e.url)}var r=C.get("campx_session_key"),o=C.get("campx_open_payments_key"),i=C.get("campx_student_key");return D&&r&&e.headers.set("campx_session_key",r),D&&i&&e.headers.set("campx_student_key",i),o&&e.headers.set("campx_open_payments_key",o),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),j(j({},e),{params:t})},function(e){return Promise.reject(e)}),B.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,r,o,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422,413].includes(null===(r=e.response)||void 0===r?void 0:r.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(o=e.response)||void 0===o?void 0:o.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var L=t.styled(t.MenuItem)(function(){return{display:"flex",alignItems:"center",gap:"5px","& .MuiListItemIcon-root":{minWidth:"24px"},"& .MuiSvgIcon-root":{height:"14px",width:"14px"}}});function F(s){var c=this,u=s.close,l=n.useState({oldPassword:!1,newPassword:!1,confirmPassword:!1}),d=l[0],p=l[1],f=n.useState(!1),h=f[0],m=f[1],v=r.useForm(),y=v.handleSubmit,b=v.control,g=v.reset;return e.jsx("form",{onSubmit:y(function(e){return S(c,void 0,void 0,function(){var t,n,r;return O(this,function(o){switch(o.label){case 0:if(m(!0),t=e.oldPassword,n=e.newPassword,r=e.confirmPassword,n!==r)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,B.post(D?"https://api.campx.dev/auth-server/auth/change-password":"https://api.campx.in/auth-server/auth/change-password",{oldPassword:t,newPassword:n})];case 2:return o.sent(),a.toast.success("Password Changed Successfully"),m(!1),g(),u(),[3,4];case 3:return o.sent(),m(!1),[3,4];case 4:return[3,6];case 5:a.toast.error("New Password, Confirm Password must be same"),m(!1),o.label=6;case 6:return[2]}})})}),children:e.jsx(o.FormControlWrapper,{control:b,children:e.jsxs(t.Stack,{gap:1,direction:"column",children:[[{label:"Old Password",name:"oldPassword"},{label:"New Password",name:"newPassword"},{label:"Confirm Password",name:"confirmPassword"}].map(function(n){return e.jsx(e.Fragment,{children:e.jsx(o.TextField,{label:n.label,name:n.name,type:d[n.name]?"text":"password",required:!0,InputProps:{endAdornment:e.jsx(t.InputAdornment,{position:"end",children:e.jsx(t.IconButton,{size:"small",onClick:function(){return p(function(e){var t;return j(j({},e),((t={})[n.name]=!e[n.name],t))})},edge:"end",children:d[n.name]?e.jsx(i.Visibility,{}):e.jsx(i.VisibilityOff,{})})})}})})}),e.jsxs(t.Stack,{direction:"row",gap:2,sx:{marginTop:"15px"},children:[e.jsx(o.Button,{variant:"outlined",onClick:u,children:"Cancel"}),e.jsx(o.Button,{type:"submit",variant:"contained",endIcon:h&&e.jsx(t.CircularProgress,{style:{color:"white"},size:"30px",thickness:1.7}),children:"Submit"})]})]})})})}var q=function(){return e.jsx(e.Fragment,{children:e.jsx(o.DialogButton,{anchor:function(t){var n=t.open;return e.jsx(L,{onClick:function(){n()},children:"Change Password"})},content:function(t){var n=t.close;return e.jsx(F,{close:n})},title:"Change Password"})})};var K=s.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,workspace:!1,headers:{"x-tenant-id":I,"x-institution-code":T}});K.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params),n=C.get("campx_session_key"),r=C.get("campx_open_payments_key"),o=C.get("campx_student_key");return D&&n&&e.headers.set("campx_session_key",n),D&&o&&e.headers.set("campx_student_key",o),r&&e.headers.set("campx_open_payments_key",r),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),j(j({},e),{params:t})},function(e){return Promise.reject(e)}),K.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,r,o,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422].includes(null===(r=e.response)||void 0===r?void 0:r.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(o=e.response)||void 0===o?void 0:o.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&A.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var M=n.createContext({showConfirmDialog:function(){}}),$=function(t){var n=t.children,r=A.useState(function(e){return e.confirmDialog}),i=function(){A.update(function(e){e.confirmDialog.isOpen=!1})};return e.jsxs(M.Provider,{value:{showConfirmDialog:function(e,t,n,r,o,i,a){void 0===o&&(o="confirm"),A.update(function(s){s.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:r,type:o,confirmButtonText:i,cancelButtonText:a}})}},children:[n,e.jsx(o.ConfirmDialog,{isOpen:r.isOpen,title:r.title,message:r.message,type:r.type,confirmButtonText:r.confirmButtonText,cancelButtonText:r.cancelButtonText,onConfirm:function(){r.onConfirm(),i()},onCancel:function(){r.onCancel(),i()}})]})};function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},U(e,t)}var z={error:null},W=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=z,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(z)},n.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},n.componentDidUpdate=function(e,t){var n,r,o,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=s)&&(i=[]),o.length!==i.length||o.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(E.isValidElement(o))return o;if("function"==typeof n)return n(i);if(r)return E.createElement(r,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(E.Component),Y=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(o,i,a){try{return Promise.resolve(function(r,s){try{var c=(t.context&&process.env.NODE_ENV,Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:i}))).then(function(e){return a.shouldUseNativeValidation&&d.validateFieldsNatively({},a),{values:n.rawValues?o:e,errors:{}}}))}catch(e){return s(e)}return c&&c.then?c.then(void 0,s):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:d.toNestError((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,i=o&&o[t.type];e[t.path]=r.appendErrors(t.path,n,e,t.type,i?[].concat(i,t.message):t.message)}return e},{})),a)};var t,n}))}catch(e){return Promise.reject(e)}}},H=function(e){return S(void 0,void 0,void 0,function(){var t;return O(this,function(n){switch(n.label){case 0:return e.latitude&&e.longitude?[3,3]:[4,fetch("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB2YCpo1yi107RYj1LdZu2DCcpcO93reFY",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({considerIp:"true"})})];case 1:return[4,n.sent().json()];case 2:t=n.sent(),e.latitude=t.location.lat,e.longitude=t.location.lng,n.label=3;case 3:return[2,B.post("/auth-server/auth-v2/login",e,{workspace:!1}).then(function(e){return e.data})]}})})},Q=k.object().shape({username:k.string().required("Username is required"),password:k.string().required("Password is required")}),X=function(i){var a=i.close,s=n.useState({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),c=s[0],d=s[1],f=l.useNavigate();n.useEffect(function(){navigator.geolocation.getCurrentPosition(function(e){d(function(t){return j(j({},t),{deviceInformation:j(j({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})})}),navigator.permissions.query({name:"geolocation"}).then(function(e){"denied"===e.state&&d(function(e){return j(j({},e),{isLocationAllowed:!1})})});var e=(new p).parse(navigator.userAgent);d(function(t){var n,r,o;return j(j({},t),{deviceInformation:j(j({},t.deviceInformation),{clientName:(null===(n=e.client)||void 0===n?void 0:n.name)||t.deviceInformation.clientName,os:(null===(r=e.os)||void 0===r?void 0:r.name)||t.deviceInformation.os,osVersion:(null===(o=e.os)||void 0===o?void 0:o.version)||t.deviceInformation.osVersion})})})},[]);var h=r.useForm({resolver:Y(Q)}),m=h.handleSubmit,v=h.control,y=h.formState.errors,b=u.useMutation(H,{onSuccess:function(e){D&&(C.remove("campx_session_key"),C.set("campx_session_key",e.session.token),a(),f("/".concat(e.session.institutionCode,"/workspace")),window.location.reload())}}),g=b.mutate,x=b.isLoading;return e.jsx(e.Fragment,{children:e.jsxs(t.Stack,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t.Box,{height:"36px",width:"194.8px",children:e.jsx(o.Icons.CampxFullLogoIcon,{})}),e.jsxs(t.Stack,{gap:"10px",justifyContent:"center",alignItems:"center",children:[e.jsx(r.Controller,{control:v,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"username",sx:{width:"400px"},placeholder:"Enter Username or Email",containerProps:{my:"0"},onChange:n.onChange,label:"Username or Email",error:!!y.username,required:!0})},name:"username"}),e.jsx(r.Controller,{control:v,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"password",sx:{width:"400px"},placeholder:"Enter password",onChange:n.onChange,containerProps:{my:"0"},label:"Password",type:"password",error:!!y.password,required:!0})},name:"password"}),e.jsx(o.Button,{type:"submit",color:"primary",variant:"contained",sx:{width:"400px"},onClick:m(function(e){return S(void 0,void 0,void 0,function(){return O(this,function(t){return g(j(j(j({},e),c.deviceInformation),{loginId:e.username,loginType:"USER"})),[2]})})}),disabled:x,loading:x,children:"Login"})]})]})})},G=t.styled(t.Alert)(function(e){var t=e.theme;return{height:"60px",border:"1px solid ".concat(t.palette.error.main),display:"flex",alignItems:"center","& .MuiAlert-message":{padding:0},"& .MuiTypography-root":{margin:0},position:"relative","& .retryBtn":{color:"#661B2A",position:"absolute",right:8,top:8}}}),J=function(t){var n=l.useLocation();return e.jsx(u.QueryErrorResetBoundary,{children:function(r){var o=r.reset;return e.jsx(W,{onReset:o,FallbackComponent:Z,children:t.children},null==n?void 0:n.pathname)}})},Z=function(n){var r,i,a,s,c,u,l,d=n.error,p=n.resetErrorBoundary;if(null===(r=null==d?void 0:d.response)||void 0===r?void 0:r.status)switch(null===(i=null==d?void 0:d.response)||void 0===i?void 0:i.status){case 401:return e.jsx(ee,{});case 500:return e.jsx(o.InternalServerError,{resetBoundary:p});case 404:return e.jsx(o.ResourceNotFound,{message:null===(s=null===(a=null==d?void 0:d.response)||void 0===a?void 0:a.data)||void 0===s?void 0:s.message})}return"ERR_NETWORK"===(null==d?void 0:d.code)?e.jsx(o.NoInterneConnection,{resetBoundary:p}):e.jsx(t.Box,{sx:{marginTop:"16px",padding:"20px"},children:e.jsxs(G,{severity:"error",children:[null!==(l=null===(u=null===(c=null==d?void 0:d.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)&&void 0!==l?l:null==d?void 0:d.message,e.jsx(o.Button,{className:"retryBtn",onClick:function(){return p()},size:"small",color:"error",variant:"outlined",children:"Try Again"})]})})},ee=function(){var t=l.useNavigate(),r=n.useState(!1),i=r[0],a=r[1],s=C.get("campx_session_key");return e.jsx(o.UnAuthorized,{component:e.jsxs(e.Fragment,{children:[e.jsx(o.Button,{sx:{marginTop:"20px"},variant:"contained",onClick:function(){"localhost"===window.location.hostname.split(".")[1]?a(!0):s||t("/auth/login")},children:"Click Here To Login"}),e.jsx(o.Dialog,{open:i,onClose:function(){return a(!1)},content:function(t){var n=t.close;return e.jsx(X,{close:n})}})]})})};function te(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ne=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),re=()=>Math.random().toString(36).substring(7).split("").join("."),oe={INIT:`@@redux/INIT${re()}`,REPLACE:`@@redux/REPLACE${re()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${re()}`};function ie(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function ae(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function se(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=ae(e)),t}function ce(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?te(2):`Expected the root reducer to be a function. Instead, received: '${se(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?te(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?te(1):`Expected the enhancer to be a function. Instead, received: '${se(n)}'`);return n(ce)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((e,t)=>{a.set(t,e)}))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?te(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?te(4):`Expected the listener to be a function. Instead, received: '${se(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?te(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;u();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?te(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),a.delete(n),i=null}}}function p(e){if(!ie(e))throw new Error("production"===process.env.NODE_ENV?te(7):`Actions must be plain objects. Instead, the actual type was: '${se(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?te(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?te(17):`Action "type" property must be a string. Instead, the actual type was: '${se(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?te(9):"Reducers may not dispatch actions.");try{c=!0,o=r(o,e)}finally{c=!1}return(i=a).forEach(e=>{e()}),e}p({type:oe.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?te(10):`Expected the nextReducer to be a function. Instead, received: '${se(e)}`);r=e,p({type:oe.REPLACE})},[ne]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?te(11):`Expected the observer to be an object. Instead, received: '${se(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[ne](){return this}}}}}function ue(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}function le(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"production"!==process.env.NODE_ENV&&void 0===e[o]&&ue(`No reducer provided for key "${o}"`),"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o,i;"production"!==process.env.NODE_ENV&&(o={});try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:oe.INIT}))throw new Error("production"===process.env.NODE_ENV?te(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:oe.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?te(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${oe.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const r=function(e,t,n,r){const o=Object.keys(t),i=n&&n.type===oe.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!ie(e))return`The ${i} has unexpected type of "${se(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const a=Object.keys(e).filter(e=>!t.hasOwnProperty(e)&&!r[e]);return a.forEach(e=>{r[e]=!0}),n&&n.type===oe.REPLACE?void 0:a.length>0?`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,o);r&&ue(r)}let a=!1;const s={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],u=e[i],l=c(u,t);if(void 0===l){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?te(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}s[i]=l,a=a||l!==u}return a=a||r.length!==Object.keys(e).length,a?s:e}}function de(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function pe(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var fe=pe(),he=pe,me="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?de:de.apply(null,arguments)};function ve(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function ye(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){}}}var be=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ge(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function xe(e,t,n){const r=we(e,t,n);return{detectMutations:()=>Ee(e,t,r,n)}}function we(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const a=r?r+"."+o:o;t.length&&-1!==t.indexOf(a)||(i.children[o]=we(e,t,n[o],a))}}return i}function Ee(e,t=[],n,r,o=!1,i=""){const a=n?n.value:void 0,s=a===r;if(o&&!s&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(a)||e(r))return{wasMutated:!1};const c={};for(let e in n.children)c[e]=!0;for(let e in r)c[e]=!0;const u=t.length>0;for(let o in c){const a=i?i+"."+o:o;if(u){if(t.some(e=>e instanceof RegExp?e.test(a):a===e))continue}const c=Ee(e,t,n.children[o],r[o],s,a);if(c.wasMutated)return c}return{wasMutated:!1}}function ke(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||ie(e)}function je(e,t="",n=ke,r,o=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const s=null!=r?r(e):Object.entries(e),c=o.length>0;for(const[e,u]of s){const s=t?t+"."+e:e;if(c){if(o.some(e=>e instanceof RegExp?e.test(s):s===e))continue}if(!n(u))return{keyPath:s,value:u};if("object"==typeof u&&(a=je(u,s,n,r,o,i),a))return a}return i&&Se(e)&&i.add(e),!1}function Se(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!Se(t))return!1;return!0}function Oe(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=ke,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>a=>u=>{if(!function(e){return ie(e)&&"type"in e&&"string"==typeof e.type}(u))return a(u);const d=a(u),p=ye();return c||r.length&&-1!==r.indexOf(u.type)||p.measureTime(()=>{const e=je(u,"",t,n,o,l);if(e){const{keyPath:t,value:n}=e}}),s||(p.measureTime(()=>{const r=je(e.getState(),"",t,n,i,l);if(r){const{keyPath:e,value:t}=r}}),p.warnIfExceeded()),d}}}function Ne(e){return"boolean"==typeof e}var _e=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new be;if(t&&(Ne(t)?i.push(fe):i.push(he(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};Ne(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?r.splice(a,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=ge,ignoredPaths:o,warnAfter:i=32}=e;const a=xe.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=a(r);return i=>s=>{const c=ye();c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=a(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?De(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const u=i(s);return c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=a(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?De(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(s)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),c.warnIfExceeded(),u}}}}(e))}if(r){let e={};Ne(r)||(e=r),i.push(Oe(e))}if(o){let e={};Ne(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=ve}=e;return()=>e=>n=>(t(n),e(n))}(e))}}return i},Ce=e=>t=>{setTimeout(t,e)},Pe=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new be(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ce(10):"callback"===e.type?e.queueNotification:Ce(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(a||(a=!0,c(u))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function Ae(e){const t=_e(),{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a,enhancers:s}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!ie(n))throw new Error("production"===process.env.NODE_ENV?De(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=le(n)}if("production"!==process.env.NODE_ENV&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?De(2):"`middleware` field must be a callback");if("function"==typeof r){if(u=r(t),"production"!==process.env.NODE_ENV&&!Array.isArray(u))throw new Error("production"===process.env.NODE_ENV?De(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if("production"!==process.env.NODE_ENV&&u.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?De(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;u.forEach(t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?De(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)})}let l=de;o&&(l=me({trace:"production"!==process.env.NODE_ENV,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"===process.env.NODE_ENV?te(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(a));return i=de(...s)(o.dispatch),{...o,dispatch:i}}}(...u),p=Pe(d);if("production"!==process.env.NODE_ENV&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?De(5):"`enhancers` field must be a callback");let f="function"==typeof s?s(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?De(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&f.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?De(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&f.includes(d);return ce(c,a,l(...f))}function De(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ie=n.createContext(void 0),Te=function(t){var n=t.children,r=A.useState(function(e){return e.snackbar});return e.jsxs(Ie.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),A.update(function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t})}},children:[n,e.jsx(o.Snackbar,{open:r.open,message:r.message,severity:r.severity,autoHideDuration:1500,onClose:function(){A.update(function(e){e.snackbar.open=!1})}})]})},Re={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},Ve=function(n){var r=n.actions,i=t.useTheme(),a=E.useState(!1),s=a[0],c=a[1],u=function(){return c(!1)};return e.jsxs(b,{sx:{position:"fixed",bottom:26,right:0,zIndex:1e3},children:[e.jsx(t.Backdrop,{open:s}),e.jsx(g,{ariaLabel:"Custom Help Docs",sx:{position:"absolute",bottom:0,right:40,display:"flex",alignItems:"flex-end","& .MuiFab-primary":{backgroundColor:i.palette.highlight.highlightBlue,borderRadius:"8px",width:"50px",height:"50px",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:i.palette.highlight.highlightBlue}},"& .MuiSpeedDialAction-fab":{margin:"0 0 16px 0","&:not(:last-child)":{marginBottom:"8px"}}},icon:e.jsx(o.Icons.HelpDocsIcon,{size:20}),onClose:u,onOpen:function(){return c(!0)},open:s,direction:"up",children:r.map(function(t){return e.jsx(x,{onClick:function(){var e;null===(e=t.onClick)||void 0===e||e.call(t),u()},icon:e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),FabProps:{sx:{width:"auto",minWidth:"180px",maxWidth:"280px",padding:"8px 12px",boxShadow:"none",height:"40px",borderRadius:"8px",backgroundColor:i.palette.surface.defaultBackground,color:i.palette.text.primary,fontWeight:500,fontFamily:"Heebo",fontSize:"12px",whiteSpace:"nowrap",textAlign:"right",display:"flex",justifyContent:"flex-end",alignItems:"center","&:hover":{backgroundColor:i.palette.surface.defaultBackground}}}},t.name)})})]})},Be=t.styled(t.Stack)(function(e){var t,n=e.theme;return(t={flexDirection:"row",backgroundColor:n.palette.surface.defaultBackground})[n.breakpoints.down("md")]={flexWrap:"wrap"},t}),Le=t.styled(t.Box)(function(e){var t,n=e.theme;return(t={borderRadius:"8px",height:"calc(100vh - 96px)",overflowY:"scroll",width:"100%","&::-webkit-scrollbar":{width:"0.5em",height:"0.2em",backgroundColor:n.palette.surface.defaultBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.primary.light,borderRadius:"3px","&:hover":{backgroundColor:n.palette.primary.main}}})[n.breakpoints.down("md")]={margin:"0px 12px 12px 12px",height:"calc(100vh - 118px)","&::-webkit-scrollbar":{display:"none"}},t}),Fe=[{label:"All",value:null},{label:"REGULAR",value:"R"},{label:"SUPPLEMENTARY",value:"S"}],qe=[{label:"Tuition Fee",value:"tuition_fee"},{label:"Admission Fee",value:"admission_fee"},{label:"Hostel Fee",value:"hostel_fee"},{label:"Transport Fee",value:"transport_fee"},{label:"Exam Fee",value:"exam_fee"},{label:"Other Fee",value:"other_fee"}],Ke=Array.from({length:6},function(e,t){return(new Date).getFullYear()-t});Array.from({length:12},function(e,t){return{label:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1),value:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1)}});Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:function(){return l.BrowserRouter}}),exports.AppLayout=function(r){var i,a=r.actions,s=void 0===a?[]:a,c=r.profileActions,u=void 0===c?[]:c,l=r.children,d=r.institutionData,p=void 0===d?[]:d,f=r.menu,h=r.mainContainerSx,m=r.handleLogout,v=r.userName,b=void 0===v?"":v,g=r.designation,x=void 0===g?"":g,w=r.clientName,E=void 0===w?"":w,k=r.defaultCollapsed,S=void 0===k||k,O=r.helpDocsConfig,_=n.useState(S),P=_[0],A=_[1],D=t.useTheme(),I=t.useMediaQuery(D.breakpoints.down("md"));var T=window.location.pathname.split("/").filter(Boolean).slice(1).join("/").replace(/\/\d+/g,"/:id"),R=(null===(i=null==O?void 0:O["/".concat(T)])||void 0===i?void 0:i.actions)||[];return e.jsxs(Be,{children:[e.jsx(o.Sidebar,{menu:f,collapsed:P,setCollapsed:A}),e.jsxs(y.motion.div,{animate:{width:P?"calc(100% - 84px)":"calc(100% - 278px)"},transition:{duration:.3,ease:"circOut"},style:{margin:"12px 12px 12px 0px",width:I?"100%":"calc(100% - 84px)",display:I?"contents":"block"},children:[e.jsx(o.AppHeader,j({clientName:E,userFullName:b,designation:x,actions:s,profileActions:N([e.jsx(q,{})],u,!0),collapsed:P,showActiveDevices:!1,onLogoutClick:null!=m?m:function(){B.post("/auth-server/auth/logout").then(function(e){C.remove("campx_tenant"),C.remove("campx_session_key"),C.remove("campx_institution"),window.location.href="/"}).catch(function(e){})},institutionsData:p},I&&{profileSx:{width:32,height:32,fontSize:"12px"}})),O&&R.length>0&&e.jsx(Ve,{actions:R}),e.jsx(Le,{sx:j({margin:"12px 0px 0px 0px",backgroundColor:D.palette.surface.paperBackground},h),onClick:function(){A(!0)},children:e.jsx(n.Suspense,{fallback:e.jsx(o.Spinner,{}),children:e.jsx(J,{children:l})})})]})]})},exports.ApplicationStore=A,exports.BatchSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Batch"},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/batches"}))},exports.ChangePassword=F,exports.ChangePasswordDialog=q,exports.ConfirmDialogProvider=$,exports.CourseSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/courses"}))},exports.DepartmentSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"_id",isObjectId:!0}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/departments"}))},exports.EmployeesSelector=function(t){return e.jsx(o.SingleSelect,j({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/employees"}))},exports.ErrorBoundary=J,exports.ExamTypeSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Exam Type",options:Fe},t))},exports.ExamsRegulationSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Regulation"},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/exam-regulations",dbLabelProps:{labelKey:"r.name"},dbValueProps:{valueKey:"r.name"}}))},exports.FeeTypeSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Fee Type",options:null==qe?void 0:qe.map(function(e){return{label:e.label,value:e.value}})},t))},exports.HelpDocs=Ve,exports.HostelBlockSelector=function(t){return e.jsx(o.SingleSelect,j({dbValueProps:{valueKey:"id",isInt:!0},dbLabelProps:{labelKey:"name",subLabelKey:"type",useLabelStartCase:!0,useSubLabelStartCase:!0}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/hostel-blocks"}))},exports.HostelFloorSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},t,{externalAxios:K,optionsApiEndPoint:"dropdowns/floors"}))},exports.HostelRoomSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Hostel Room",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",useLabelStartCase:!0}},t,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:K}))},exports.MonthYearSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Month & Year"},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/month-years"}))},exports.PrintFormatSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/print-formats"}))},exports.ProgramSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/programs"}))},exports.Providers=function(t){var r=t.children,i=t.basename,a=t.theme,s=void 0===a?o.lightTheme:a,c=t.reducers,d=void 0===c?{}:c,p=new u.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),f=I&&T&&R?"/".concat(T,"/").concat(R):"/";n.useEffect(function(){"/"===window.location.pathname&&T&&R&&I&&window.location.replace(window.location.origin+"/".concat(T,"/").concat(R))},[T,I,R]);var y=Ae({reducer:le(d)});return e.jsx(v.Provider,{store:y,children:e.jsx(l.BrowserRouter,{basename:null!=i?i:f,children:e.jsx(u.QueryClientProvider,{client:p,children:e.jsx(o.MuiThemeProvider,{theme:s,children:e.jsx(Te,{children:e.jsx(h.LocalizationProvider,{dateAdapter:m.AdapterDateFns,children:e.jsx($,{children:r})})})})})})})},exports.RegulationSelector=function(t){return e.jsx(o.SingleSelect,j({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},t,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:K}))},exports.SemesterSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},t,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:K}))},exports.SnackbarProvider=Te,exports.StudentSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/students"}))},exports.StudentServicesSelector=function(t){return e.jsx(o.SingleSelect,j({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:K,optionsApiEndPoint:"/dropdowns/student-services"}))},exports.StyledMenuItem=L,exports.YearRangeSelector=function(t){var n=t.suffix,r=void 0===n?null:n,i=t.valueKey,a=void 0===i?"yearRange":i,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["suffix","valueKey"]);return e.jsx(o.SingleSelect,j({label:"Year Range",options:null==Ke?void 0:Ke.map(function(e){return{label:r?"".concat(r," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===a?"".concat(e," - ").concat(e+1):e}})},s))},exports.axios=B,exports.createRsbuildSharedConfig=function(e,t,n){return n.reduce(function(n,r){var o=e[r];return o&&(n[r]=j({singleton:!0,requiredVersion:o,version:o.replace(/^[\^~]/,"")},t.includes(r)?{eager:!0}:{})),n},{})},exports.initialApplicationState=P,exports.institutionCode=T,exports.isDevelopment=D,exports.nonWorkspaceAxios=K,exports.openInNewTab=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=window.location.pathname.split("/"),o=[];!t&&r[1]&&o.push(r[1]),!n&&r[2]&&o.push(r[2]);var i=o.length>0?"/"+o.join("/"):"",a="".concat(window.location.origin).concat(i,"/").concat(e);window.open(a,"_blank")},exports.tenantCode=I,exports.useConfirm=function(){var e=function(){A.update(function(e){e.confirmDialog=Re})};return function(t){var n=t.title,r=t.message,o=t.confirmButtonText,i=t.cancelButtonText,a=t.type,s=void 0===a?"confirm":a;return new Promise(function(t){A.update(function(a){a.confirmDialog={isOpen:!0,title:n,message:r,confirmButtonText:o,cancelButtonText:i,type:s,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}})})}},exports.workspace=R,exports.workspaceApiMapping=V;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{styled as o,MenuItem as r,Stack as i,InputAdornment as a,IconButton as s,CircularProgress as c,Box as u,Alert as l,useTheme as d,Backdrop as p,useMediaQuery as f}from"@mui/material";import*as h from"react";import{useState as m,createContext as v,useEffect as y,Suspense as b}from"react";import{useForm as g,appendErrors as w,Controller as x}from"react-hook-form";import{FormControlWrapper as E,TextField as k,Button as O,DialogButton as N,ConfirmDialog as _,Icons as P,ResourceNotFound as C,InternalServerError as A,NoInterneConnection as S,UnAuthorized as D,Dialog as j,Snackbar as I,MuiThemeProvider as T,lightTheme as V,Sidebar as R,AppHeader as L,Spinner as B,SingleSelect as K}from"@campxdev/react-blueprint";import{Visibility as F,VisibilityOff as $}from"@mui/icons-material";import{toast as M}from"react-toastify";import U from"axios";import{Store as q}from"pullstate";import{useMutation as z,QueryErrorResetBoundary as W,QueryClient as Y,QueryClientProvider as H}from"react-query";import{useNavigate as X,useLocation as G,BrowserRouter as J}from"react-router-dom";export{BrowserRouter}from"react-router-dom";import{validateFieldsNatively as Q,toNestError as Z}from"@hookform/resolvers";import ee from"device-detector-js";import*as te from"yup";import{LocalizationProvider as ne}from"@mui/x-date-pickers";import{AdapterDateFns as oe}from"@mui/x-date-pickers/AdapterDateFns";import{Provider as re}from"react-redux";import{motion as ie}from"framer-motion";import ae from"@mui/material/Box";import se from"@mui/material/SpeedDial";import ce from"@mui/material/SpeedDialAction";var ue=function(){return ue=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ue.apply(this,arguments)};function le(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((o=o.apply(e,t||[])).next())})}function de(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function pe(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}"function"==typeof SuppressedError&&SuppressedError;var he=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=fe({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in r)r[a]&&(i+="; "+a,!0!==r[a]&&(i+="="+r[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(o[s]=t.read(a,s),e===s)break}catch(e){}}return e?o[e]:o}},remove:function(e,t){o(e,"",fe({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,fe({},this.attributes,t))},withConverter:function(t){return e(fe({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),me={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institutionInfo:void 0,asset:void 0},ve=new q(me),ye=window.location.hostname.includes("localhost"),be=window.location.hostname.split(".")[0],ge=window.location.pathname.split("/")[1],we=window.location.pathname.split("/")[2],xe={"student-workspace":"/student-api","faculty-workspace":"/faculty-api","department-workspace":"/department-api","academic-coordinator-workspace":"/academic-coordinator-api","academic-admin-workspace":"/academic-admin-api","hostel-admin-workspace":"/hostel-admin-api","transport-coordinator-workspace":"/transport-coordinator-api","employee-workspace":"/employee-api"},Ee=U.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,headers:{"x-tenant-id":be,"x-institution-code":ge}});Ee.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params);if(!1!==e.workspace&&we&&xe[we]&&"common-workspace"!==we){var n=xe[we];e.url="".concat(n).concat(e.url)}var o=he.get("campx_session_key"),r=he.get("campx_open_payments_key"),i=he.get("campx_student_key");return ye&&o&&e.headers.set("campx_session_key",o),ye&&i&&e.headers.set("campx_student_key",i),r&&e.headers.set("campx_open_payments_key",r),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),ue(ue({},e),{params:t})},function(e){return Promise.reject(e)}),Ee.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,o,r,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422,413].includes(null===(o=e.response)||void 0===o?void 0:o.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(r=e.response)||void 0===r?void 0:r.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var ke=o(r)(function(){return{display:"flex",alignItems:"center",gap:"5px","& .MuiListItemIcon-root":{minWidth:"24px"},"& .MuiSvgIcon-root":{height:"14px",width:"14px"}}});function Oe(o){var r=this,u=o.close,l=m({oldPassword:!1,newPassword:!1,confirmPassword:!1}),d=l[0],p=l[1],f=m(!1),h=f[0],v=f[1],y=g(),b=y.handleSubmit,w=y.control,x=y.reset;return e("form",{onSubmit:b(function(e){return le(r,void 0,void 0,function(){var t,n,o;return de(this,function(r){switch(r.label){case 0:if(v(!0),t=e.oldPassword,n=e.newPassword,o=e.confirmPassword,n!==o)return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ee.post(ye?"https://api.campx.dev/auth-server/auth/change-password":"https://api.campx.in/auth-server/auth/change-password",{oldPassword:t,newPassword:n})];case 2:return r.sent(),M.success("Password Changed Successfully"),v(!1),x(),u(),[3,4];case 3:return r.sent(),v(!1),[3,4];case 4:return[3,6];case 5:M.error("New Password, Confirm Password must be same"),v(!1),r.label=6;case 6:return[2]}})})}),children:e(E,{control:w,children:t(i,{gap:1,direction:"column",children:[[{label:"Old Password",name:"oldPassword"},{label:"New Password",name:"newPassword"},{label:"Confirm Password",name:"confirmPassword"}].map(function(t){return e(n,{children:e(k,{label:t.label,name:t.name,type:d[t.name]?"text":"password",required:!0,InputProps:{endAdornment:e(a,{position:"end",children:e(s,{size:"small",onClick:function(){return p(function(e){var n;return ue(ue({},e),((n={})[t.name]=!e[t.name],n))})},edge:"end",children:d[t.name]?e(F,{}):e($,{})})})}})})}),t(i,{direction:"row",gap:2,sx:{marginTop:"15px"},children:[e(O,{variant:"outlined",onClick:u,children:"Cancel"}),e(O,{type:"submit",variant:"contained",endIcon:h&&e(c,{style:{color:"white"},size:"30px",thickness:1.7}),children:"Submit"})]})]})})})}var Ne=function(){return e(n,{children:e(N,{anchor:function(t){var n=t.open;return e(ke,{onClick:function(){n()},children:"Change Password"})},content:function(t){var n=t.close;return e(Oe,{close:n})},title:"Change Password"})})};function _e(e,t,n){return n.reduce(function(n,o){var r=e[o];return r&&(n[o]=ue({singleton:!0,requiredVersion:r,version:r.replace(/^[\^~]/,"")},t.includes(o)?{eager:!0}:{})),n},{})}var Pe=U.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,workspace:!1,headers:{"x-tenant-id":be,"x-institution-code":ge}});Pe.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params),n=he.get("campx_session_key"),o=he.get("campx_open_payments_key"),r=he.get("campx_student_key");return ye&&n&&e.headers.set("campx_session_key",n),ye&&r&&e.headers.set("campx_student_key",r),o&&e.headers.set("campx_open_payments_key",o),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),ue(ue({},e),{params:t})},function(e){return Promise.reject(e)}),Pe.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,o,r,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422].includes(null===(o=e.response)||void 0===o?void 0:o.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(r=e.response)||void 0===r?void 0:r.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var Ce=v({showConfirmDialog:function(){}}),Ae=function(n){var o=n.children,r=ve.useState(function(e){return e.confirmDialog}),i=function(){ve.update(function(e){e.confirmDialog.isOpen=!1})};return t(Ce.Provider,{value:{showConfirmDialog:function(e,t,n,o,r,i,a){void 0===r&&(r="confirm"),ve.update(function(s){s.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:o,type:r,confirmButtonText:i,cancelButtonText:a}})}},children:[o,e(_,{isOpen:r.isOpen,title:r.title,message:r.message,type:r.type,confirmButtonText:r.confirmButtonText,cancelButtonText:r.cancelButtonText,onConfirm:function(){r.onConfirm(),i()},onCancel:function(){r.onCancel(),i()}})]})};function Se(e,t){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Se(e,t)}var De={error:null},je=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(t=e.call.apply(e,[this].concat(o))||this).state=De,t.resetErrorBoundary=function(){for(var e,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];null==t.props.onReset||(e=t.props).onReset.apply(e,o),t.reset()},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Se(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(De)},n.componentDidCatch=function(e,t){var n,o;null==(n=(o=this.props).onError)||n.call(o,e,t)},n.componentDidUpdate=function(e,t){var n,o,r,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(r=e.resetKeys)&&(r=[]),void 0===(i=s)&&(i=[]),r.length!==i.length||r.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(n=(o=this.props).onResetKeysChange)||n.call(o,e.resetKeys,s),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,r=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(h.isValidElement(r))return r;if("function"==typeof n)return n(i);if(o)return h.createElement(o,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(h.Component),Ie=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(o,r,i){try{return Promise.resolve(function(a,s){try{var c=(t.context&&process.env.NODE_ENV,Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:r}))).then(function(e){return i.shouldUseNativeValidation&&Q({},i),{values:n.rawValues?o:e,errors:{}}}))}catch(e){return s(e)}return c&&c.then?c.then(void 0,s):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:Z((t=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,r=o&&o[t.type];e[t.path]=w(t.path,n,e,t.type,r?[].concat(r,t.message):t.message)}return e},{})),i)};var t,n}))}catch(e){return Promise.reject(e)}}},Te=function(e){return le(void 0,void 0,void 0,function(){var t;return de(this,function(n){switch(n.label){case 0:return e.latitude&&e.longitude?[3,3]:[4,fetch("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB2YCpo1yi107RYj1LdZu2DCcpcO93reFY",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({considerIp:"true"})})];case 1:return[4,n.sent().json()];case 2:t=n.sent(),e.latitude=t.location.lat,e.longitude=t.location.lng,n.label=3;case 3:return[2,Ee.post("/auth-server/auth-v2/login",e,{workspace:!1}).then(function(e){return e.data})]}})})},Ve=te.object().shape({username:te.string().required("Username is required"),password:te.string().required("Password is required")}),Re=function(o){var r=o.close,a=m({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),s=a[0],c=a[1],l=X();y(function(){navigator.geolocation.getCurrentPosition(function(e){c(function(t){return ue(ue({},t),{deviceInformation:ue(ue({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})})}),navigator.permissions.query({name:"geolocation"}).then(function(e){"denied"===e.state&&c(function(e){return ue(ue({},e),{isLocationAllowed:!1})})});var e=(new ee).parse(navigator.userAgent);c(function(t){var n,o,r;return ue(ue({},t),{deviceInformation:ue(ue({},t.deviceInformation),{clientName:(null===(n=e.client)||void 0===n?void 0:n.name)||t.deviceInformation.clientName,os:(null===(o=e.os)||void 0===o?void 0:o.name)||t.deviceInformation.os,osVersion:(null===(r=e.os)||void 0===r?void 0:r.version)||t.deviceInformation.osVersion})})})},[]);var d=g({resolver:Ie(Ve)}),p=d.handleSubmit,f=d.control,h=d.formState.errors,v=z(Te,{onSuccess:function(e){ye&&(he.remove("campx_session_key"),he.set("campx_session_key",e.session.token),r(),l("/".concat(e.session.institutionCode,"/workspace")),window.location.reload())}}),b=v.mutate,w=v.isLoading;return e(n,{children:t(i,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[e(u,{height:"36px",width:"194.8px",children:e(P.CampxFullLogoIcon,{})}),t(i,{gap:"10px",justifyContent:"center",alignItems:"center",children:[e(x,{control:f,render:function(t){var n=t.field;return e(k,{size:"medium",name:"username",sx:{width:"400px"},placeholder:"Enter Username or Email",containerProps:{my:"0"},onChange:n.onChange,label:"Username or Email",error:!!h.username,required:!0})},name:"username"}),e(x,{control:f,render:function(t){var n=t.field;return e(k,{size:"medium",name:"password",sx:{width:"400px"},placeholder:"Enter password",onChange:n.onChange,containerProps:{my:"0"},label:"Password",type:"password",error:!!h.password,required:!0})},name:"password"}),e(O,{type:"submit",color:"primary",variant:"contained",sx:{width:"400px"},onClick:p(function(e){return le(void 0,void 0,void 0,function(){return de(this,function(t){return b(ue(ue(ue({},e),s.deviceInformation),{loginId:e.username,loginType:"USER"})),[2]})})}),disabled:w,loading:w,children:"Login"})]})]})})},Le=o(l)(function(e){var t=e.theme;return{height:"60px",border:"1px solid ".concat(t.palette.error.main),display:"flex",alignItems:"center","& .MuiAlert-message":{padding:0},"& .MuiTypography-root":{margin:0},position:"relative","& .retryBtn":{color:"#661B2A",position:"absolute",right:8,top:8}}}),Be=function(t){var n=G();return e(W,{children:function(o){var r=o.reset;return e(je,{onReset:r,FallbackComponent:Ke,children:t.children},null==n?void 0:n.pathname)}})},Ke=function(n){var o,r,i,a,s,c,l,d=n.error,p=n.resetErrorBoundary;if(null===(o=null==d?void 0:d.response)||void 0===o?void 0:o.status)switch(null===(r=null==d?void 0:d.response)||void 0===r?void 0:r.status){case 401:return e(Fe,{});case 500:return e(A,{resetBoundary:p});case 404:return e(C,{message:null===(a=null===(i=null==d?void 0:d.response)||void 0===i?void 0:i.data)||void 0===a?void 0:a.message})}return"ERR_NETWORK"===(null==d?void 0:d.code)?e(S,{resetBoundary:p}):e(u,{sx:{marginTop:"16px",padding:"20px"},children:t(Le,{severity:"error",children:[null!==(l=null===(c=null===(s=null==d?void 0:d.response)||void 0===s?void 0:s.data)||void 0===c?void 0:c.message)&&void 0!==l?l:null==d?void 0:d.message,e(O,{className:"retryBtn",onClick:function(){return p()},size:"small",color:"error",variant:"outlined",children:"Try Again"})]})})},Fe=function(){var o=X(),r=m(!1),i=r[0],a=r[1],s=he.get("campx_session_key");return e(D,{component:t(n,{children:[e(O,{sx:{marginTop:"20px"},variant:"contained",onClick:function(){"localhost"===window.location.hostname.split(".")[1]?a(!0):s||o("/auth/login")},children:"Click Here To Login"}),e(j,{open:i,onClose:function(){return a(!1)},content:function(t){var n=t.close;return e(Re,{close:n})}})]})})};function $e(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Me=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Ue=()=>Math.random().toString(36).substring(7).split("").join("."),qe={INIT:`@@redux/INIT${Ue()}`,REPLACE:`@@redux/REPLACE${Ue()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ue()}`};function ze(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function We(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function Ye(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=We(e)),t}function He(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$e(2):`Expected the root reducer to be a function. Instead, received: '${Ye(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?$e(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?$e(1):`Expected the enhancer to be a function. Instead, received: '${Ye(n)}'`);return n(He)(e,t)}let o=e,r=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((e,t)=>{a.set(t,e)}))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?$e(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return r}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$e(4):`Expected the listener to be a function. Instead, received: '${Ye(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?$e(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;u();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?$e(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),a.delete(n),i=null}}}function p(e){if(!ze(e))throw new Error("production"===process.env.NODE_ENV?$e(7):`Actions must be plain objects. Instead, the actual type was: '${Ye(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?$e(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?$e(17):`Action "type" property must be a string. Instead, the actual type was: '${Ye(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?$e(9):"Reducers may not dispatch actions.");try{c=!0,r=o(r,e)}finally{c=!1}return(i=a).forEach(e=>{e()}),e}p({type:qe.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$e(10):`Expected the nextReducer to be a function. Instead, received: '${Ye(e)}`);o=e,p({type:qe.REPLACE})},[Me]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?$e(11):`Expected the observer to be an object. Instead, received: '${Ye(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[Me](){return this}}}}}function Xe(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}function Ge(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const r=t[o];"production"!==process.env.NODE_ENV&&void 0===e[r]&&Xe(`No reducer provided for key "${r}"`),"function"==typeof e[r]&&(n[r]=e[r])}const o=Object.keys(n);let r,i;"production"!==process.env.NODE_ENV&&(r={});try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:qe.INIT}))throw new Error("production"===process.env.NODE_ENV?$e(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:qe.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?$e(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${qe.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const o=function(e,t,n,o){const r=Object.keys(t),i=n&&n.type===qe.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===r.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!ze(e))return`The ${i} has unexpected type of "${Ye(e)}". Expected argument to be an object with the following keys: "${r.join('", "')}"`;const a=Object.keys(e).filter(e=>!t.hasOwnProperty(e)&&!o[e]);return a.forEach(e=>{o[e]=!0}),n&&n.type===qe.REPLACE?void 0:a.length>0?`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${r.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,r);o&&Xe(o)}let a=!1;const s={};for(let r=0;r<o.length;r++){const i=o[r],c=n[i],u=e[i],l=c(u,t);if(void 0===l){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?$e(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}s[i]=l,a=a||l!==u}return a=a||o.length!==Object.keys(e).length,a?s:e}}function Je(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Qe(e){return({dispatch:t,getState:n})=>o=>r=>"function"==typeof r?r(t,n,e):o(r)}var Ze=Qe(),et=Qe,tt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Je:Je.apply(null,arguments)};function nt(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function ot(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){}}}var rt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function it(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function at(e,t,n){const o=st(e,t,n);return{detectMutations:()=>ct(e,t,o,n)}}function st(e,t=[],n,o="",r=new Set){const i={value:n};if(!e(n)&&!r.has(n)){r.add(n),i.children={};for(const r in n){const a=o?o+"."+r:r;t.length&&-1!==t.indexOf(a)||(i.children[r]=st(e,t,n[r],a))}}return i}function ct(e,t=[],n,o,r=!1,i=""){const a=n?n.value:void 0,s=a===o;if(r&&!s&&!Number.isNaN(o))return{wasMutated:!0,path:i};if(e(a)||e(o))return{wasMutated:!1};const c={};for(let e in n.children)c[e]=!0;for(let e in o)c[e]=!0;const u=t.length>0;for(let r in c){const a=i?i+"."+r:r;if(u){if(t.some(e=>e instanceof RegExp?e.test(a):a===e))continue}const c=ct(e,t,n.children[r],o[r],s,a);if(c.wasMutated)return c}return{wasMutated:!1}}function ut(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||ze(e)}function lt(e,t="",n=ut,o,r=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const s=null!=o?o(e):Object.entries(e),c=r.length>0;for(const[e,u]of s){const s=t?t+"."+e:e;if(c){if(r.some(e=>e instanceof RegExp?e.test(s):s===e))continue}if(!n(u))return{keyPath:s,value:u};if("object"==typeof u&&(a=lt(u,s,n,o,r,i),a))return a}return i&&dt(e)&&i.add(e),!1}function dt(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!dt(t))return!1;return!0}function pt(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=ut,getEntries:n,ignoredActions:o=[],ignoredActionPaths:r=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>a=>u=>{if(!function(e){return ze(e)&&"type"in e&&"string"==typeof e.type}(u))return a(u);const d=a(u),p=ot();return c||o.length&&-1!==o.indexOf(u.type)||p.measureTime(()=>{const e=lt(u,"",t,n,r,l);if(e){const{keyPath:t,value:n}=e}}),s||(p.measureTime(()=>{const o=lt(e.getState(),"",t,n,i,l);if(o){const{keyPath:e,value:t}=o}}),p.warnIfExceeded()),d}}}function ft(e){return"boolean"==typeof e}var ht=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:r=!0}=e??{};let i=new rt;if(t&&(ft(t)?i.push(Ze):i.push(et(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};ft(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,o,r){return JSON.stringify(e,n(t,r),o)},n=function(e,t){let n=[],o=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]"}),function(r,i){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?o.splice(a,1/0,r):o.push(r),~n.indexOf(i)&&(i=t.call(this,r,i))}else n.push(i);return null==e?i:e.call(this,r,i)}},{isImmutable:o=it,ignoredPaths:r,warnAfter:i=32}=e;const a=at.bind(null,o,r);return({getState:e})=>{let n,o=e(),r=a(o);return i=>s=>{const c=ot();c.measureTime(()=>{if(o=e(),n=r.detectMutations(),r=a(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?bt(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const u=i(s);return c.measureTime(()=>{if(o=e(),n=r.detectMutations(),r=a(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?bt(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(s)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),c.warnIfExceeded(),u}}}}(e))}if(o){let e={};ft(o)||(e=o),i.push(pt(e))}if(r){let e={};ft(r)||(e=r),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=nt}=e;return()=>e=>n=>(t(n),e(n))}(e))}}return i},mt=e=>t=>{setTimeout(t,e)},vt=e=>function(t){const{autoBatch:n=!0}=t??{};let o=new rt(e);return n&&o.push(((e={type:"raf"})=>t=>(...n)=>{const o=t(...n);let r=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:mt(10):"callback"===e.type?e.queueNotification:mt(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(e=>e()))};return Object.assign({},o,{subscribe(e){const t=o.subscribe(()=>r&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return r=!e?.meta?.RTK_autoBatch,i=!r,i&&(a||(a=!0,c(u))),o.dispatch(e)}finally{r=!0}}})})("object"==typeof n?n:void 0)),o};function yt(e){const t=ht(),{reducer:n,middleware:o,devTools:r=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a,enhancers:s}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!ze(n))throw new Error("production"===process.env.NODE_ENV?bt(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=Ge(n)}if("production"!==process.env.NODE_ENV&&o&&"function"!=typeof o)throw new Error("production"===process.env.NODE_ENV?bt(2):"`middleware` field must be a callback");if("function"==typeof o){if(u=o(t),"production"!==process.env.NODE_ENV&&!Array.isArray(u))throw new Error("production"===process.env.NODE_ENV?bt(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if("production"!==process.env.NODE_ENV&&u.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?bt(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;u.forEach(t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?bt(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)})}let l=Je;r&&(l=tt({trace:"production"!==process.env.NODE_ENV,..."object"==typeof r&&r}));const d=function(...e){return t=>(n,o)=>{const r=t(n,o);let i=()=>{throw new Error("production"===process.env.NODE_ENV?$e(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:r.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(a));return i=Je(...s)(r.dispatch),{...r,dispatch:i}}}(...u),p=vt(d);if("production"!==process.env.NODE_ENV&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?bt(5):"`enhancers` field must be a callback");let f="function"==typeof s?s(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?bt(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&f.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?bt(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&f.includes(d);return He(c,a,l(...f))}function bt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var gt=v(void 0),wt=function(n){var o=n.children,r=ve.useState(function(e){return e.snackbar});return t(gt.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),ve.update(function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t})}},children:[o,e(I,{open:r.open,message:r.message,severity:r.severity,autoHideDuration:1500,onClose:function(){ve.update(function(e){e.snackbar.open=!1})}})]})},xt=function(t){var n=t.children,o=t.basename,r=t.theme,i=void 0===r?V:r,a=t.reducers,s=void 0===a?{}:a,c=new Y({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),u=be&&ge&&we?"/".concat(ge,"/").concat(we):"/";y(function(){"/"===window.location.pathname&&ge&&we&&be&&window.location.replace(window.location.origin+"/".concat(ge,"/").concat(we))},[ge,be,we]);var l=yt({reducer:Ge(s)});return e(re,{store:l,children:e(J,{basename:null!=o?o:u,children:e(H,{client:c,children:e(T,{theme:i,children:e(wt,{children:e(ne,{dateAdapter:oe,children:e(Ae,{children:n})})})})})})})},Et={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},kt=function(){var e=function(){ve.update(function(e){e.confirmDialog=Et})};return function(t){var n=t.title,o=t.message,r=t.confirmButtonText,i=t.cancelButtonText,a=t.type,s=void 0===a?"confirm":a;return new Promise(function(t){ve.update(function(a){a.confirmDialog={isOpen:!0,title:n,message:o,confirmButtonText:r,cancelButtonText:i,type:s,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}})})}},Ot=function(n){var o=n.actions,r=d(),i=h.useState(!1),a=i[0],s=i[1],c=function(){return s(!1)};return t(ae,{sx:{position:"fixed",bottom:26,right:0,zIndex:1e3},children:[e(p,{open:a}),e(se,{ariaLabel:"Custom Help Docs",sx:{position:"absolute",bottom:0,right:40,display:"flex",alignItems:"flex-end","& .MuiFab-primary":{backgroundColor:r.palette.highlight.highlightBlue,borderRadius:"8px",width:"50px",height:"50px",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:r.palette.highlight.highlightBlue}},"& .MuiSpeedDialAction-fab":{margin:"0 0 16px 0","&:not(:last-child)":{marginBottom:"8px"}}},icon:e(P.HelpDocsIcon,{size:20}),onClose:c,onOpen:function(){return s(!0)},open:a,direction:"up",children:o.map(function(t){return e(ce,{onClick:function(){var e;null===(e=t.onClick)||void 0===e||e.call(t),c()},icon:e("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),FabProps:{sx:{width:"auto",minWidth:"180px",maxWidth:"280px",padding:"8px 12px",boxShadow:"none",height:"40px",borderRadius:"8px",backgroundColor:r.palette.surface.defaultBackground,color:r.palette.text.primary,fontWeight:500,fontFamily:"Heebo",fontSize:"12px",whiteSpace:"nowrap",textAlign:"right",display:"flex",justifyContent:"flex-end",alignItems:"center","&:hover":{backgroundColor:r.palette.surface.defaultBackground}}}},t.name)})})]})},Nt=function(n){var o,r=n.actions,i=void 0===r?[]:r,a=n.profileActions,s=void 0===a?[]:a,c=n.children,u=n.institutionData,l=void 0===u?[]:u,p=n.menu,h=n.mainContainerSx,v=n.handleLogout,y=n.userName,g=void 0===y?"":y,w=n.designation,x=void 0===w?"":w,E=n.clientName,k=void 0===E?"":E,O=n.defaultCollapsed,N=void 0===O||O,_=n.helpDocsConfig,P=m(N),C=P[0],A=P[1],S=d(),D=f(S.breakpoints.down("md"));var j=window.location.pathname.split("/").filter(Boolean).slice(1).join("/").replace(/\/\d+/g,"/:id"),I=(null===(o=null==_?void 0:_["/".concat(j)])||void 0===o?void 0:o.actions)||[];return t(_t,{children:[e(R,{menu:p,collapsed:C,setCollapsed:A}),t(ie.div,{animate:{width:C?"calc(100% - 84px)":"calc(100% - 278px)"},transition:{duration:.3,ease:"circOut"},style:{margin:"12px 12px 12px 0px",width:D?"100%":"calc(100% - 84px)",display:D?"contents":"block"},children:[e(L,ue({clientName:k,userFullName:g,designation:x,actions:i,profileActions:pe([e(Ne,{})],s,!0),collapsed:C,showActiveDevices:!1,onLogoutClick:null!=v?v:function(){Ee.post("/auth-server/auth/logout").then(function(e){he.remove("campx_tenant"),he.remove("campx_session_key"),he.remove("campx_institution"),window.location.href="/"}).catch(function(e){})},institutionsData:l},D&&{profileSx:{width:32,height:32,fontSize:"12px"}})),_&&I.length>0&&e(Ot,{actions:I}),e(Pt,{sx:ue({margin:"12px 0px 0px 0px",backgroundColor:S.palette.surface.paperBackground},h),onClick:function(){A(!0)},children:e(b,{fallback:e(B,{}),children:e(Be,{children:c})})})]})]})},_t=o(i)(function(e){var t,n=e.theme;return(t={flexDirection:"row",backgroundColor:n.palette.surface.defaultBackground})[n.breakpoints.down("md")]={flexWrap:"wrap"},t}),Pt=o(u)(function(e){var t,n=e.theme;return(t={borderRadius:"8px",height:"calc(100vh - 96px)",overflowY:"scroll",width:"100%","&::-webkit-scrollbar":{width:"0.5em",height:"0.2em",backgroundColor:n.palette.surface.defaultBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.primary.light,borderRadius:"3px","&:hover":{backgroundColor:n.palette.primary.main}}})[n.breakpoints.down("md")]={margin:"0px 12px 12px 12px",height:"calc(100vh - 118px)","&::-webkit-scrollbar":{display:"none"}},t}),Ct=function(t){return e(K,ue({label:"Batch"},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/batches"}))},At=function(t){return e(K,ue({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/courses"}))},St=function(t){return e(K,ue({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"_id",isObjectId:!0}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/departments"}))},Dt=function(t){return e(K,ue({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/employees"}))},jt=function(t){return e(K,ue({label:"Regulation"},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/exam-regulations",dbLabelProps:{labelKey:"r.name"},dbValueProps:{valueKey:"r.name"}}))},It=[{label:"All",value:null},{label:"REGULAR",value:"R"},{label:"SUPPLEMENTARY",value:"S"}],Tt=function(t){return e(K,ue({label:"Exam Type",options:It},t))},Vt=[{label:"Tuition Fee",value:"tuition_fee"},{label:"Admission Fee",value:"admission_fee"},{label:"Hostel Fee",value:"hostel_fee"},{label:"Transport Fee",value:"transport_fee"},{label:"Exam Fee",value:"exam_fee"},{label:"Other Fee",value:"other_fee"}],Rt=Array.from({length:6},function(e,t){return(new Date).getFullYear()-t});Array.from({length:12},function(e,t){return{label:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1),value:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1)}});var Lt=function(t){return e(K,ue({label:"Fee Type",options:null==Vt?void 0:Vt.map(function(e){return{label:e.label,value:e.value}})},t))},Bt=function(t){return e(K,ue({dbValueProps:{valueKey:"id",isInt:!0},dbLabelProps:{labelKey:"name",subLabelKey:"type",useLabelStartCase:!0,useSubLabelStartCase:!0}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/hostel-blocks"}))},Kt=function(t){return e(K,ue({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},t,{externalAxios:Pe,optionsApiEndPoint:"dropdowns/floors"}))},Ft=function(t){return e(K,ue({label:"Hostel Room",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",useLabelStartCase:!0}},t,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:Pe}))},$t=function(t){return e(K,ue({label:"Month & Year"},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/month-years"}))},Mt=function(t){return e(K,ue({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/print-formats"}))},Ut=function(t){return e(K,ue({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/programs"}))},qt=function(t){return e(K,ue({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},t,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:Pe}))},zt=function(t){return e(K,ue({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},t,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:Pe}))},Wt=function(t){return e(K,ue({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/students"}))},Yt=function(t){return e(K,ue({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/student-services"}))},Ht=function(t){var n=t.suffix,o=void 0===n?null:n,r=t.valueKey,i=void 0===r?"yearRange":r,a=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(t,["suffix","valueKey"]);return e(K,ue({label:"Year Range",options:null==Rt?void 0:Rt.map(function(e){return{label:o?"".concat(o," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===i?"".concat(e," - ").concat(e+1):e}})},a))},Xt=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=window.location.pathname.split("/"),r=[];!t&&o[1]&&r.push(o[1]),!n&&o[2]&&r.push(o[2]);var i=r.length>0?"/"+r.join("/"):"",a="".concat(window.location.origin).concat(i,"/").concat(e);window.open(a,"_blank")};export{Nt as AppLayout,ve as ApplicationStore,Ct as BatchSelector,Oe as ChangePassword,Ne as ChangePasswordDialog,Ae as ConfirmDialogProvider,At as CourseSelector,St as DepartmentSelector,Dt as EmployeesSelector,Be as ErrorBoundary,Tt as ExamTypeSelector,jt as ExamsRegulationSelector,Lt as FeeTypeSelector,Ot as HelpDocs,Bt as HostelBlockSelector,Kt as HostelFloorSelector,Ft as HostelRoomSelector,$t as MonthYearSelector,Mt as PrintFormatSelector,Ut as ProgramSelector,xt as Providers,qt as RegulationSelector,zt as SemesterSelector,wt as SnackbarProvider,Wt as StudentSelector,Yt as StudentServicesSelector,ke as StyledMenuItem,Ht as YearRangeSelector,Ee as axios,_e as createRsbuildSharedConfig,me as initialApplicationState,ge as institutionCode,ye as isDevelopment,Pe as nonWorkspaceAxios,Xt as openInNewTab,be as tenantCode,kt as useConfirm,we as workspace,xe as workspaceApiMapping};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{styled as o,MenuItem as r,Stack as i,InputAdornment as a,IconButton as s,CircularProgress as c,Box as u,Alert as l,useTheme as d,Backdrop as p,useMediaQuery as f}from"@mui/material";import*as h from"react";import{useState as m,createContext as v,useEffect as y,Suspense as b}from"react";import{useForm as g,appendErrors as w,Controller as x}from"react-hook-form";import{FormControlWrapper as E,TextField as k,Button as O,DialogButton as N,ConfirmDialog as _,Icons as P,ResourceNotFound as C,InternalServerError as A,NoInterneConnection as S,UnAuthorized as D,Dialog as j,Snackbar as I,MuiThemeProvider as T,lightTheme as V,Sidebar as R,AppHeader as L,Spinner as B,SingleSelect as K}from"@campxdev/react-blueprint";import{Visibility as F,VisibilityOff as $}from"@mui/icons-material";import{toast as M}from"react-toastify";import U from"axios";import{Store as q}from"pullstate";import{useMutation as z,QueryErrorResetBoundary as W,QueryClient as Y,QueryClientProvider as H}from"react-query";import{useNavigate as X,useLocation as G,BrowserRouter as J}from"react-router-dom";export{BrowserRouter}from"react-router-dom";import{validateFieldsNatively as Q,toNestError as Z}from"@hookform/resolvers";import ee from"device-detector-js";import*as te from"yup";import{LocalizationProvider as ne}from"@mui/x-date-pickers";import{AdapterDateFns as oe}from"@mui/x-date-pickers/AdapterDateFns";import{Provider as re}from"react-redux";import{motion as ie}from"framer-motion";import ae from"@mui/material/Box";import se from"@mui/material/SpeedDial";import ce from"@mui/material/SpeedDialAction";var ue=function(){return ue=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ue.apply(this,arguments)};function le(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((o=o.apply(e,t||[])).next())})}function de(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function pe(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}"function"==typeof SuppressedError&&SuppressedError;var he=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=fe({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in r)r[a]&&(i+="; "+a,!0!==r[a]&&(i+="="+r[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(o[s]=t.read(a,s),e===s)break}catch(e){}}return e?o[e]:o}},remove:function(e,t){o(e,"",fe({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,fe({},this.attributes,t))},withConverter:function(t){return e(fe({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),me={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institutionInfo:void 0,asset:void 0},ve=new q(me),ye=window.location.hostname.includes("localhost"),be=window.location.hostname.split(".")[0],ge=window.location.pathname.split("/")[1],we=window.location.pathname.split("/")[2],xe={"student-workspace":"/student-api","faculty-workspace":"/faculty-api","department-workspace":"/department-api","academic-coordinator-workspace":"/academic-coordinator-api","academic-admin-workspace":"/academic-admin-api","hostel-admin-workspace":"/hostel-admin-api","transport-coordinator-workspace":"/transport-coordinator-api","employee-workspace":"/employee-api","librarian-workspace":"/librarian-api"},Ee=U.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,headers:{"x-tenant-id":be,"x-institution-code":ge}});Ee.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params);if(!1!==e.workspace&&we&&xe[we]&&"common-workspace"!==we){var n=xe[we];e.url="".concat(n).concat(e.url)}var o=he.get("campx_session_key"),r=he.get("campx_open_payments_key"),i=he.get("campx_student_key");return ye&&o&&e.headers.set("campx_session_key",o),ye&&i&&e.headers.set("campx_student_key",i),r&&e.headers.set("campx_open_payments_key",r),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),ue(ue({},e),{params:t})},function(e){return Promise.reject(e)}),Ee.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,o,r,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422,413].includes(null===(o=e.response)||void 0===o?void 0:o.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(r=e.response)||void 0===r?void 0:r.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var ke=o(r)(function(){return{display:"flex",alignItems:"center",gap:"5px","& .MuiListItemIcon-root":{minWidth:"24px"},"& .MuiSvgIcon-root":{height:"14px",width:"14px"}}});function Oe(o){var r=this,u=o.close,l=m({oldPassword:!1,newPassword:!1,confirmPassword:!1}),d=l[0],p=l[1],f=m(!1),h=f[0],v=f[1],y=g(),b=y.handleSubmit,w=y.control,x=y.reset;return e("form",{onSubmit:b(function(e){return le(r,void 0,void 0,function(){var t,n,o;return de(this,function(r){switch(r.label){case 0:if(v(!0),t=e.oldPassword,n=e.newPassword,o=e.confirmPassword,n!==o)return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Ee.post(ye?"https://api.campx.dev/auth-server/auth/change-password":"https://api.campx.in/auth-server/auth/change-password",{oldPassword:t,newPassword:n})];case 2:return r.sent(),M.success("Password Changed Successfully"),v(!1),x(),u(),[3,4];case 3:return r.sent(),v(!1),[3,4];case 4:return[3,6];case 5:M.error("New Password, Confirm Password must be same"),v(!1),r.label=6;case 6:return[2]}})})}),children:e(E,{control:w,children:t(i,{gap:1,direction:"column",children:[[{label:"Old Password",name:"oldPassword"},{label:"New Password",name:"newPassword"},{label:"Confirm Password",name:"confirmPassword"}].map(function(t){return e(n,{children:e(k,{label:t.label,name:t.name,type:d[t.name]?"text":"password",required:!0,InputProps:{endAdornment:e(a,{position:"end",children:e(s,{size:"small",onClick:function(){return p(function(e){var n;return ue(ue({},e),((n={})[t.name]=!e[t.name],n))})},edge:"end",children:d[t.name]?e(F,{}):e($,{})})})}})})}),t(i,{direction:"row",gap:2,sx:{marginTop:"15px"},children:[e(O,{variant:"outlined",onClick:u,children:"Cancel"}),e(O,{type:"submit",variant:"contained",endIcon:h&&e(c,{style:{color:"white"},size:"30px",thickness:1.7}),children:"Submit"})]})]})})})}var Ne=function(){return e(n,{children:e(N,{anchor:function(t){var n=t.open;return e(ke,{onClick:function(){n()},children:"Change Password"})},content:function(t){var n=t.close;return e(Oe,{close:n})},title:"Change Password"})})};function _e(e,t,n){return n.reduce(function(n,o){var r=e[o];return r&&(n[o]=ue({singleton:!0,requiredVersion:r,version:r.replace(/^[\^~]/,"")},t.includes(o)?{eager:!0}:{})),n},{})}var Pe=U.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,workspace:!1,headers:{"x-tenant-id":be,"x-institution-code":ge}});Pe.interceptors.request.use(function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map(function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]}))}(null==e?void 0:e.params),n=he.get("campx_session_key"),o=he.get("campx_open_payments_key"),r=he.get("campx_student_key");return ye&&n&&e.headers.set("campx_session_key",n),ye&&r&&e.headers.set("campx_student_key",r),o&&e.headers.set("campx_open_payments_key",o),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),ue(ue({},e),{params:t})},function(e){return Promise.reject(e)}),Pe.interceptors.response.use(function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"}),e},function(e){var t,n,o,r,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422].includes(null===(o=e.response)||void 0===o?void 0:o.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"}),!i&&(null===(r=e.response)||void 0===r?void 0:r.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&ve.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var Ce=v({showConfirmDialog:function(){}}),Ae=function(n){var o=n.children,r=ve.useState(function(e){return e.confirmDialog}),i=function(){ve.update(function(e){e.confirmDialog.isOpen=!1})};return t(Ce.Provider,{value:{showConfirmDialog:function(e,t,n,o,r,i,a){void 0===r&&(r="confirm"),ve.update(function(s){s.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:o,type:r,confirmButtonText:i,cancelButtonText:a}})}},children:[o,e(_,{isOpen:r.isOpen,title:r.title,message:r.message,type:r.type,confirmButtonText:r.confirmButtonText,cancelButtonText:r.cancelButtonText,onConfirm:function(){r.onConfirm(),i()},onCancel:function(){r.onCancel(),i()}})]})};function Se(e,t){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Se(e,t)}var De={error:null},je=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(t=e.call.apply(e,[this].concat(o))||this).state=De,t.resetErrorBoundary=function(){for(var e,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];null==t.props.onReset||(e=t.props).onReset.apply(e,o),t.reset()},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Se(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(De)},n.componentDidCatch=function(e,t){var n,o;null==(n=(o=this.props).onError)||n.call(o,e,t)},n.componentDidUpdate=function(e,t){var n,o,r,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(r=e.resetKeys)&&(r=[]),void 0===(i=s)&&(i=[]),r.length!==i.length||r.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(n=(o=this.props).onResetKeysChange)||n.call(o,e.resetKeys,s),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,r=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(h.isValidElement(r))return r;if("function"==typeof n)return n(i);if(o)return h.createElement(o,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(h.Component),Ie=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(o,r,i){try{return Promise.resolve(function(a,s){try{var c=(t.context&&process.env.NODE_ENV,Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:r}))).then(function(e){return i.shouldUseNativeValidation&&Q({},i),{values:n.rawValues?o:e,errors:{}}}))}catch(e){return s(e)}return c&&c.then?c.then(void 0,s):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:Z((t=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,r=o&&o[t.type];e[t.path]=w(t.path,n,e,t.type,r?[].concat(r,t.message):t.message)}return e},{})),i)};var t,n}))}catch(e){return Promise.reject(e)}}},Te=function(e){return le(void 0,void 0,void 0,function(){var t;return de(this,function(n){switch(n.label){case 0:return e.latitude&&e.longitude?[3,3]:[4,fetch("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB2YCpo1yi107RYj1LdZu2DCcpcO93reFY",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({considerIp:"true"})})];case 1:return[4,n.sent().json()];case 2:t=n.sent(),e.latitude=t.location.lat,e.longitude=t.location.lng,n.label=3;case 3:return[2,Ee.post("/auth-server/auth-v2/login",e,{workspace:!1}).then(function(e){return e.data})]}})})},Ve=te.object().shape({username:te.string().required("Username is required"),password:te.string().required("Password is required")}),Re=function(o){var r=o.close,a=m({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),s=a[0],c=a[1],l=X();y(function(){navigator.geolocation.getCurrentPosition(function(e){c(function(t){return ue(ue({},t),{deviceInformation:ue(ue({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})})}),navigator.permissions.query({name:"geolocation"}).then(function(e){"denied"===e.state&&c(function(e){return ue(ue({},e),{isLocationAllowed:!1})})});var e=(new ee).parse(navigator.userAgent);c(function(t){var n,o,r;return ue(ue({},t),{deviceInformation:ue(ue({},t.deviceInformation),{clientName:(null===(n=e.client)||void 0===n?void 0:n.name)||t.deviceInformation.clientName,os:(null===(o=e.os)||void 0===o?void 0:o.name)||t.deviceInformation.os,osVersion:(null===(r=e.os)||void 0===r?void 0:r.version)||t.deviceInformation.osVersion})})})},[]);var d=g({resolver:Ie(Ve)}),p=d.handleSubmit,f=d.control,h=d.formState.errors,v=z(Te,{onSuccess:function(e){ye&&(he.remove("campx_session_key"),he.set("campx_session_key",e.session.token),r(),l("/".concat(e.session.institutionCode,"/workspace")),window.location.reload())}}),b=v.mutate,w=v.isLoading;return e(n,{children:t(i,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[e(u,{height:"36px",width:"194.8px",children:e(P.CampxFullLogoIcon,{})}),t(i,{gap:"10px",justifyContent:"center",alignItems:"center",children:[e(x,{control:f,render:function(t){var n=t.field;return e(k,{size:"medium",name:"username",sx:{width:"400px"},placeholder:"Enter Username or Email",containerProps:{my:"0"},onChange:n.onChange,label:"Username or Email",error:!!h.username,required:!0})},name:"username"}),e(x,{control:f,render:function(t){var n=t.field;return e(k,{size:"medium",name:"password",sx:{width:"400px"},placeholder:"Enter password",onChange:n.onChange,containerProps:{my:"0"},label:"Password",type:"password",error:!!h.password,required:!0})},name:"password"}),e(O,{type:"submit",color:"primary",variant:"contained",sx:{width:"400px"},onClick:p(function(e){return le(void 0,void 0,void 0,function(){return de(this,function(t){return b(ue(ue(ue({},e),s.deviceInformation),{loginId:e.username,loginType:"USER"})),[2]})})}),disabled:w,loading:w,children:"Login"})]})]})})},Le=o(l)(function(e){var t=e.theme;return{height:"60px",border:"1px solid ".concat(t.palette.error.main),display:"flex",alignItems:"center","& .MuiAlert-message":{padding:0},"& .MuiTypography-root":{margin:0},position:"relative","& .retryBtn":{color:"#661B2A",position:"absolute",right:8,top:8}}}),Be=function(t){var n=G();return e(W,{children:function(o){var r=o.reset;return e(je,{onReset:r,FallbackComponent:Ke,children:t.children},null==n?void 0:n.pathname)}})},Ke=function(n){var o,r,i,a,s,c,l,d=n.error,p=n.resetErrorBoundary;if(null===(o=null==d?void 0:d.response)||void 0===o?void 0:o.status)switch(null===(r=null==d?void 0:d.response)||void 0===r?void 0:r.status){case 401:return e(Fe,{});case 500:return e(A,{resetBoundary:p});case 404:return e(C,{message:null===(a=null===(i=null==d?void 0:d.response)||void 0===i?void 0:i.data)||void 0===a?void 0:a.message})}return"ERR_NETWORK"===(null==d?void 0:d.code)?e(S,{resetBoundary:p}):e(u,{sx:{marginTop:"16px",padding:"20px"},children:t(Le,{severity:"error",children:[null!==(l=null===(c=null===(s=null==d?void 0:d.response)||void 0===s?void 0:s.data)||void 0===c?void 0:c.message)&&void 0!==l?l:null==d?void 0:d.message,e(O,{className:"retryBtn",onClick:function(){return p()},size:"small",color:"error",variant:"outlined",children:"Try Again"})]})})},Fe=function(){var o=X(),r=m(!1),i=r[0],a=r[1],s=he.get("campx_session_key");return e(D,{component:t(n,{children:[e(O,{sx:{marginTop:"20px"},variant:"contained",onClick:function(){"localhost"===window.location.hostname.split(".")[1]?a(!0):s||o("/auth/login")},children:"Click Here To Login"}),e(j,{open:i,onClose:function(){return a(!1)},content:function(t){var n=t.close;return e(Re,{close:n})}})]})})};function $e(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Me=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Ue=()=>Math.random().toString(36).substring(7).split("").join("."),qe={INIT:`@@redux/INIT${Ue()}`,REPLACE:`@@redux/REPLACE${Ue()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ue()}`};function ze(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function We(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function Ye(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=We(e)),t}function He(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$e(2):`Expected the root reducer to be a function. Instead, received: '${Ye(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?$e(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?$e(1):`Expected the enhancer to be a function. Instead, received: '${Ye(n)}'`);return n(He)(e,t)}let o=e,r=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach((e,t)=>{a.set(t,e)}))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?$e(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return r}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$e(4):`Expected the listener to be a function. Instead, received: '${Ye(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?$e(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;u();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?$e(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),a.delete(n),i=null}}}function p(e){if(!ze(e))throw new Error("production"===process.env.NODE_ENV?$e(7):`Actions must be plain objects. Instead, the actual type was: '${Ye(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?$e(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?$e(17):`Action "type" property must be a string. Instead, the actual type was: '${Ye(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?$e(9):"Reducers may not dispatch actions.");try{c=!0,r=o(r,e)}finally{c=!1}return(i=a).forEach(e=>{e()}),e}p({type:qe.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$e(10):`Expected the nextReducer to be a function. Instead, received: '${Ye(e)}`);o=e,p({type:qe.REPLACE})},[Me]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?$e(11):`Expected the observer to be an object. Instead, received: '${Ye(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[Me](){return this}}}}}function Xe(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}function Ge(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const r=t[o];"production"!==process.env.NODE_ENV&&void 0===e[r]&&Xe(`No reducer provided for key "${r}"`),"function"==typeof e[r]&&(n[r]=e[r])}const o=Object.keys(n);let r,i;"production"!==process.env.NODE_ENV&&(r={});try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:qe.INIT}))throw new Error("production"===process.env.NODE_ENV?$e(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:qe.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?$e(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${qe.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const o=function(e,t,n,o){const r=Object.keys(t),i=n&&n.type===qe.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===r.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!ze(e))return`The ${i} has unexpected type of "${Ye(e)}". Expected argument to be an object with the following keys: "${r.join('", "')}"`;const a=Object.keys(e).filter(e=>!t.hasOwnProperty(e)&&!o[e]);return a.forEach(e=>{o[e]=!0}),n&&n.type===qe.REPLACE?void 0:a.length>0?`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${r.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,r);o&&Xe(o)}let a=!1;const s={};for(let r=0;r<o.length;r++){const i=o[r],c=n[i],u=e[i],l=c(u,t);if(void 0===l){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?$e(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}s[i]=l,a=a||l!==u}return a=a||o.length!==Object.keys(e).length,a?s:e}}function Je(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Qe(e){return({dispatch:t,getState:n})=>o=>r=>"function"==typeof r?r(t,n,e):o(r)}var Ze=Qe(),et=Qe,tt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Je:Je.apply(null,arguments)};function nt(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function ot(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){}}}var rt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function it(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function at(e,t,n){const o=st(e,t,n);return{detectMutations:()=>ct(e,t,o,n)}}function st(e,t=[],n,o="",r=new Set){const i={value:n};if(!e(n)&&!r.has(n)){r.add(n),i.children={};for(const r in n){const a=o?o+"."+r:r;t.length&&-1!==t.indexOf(a)||(i.children[r]=st(e,t,n[r],a))}}return i}function ct(e,t=[],n,o,r=!1,i=""){const a=n?n.value:void 0,s=a===o;if(r&&!s&&!Number.isNaN(o))return{wasMutated:!0,path:i};if(e(a)||e(o))return{wasMutated:!1};const c={};for(let e in n.children)c[e]=!0;for(let e in o)c[e]=!0;const u=t.length>0;for(let r in c){const a=i?i+"."+r:r;if(u){if(t.some(e=>e instanceof RegExp?e.test(a):a===e))continue}const c=ct(e,t,n.children[r],o[r],s,a);if(c.wasMutated)return c}return{wasMutated:!1}}function ut(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||ze(e)}function lt(e,t="",n=ut,o,r=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const s=null!=o?o(e):Object.entries(e),c=r.length>0;for(const[e,u]of s){const s=t?t+"."+e:e;if(c){if(r.some(e=>e instanceof RegExp?e.test(s):s===e))continue}if(!n(u))return{keyPath:s,value:u};if("object"==typeof u&&(a=lt(u,s,n,o,r,i),a))return a}return i&&dt(e)&&i.add(e),!1}function dt(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!dt(t))return!1;return!0}function pt(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=ut,getEntries:n,ignoredActions:o=[],ignoredActionPaths:r=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>a=>u=>{if(!function(e){return ze(e)&&"type"in e&&"string"==typeof e.type}(u))return a(u);const d=a(u),p=ot();return c||o.length&&-1!==o.indexOf(u.type)||p.measureTime(()=>{const e=lt(u,"",t,n,r,l);if(e){const{keyPath:t,value:n}=e}}),s||(p.measureTime(()=>{const o=lt(e.getState(),"",t,n,i,l);if(o){const{keyPath:e,value:t}=o}}),p.warnIfExceeded()),d}}}function ft(e){return"boolean"==typeof e}var ht=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:r=!0}=e??{};let i=new rt;if(t&&(ft(t)?i.push(Ze):i.push(et(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};ft(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,o,r){return JSON.stringify(e,n(t,r),o)},n=function(e,t){let n=[],o=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]"}),function(r,i){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?o.splice(a,1/0,r):o.push(r),~n.indexOf(i)&&(i=t.call(this,r,i))}else n.push(i);return null==e?i:e.call(this,r,i)}},{isImmutable:o=it,ignoredPaths:r,warnAfter:i=32}=e;const a=at.bind(null,o,r);return({getState:e})=>{let n,o=e(),r=a(o);return i=>s=>{const c=ot();c.measureTime(()=>{if(o=e(),n=r.detectMutations(),r=a(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?bt(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const u=i(s);return c.measureTime(()=>{if(o=e(),n=r.detectMutations(),r=a(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?bt(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(s)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),c.warnIfExceeded(),u}}}}(e))}if(o){let e={};ft(o)||(e=o),i.push(pt(e))}if(r){let e={};ft(r)||(e=r),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=nt}=e;return()=>e=>n=>(t(n),e(n))}(e))}}return i},mt=e=>t=>{setTimeout(t,e)},vt=e=>function(t){const{autoBatch:n=!0}=t??{};let o=new rt(e);return n&&o.push(((e={type:"raf"})=>t=>(...n)=>{const o=t(...n);let r=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:mt(10):"callback"===e.type?e.queueNotification:mt(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(e=>e()))};return Object.assign({},o,{subscribe(e){const t=o.subscribe(()=>r&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return r=!e?.meta?.RTK_autoBatch,i=!r,i&&(a||(a=!0,c(u))),o.dispatch(e)}finally{r=!0}}})})("object"==typeof n?n:void 0)),o};function yt(e){const t=ht(),{reducer:n,middleware:o,devTools:r=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a,enhancers:s}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!ze(n))throw new Error("production"===process.env.NODE_ENV?bt(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=Ge(n)}if("production"!==process.env.NODE_ENV&&o&&"function"!=typeof o)throw new Error("production"===process.env.NODE_ENV?bt(2):"`middleware` field must be a callback");if("function"==typeof o){if(u=o(t),"production"!==process.env.NODE_ENV&&!Array.isArray(u))throw new Error("production"===process.env.NODE_ENV?bt(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if("production"!==process.env.NODE_ENV&&u.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?bt(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;u.forEach(t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?bt(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)})}let l=Je;r&&(l=tt({trace:"production"!==process.env.NODE_ENV,..."object"==typeof r&&r}));const d=function(...e){return t=>(n,o)=>{const r=t(n,o);let i=()=>{throw new Error("production"===process.env.NODE_ENV?$e(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:r.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(a));return i=Je(...s)(r.dispatch),{...r,dispatch:i}}}(...u),p=vt(d);if("production"!==process.env.NODE_ENV&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?bt(5):"`enhancers` field must be a callback");let f="function"==typeof s?s(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?bt(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&f.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?bt(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&f.includes(d);return He(c,a,l(...f))}function bt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var gt=v(void 0),wt=function(n){var o=n.children,r=ve.useState(function(e){return e.snackbar});return t(gt.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),ve.update(function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t})}},children:[o,e(I,{open:r.open,message:r.message,severity:r.severity,autoHideDuration:1500,onClose:function(){ve.update(function(e){e.snackbar.open=!1})}})]})},xt=function(t){var n=t.children,o=t.basename,r=t.theme,i=void 0===r?V:r,a=t.reducers,s=void 0===a?{}:a,c=new Y({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),u=be&&ge&&we?"/".concat(ge,"/").concat(we):"/";y(function(){"/"===window.location.pathname&&ge&&we&&be&&window.location.replace(window.location.origin+"/".concat(ge,"/").concat(we))},[ge,be,we]);var l=yt({reducer:Ge(s)});return e(re,{store:l,children:e(J,{basename:null!=o?o:u,children:e(H,{client:c,children:e(T,{theme:i,children:e(wt,{children:e(ne,{dateAdapter:oe,children:e(Ae,{children:n})})})})})})})},Et={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},kt=function(){var e=function(){ve.update(function(e){e.confirmDialog=Et})};return function(t){var n=t.title,o=t.message,r=t.confirmButtonText,i=t.cancelButtonText,a=t.type,s=void 0===a?"confirm":a;return new Promise(function(t){ve.update(function(a){a.confirmDialog={isOpen:!0,title:n,message:o,confirmButtonText:r,cancelButtonText:i,type:s,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}})})}},Ot=function(n){var o=n.actions,r=d(),i=h.useState(!1),a=i[0],s=i[1],c=function(){return s(!1)};return t(ae,{sx:{position:"fixed",bottom:26,right:0,zIndex:1e3},children:[e(p,{open:a}),e(se,{ariaLabel:"Custom Help Docs",sx:{position:"absolute",bottom:0,right:40,display:"flex",alignItems:"flex-end","& .MuiFab-primary":{backgroundColor:r.palette.highlight.highlightBlue,borderRadius:"8px",width:"50px",height:"50px",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:r.palette.highlight.highlightBlue}},"& .MuiSpeedDialAction-fab":{margin:"0 0 16px 0","&:not(:last-child)":{marginBottom:"8px"}}},icon:e(P.HelpDocsIcon,{size:20}),onClose:c,onOpen:function(){return s(!0)},open:a,direction:"up",children:o.map(function(t){return e(ce,{onClick:function(){var e;null===(e=t.onClick)||void 0===e||e.call(t),c()},icon:e("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),FabProps:{sx:{width:"auto",minWidth:"180px",maxWidth:"280px",padding:"8px 12px",boxShadow:"none",height:"40px",borderRadius:"8px",backgroundColor:r.palette.surface.defaultBackground,color:r.palette.text.primary,fontWeight:500,fontFamily:"Heebo",fontSize:"12px",whiteSpace:"nowrap",textAlign:"right",display:"flex",justifyContent:"flex-end",alignItems:"center","&:hover":{backgroundColor:r.palette.surface.defaultBackground}}}},t.name)})})]})},Nt=function(n){var o,r=n.actions,i=void 0===r?[]:r,a=n.profileActions,s=void 0===a?[]:a,c=n.children,u=n.institutionData,l=void 0===u?[]:u,p=n.menu,h=n.mainContainerSx,v=n.handleLogout,y=n.userName,g=void 0===y?"":y,w=n.designation,x=void 0===w?"":w,E=n.clientName,k=void 0===E?"":E,O=n.defaultCollapsed,N=void 0===O||O,_=n.helpDocsConfig,P=m(N),C=P[0],A=P[1],S=d(),D=f(S.breakpoints.down("md"));var j=window.location.pathname.split("/").filter(Boolean).slice(1).join("/").replace(/\/\d+/g,"/:id"),I=(null===(o=null==_?void 0:_["/".concat(j)])||void 0===o?void 0:o.actions)||[];return t(_t,{children:[e(R,{menu:p,collapsed:C,setCollapsed:A}),t(ie.div,{animate:{width:C?"calc(100% - 84px)":"calc(100% - 278px)"},transition:{duration:.3,ease:"circOut"},style:{margin:"12px 12px 12px 0px",width:D?"100%":"calc(100% - 84px)",display:D?"contents":"block"},children:[e(L,ue({clientName:k,userFullName:g,designation:x,actions:i,profileActions:pe([e(Ne,{})],s,!0),collapsed:C,showActiveDevices:!1,onLogoutClick:null!=v?v:function(){Ee.post("/auth-server/auth/logout").then(function(e){he.remove("campx_tenant"),he.remove("campx_session_key"),he.remove("campx_institution"),window.location.href="/"}).catch(function(e){})},institutionsData:l},D&&{profileSx:{width:32,height:32,fontSize:"12px"}})),_&&I.length>0&&e(Ot,{actions:I}),e(Pt,{sx:ue({margin:"12px 0px 0px 0px",backgroundColor:S.palette.surface.paperBackground},h),onClick:function(){A(!0)},children:e(b,{fallback:e(B,{}),children:e(Be,{children:c})})})]})]})},_t=o(i)(function(e){var t,n=e.theme;return(t={flexDirection:"row",backgroundColor:n.palette.surface.defaultBackground})[n.breakpoints.down("md")]={flexWrap:"wrap"},t}),Pt=o(u)(function(e){var t,n=e.theme;return(t={borderRadius:"8px",height:"calc(100vh - 96px)",overflowY:"scroll",width:"100%","&::-webkit-scrollbar":{width:"0.5em",height:"0.2em",backgroundColor:n.palette.surface.defaultBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.primary.light,borderRadius:"3px","&:hover":{backgroundColor:n.palette.primary.main}}})[n.breakpoints.down("md")]={margin:"0px 12px 12px 12px",height:"calc(100vh - 118px)","&::-webkit-scrollbar":{display:"none"}},t}),Ct=function(t){return e(K,ue({label:"Batch"},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/batches"}))},At=function(t){return e(K,ue({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/courses"}))},St=function(t){return e(K,ue({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"_id",isObjectId:!0}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/departments"}))},Dt=function(t){return e(K,ue({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/employees"}))},jt=function(t){return e(K,ue({label:"Regulation"},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/exam-regulations",dbLabelProps:{labelKey:"r.name"},dbValueProps:{valueKey:"r.name"}}))},It=[{label:"All",value:null},{label:"REGULAR",value:"R"},{label:"SUPPLEMENTARY",value:"S"}],Tt=function(t){return e(K,ue({label:"Exam Type",options:It},t))},Vt=[{label:"Tuition Fee",value:"tuition_fee"},{label:"Admission Fee",value:"admission_fee"},{label:"Hostel Fee",value:"hostel_fee"},{label:"Transport Fee",value:"transport_fee"},{label:"Exam Fee",value:"exam_fee"},{label:"Other Fee",value:"other_fee"}],Rt=Array.from({length:6},function(e,t){return(new Date).getFullYear()-t});Array.from({length:12},function(e,t){return{label:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1),value:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1)}});var Lt=function(t){return e(K,ue({label:"Fee Type",options:null==Vt?void 0:Vt.map(function(e){return{label:e.label,value:e.value}})},t))},Bt=function(t){return e(K,ue({dbValueProps:{valueKey:"id",isInt:!0},dbLabelProps:{labelKey:"name",subLabelKey:"type",useLabelStartCase:!0,useSubLabelStartCase:!0}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/hostel-blocks"}))},Kt=function(t){return e(K,ue({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},t,{externalAxios:Pe,optionsApiEndPoint:"dropdowns/floors"}))},Ft=function(t){return e(K,ue({label:"Hostel Room",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",useLabelStartCase:!0}},t,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:Pe}))},$t=function(t){return e(K,ue({label:"Month & Year"},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/month-years"}))},Mt=function(t){return e(K,ue({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/print-formats"}))},Ut=function(t){return e(K,ue({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/programs"}))},qt=function(t){return e(K,ue({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},t,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:Pe}))},zt=function(t){return e(K,ue({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},t,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:Pe}))},Wt=function(t){return e(K,ue({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/students"}))},Yt=function(t){return e(K,ue({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},t,{externalAxios:Pe,optionsApiEndPoint:"/dropdowns/student-services"}))},Ht=function(t){var n=t.suffix,o=void 0===n?null:n,r=t.valueKey,i=void 0===r?"yearRange":r,a=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(t,["suffix","valueKey"]);return e(K,ue({label:"Year Range",options:null==Rt?void 0:Rt.map(function(e){return{label:o?"".concat(o," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===i?"".concat(e," - ").concat(e+1):e}})},a))},Xt=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=window.location.pathname.split("/"),r=[];!t&&o[1]&&r.push(o[1]),!n&&o[2]&&r.push(o[2]);var i=r.length>0?"/"+r.join("/"):"",a="".concat(window.location.origin).concat(i,"/").concat(e);window.open(a,"_blank")};export{Nt as AppLayout,ve as ApplicationStore,Ct as BatchSelector,Oe as ChangePassword,Ne as ChangePasswordDialog,Ae as ConfirmDialogProvider,At as CourseSelector,St as DepartmentSelector,Dt as EmployeesSelector,Be as ErrorBoundary,Tt as ExamTypeSelector,jt as ExamsRegulationSelector,Lt as FeeTypeSelector,Ot as HelpDocs,Bt as HostelBlockSelector,Kt as HostelFloorSelector,Ft as HostelRoomSelector,$t as MonthYearSelector,Mt as PrintFormatSelector,Ut as ProgramSelector,xt as Providers,qt as RegulationSelector,zt as SemesterSelector,wt as SnackbarProvider,Wt as StudentSelector,Yt as StudentServicesSelector,ke as StyledMenuItem,Ht as YearRangeSelector,Ee as axios,_e as createRsbuildSharedConfig,me as initialApplicationState,ge as institutionCode,ye as isDevelopment,Pe as nonWorkspaceAxios,Xt as openInNewTab,be as tenantCode,kt as useConfirm,we as workspace,xe as workspaceApiMapping};
|
|
2
2
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/campx-web-utils",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"author": "CampX",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"private": false,
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@campxdev/react-blueprint": ">=2.3.
|
|
23
|
+
"@campxdev/react-blueprint": ">=2.3.11",
|
|
24
24
|
"@emotion/react": "^11.14.0",
|
|
25
25
|
"@emotion/styled": "^11.14.0",
|
|
26
26
|
"@mui/icons-material": "^7.0.2",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-router-dom": "^6.24.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@campxdev/react-blueprint": "2.3.
|
|
34
|
+
"@campxdev/react-blueprint": "2.3.11",
|
|
35
35
|
"@hookform/resolvers": "^2.9.10",
|
|
36
36
|
"@mui/x-date-pickers": "^8.1.0",
|
|
37
37
|
"axios": "^1.7.2",
|
package/src/utils/constants.ts
CHANGED
|
@@ -16,4 +16,5 @@ export const workspaceApiMapping: Record<string, string> = {
|
|
|
16
16
|
'hostel-admin-workspace': '/hostel-admin-api',
|
|
17
17
|
'transport-coordinator-workspace': '/transport-coordinator-api',
|
|
18
18
|
'employee-workspace': '/employee-api',
|
|
19
|
+
'librarian-workspace': '/librarian-api',
|
|
19
20
|
};
|