diff --git a/assets/index-gCiHLB0U.js b/assets/index-Be0BpSb8.js similarity index 99% rename from assets/index-gCiHLB0U.js rename to assets/index-Be0BpSb8.js index c4ee8d3..8474acb 100644 --- a/assets/index-gCiHLB0U.js +++ b/assets/index-Be0BpSb8.js @@ -50,7 +50,7 @@ Error generating stack: `+o.message+` The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=qT,t.componentWillReceiveProps=XT),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=YT;var s=t.componentDidUpdate;t.componentDidUpdate=function(u,d,f){var h=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;s.call(this,u,d,h)}}return e}const Ij=Object.freeze(Object.defineProperty({__proto__:null,polyfill:Cj},Symbol.toStringTag,{value:"Module"})),kj=["xxl","xl","lg","md","sm","xs"],Mj="xs",v0=F.createContext({prefixes:{},breakpoints:kj,minBreakpoint:Mj});function ut(e,t){const{prefixes:n}=F.useContext(v0);return e||n[t]||t}function QT(){const{breakpoints:e}=F.useContext(v0);return e}function JT(){const{minBreakpoint:e}=F.useContext(v0);return e}var ZT={exports:{}},$j="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Nj=$j,jj=Nj;function eP(){}function tP(){}tP.resetWarningCache=eP;var Dj=function(){function e(r,i,o,a,s,l){if(l!==jj){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:tP,resetWarningCache:eP};return n.PropTypes=n,n};ZT.exports=Dj();var m0=ZT.exports;const oe=$e(m0),Rj=["as","disabled"];function Lj(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function Uj(e){return!e||e.trim()==="#"}function nP({tagName:e,disabled:t,href:n,target:r,rel:i,role:o,onClick:a,tabIndex:s=0,type:l}){e||(n!=null||r!=null||i!=null?e="a":e="button");const u={tagName:e};if(e==="button")return[{type:l||"button",disabled:t},u];const d=h=>{if((t||e==="a"&&Uj(n))&&h.preventDefault(),t){h.stopPropagation();return}a==null||a(h)},f=h=>{h.key===" "&&(h.preventDefault(),d(h))};return e==="a"&&(n||(n="#"),t&&(n=void 0)),[{role:o??"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:e==="a"?r:void 0,"aria-disabled":t||void 0,rel:e==="a"?i:void 0,onClick:d,onKeyDown:f},u]}const Fj=F.forwardRef((e,t)=>{let{as:n,disabled:r}=e,i=Lj(e,Rj);const[o,{tagName:a}]=nP(Object.assign({tagName:n,disabled:r},i));return U.jsx(a,Object.assign({},i,o,{ref:t}))});Fj.displayName="Button";const Sl=F.forwardRef(({as:e,bsPrefix:t,variant:n="primary",size:r,active:i=!1,disabled:o=!1,className:a,...s},l)=>{const u=ut(t,"btn"),[d,{tagName:f}]=nP({tagName:e,disabled:o,...s}),h=f;return U.jsx(h,{...d,...s,ref:l,disabled:o,className:nt(a,u,i&&"active",n&&`${u}-${n}`,r&&`${u}-${r}`,s.href&&o&&"disabled")})});Sl.displayName="Button";function Bj(e,t){return F.Children.toArray(e).some(n=>F.isValidElement(n)&&n.type===t)}function zj({as:e,bsPrefix:t,className:n,...r}){t=ut(t,"col");const i=QT(),o=JT(),a=[],s=[];return i.forEach(l=>{const u=r[l];delete r[l];let d,f,h;typeof u=="object"&&u!=null?{span:d,offset:f,order:h}=u:d=u;const p=l!==o?`-${l}`:"";d&&a.push(d===!0?`${t}${p}`:`${t}${p}-${d}`),h!=null&&s.push(`order${p}-${h}`),f!=null&&s.push(`offset${p}-${f}`)}),[{...r,className:nt(n,...a,...s)},{as:e,bsPrefix:t,spans:a}]}const Aa=F.forwardRef((e,t)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:a}]=zj(e);return U.jsx(i,{...r,ref:t,className:nt(n,!a.length&&o)})});Aa.displayName="Col";const g0=F.forwardRef(({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...i},o)=>{const a=ut(e,"container"),s=typeof t=="string"?`-${t}`:"-fluid";return U.jsx(n,{ref:o,...i,className:nt(r,t?`${a}${s}`:a)})});g0.displayName="Container";var Wj=function(){},Vj=Wj;const rP=F.createContext(null);rP.displayName="InputGroupContext";oe.string,oe.bool,oe.bool,oe.bool,oe.bool;const iP=F.forwardRef(({bsPrefix:e,className:t,fluid:n=!1,rounded:r=!1,roundedCircle:i=!1,thumbnail:o=!1,...a},s)=>(e=ut(e,"img"),U.jsx("img",{ref:s,...a,className:nt(t,n&&`${e}-fluid`,r&&"rounded",i&&"rounded-circle",o&&`${e}-thumbnail`)})));iP.displayName="Image";const Hj={type:oe.string,tooltip:oe.bool,as:oe.elementType},Sh=F.forwardRef(({as:e="div",className:t,type:n="valid",tooltip:r=!1,...i},o)=>U.jsx(e,{...i,ref:o,className:nt(t,`${n}-${r?"tooltip":"feedback"}`)}));Sh.displayName="Feedback";Sh.propTypes=Hj;const ei=F.createContext({}),Wu=F.forwardRef(({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:i=!1,isInvalid:o=!1,as:a="input",...s},l)=>{const{controlId:u}=F.useContext(ei);return t=ut(t,"form-check-input"),U.jsx(a,{...s,ref:l,type:r,id:e||u,className:nt(n,t,i&&"is-valid",o&&"is-invalid")})});Wu.displayName="FormCheckInput";const qf=F.forwardRef(({bsPrefix:e,className:t,htmlFor:n,...r},i)=>{const{controlId:o}=F.useContext(ei);return e=ut(e,"form-check-label"),U.jsx("label",{...r,ref:i,htmlFor:n||o,className:nt(t,e)})});qf.displayName="FormCheckLabel";const oP=F.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:r=!1,reverse:i=!1,disabled:o=!1,isValid:a=!1,isInvalid:s=!1,feedbackTooltip:l=!1,feedback:u,feedbackType:d,className:f,style:h,title:p="",type:v="checkbox",label:g,children:b,as:S="input",...y},_)=>{t=ut(t,"form-check"),n=ut(n,"form-switch");const{controlId:w}=F.useContext(ei),A=F.useMemo(()=>({controlId:e||w}),[w,e]),C=!b&&g!=null&&g!==!1||Bj(b,qf),E=U.jsx(Wu,{...y,type:v==="switch"?"checkbox":v,ref:_,isValid:a,isInvalid:s,disabled:o,as:S});return U.jsx(ei.Provider,{value:A,children:U.jsx("div",{style:h,className:nt(f,C&&t,r&&`${t}-inline`,i&&`${t}-reverse`,v==="switch"&&n),children:b||U.jsxs(U.Fragment,{children:[E,C&&U.jsx(qf,{title:p,children:g}),u&&U.jsx(Sh,{type:d,tooltip:l,children:u})]})})})});oP.displayName="FormCheck";const Xf=Object.assign(oP,{Input:Wu,Label:qf}),aP=F.forwardRef(({bsPrefix:e,type:t,size:n,htmlSize:r,id:i,className:o,isValid:a=!1,isInvalid:s=!1,plaintext:l,readOnly:u,as:d="input",...f},h)=>{const{controlId:p}=F.useContext(ei);return e=ut(e,"form-control"),U.jsx(d,{...f,type:t,size:r,ref:h,readOnly:u,id:i||p,className:nt(o,l?`${e}-plaintext`:e,n&&`${e}-${n}`,t==="color"&&`${e}-color`,a&&"is-valid",s&&"is-invalid")})});aP.displayName="FormControl";const Gj=Object.assign(aP,{Feedback:Sh}),sP=F.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},i)=>(t=ut(t,"form-floating"),U.jsx(n,{ref:i,className:nt(e,t),...r})));sP.displayName="FormFloating";const y0=F.forwardRef(({controlId:e,as:t="div",...n},r)=>{const i=F.useMemo(()=>({controlId:e}),[e]);return U.jsx(ei.Provider,{value:i,children:U.jsx(t,{...n,ref:r})})});y0.displayName="FormGroup";const lP=F.forwardRef(({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:i,htmlFor:o,...a},s)=>{const{controlId:l}=F.useContext(ei);t=ut(t,"form-label");let u="col-form-label";typeof n=="string"&&(u=`${u} ${u}-${n}`);const d=nt(i,t,r&&"visually-hidden",n&&u);return o=o||l,n?U.jsx(Aa,{ref:s,as:"label",className:d,htmlFor:o,...a}):U.jsx(e,{ref:s,className:d,htmlFor:o,...a})});lP.displayName="FormLabel";const uP=F.forwardRef(({bsPrefix:e,className:t,id:n,...r},i)=>{const{controlId:o}=F.useContext(ei);return e=ut(e,"form-range"),U.jsx("input",{...r,type:"range",ref:i,className:nt(t,e),id:n||o})});uP.displayName="FormRange";const cP=F.forwardRef(({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:i=!1,isInvalid:o=!1,id:a,...s},l)=>{const{controlId:u}=F.useContext(ei);return e=ut(e,"form-select"),U.jsx("select",{...s,size:n,ref:l,className:nt(r,e,t&&`${e}-${t}`,i&&"is-valid",o&&"is-invalid"),id:a||u})});cP.displayName="FormSelect";const fP=F.forwardRef(({bsPrefix:e,className:t,as:n="small",muted:r,...i},o)=>(e=ut(e,"form-text"),U.jsx(n,{...i,ref:o,className:nt(t,e,r&&"text-muted")})));fP.displayName="FormText";const dP=F.forwardRef((e,t)=>U.jsx(Xf,{...e,ref:t,type:"switch"}));dP.displayName="Switch";const Kj=Object.assign(dP,{Input:Xf.Input,Label:Xf.Label}),hP=F.forwardRef(({bsPrefix:e,className:t,children:n,controlId:r,label:i,...o},a)=>(e=ut(e,"form-floating"),U.jsxs(y0,{ref:a,className:nt(t,e),controlId:r,...o,children:[n,U.jsx("label",{htmlFor:r,children:i})]})));hP.displayName="FloatingLabel";const qj={_ref:oe.any,validated:oe.bool,as:oe.elementType},b0=F.forwardRef(({className:e,validated:t,as:n="form",...r},i)=>U.jsx(n,{...r,ref:i,className:nt(e,t&&"was-validated")}));b0.displayName="Form";b0.propTypes=qj;const Yf=Object.assign(b0,{Group:y0,Control:Gj,Floating:sP,Check:Xf,Switch:Kj,Label:lP,Text:fP,Range:uP,Select:cP,FloatingLabel:hP}),xh=F.forwardRef(({className:e,bsPrefix:t,as:n="span",...r},i)=>(t=ut(t,"input-group-text"),U.jsx(n,{ref:i,className:nt(e,t),...r})));xh.displayName="InputGroupText";const Xj=e=>U.jsx(xh,{children:U.jsx(Wu,{type:"checkbox",...e})}),Yj=e=>U.jsx(xh,{children:U.jsx(Wu,{type:"radio",...e})}),pP=F.forwardRef(({bsPrefix:e,size:t,hasValidation:n,className:r,as:i="div",...o},a)=>{e=ut(e,"input-group");const s=F.useMemo(()=>({}),[]);return U.jsx(rP.Provider,{value:s,children:U.jsx(i,{ref:a,...o,className:nt(r,e,t&&`${e}-${t}`,n&&"has-validation")})})});pP.displayName="InputGroup";const Qj=Object.assign(pP,{Text:xh,Radio:Yj,Checkbox:Xj}),ma=F.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},i)=>{const o=ut(e,"row"),a=QT(),s=JT(),l=`${o}-cols`,u=[];return a.forEach(d=>{const f=r[d];delete r[d];let h;f!=null&&typeof f=="object"?{cols:h}=f:h=f;const p=d!==s?`-${d}`:"";h!=null&&u.push(`${l}${p}-${h}`)}),U.jsx(n,{ref:i,...r,className:nt(t,o,...u)})});ma.displayName="Row";const vP=F.forwardRef(({bsPrefix:e,variant:t,animation:n="border",size:r,as:i="div",className:o,...a},s)=>{e=ut(e,"spinner");const l=`${e}-${n}`;return U.jsx(i,{ref:s,...a,className:nt(o,l,r&&`${l}-${r}`,t&&`text-${t}`)})});vP.displayName="Spinner";const Jj=F.forwardRef(({bsPrefix:e,className:t,striped:n,bordered:r,borderless:i,hover:o,size:a,variant:s,responsive:l,...u},d)=>{const f=ut(e,"table"),h=nt(t,f,s&&`${f}-${s}`,a&&`${f}-${a}`,n&&`${f}-${typeof n=="string"?`striped-${n}`:"striped"}`,r&&`${f}-bordered`,i&&`${f}-borderless`,o&&`${f}-hover`),p=U.jsx("table",{...u,className:h,ref:d});if(l){let v=`${f}-responsive`;return typeof l=="string"&&(v=`${v}-${l}`),U.jsx("div",{className:v,children:p})}return p});var re={},jm={exports:{}};(function(e,t){(function(n,r){var i="1.0.38",o="",a="?",s="function",l="undefined",u="object",d="string",f="major",h="model",p="name",v="type",g="vendor",b="version",S="architecture",y="console",_="mobile",w="tablet",A="smarttv",C="wearable",E="embedded",x=500,T="Amazon",P="Apple",k="ASUS",$="BlackBerry",I="Browser",R="Chrome",z="Edge",W="Firefox",N="Google",j="Huawei",V="LG",K="Microsoft",Y="Motorola",X="Opera",ee="Samsung",be="Sharp",Te="Sony",Qe="Xiaomi",Ie="Zebra",en="Facebook",Z="Chromium OS",ae="Mac OS",de=function(ve,ue){var ie={};for(var Pe in ve)ue[Pe]&&ue[Pe].length%2===0?ie[Pe]=ue[Pe].concat(ve[Pe]):ie[Pe]=ve[Pe];return ie},G=function(ve){for(var ue={},ie=0;ie0?Oe.length===2?typeof Oe[1]==s?this[Oe[0]]=Oe[1].call(this,pn):this[Oe[0]]=Oe[1]:Oe.length===3?typeof Oe[1]===s&&!(Oe[1].exec&&Oe[1].test)?this[Oe[0]]=pn?Oe[1].call(this,pn,Oe[2]):r:this[Oe[0]]=pn?pn.replace(Oe[1],Oe[2]):r:Oe.length===4&&(this[Oe[0]]=pn?Oe[3].call(this,pn.replace(Oe[1],Oe[2])):r):this[Oe]=pn||r;ie+=2}},Gt=function(ve,ue){for(var ie in ue)if(typeof ue[ie]===u&&ue[ie].length>0){for(var Pe=0;Pe2&&(se[h]="iPad",se[v]=w),se},this.getEngine=function(){var se={};return se[p]=r,se[b]=r,rt.call(se,Pe,hn.engine),se},this.getOS=function(){var se={};return se[p]=r,se[b]=r,rt.call(se,Pe,hn.os),Oe&&!se[p]&&Cn&&Cn.platform&&Cn.platform!="Unknown"&&(se[p]=Cn.platform.replace(/chrome os/i,Z).replace(/macos/i,ae)),se},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Pe},this.setUA=function(se){return Pe=typeof se===d&&se.length>x?Re(se,x):se,this},this.setUA(Pe),this};_t.VERSION=i,_t.BROWSER=G([p,b,f]),_t.CPU=G([S]),_t.DEVICE=G([h,g,v,y,_,A,w,C,E]),_t.ENGINE=_t.OS=G([p,b]),e.exports&&(t=e.exports=_t),t.UAParser=_t;var dn=typeof n!==l&&(n.jQuery||n.Zepto);if(dn&&!dn.ua){var Xn=new _t;dn.ua=Xn.getResult(),dn.ua.get=function(){return Xn.getUA()},dn.ua.set=function(ve){Xn.setUA(ve);var ue=Xn.getResult();for(var ie in ue)dn.ua[ie]=ue[ie]}}})(typeof window=="object"?window:al)})(jm,jm.exports);var Zj=jm.exports;Object.defineProperty(re,"__esModule",{value:!0});function eD(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var zt=F,ze=eD(zt),mP=Zj,Xi=new mP,Ht=Xi.getBrowser(),tD=Xi.getCPU(),Tn=Xi.getDevice(),w0=Xi.getEngine(),Yi=Xi.getOS(),Vu=Xi.getUA(),gP=function(t){return Xi.setUA(t)},Hu=function(t){if(!t){console.error("No userAgent string was provided");return}var n=new mP(t);return{UA:n,browser:n.getBrowser(),cpu:n.getCPU(),device:n.getDevice(),engine:n.getEngine(),os:n.getOS(),ua:n.getUA(),setUserAgent:function(i){return n.setUA(i)}}},yP=Object.freeze({ClientUAInstance:Xi,browser:Ht,cpu:tD,device:Tn,engine:w0,os:Yi,ua:Vu,setUa:gP,parseUserAgent:Hu});function Z1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nD(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Gn(e,t){if(e==null)return{};var n=lD(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uD(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bf(e)}function cD(e,t){return fD(e)||dD(e,t)||hD(e,t)||pD()}function fD(e){if(Array.isArray(e))return e}function dD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function hD(e,t){if(e){if(typeof e=="string")return e_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e_(e,t)}}function e_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:"none";return t||n},_0=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},S0=function(t){var n=_0();return n&&n.platform&&(n.platform.indexOf(t)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},yD=function(t,n,r,i,o){return{isBrowser:t,browserMajorVersion:ce(n.major),browserFullVersion:ce(n.version),browserName:ce(n.name),engineName:ce(r.name),engineVersion:ce(r.version),osName:ce(i.name),osVersion:ce(i.version),userAgent:ce(o)}},t_=function(t,n,r,i){return nD({},t,{vendor:ce(n.vendor),model:ce(n.model),os:ce(r.name),osVersion:ce(r.version),ua:ce(i)})},bD=function(t,n,r,i){return{isSmartTV:t,engineName:ce(n.name),engineVersion:ce(n.version),osName:ce(r.name),osVersion:ce(r.version),userAgent:ce(i)}},wD=function(t,n,r,i){return{isConsole:t,engineName:ce(n.name),engineVersion:ce(n.version),osName:ce(r.name),osVersion:ce(r.version),userAgent:ce(i)}},_D=function(t,n,r,i){return{isWearable:t,engineName:ce(n.name),engineVersion:ce(n.version),osName:ce(r.name),osVersion:ce(r.version),userAgent:ce(i)}},SD=function(t,n,r,i,o){return{isEmbedded:t,vendor:ce(n.vendor),model:ce(n.model),engineName:ce(r.name),engineVersion:ce(r.version),osName:ce(i.name),osVersion:ce(i.version),userAgent:ce(o)}};function xD(e){var t=e?Hu(e):yP,n=t.device,r=t.browser,i=t.engine,o=t.os,a=t.ua,s=mD(n.type),l=s.isBrowser,u=s.isMobile,d=s.isTablet,f=s.isSmartTV,h=s.isConsole,p=s.isWearable,v=s.isEmbedded;if(l)return yD(l,r,i,o,a);if(f)return bD(f,i,o,a);if(h)return wD(h,i,o,a);if(u||d)return t_(s,n,o,a);if(p)return _D(p,i,o,a);if(v)return SD(v,n,i,o,a)}var bP=function(t){var n=t.type;return n===Dt.Mobile},wP=function(t){var n=t.type;return n===Dt.Tablet},_P=function(t){var n=t.type;return n===Dt.Mobile||n===Dt.Tablet},SP=function(t){var n=t.type;return n===Dt.SmartTv},Qf=function(t){var n=t.type;return n===Dt.Browser},xP=function(t){var n=t.type;return n===Dt.Wearable},OP=function(t){var n=t.type;return n===Dt.Console},EP=function(t){var n=t.type;return n===Dt.Embedded},AP=function(t){var n=t.vendor;return ce(n)},TP=function(t){var n=t.model;return ce(n)},PP=function(t){var n=t.type;return ce(n,"browser")},CP=function(t){var n=t.name;return n===ds.Android},IP=function(t){var n=t.name;return n===ds.Windows},kP=function(t){var n=t.name;return n===ds.MAC_OS},MP=function(t){var n=t.name;return n===ds.WindowsPhone},$P=function(t){var n=t.name;return n===ds.IOS},NP=function(t){var n=t.version;return ce(n)},jP=function(t){var n=t.name;return ce(n)},DP=function(t){var n=t.name;return n===un.Chrome},RP=function(t){var n=t.name;return n===un.Firefox},LP=function(t){var n=t.name;return n===un.Chromium},Jf=function(t){var n=t.name;return n===un.Edge},UP=function(t){var n=t.name;return n===un.Yandex},FP=function(t){var n=t.name;return n===un.Safari||n===un.MobileSafari},BP=function(t){var n=t.name;return n===un.MobileSafari},zP=function(t){var n=t.name;return n===un.Opera},WP=function(t){var n=t.name;return n===un.InternetExplorer||n===un.Ie},VP=function(t){var n=t.name;return n===un.MIUI},HP=function(t){var n=t.name;return n===un.SamsungBrowser},GP=function(t){var n=t.version;return ce(n)},KP=function(t){var n=t.major;return ce(n)},qP=function(t){var n=t.name;return ce(n)},XP=function(t){var n=t.name;return ce(n)},YP=function(t){var n=t.version;return ce(n)},QP=function(){var t=_0(),n=t&&t.userAgent&&t.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},Ta=function(t){return typeof t=="string"&&t.indexOf("Edg/")!==-1},JP=function(){var t=_0();return t&&(/iPad|iPhone|iPod/.test(t.platform)||t.platform==="MacIntel"&&t.maxTouchPoints>1)&&!window.MSStream},wr=function(){return S0("iPad")},ZP=function(){return S0("iPhone")},eC=function(){return S0("iPod")},tC=function(t){return ce(t)};function nC(e){var t=e||yP,n=t.device,r=t.browser,i=t.os,o=t.engine,a=t.ua;return{isSmartTV:SP(n),isConsole:OP(n),isWearable:xP(n),isEmbedded:EP(n),isMobileSafari:BP(r)||wr(),isChromium:LP(r),isMobile:_P(n)||wr(),isMobileOnly:bP(n),isTablet:wP(n)||wr(),isBrowser:Qf(n),isDesktop:Qf(n),isAndroid:CP(i),isWinPhone:MP(i),isIOS:$P(i)||wr(),isChrome:DP(r),isFirefox:RP(r),isSafari:FP(r),isOpera:zP(r),isIE:WP(r),osVersion:NP(i),osName:jP(i),fullBrowserVersion:GP(r),browserVersion:KP(r),browserName:qP(r),mobileVendor:AP(n),mobileModel:TP(n),engineName:XP(o),engineVersion:YP(o),getUA:tC(a),isEdge:Jf(r)||Ta(a),isYandex:UP(r),deviceType:PP(n),isIOS13:JP(),isIPad13:wr(),isIPhone13:ZP(),isIPod13:eC(),isElectron:QP(),isEdgeChromium:Ta(a),isLegacyEdge:Jf(r)&&!Ta(a),isWindows:IP(i),isMacOs:kP(i),isMIUI:VP(r),isSamsungBrowser:HP(r)}}var rC=SP(Tn),iC=OP(Tn),oC=xP(Tn),OD=EP(Tn),ED=BP(Ht)||wr(),AD=LP(Ht),Oh=_P(Tn)||wr(),aC=bP(Tn),sC=wP(Tn)||wr(),lC=Qf(Tn),TD=Qf(Tn),uC=CP(Yi),cC=MP(Yi),fC=$P(Yi)||wr(),PD=DP(Ht),CD=RP(Ht),ID=FP(Ht),kD=zP(Ht),dC=WP(Ht),MD=NP(Yi),$D=jP(Yi),ND=GP(Ht),jD=KP(Ht),DD=qP(Ht),RD=AP(Tn),LD=TP(Tn),UD=XP(w0),FD=YP(w0),BD=tC(Vu),zD=Jf(Ht)||Ta(Vu),WD=UP(Ht),VD=PP(Tn),HD=JP(),GD=wr(),KD=ZP(),qD=eC(),XD=QP(),YD=Ta(Vu),QD=Jf(Ht)&&!Ta(Vu),JD=IP(Yi),ZD=kP(Yi),eR=VP(Ht),tR=HP(Ht),nR=function(t){if(!t||typeof t!="string"){console.error("No valid user agent string was provided");return}var n=Hu(t),r=n.device,i=n.browser,o=n.os,a=n.engine,s=n.ua;return nC({device:r,browser:i,os:o,engine:a,ua:s})},rR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return uC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},iR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return lC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},oR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return dC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},aR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return fC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},sR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return Oh?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},lR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return sC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},uR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return cC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},cR=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=Gn(t,["renderWithFragment","children","viewClassName","style"]);return aC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},fR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return rC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},dR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return iC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},hR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return oC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},pR=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=t.condition,o=Gn(t,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",o,r):null};function vR(e){return function(t){sD(n,t);function n(r){var i;return rD(this,n),i=uD(this,Rm(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(bf(i)),i.onOrientationChange=i.onOrientationChange.bind(bf(i)),i.onPageLoad=i.onPageLoad.bind(bf(i)),i.state={isLandscape:!1,isPortrait:!1},i}return oD(n,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var i=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:i===0,isLandscape:i===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":xl(window))!==void 0&&Oh&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return ze.createElement(e,Dm({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(ze.Component)}function mR(){var e=zt.useState(function(){var o=window.innerWidth>window.innerHeight?90:0;return{isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"}}),t=cD(e,2),n=t[0],r=t[1],i=zt.useCallback(function(){var o=window.innerWidth>window.innerHeight?90:0,a={isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"};n.orientation!==a.orientation&&r(a)},[n.orientation]);return zt.useEffect(function(){return(typeof window>"u"?"undefined":xl(window))!==void 0&&Oh&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),n}function hC(e){var t=e||window.navigator.userAgent;return Hu(t)}function gR(e){var t=e||window.navigator.userAgent,n=hC(t),r=nC(n);return[r,n]}re.AndroidView=rR;re.BrowserTypes=un;re.BrowserView=iR;re.ConsoleView=dR;re.CustomView=pR;re.IEView=oR;re.IOSView=aR;re.MobileOnlyView=cR;re.MobileView=sR;re.OsTypes=ds;re.SmartTVView=fR;re.TabletView=lR;re.WearableView=hR;re.WinPhoneView=uR;re.browserName=DD;re.browserVersion=jD;re.deviceDetect=xD;re.deviceType=VD;re.engineName=UD;re.engineVersion=FD;re.fullBrowserVersion=ND;re.getSelectorsByUserAgent=nR;re.getUA=BD;re.isAndroid=uC;re.isBrowser=lC;re.isChrome=PD;re.isChromium=AD;re.isConsole=iC;var yR=re.isDesktop=TD;re.isEdge=zD;re.isEdgeChromium=YD;re.isElectron=XD;re.isEmbedded=OD;re.isFirefox=CD;re.isIE=dC;re.isIOS=fC;re.isIOS13=HD;re.isIPad13=GD;re.isIPhone13=KD;re.isIPod13=qD;re.isLegacyEdge=QD;re.isMIUI=eR;re.isMacOs=ZD;re.isMobile=Oh;re.isMobileOnly=aC;re.isMobileSafari=ED;re.isOpera=kD;re.isSafari=ID;re.isSamsungBrowser=tR;re.isSmartTV=rC;re.isTablet=sC;re.isWearable=oC;re.isWinPhone=cC;re.isWindows=JD;re.isYandex=WD;re.mobileModel=LD;re.mobileVendor=RD;re.osName=$D;re.osVersion=MD;re.parseUserAgent=Hu;re.setUserAgent=gD;re.useDeviceData=hC;re.useDeviceSelectors=gR;re.useMobileOrientation=mR;re.withOrientationChange=vR;const Kn=F.createContext(),bR=({children:e})=>{const t=()=>yR?"desktop":"mobile",[n,r]=F.useState(),[i,o]=F.useState({first_name:"",last_name:"",categories:[]}),[a,s]=F.useState(!0),[l,u]=F.useState(!1),[d,f]=F.useState(null),[h,p]=F.useState(null),[v,g]=F.useState(t()),b={screen:n,setScreen:r,user:i,setUser:o,modalIsOpen:a,setModalIsOpen:s,show:l,setShow:u,capturedPhoto:d,setCapturedPhoto:f,ocrData:h,setOcrData:p,device:v,setDevice:g};return U.jsx(Kn.Provider,{value:b,children:e})},wR=()=>{const{ocrData:e,setOcrData:t}=F.useContext(Kn),n=(e==null?void 0:e.date)??new Date().toISOString().split("T")[0],r=i=>{e.date=i,t(e)};return U.jsx(Yf.Control,{type:"date",value:n,onChange:i=>r(i.target.value)})},n_=e=>{const[t,n]=F.useState(e.options),[r,i]=F.useState(e.options[0]),[o,a]=F.useState(""),s=d=>{const f=d.target.value;i(f),f!=="Custom"&&a("")},l=d=>{d.target.value!==""&&(n([...t,d.target.value]),a(d.target.value),i(d.target.value))},u=d=>d.map((f,h)=>U.jsx("option",{value:f,children:f},h));return U.jsxs(Qj,{children:[U.jsxs(Yf.Control,{as:"select",value:r,onChange:s,children:[u(t),U.jsx("option",{value:"Custom",children:"Custom..."})]}),r==="Custom"&&U.jsx(Yf.Control,{type:"text",defaultValue:o,onBlur:l,placeholder:"Enter custom option"})]})},_R=e=>{const[t,n]=F.useState(e.amount);return U.jsx(U.Fragment,{children:U.jsx(Yf.Control,{value:t,placeholder:"Total amount spent...",inputMode:"numeric"})})},SR=()=>{const{user:e,ocrData:t}=F.useContext(Kn),n=()=>{let i=[];if(e.transactions.length!==0)return i=e.transactions.map(o=>o.vendor),i},r=()=>{let i=[];if(e.categories.length!==0)return i=e.categories.map(o=>o.name),i};return F.useEffect(()=>{},[e,t]),U.jsxs(Jj,{bordered:!0,children:[U.jsx("thead",{children:U.jsxs("tr",{children:[U.jsx("th",{children:"Expenses"}),U.jsx("th",{children:"Userfields"})]})}),U.jsxs("tbody",{children:[U.jsxs("tr",{children:[U.jsx("td",{children:"Date"}),U.jsx("td",{children:U.jsx(wR,{})})]}),U.jsxs("tr",{children:[U.jsx("td",{children:"Vendor"}),U.jsx("td",{children:U.jsx(n_,{options:n()??["Choose Vendor"]})})]}),U.jsxs("tr",{children:[U.jsx("td",{children:"Total"}),U.jsx("td",{children:U.jsx(_R,{amount:t==null?void 0:t.amount})})]}),U.jsxs("tr",{children:[U.jsx("td",{children:"Category"}),U.jsx("td",{children:U.jsx(n_,{options:r()??["Select Category"]})})]})]})]})},Um=()=>{const{setScreen:e}=F.useContext(Kn),t=()=>{e("landing")};return U.jsx("button",{onClick:t,children:"Back"})};var xt=[];for(var iv=0;iv<256;++iv)xt.push((iv+256).toString(16).slice(1));function xR(e,t=0){return(xt[e[t+0]]+xt[e[t+1]]+xt[e[t+2]]+xt[e[t+3]]+"-"+xt[e[t+4]]+xt[e[t+5]]+"-"+xt[e[t+6]]+xt[e[t+7]]+"-"+xt[e[t+8]]+xt[e[t+9]]+"-"+xt[e[t+10]]+xt[e[t+11]]+xt[e[t+12]]+xt[e[t+13]]+xt[e[t+14]]+xt[e[t+15]]).toLowerCase()}var Wc,OR=new Uint8Array(16);function ER(){if(!Wc&&(Wc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wc(OR)}var AR=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const r_={randomUUID:AR};function TR(e,t,n){if(r_.randomUUID&&!t&&!e)return r_.randomUUID();e=e||{};var r=e.random||(e.rng||ER)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,xR(r)}var oh,vC;class pC{constructor(t={}){zw(this,oh);if(typeof t=="string")try{t=JSON.parse(t)}catch(n){console.error("Invalid JSON string provided:",n),t={}}this.transactionId=t.transactionId||Ww(this,oh,vC).call(this),this.createdAt=t.createdAt||null,this.amount=t.amount||null,this.vendor=t.vendor||null,this.categoryId=t.categoryId||null,this.pictureId=t.pictureId||null,this.isSuccessful=t.isSuccessful||null}serialize(){return{transactionId:this.transactionId,createdAt:this.createdAt,amount:this.amount,vendor:this.vendor,categoryId:this.categoryId,pictureId:this.pictureId,isSuccessful:this.isSuccessful}}toString(){return JSON.stringify(this.serialize())}}oh=new WeakSet,vC=function(){return TR()};const PR=()=>{const{capturedPhoto:e,setCapturedPhoto:t,screen:n,setScreen:r,ocrData:i,setOcrData:o,device:a}=F.useContext(Kn),[s,l]=F.useState(null),[u,d]=F.useState(null),f=F.useRef(null),h=F.useRef(null),p=F.useRef(null);F.useEffect(()=>(n!=="landing"&&a!=="mobile"&&g().then(()=>{console.log("Camera light turned on")}),()=>{u&&u.getTracks().forEach(y=>y.stop())}),[n]);const v=()=>{if(f.current&&h.current){h.current.getContext("2d").drawImage(f.current,0,0,h.current.width,h.current.height);const _=h.current.toDataURL("image/png");t(_),u.getTracks().forEach(w=>{w.stop()}),d(null),console.log("Camera light turned off")}},g=async()=>{t(null);try{let y;if(a==="mobile"&&!e)return U.jsx("div",{children:U.jsx("input",{type:"file",accept:"image/*",capture:"environment",ref:p,onChange:b,style:$r.fileInput})});y=await navigator.mediaDevices.getUserMedia({video:!0}),d(y),f.current&&(f.current.srcObject=y,f.current.play()),l(!0)}catch(y){console.error("Error accessing camera:",y),l(!1)}},b=y=>{const _=y.target.files[0];if(_){const w=new FileReader;w.onload=A=>{t(A.target.result)},w.readAsDataURL(_)}},S=async()=>{try{const y="https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",w={method:"POST",body:IR(e)},A=await fetch(y,w);if(!A.ok)throw new Error("Network response was not ok");const C=await A.json(),E=new pC(C);o(E),r("landing")}catch(y){console.error("Error submitting photo:",y)}};return s===null&&a!=="mobile"?U.jsx(U.Fragment,{children:U.jsxs(Sl,{variant:"primary",disabled:!0,children:[U.jsx(vP,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}),U.jsx("span",{className:"visually-hidden",children:"Loading..."})]})}):!s&&a!=="mobile"?U.jsxs(U.Fragment,{children:[U.jsx("p",{children:"No access to camera"}),U.jsx(Um,{})]}):U.jsxs("div",{style:$r.container,children:[g(),a!=="mobile"&&!e&&U.jsxs("div",{children:[U.jsx("video",{ref:f,style:$r.video}),U.jsx("button",{onClick:v,style:$r.button,children:"Capture Photo"})]}),U.jsx(Um,{}),e&&U.jsxs("div",{children:[U.jsxs("div",{style:$r.imageContainer,children:[U.jsx("p",{children:"Captured Photo:"}),U.jsx("img",{src:e,alt:"Captured",style:$r.image})]}),U.jsx("button",{onClick:S,style:$r.button,children:"Submit"}),U.jsx("button",{onClick:g,style:$r.button,children:"Retake"})]}),U.jsx("canvas",{ref:h,style:$r.hiddenCanvas})]})},$r={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"20px"},video:{width:"100%",maxWidth:"400px",height:"auto"},button:{marginTop:"10px",padding:"10px 20px",fontSize:"16px"},imageContainer:{marginTop:"10px"},image:{width:"300px",height:"200px"},hiddenCanvas:{display:"none"},fileInput:{marginTop:"10px",padding:"10px 20px",fontSize:"16px"}};function CR(e){const t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:"none";return t||n},_0=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},S0=function(t){var n=_0();return n&&n.platform&&(n.platform.indexOf(t)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},yD=function(t,n,r,i,o){return{isBrowser:t,browserMajorVersion:ce(n.major),browserFullVersion:ce(n.version),browserName:ce(n.name),engineName:ce(r.name),engineVersion:ce(r.version),osName:ce(i.name),osVersion:ce(i.version),userAgent:ce(o)}},t_=function(t,n,r,i){return nD({},t,{vendor:ce(n.vendor),model:ce(n.model),os:ce(r.name),osVersion:ce(r.version),ua:ce(i)})},bD=function(t,n,r,i){return{isSmartTV:t,engineName:ce(n.name),engineVersion:ce(n.version),osName:ce(r.name),osVersion:ce(r.version),userAgent:ce(i)}},wD=function(t,n,r,i){return{isConsole:t,engineName:ce(n.name),engineVersion:ce(n.version),osName:ce(r.name),osVersion:ce(r.version),userAgent:ce(i)}},_D=function(t,n,r,i){return{isWearable:t,engineName:ce(n.name),engineVersion:ce(n.version),osName:ce(r.name),osVersion:ce(r.version),userAgent:ce(i)}},SD=function(t,n,r,i,o){return{isEmbedded:t,vendor:ce(n.vendor),model:ce(n.model),engineName:ce(r.name),engineVersion:ce(r.version),osName:ce(i.name),osVersion:ce(i.version),userAgent:ce(o)}};function xD(e){var t=e?Hu(e):yP,n=t.device,r=t.browser,i=t.engine,o=t.os,a=t.ua,s=mD(n.type),l=s.isBrowser,u=s.isMobile,d=s.isTablet,f=s.isSmartTV,h=s.isConsole,p=s.isWearable,v=s.isEmbedded;if(l)return yD(l,r,i,o,a);if(f)return bD(f,i,o,a);if(h)return wD(h,i,o,a);if(u||d)return t_(s,n,o,a);if(p)return _D(p,i,o,a);if(v)return SD(v,n,i,o,a)}var bP=function(t){var n=t.type;return n===Dt.Mobile},wP=function(t){var n=t.type;return n===Dt.Tablet},_P=function(t){var n=t.type;return n===Dt.Mobile||n===Dt.Tablet},SP=function(t){var n=t.type;return n===Dt.SmartTv},Qf=function(t){var n=t.type;return n===Dt.Browser},xP=function(t){var n=t.type;return n===Dt.Wearable},OP=function(t){var n=t.type;return n===Dt.Console},EP=function(t){var n=t.type;return n===Dt.Embedded},AP=function(t){var n=t.vendor;return ce(n)},TP=function(t){var n=t.model;return ce(n)},PP=function(t){var n=t.type;return ce(n,"browser")},CP=function(t){var n=t.name;return n===ds.Android},IP=function(t){var n=t.name;return n===ds.Windows},kP=function(t){var n=t.name;return n===ds.MAC_OS},MP=function(t){var n=t.name;return n===ds.WindowsPhone},$P=function(t){var n=t.name;return n===ds.IOS},NP=function(t){var n=t.version;return ce(n)},jP=function(t){var n=t.name;return ce(n)},DP=function(t){var n=t.name;return n===un.Chrome},RP=function(t){var n=t.name;return n===un.Firefox},LP=function(t){var n=t.name;return n===un.Chromium},Jf=function(t){var n=t.name;return n===un.Edge},UP=function(t){var n=t.name;return n===un.Yandex},FP=function(t){var n=t.name;return n===un.Safari||n===un.MobileSafari},BP=function(t){var n=t.name;return n===un.MobileSafari},zP=function(t){var n=t.name;return n===un.Opera},WP=function(t){var n=t.name;return n===un.InternetExplorer||n===un.Ie},VP=function(t){var n=t.name;return n===un.MIUI},HP=function(t){var n=t.name;return n===un.SamsungBrowser},GP=function(t){var n=t.version;return ce(n)},KP=function(t){var n=t.major;return ce(n)},qP=function(t){var n=t.name;return ce(n)},XP=function(t){var n=t.name;return ce(n)},YP=function(t){var n=t.version;return ce(n)},QP=function(){var t=_0(),n=t&&t.userAgent&&t.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},Ta=function(t){return typeof t=="string"&&t.indexOf("Edg/")!==-1},JP=function(){var t=_0();return t&&(/iPad|iPhone|iPod/.test(t.platform)||t.platform==="MacIntel"&&t.maxTouchPoints>1)&&!window.MSStream},wr=function(){return S0("iPad")},ZP=function(){return S0("iPhone")},eC=function(){return S0("iPod")},tC=function(t){return ce(t)};function nC(e){var t=e||yP,n=t.device,r=t.browser,i=t.os,o=t.engine,a=t.ua;return{isSmartTV:SP(n),isConsole:OP(n),isWearable:xP(n),isEmbedded:EP(n),isMobileSafari:BP(r)||wr(),isChromium:LP(r),isMobile:_P(n)||wr(),isMobileOnly:bP(n),isTablet:wP(n)||wr(),isBrowser:Qf(n),isDesktop:Qf(n),isAndroid:CP(i),isWinPhone:MP(i),isIOS:$P(i)||wr(),isChrome:DP(r),isFirefox:RP(r),isSafari:FP(r),isOpera:zP(r),isIE:WP(r),osVersion:NP(i),osName:jP(i),fullBrowserVersion:GP(r),browserVersion:KP(r),browserName:qP(r),mobileVendor:AP(n),mobileModel:TP(n),engineName:XP(o),engineVersion:YP(o),getUA:tC(a),isEdge:Jf(r)||Ta(a),isYandex:UP(r),deviceType:PP(n),isIOS13:JP(),isIPad13:wr(),isIPhone13:ZP(),isIPod13:eC(),isElectron:QP(),isEdgeChromium:Ta(a),isLegacyEdge:Jf(r)&&!Ta(a),isWindows:IP(i),isMacOs:kP(i),isMIUI:VP(r),isSamsungBrowser:HP(r)}}var rC=SP(Tn),iC=OP(Tn),oC=xP(Tn),OD=EP(Tn),ED=BP(Ht)||wr(),AD=LP(Ht),Oh=_P(Tn)||wr(),aC=bP(Tn),sC=wP(Tn)||wr(),lC=Qf(Tn),TD=Qf(Tn),uC=CP(Yi),cC=MP(Yi),fC=$P(Yi)||wr(),PD=DP(Ht),CD=RP(Ht),ID=FP(Ht),kD=zP(Ht),dC=WP(Ht),MD=NP(Yi),$D=jP(Yi),ND=GP(Ht),jD=KP(Ht),DD=qP(Ht),RD=AP(Tn),LD=TP(Tn),UD=XP(w0),FD=YP(w0),BD=tC(Vu),zD=Jf(Ht)||Ta(Vu),WD=UP(Ht),VD=PP(Tn),HD=JP(),GD=wr(),KD=ZP(),qD=eC(),XD=QP(),YD=Ta(Vu),QD=Jf(Ht)&&!Ta(Vu),JD=IP(Yi),ZD=kP(Yi),eR=VP(Ht),tR=HP(Ht),nR=function(t){if(!t||typeof t!="string"){console.error("No valid user agent string was provided");return}var n=Hu(t),r=n.device,i=n.browser,o=n.os,a=n.engine,s=n.ua;return nC({device:r,browser:i,os:o,engine:a,ua:s})},rR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return uC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},iR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return lC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},oR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return dC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},aR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return fC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},sR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return Oh?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},lR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return sC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},uR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return cC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},cR=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=Gn(t,["renderWithFragment","children","viewClassName","style"]);return aC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},fR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return rC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},dR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return iC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},hR=function(t){var n=t.renderWithFragment,r=t.children,i=Gn(t,["renderWithFragment","children"]);return oC?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",i,r):null},pR=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=t.condition,o=Gn(t,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?ze.createElement(zt.Fragment,null,r):ze.createElement("div",o,r):null};function vR(e){return function(t){sD(n,t);function n(r){var i;return rD(this,n),i=uD(this,Rm(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(bf(i)),i.onOrientationChange=i.onOrientationChange.bind(bf(i)),i.onPageLoad=i.onPageLoad.bind(bf(i)),i.state={isLandscape:!1,isPortrait:!1},i}return oD(n,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var i=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:i===0,isLandscape:i===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":xl(window))!==void 0&&Oh&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return ze.createElement(e,Dm({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(ze.Component)}function mR(){var e=zt.useState(function(){var o=window.innerWidth>window.innerHeight?90:0;return{isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"}}),t=cD(e,2),n=t[0],r=t[1],i=zt.useCallback(function(){var o=window.innerWidth>window.innerHeight?90:0,a={isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"};n.orientation!==a.orientation&&r(a)},[n.orientation]);return zt.useEffect(function(){return(typeof window>"u"?"undefined":xl(window))!==void 0&&Oh&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),n}function hC(e){var t=e||window.navigator.userAgent;return Hu(t)}function gR(e){var t=e||window.navigator.userAgent,n=hC(t),r=nC(n);return[r,n]}re.AndroidView=rR;re.BrowserTypes=un;re.BrowserView=iR;re.ConsoleView=dR;re.CustomView=pR;re.IEView=oR;re.IOSView=aR;re.MobileOnlyView=cR;re.MobileView=sR;re.OsTypes=ds;re.SmartTVView=fR;re.TabletView=lR;re.WearableView=hR;re.WinPhoneView=uR;re.browserName=DD;re.browserVersion=jD;re.deviceDetect=xD;re.deviceType=VD;re.engineName=UD;re.engineVersion=FD;re.fullBrowserVersion=ND;re.getSelectorsByUserAgent=nR;re.getUA=BD;re.isAndroid=uC;re.isBrowser=lC;re.isChrome=PD;re.isChromium=AD;re.isConsole=iC;var yR=re.isDesktop=TD;re.isEdge=zD;re.isEdgeChromium=YD;re.isElectron=XD;re.isEmbedded=OD;re.isFirefox=CD;re.isIE=dC;re.isIOS=fC;re.isIOS13=HD;re.isIPad13=GD;re.isIPhone13=KD;re.isIPod13=qD;re.isLegacyEdge=QD;re.isMIUI=eR;re.isMacOs=ZD;re.isMobile=Oh;re.isMobileOnly=aC;re.isMobileSafari=ED;re.isOpera=kD;re.isSafari=ID;re.isSamsungBrowser=tR;re.isSmartTV=rC;re.isTablet=sC;re.isWearable=oC;re.isWinPhone=cC;re.isWindows=JD;re.isYandex=WD;re.mobileModel=LD;re.mobileVendor=RD;re.osName=$D;re.osVersion=MD;re.parseUserAgent=Hu;re.setUserAgent=gD;re.useDeviceData=hC;re.useDeviceSelectors=gR;re.useMobileOrientation=mR;re.withOrientationChange=vR;const Kn=F.createContext(),bR=({children:e})=>{const t=()=>yR?"desktop":"mobile",[n,r]=F.useState(),[i,o]=F.useState({first_name:"",last_name:"",categories:[]}),[a,s]=F.useState(!0),[l,u]=F.useState(!1),[d,f]=F.useState(null),[h,p]=F.useState(null),[v,g]=F.useState(t()),b={screen:n,setScreen:r,user:i,setUser:o,modalIsOpen:a,setModalIsOpen:s,show:l,setShow:u,capturedPhoto:d,setCapturedPhoto:f,ocrData:h,setOcrData:p,device:v,setDevice:g};return U.jsx(Kn.Provider,{value:b,children:e})},wR=()=>{const{ocrData:e,setOcrData:t}=F.useContext(Kn),n=(e==null?void 0:e.date)??new Date().toISOString().split("T")[0],r=i=>{e.date=i,t(e)};return U.jsx(Yf.Control,{type:"date",value:n,onChange:i=>r(i.target.value)})},n_=e=>{const[t,n]=F.useState(e.options),[r,i]=F.useState(e.options[0]),[o,a]=F.useState(""),s=d=>{const f=d.target.value;i(f),f!=="Custom"&&a("")},l=d=>{d.target.value!==""&&(n([...t,d.target.value]),a(d.target.value),i(d.target.value))},u=d=>d.map((f,h)=>U.jsx("option",{value:f,children:f},h));return U.jsxs(Qj,{children:[U.jsxs(Yf.Control,{as:"select",value:r,onChange:s,children:[u(t),U.jsx("option",{value:"Custom",children:"Custom..."})]}),r==="Custom"&&U.jsx(Yf.Control,{type:"text",defaultValue:o,onBlur:l,placeholder:"Enter custom option"})]})},_R=e=>{const[t,n]=F.useState(e.amount);return U.jsx(U.Fragment,{children:U.jsx(Yf.Control,{value:t,placeholder:"Total amount spent...",inputMode:"numeric"})})},SR=()=>{const{user:e,ocrData:t}=F.useContext(Kn),n=()=>{let i=[];if(e.transactions.length!==0)return i=e.transactions.map(o=>o.vendor),i},r=()=>{let i=[];if(e.categories.length!==0)return i=e.categories.map(o=>o.name),i};return F.useEffect(()=>{},[e,t]),U.jsxs(Jj,{bordered:!0,children:[U.jsx("thead",{children:U.jsxs("tr",{children:[U.jsx("th",{children:"Expenses"}),U.jsx("th",{children:"Userfields"})]})}),U.jsxs("tbody",{children:[U.jsxs("tr",{children:[U.jsx("td",{children:"Date"}),U.jsx("td",{children:U.jsx(wR,{})})]}),U.jsxs("tr",{children:[U.jsx("td",{children:"Vendor"}),U.jsx("td",{children:U.jsx(n_,{options:n()??["Choose Vendor"]})})]}),U.jsxs("tr",{children:[U.jsx("td",{children:"Total"}),U.jsx("td",{children:U.jsx(_R,{amount:t==null?void 0:t.amount})})]}),U.jsxs("tr",{children:[U.jsx("td",{children:"Category"}),U.jsx("td",{children:U.jsx(n_,{options:r()??["Select Category"]})})]})]})]})},Um=()=>{const{setScreen:e}=F.useContext(Kn),t=()=>{e("landing")};return U.jsx("button",{onClick:t,children:"Back"})};var xt=[];for(var iv=0;iv<256;++iv)xt.push((iv+256).toString(16).slice(1));function xR(e,t=0){return(xt[e[t+0]]+xt[e[t+1]]+xt[e[t+2]]+xt[e[t+3]]+"-"+xt[e[t+4]]+xt[e[t+5]]+"-"+xt[e[t+6]]+xt[e[t+7]]+"-"+xt[e[t+8]]+xt[e[t+9]]+"-"+xt[e[t+10]]+xt[e[t+11]]+xt[e[t+12]]+xt[e[t+13]]+xt[e[t+14]]+xt[e[t+15]]).toLowerCase()}var Wc,OR=new Uint8Array(16);function ER(){if(!Wc&&(Wc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wc(OR)}var AR=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const r_={randomUUID:AR};function TR(e,t,n){if(r_.randomUUID&&!t&&!e)return r_.randomUUID();e=e||{};var r=e.random||(e.rng||ER)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,xR(r)}var oh,vC;class pC{constructor(t={}){zw(this,oh);if(typeof t=="string")try{t=JSON.parse(t)}catch(n){console.error("Invalid JSON string provided:",n),t={}}this.transactionId=t.transactionId||Ww(this,oh,vC).call(this),this.createdAt=t.createdAt||null,this.amount=t.amount||null,this.vendor=t.vendor||null,this.categoryId=t.categoryId||null,this.pictureId=t.pictureId||null,this.isSuccessful=t.isSuccessful||null}serialize(){return{transactionId:this.transactionId,createdAt:this.createdAt,amount:this.amount,vendor:this.vendor,categoryId:this.categoryId,pictureId:this.pictureId,isSuccessful:this.isSuccessful}}toString(){return JSON.stringify(this.serialize())}}oh=new WeakSet,vC=function(){return TR()};const PR=()=>{const{capturedPhoto:e,setCapturedPhoto:t,screen:n,setScreen:r,ocrData:i,setOcrData:o,device:a}=F.useContext(Kn),[s,l]=F.useState(null),[u,d]=F.useState(null),f=F.useRef(null),h=F.useRef(null),p=F.useRef(null);F.useEffect(()=>(n!=="landing"&&a!=="mobile"&&g().then(()=>{console.log("Camera light turned on")}),()=>{u&&u.getTracks().forEach(y=>y.stop())}),[n]);const v=()=>{if(f.current&&h.current){h.current.getContext("2d").drawImage(f.current,0,0,h.current.width,h.current.height);const _=h.current.toDataURL("image/png");t(_),u.getTracks().forEach(w=>{w.stop()}),d(null),console.log("Camera light turned off")}},g=async()=>{t(null);try{let y;a==="desktop"&&(y=await navigator.mediaDevices.getUserMedia({video:!0})),d(y),f.current&&(f.current.srcObject=y,f.current.play()),l(!0)}catch(y){console.error("Error accessing camera:",y),l(!1)}},b=y=>{const _=y.target.files[0];if(_){const w=new FileReader;w.onload=A=>{t(A.target.result)},w.readAsDataURL(_)}},S=async()=>{try{const y="https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",w={method:"POST",body:IR(e)},A=await fetch(y,w);if(!A.ok)throw new Error("Network response was not ok");const C=await A.json(),E=new pC(C);o(E),r("landing")}catch(y){console.error("Error submitting photo:",y)}};return a==="desktop"?s?U.jsx(U.Fragment,{children:U.jsxs(Sl,{variant:"primary",disabled:!0,children:[U.jsx(vP,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}),U.jsx("span",{className:"visually-hidden",children:"Loading..."})]})}):U.jsxs(U.Fragment,{children:[U.jsx("p",{children:"No access to camera"}),U.jsx(Um,{})]}):U.jsxs("div",{style:$r.container,children:[a==="mobile"&&!e&&U.jsx("div",{children:U.jsx("input",{type:"file",accept:"image/*",capture:"environment",ref:p,onChange:b,style:$r.fileInput})}),a!=="mobile"&&!e&&U.jsxs("div",{children:[U.jsx("video",{ref:f,style:$r.video}),U.jsx("button",{onClick:v,style:$r.button,children:"Capture Photo"})]}),U.jsx(Um,{}),e&&U.jsxs("div",{children:[U.jsxs("div",{style:$r.imageContainer,children:[U.jsx("p",{children:"Captured Photo:"}),U.jsx("img",{src:e,alt:"Captured",style:$r.image})]}),U.jsx("button",{onClick:S,style:$r.button,children:"Submit"}),U.jsx("button",{onClick:g,style:$r.button,children:"Retake"})]}),U.jsx("canvas",{ref:h,style:$r.hiddenCanvas})]})},$r={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"20px"},video:{width:"100%",maxWidth:"400px",height:"auto"},button:{marginTop:"10px",padding:"10px 20px",fontSize:"16px"},imageContainer:{marginTop:"10px"},image:{width:"300px",height:"200px"},hiddenCanvas:{display:"none"},fileInput:{marginTop:"10px",padding:"10px 20px",fontSize:"16px"}};function CR(e){const t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o