@veripass/react-sdk 1.0.8 → 1.0.9
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/react-sdk.cjs.js +871 -46
- package/dist/react-sdk.cjs.js.map +1 -1
- package/dist/react-sdk.esm.js +869 -47
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/react-sdk.cjs.js
CHANGED
|
@@ -37163,6 +37163,28 @@ var unitlessKeys$1 = {
|
|
|
37163
37163
|
|
|
37164
37164
|
var f="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",m="active",y="data-styled-version",v="6.1.8",g="/*!sc*/\n",S="undefined"!=typeof window&&"HTMLElement"in window,w=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),E=/invalid hook call/i,N=new Set,P=function(t,n){if("production"!==process.env.NODE_ENV){var o=n?' with the id of "'.concat(n,'"'):"",s="The component ".concat(t).concat(o," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",i=console.error;try{var a=!0;console.error=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];E.test(t)?(a=!1,N.delete(s)):i.apply(void 0,__spreadArray([t],n,!1));},React.useRef(),a&&!N.has(s)&&(console.warn(s),N.add(s));}catch(e){E.test(e.message)&&N.delete(s);}finally{console.error=i;}}},_=Object.freeze([]),C=Object.freeze({});function I(e,t,n){return void 0===n&&(n=C),e.theme!==n.theme&&e.theme||t||n.theme}var A=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),O=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,D=/(^-|-$)/g;function R(e){return e.replace(O,"-").replace(D,"")}var T=/(a)(d)/gi,k=52,j=function(e){return String.fromCharCode(e+(e>25?39:97))};function x(e){var t,n="";for(t=Math.abs(e);t>k;t=t/k|0)n=j(t%k)+n;return (j(t%k)+n).replace(T,"$1-$2")}var V,F=5381,M=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},$=function(e){return M(F,e)};function z(e){return x($(e)>>>0)}function B(e){return "production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function L(e){return "string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var G="function"==typeof Symbol&&Symbol.for,Y=G?Symbol.for("react.memo"):60115,W=G?Symbol.for("react.forward_ref"):60112,q={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},H={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},U={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},J=((V={})[W]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},V[Y]=U,V);function X(e){return ("type"in(t=e)&&t.type.$$typeof)===Y?U:"$$typeof"in e?J[e.$$typeof]:q;var t;}var Z=Object.defineProperty,K=Object.getOwnPropertyNames,Q=Object.getOwnPropertySymbols,ee=Object.getOwnPropertyDescriptor,te=Object.getPrototypeOf,ne=Object.prototype;function oe(e,t,n){if("string"!=typeof t){if(ne){var o=te(t);o&&o!==ne&&oe(e,o,n);}var r=K(t);Q&&(r=r.concat(Q(t)));for(var s=X(e),i=X(t),a=0;a<r.length;++a){var c=r[a];if(!(c in H||n&&n[c]||i&&c in i||s&&c in s)){var l=ee(t,c);try{Z(e,c,l);}catch(e){}}}}return e}function re(e){return "function"==typeof e}function se(e){return "object"==typeof e&&"styledComponentId"in e}function ie(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function ae(e,t){if(0===e.length)return "";for(var n=e[0],o=1;o<e.length;o++)n+=t?t+e[o]:e[o];return n}function ce(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function le(e,t,n){if(void 0===n&&(n=!1),!n&&!ce(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var o=0;o<t.length;o++)e[o]=le(e[o],t[o]);else if(ce(t))for(var o in t)e[o]=le(e[o],t[o]);return e}function ue(e,t){Object.defineProperty(e,"toString",{value:t});}var pe="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function de(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],o=[],r=1,s=e.length;r<s;r+=1)o.push(e[r]);return o.forEach(function(e){n=n.replace(/%[a-z]/,e);}),n}function he(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return "production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(n.length>0?" Args: ".concat(n.join(", ")):"")):new Error(de.apply(void 0,__spreadArray([pe[t]],n,!1)).trim())}var fe=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e;}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,r=o;e>=r;)if((r<<=1)<0)throw he(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var s=o;s<r;s++)this.groupSizes[s]=0;}for(var i=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++);},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),o=n+t;this.groupSizes[e]=0;for(var r=n;r<o;r++)this.tag.deleteRule(n);}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],o=this.indexOfGroup(e),r=o+n,s=o;s<r;s++)t+="".concat(this.tag.getRule(s)).concat(g);return t},e}(),me=new Map,ye=new Map,ve=1,ge=function(e){if(me.has(e))return me.get(e);for(;ye.has(ve);)ve++;var t=ve++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>1073741824))throw he(16,"".concat(t));return me.set(e,t),ye.set(t,e),t},Se=function(e,t){ve=t+1,me.set(e,t),ye.set(t,e);},we="style[".concat(f,"][").concat(y,'="').concat(v,'"]'),be=new RegExp("^".concat(f,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Ee=function(e,t,n){for(var o,r=n.split(","),s=0,i=r.length;s<i;s++)(o=r[s])&&e.registerName(t,o);},Ne=function(e,t){for(var n,o=(null!==(n=t.textContent)&&void 0!==n?n:"").split(g),r=[],s=0,i=o.length;s<i;s++){var a=o[s].trim();if(a){var c=a.match(be);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(Se(u,l),Ee(e,u,c[3]),e.getTag().insertRules(l,r)),r.length=0;}else r.push(a);}}};function Pe(){return "undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null}var _e=function(e){var t=document.head,n=e||t,o=document.createElement("style"),r=function(e){var t=Array.from(e.querySelectorAll("style[".concat(f,"]")));return t[t.length-1]}(n),s=void 0!==r?r.nextSibling:null;o.setAttribute(f,m),o.setAttribute(y,v);var i=Pe();return i&&o.setAttribute("nonce",i),n.insertBefore(o,s),o},Ce=function(){function e(e){this.element=_e(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,o=t.length;n<o;n++){var r=t[n];if(r.ownerNode===e)return r}throw he(17)}(this.element),this.length=0;}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return !1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--;},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Ie=function(){function e(e){this.element=_e(e),this.nodes=this.element.childNodes,this.length=0;}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return !1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Ae=function(){function e(e){this.rules=[],this.length=0;}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--;},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Oe=S,De={isServer:!S,useCSSOMInjection:!w},Re=function(){function e(e,n,o){void 0===e&&(e=C),void 0===n&&(n={});var r=this;this.options=__assign(__assign({},De),e),this.gs=n,this.names=new Map(o),this.server=!!e.isServer,!this.server&&S&&Oe&&(Oe=!1,function(e){for(var t=document.querySelectorAll(we),n=0,o=t.length;n<o;n++){var r=t[n];r&&r.getAttribute(f)!==m&&(Ne(e,r),r.parentNode&&r.parentNode.removeChild(r));}}(this)),ue(this,function(){return function(e){for(var t=e.getTag(),n=t.length,o="",r=function(n){var r=function(e){return ye.get(e)}(n);if(void 0===r)return "continue";var s=e.names.get(r),i=t.getGroup(n);if(void 0===s||0===i.length)return "continue";var a="".concat(f,".g").concat(n,'[id="').concat(r,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","));}),o+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat(g);},s=0;s<n;s++)r(s);return o}(r)});}return e.registerId=function(e){return ge(e)},e.prototype.reconstructWithOptions=function(n,o){return void 0===o&&(o=!0),new e(__assign(__assign({},this.options),n),this.gs,o&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Ae(n):t?new Ce(n):new Ie(n)}(this.options),new fe(e)));var e;},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(ge(e),this.names.has(e))this.names.get(e).add(t);else {var n=new Set;n.add(t),this.names.set(e,n);}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(ge(e),n);},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear();},e.prototype.clearRules=function(e){this.getTag().clearGroup(ge(e)),this.clearNames(e);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),Te=/&/g,ke=/^\s*\/\/.*$/gm;function je(e,t){return e.map(function(e){return "rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return "".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=je(e.children,t)),e})}function xe(e){var t,n,o,r=void 0===e?C:e,s=r.options,i=void 0===s?C:s,a=r.plugins,c=void 0===a?_:a,l=function(e,o,r){return r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?".".concat(t):e},u=c.slice();u.push(function(e){e.type===RULESET$1&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Te,n).replace(o,l));}),i.prefix&&u.push(prefixer$1),u.push(stringify$1);var p=function(e,r,s,a){void 0===r&&(r=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=r,o=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(ke,""),l=compile$1(s||r?"".concat(s," ").concat(r," { ").concat(c," }"):c);i.namespace&&(l=je(l,i.namespace));var p=[];return serialize$1(l,middleware$1(u.concat(rulesheet$1(function(e){return p.push(e)})))),p};return p.hash=c.length?c.reduce(function(e,t){return t.name||he(15),M(e,t.name)},F).toString():"",p}var Ve=new Re,Fe=xe(),Me=React.createContext({shouldForwardProp:void 0,styleSheet:Ve,stylis:Fe});Me.Consumer;React.createContext(void 0);function Be(){return React.useContext(Me)}var Ge=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Fe);var o=n.name+t.hash;e.hasNameForId(n.id,o)||e.insertRules(n.id,o,t(n.rules,o,"@keyframes"));},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,ue(this,function(){throw he(12,String(n.name))});}return e.prototype.getName=function(e){return void 0===e&&(e=Fe),this.name+e.hash},e}(),Ye=function(e){return e>="A"&&e<="Z"};function We(e){for(var t="",n=0;n<e.length;n++){var o=e[n];if(1===n&&"-"===o&&"-"===e[0])return e;Ye(o)?t+="-"+o.toLowerCase():t+=o;}return t.startsWith("ms-")?"-"+t:t}var qe=function(e){return null==e||!1===e||""===e},He=function(t){var n,o,r=[];for(var s in t){var i=t[s];t.hasOwnProperty(s)&&!qe(i)&&(Array.isArray(i)&&i.isCss||re(i)?r.push("".concat(We(s),":"),i,";"):ce(i)?r.push.apply(r,__spreadArray(__spreadArray(["".concat(s," {")],He(i),!1),["}"],!1)):r.push("".concat(We(s),": ").concat((n=s,null==(o=i)||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||n in unitlessKeys$1||n.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function Ue(e,t,n,o){if(qe(e))return [];if(se(e))return [".".concat(e.styledComponentId)];if(re(e)){if(!re(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return [e];var r=e(t);return "production"===process.env.NODE_ENV||"object"!=typeof r||Array.isArray(r)||r instanceof Ge||ce(r)||null===r||console.error("".concat(B(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Ue(r,t,n,o)}var s;return e instanceof Ge?n?(e.inject(n,o),[e.getName(o)]):[e]:ce(e)?He(e):Array.isArray(e)?Array.prototype.concat.apply(_,e.map(function(e){return Ue(e,t,n,o)})):[e.toString()]}function Je(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(re(n)&&!se(n))return !1}return !0}var Xe=$(v),Ze=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&Je(e),this.componentId=t,this.baseHash=M(Xe,t),this.baseStyle=n,Re.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))o=ie(o,this.staticRulesId);else {var r=ae(Ue(this.rules,e,t,n)),s=x(M(this.baseHash,r)>>>0);if(!t.hasNameForId(this.componentId,s)){var i=n(r,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,i);}o=ie(o,s),this.staticRulesId=s;}else {for(var a=M(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u,"production"!==process.env.NODE_ENV&&(a=M(a,u));else if(u){var p=ae(Ue(u,e,t,n));a=M(a,p+l),c+=p;}}if(c){var d=x(a>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),o=ie(o,d);}}return o},e}(),Ke=React.createContext(void 0);Ke.Consumer;var nt={},ot=new Set;function rt(e,r,s){var i=se(e),a=e,c=!L(e),p=r.attrs,d=void 0===p?_:p,h=r.componentId,f=void 0===h?function(e,t){var n="string"!=typeof e?"sc":R(e);nt[n]=(nt[n]||0)+1;var o="".concat(n,"-").concat(z(v+n+nt[n]));return t?"".concat(t,"-").concat(o):o}(r.displayName,r.parentComponentId):h,m=r.displayName,y=void 0===m?function(e){return L(e)?"styled.".concat(e):"Styled(".concat(B(e),")")}(e):m,g=r.displayName&&r.componentId?"".concat(R(r.displayName),"-").concat(r.componentId):r.componentId||f,S=i&&a.attrs?a.attrs.concat(d).filter(Boolean):d,w=r.shouldForwardProp;if(i&&a.shouldForwardProp){var b=a.shouldForwardProp;if(r.shouldForwardProp){var E=r.shouldForwardProp;w=function(e,t){return b(e,t)&&E(e,t)};}else w=b;}var N=new Ze(s,g,i?a.componentStyle:void 0);function O(e,r){return function(e,r,s){var i=e.attrs,a=e.componentStyle,c=e.defaultProps,p=e.foldedComponentIds,d=e.styledComponentId,h=e.target,f=React.useContext(Ke),m=Be(),y=e.shouldForwardProp||m.shouldForwardProp;"production"!==process.env.NODE_ENV&&React.useDebugValue(d);var v=I(r,f,c)||C,g=function(e,n,o){for(var r,s=__assign(__assign({},n),{className:void 0,theme:o}),i=0;i<e.length;i+=1){var a=re(r=e[i])?r(s):r;for(var c in a)s[c]="className"===c?ie(s[c],a[c]):"style"===c?__assign(__assign({},s[c]),a[c]):a[c];}return n.className&&(s.className=ie(s.className,n.className)),s}(i,r,v),S=g.as||h,w={};for(var b in g)void 0===g[b]||"$"===b[0]||"as"===b||"theme"===b&&g.theme===v||("forwardedAs"===b?w.as=g.forwardedAs:y&&!y(b,S)||(w[b]=g[b],y||"development"!==process.env.NODE_ENV||isPropValid$1(b)||ot.has(b)||!A.has(S)||(ot.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var E=function(e,t){var n=Be(),o=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return "production"!==process.env.NODE_ENV&&React.useDebugValue(o),o}(a,g);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(E);var N=ie(p,d);return E&&(N+=" "+E),g.className&&(N+=" "+g.className),w[L(S)&&!A.has(S)?"class":"className"]=N,w.ref=s,React.createElement(S,w)}(D,e,r)}O.displayName=y;var D=React.forwardRef(O);return D.attrs=S,D.componentStyle=N,D.displayName=y,D.shouldForwardProp=w,D.foldedComponentIds=i?ie(a.foldedComponentIds,a.styledComponentId):"",D.styledComponentId=g,D.target=i?a.target:e,Object.defineProperty(D,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var o=0,r=t;o<r.length;o++)le(e,r[o],!0);return e}({},a.defaultProps,e):e;}}),"production"!==process.env.NODE_ENV&&(P(y,g),D.warnTooManyClasses=function(e,t){var n={},o=!1;return function(r){if(!o&&(n[r]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),o=!0,n={};}}}(y,g)),ue(D,function(){return ".".concat(D.styledComponentId)}),c&&oe(D,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),D}function st(e,t){for(var n=[e[0]],o=0,r=t.length;o<r;o+=1)n.push(t[o],e[o+1]);return n}var it=function(e){return Object.assign(e,{isCss:!0})};function at(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(re(t)||ce(t))return it(Ue(st(_,__spreadArray([t],n,!0))));var r=t;return 0===n.length&&1===r.length&&"string"==typeof r[0]?Ue(r):it(Ue(st(r,n)))}function ct(n,o,r){if(void 0===r&&(r=C),!o)throw he(1,o);var s=function(t){for(var s=[],i=1;i<arguments.length;i++)s[i-1]=arguments[i];return n(o,r,at.apply(void 0,__spreadArray([t],s,!1)))};return s.attrs=function(e){return ct(n,o,__assign(__assign({},r),{attrs:Array.prototype.concat(r.attrs,e).filter(Boolean)}))},s.withConfig=function(e){return ct(n,o,__assign(__assign({},r),e))},s}var lt=function(e){return ct(rt,e)},ut=lt;A.forEach(function(e){ut[e]=lt(e);});"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var vt="__sc-".concat(f,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[vt]||(window[vt]=0),1===window[vt]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[vt]+=1);
|
|
37165
37165
|
|
|
37166
|
+
var _templateObject$2;
|
|
37167
|
+
var StandardContainer$1 = ut.section(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n margin: 0 auto;\n min-width: 400px;\n\n @media (min-width: 768px) {\n max-width: 66.6667%; /* 8/12 */\n }\n\n @media (min-width: 992px) {\n max-width: 50%; /* 6/12 */\n }\n\n @media (min-width: 1200px) {\n max-width: 41.6667%; /* 5/12 */\n }\n"])));
|
|
37168
|
+
var Card = function Card(_ref) {
|
|
37169
|
+
var children = _ref.children;
|
|
37170
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StandardContainer$1, null, /*#__PURE__*/React.createElement("section", {
|
|
37171
|
+
style: {
|
|
37172
|
+
border: '1px solid #f2f2f2',
|
|
37173
|
+
borderRadius: '8px',
|
|
37174
|
+
padding: '2.25rem',
|
|
37175
|
+
boxShadow: '0 .75rem 6rem rgba(56, 65, 74, 0.03)',
|
|
37176
|
+
background: '#FFFFFF'
|
|
37177
|
+
},
|
|
37178
|
+
className: "veripass"
|
|
37179
|
+
}, children)));
|
|
37180
|
+
};
|
|
37181
|
+
|
|
37182
|
+
var _templateObject$1;
|
|
37183
|
+
var StandardContainer = ut.section(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n margin: 0 auto;\n min-width: 400px;\n\n @media (min-width: 768px) {\n max-width: 66.6667%; /* 8/12 */\n }\n\n @media (min-width: 992px) {\n max-width: 50%; /* 6/12 */\n }\n\n @media (min-width: 1200px) {\n max-width: 41.6667%; /* 5/12 */\n }\n"])));
|
|
37184
|
+
|
|
37185
|
+
var _templateObject;
|
|
37186
|
+
var KarlaTypography = ut.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: 'Karla', 'Roboto', sans-serif !important;\n font-weight: 600;\n"])));
|
|
37187
|
+
|
|
37166
37188
|
const common = {
|
|
37167
37189
|
black: '#000',
|
|
37168
37190
|
white: '#fff'
|
|
@@ -62193,11 +62215,8 @@ var SecurityService = /*#__PURE__*/function (_BaseApi) {
|
|
|
62193
62215
|
}]);
|
|
62194
62216
|
}(BaseApi);
|
|
62195
62217
|
|
|
62196
|
-
var
|
|
62197
|
-
var
|
|
62198
|
-
var KarlaTypography$1 = ut.span(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n font-family: 'Karla', 'Roboto', sans-serif !important;\n font-weight: 600;\n"])));
|
|
62199
|
-
var swal = withReactContent(Swal);
|
|
62200
|
-
var statusCodeMessages = {
|
|
62218
|
+
var swal$3 = withReactContent(Swal);
|
|
62219
|
+
var statusCodeMessages$3 = {
|
|
62201
62220
|
461: 'The data provided does not match any registered application',
|
|
62202
62221
|
462: 'Unauthorized user. After 3 failed attempts, your account will be locked for 24 hours.',
|
|
62203
62222
|
463: 'The user is not registered in this application, needs to register',
|
|
@@ -62205,11 +62224,11 @@ var statusCodeMessages = {
|
|
|
62205
62224
|
465: 'API key is missing or invalid',
|
|
62206
62225
|
401: 'Error authenticating'
|
|
62207
62226
|
};
|
|
62208
|
-
function signInStandard(_x) {
|
|
62209
|
-
return _signInStandard.apply(this, arguments);
|
|
62227
|
+
function signInStandard$2(_x) {
|
|
62228
|
+
return _signInStandard$2.apply(this, arguments);
|
|
62210
62229
|
}
|
|
62211
|
-
function _signInStandard() {
|
|
62212
|
-
_signInStandard = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
62230
|
+
function _signInStandard$2() {
|
|
62231
|
+
_signInStandard$2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
62213
62232
|
var payload, authProvider, redirectUrl, apiKey, debug, entityService, entityResponse;
|
|
62214
62233
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
62215
62234
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -62230,9 +62249,9 @@ function _signInStandard() {
|
|
|
62230
62249
|
break;
|
|
62231
62250
|
}
|
|
62232
62251
|
_context2.next = 8;
|
|
62233
|
-
return swal.fire({
|
|
62252
|
+
return swal$3.fire({
|
|
62234
62253
|
title: 'Sign-in error',
|
|
62235
|
-
text: statusCodeMessages[entityResponse.status] || 'An error occurred',
|
|
62254
|
+
text: statusCodeMessages$3[entityResponse.status] || 'An error occurred',
|
|
62236
62255
|
icon: 'error'
|
|
62237
62256
|
});
|
|
62238
62257
|
case 8:
|
|
@@ -62248,14 +62267,15 @@ function _signInStandard() {
|
|
|
62248
62267
|
}
|
|
62249
62268
|
}, _callee2);
|
|
62250
62269
|
}));
|
|
62251
|
-
return _signInStandard.apply(this, arguments);
|
|
62270
|
+
return _signInStandard$2.apply(this, arguments);
|
|
62252
62271
|
}
|
|
62253
62272
|
var VeripassStandardSignin = function VeripassStandardSignin(_ref2) {
|
|
62254
62273
|
var _window;
|
|
62255
|
-
var _ref2$
|
|
62256
|
-
|
|
62257
|
-
|
|
62258
|
-
|
|
62274
|
+
var _ref2$organization = _ref2.organization,
|
|
62275
|
+
organization = _ref2$organization === void 0 ? {
|
|
62276
|
+
logoSrc: '',
|
|
62277
|
+
slogan: ''
|
|
62278
|
+
} : _ref2$organization,
|
|
62259
62279
|
_ref2$redirectUrl = _ref2.redirectUrl,
|
|
62260
62280
|
redirectUrl = _ref2$redirectUrl === void 0 ? '' : _ref2$redirectUrl,
|
|
62261
62281
|
_ref2$debug = _ref2.debug,
|
|
@@ -62328,7 +62348,7 @@ var VeripassStandardSignin = function VeripassStandardSignin(_ref2) {
|
|
|
62328
62348
|
break;
|
|
62329
62349
|
}
|
|
62330
62350
|
_context.next = 6;
|
|
62331
|
-
return swal.fire({
|
|
62351
|
+
return swal$3.fire({
|
|
62332
62352
|
title: 'Error entering',
|
|
62333
62353
|
text: 'Please enter an email.',
|
|
62334
62354
|
icon: 'error'
|
|
@@ -62341,7 +62361,7 @@ var VeripassStandardSignin = function VeripassStandardSignin(_ref2) {
|
|
|
62341
62361
|
break;
|
|
62342
62362
|
}
|
|
62343
62363
|
_context.next = 10;
|
|
62344
|
-
return swal.fire({
|
|
62364
|
+
return swal$3.fire({
|
|
62345
62365
|
title: 'Error entering',
|
|
62346
62366
|
text: 'Please enter a password.',
|
|
62347
62367
|
icon: 'error'
|
|
@@ -62350,7 +62370,7 @@ var VeripassStandardSignin = function VeripassStandardSignin(_ref2) {
|
|
|
62350
62370
|
return _context.abrupt("return");
|
|
62351
62371
|
case 11:
|
|
62352
62372
|
_context.next = 13;
|
|
62353
|
-
return signInStandard({
|
|
62373
|
+
return signInStandard$2({
|
|
62354
62374
|
payload: {
|
|
62355
62375
|
email: email,
|
|
62356
62376
|
password: password
|
|
@@ -62387,16 +62407,14 @@ var VeripassStandardSignin = function VeripassStandardSignin(_ref2) {
|
|
|
62387
62407
|
React.useEffect(function () {
|
|
62388
62408
|
initializeComponent();
|
|
62389
62409
|
}, []);
|
|
62390
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
62391
|
-
className: "veripass"
|
|
62392
|
-
}, /*#__PURE__*/React.createElement("header", {
|
|
62410
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StandardContainer, null, /*#__PURE__*/React.createElement("header", {
|
|
62393
62411
|
style: {
|
|
62394
62412
|
textAlign: 'center'
|
|
62395
62413
|
}
|
|
62396
62414
|
}, /*#__PURE__*/React.createElement("a", {
|
|
62397
62415
|
href: "/"
|
|
62398
62416
|
}, /*#__PURE__*/React.createElement("img", {
|
|
62399
|
-
src:
|
|
62417
|
+
src: organization === null || organization === void 0 ? void 0 : organization.logoSrc,
|
|
62400
62418
|
alt: "",
|
|
62401
62419
|
height: "75",
|
|
62402
62420
|
style: {
|
|
@@ -62411,20 +62429,12 @@ var VeripassStandardSignin = function VeripassStandardSignin(_ref2) {
|
|
|
62411
62429
|
color: '#98a6ad',
|
|
62412
62430
|
fontWeight: 300
|
|
62413
62431
|
}
|
|
62414
|
-
},
|
|
62415
|
-
style: {
|
|
62416
|
-
border: '1px solid #f2f2f2',
|
|
62417
|
-
borderRadius: '8px',
|
|
62418
|
-
padding: '2.25rem',
|
|
62419
|
-
boxShadow: '0 .75rem 6rem rgba(56, 65, 74, 0.03)',
|
|
62420
|
-
background: '#FFFFFF'
|
|
62421
|
-
}
|
|
62422
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
62432
|
+
}, organization === null || organization === void 0 ? void 0 : organization.slogan)), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
|
|
62423
62433
|
style: {
|
|
62424
62434
|
textAlign: 'center',
|
|
62425
62435
|
marginBottom: '32px'
|
|
62426
62436
|
}
|
|
62427
|
-
}, /*#__PURE__*/React.createElement(KarlaTypography
|
|
62437
|
+
}, /*#__PURE__*/React.createElement(KarlaTypography, {
|
|
62428
62438
|
style: {
|
|
62429
62439
|
color: '#343a40'
|
|
62430
62440
|
}
|
|
@@ -62540,9 +62550,6 @@ var VeripassStandardSignin = function VeripassStandardSignin(_ref2) {
|
|
|
62540
62550
|
}), isLoading ? 'Loading...' : 'Log in'))))));
|
|
62541
62551
|
};
|
|
62542
62552
|
|
|
62543
|
-
var _templateObject, _templateObject2;
|
|
62544
|
-
var StandarSigninContainer = ut.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0 auto;\n min-width: 400px;\n\n @media (min-width: 768px) {\n max-width: 66.6667%; /* 8/12 */\n }\n\n @media (min-width: 992px) {\n max-width: 50%; /* 6/12 */\n }\n\n @media (min-width: 1200px) {\n max-width: 41.6667%; /* 5/12 */\n }\n"])));
|
|
62545
|
-
var KarlaTypography = ut.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-family: 'Karla', 'Roboto', sans-serif !important;\n font-weight: 600;\n"])));
|
|
62546
62553
|
var VeripassLogoutSuccess = function VeripassLogoutSuccess(_ref) {
|
|
62547
62554
|
var _ref$organization = _ref.organization,
|
|
62548
62555
|
organization = _ref$organization === void 0 ? {
|
|
@@ -62561,16 +62568,7 @@ var VeripassLogoutSuccess = function VeripassLogoutSuccess(_ref) {
|
|
|
62561
62568
|
React.useEffect(function () {
|
|
62562
62569
|
authProvider.logout();
|
|
62563
62570
|
}, []);
|
|
62564
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
62565
|
-
style: {
|
|
62566
|
-
border: '1px solid #f2f2f2',
|
|
62567
|
-
borderRadius: '8px',
|
|
62568
|
-
padding: '2.25rem',
|
|
62569
|
-
boxShadow: '0 .75rem 6rem rgba(56, 65, 74, 0.03)',
|
|
62570
|
-
background: '#FFFFFF'
|
|
62571
|
-
},
|
|
62572
|
-
className: "veripass"
|
|
62573
|
-
}, /*#__PURE__*/React.createElement("header", {
|
|
62571
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StandardContainer, null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("header", {
|
|
62574
62572
|
style: {
|
|
62575
62573
|
textAlign: 'center'
|
|
62576
62574
|
}
|
|
@@ -62656,10 +62654,837 @@ var VeripassLogoutSuccess = function VeripassLogoutSuccess(_ref) {
|
|
|
62656
62654
|
}, /*#__PURE__*/React.createElement("b", null, texts === null || texts === void 0 ? void 0 : texts.signinText)))))));
|
|
62657
62655
|
};
|
|
62658
62656
|
|
|
62657
|
+
var swal$2 = withReactContent(Swal);
|
|
62658
|
+
var statusCodeMessages$2 = {
|
|
62659
|
+
461: 'The data provided does not match any registered application',
|
|
62660
|
+
462: 'Unauthorized user. After 3 failed attempts, your account will be locked for 24 hours.',
|
|
62661
|
+
463: 'The user is not registered in this application, needs to register',
|
|
62662
|
+
464: 'Unauthorized. After 3 failed attempts, your account will be locked for 24 hours.',
|
|
62663
|
+
465: 'API key is missing or invalid',
|
|
62664
|
+
401: 'Error authenticating'
|
|
62665
|
+
};
|
|
62666
|
+
function signInStandard$1(_x) {
|
|
62667
|
+
return _signInStandard$1.apply(this, arguments);
|
|
62668
|
+
}
|
|
62669
|
+
function _signInStandard$1() {
|
|
62670
|
+
_signInStandard$1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
62671
|
+
var payload, authProvider, redirectUrl, apiKey, debug, entityService, entityResponse;
|
|
62672
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
62673
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
62674
|
+
case 0:
|
|
62675
|
+
payload = _ref.payload, authProvider = _ref.authProvider, redirectUrl = _ref.redirectUrl, apiKey = _ref.apiKey, debug = _ref.debug;
|
|
62676
|
+
entityService = new SecurityService({
|
|
62677
|
+
apiKey: apiKey,
|
|
62678
|
+
settings: {
|
|
62679
|
+
debug: debug
|
|
62680
|
+
}
|
|
62681
|
+
});
|
|
62682
|
+
_context2.next = 4;
|
|
62683
|
+
return entityService.signInStandard(payload);
|
|
62684
|
+
case 4:
|
|
62685
|
+
entityResponse = _context2.sent;
|
|
62686
|
+
if (!(!entityResponse || !entityResponse.result)) {
|
|
62687
|
+
_context2.next = 9;
|
|
62688
|
+
break;
|
|
62689
|
+
}
|
|
62690
|
+
_context2.next = 8;
|
|
62691
|
+
return swal$2.fire({
|
|
62692
|
+
title: 'Sign-in error',
|
|
62693
|
+
text: statusCodeMessages$2[entityResponse.status] || 'An error occurred',
|
|
62694
|
+
icon: 'error'
|
|
62695
|
+
});
|
|
62696
|
+
case 8:
|
|
62697
|
+
return _context2.abrupt("return");
|
|
62698
|
+
case 9:
|
|
62699
|
+
authProvider.login({
|
|
62700
|
+
user: entityResponse.result || {},
|
|
62701
|
+
redirectUrl: redirectUrl
|
|
62702
|
+
});
|
|
62703
|
+
case 10:
|
|
62704
|
+
case "end":
|
|
62705
|
+
return _context2.stop();
|
|
62706
|
+
}
|
|
62707
|
+
}, _callee2);
|
|
62708
|
+
}));
|
|
62709
|
+
return _signInStandard$1.apply(this, arguments);
|
|
62710
|
+
}
|
|
62711
|
+
var VeripassStandardRecoverPassword = function VeripassStandardRecoverPassword(_ref2) {
|
|
62712
|
+
var _window;
|
|
62713
|
+
var _ref2$organization = _ref2.organization,
|
|
62714
|
+
organization = _ref2$organization === void 0 ? {
|
|
62715
|
+
logoSrc: '',
|
|
62716
|
+
slogan: ''
|
|
62717
|
+
} : _ref2$organization,
|
|
62718
|
+
_ref2$redirectUrl = _ref2.redirectUrl,
|
|
62719
|
+
redirectUrl = _ref2$redirectUrl === void 0 ? '' : _ref2$redirectUrl,
|
|
62720
|
+
_ref2$debug = _ref2.debug,
|
|
62721
|
+
debug = _ref2$debug === void 0 ? false : _ref2$debug,
|
|
62722
|
+
_ref2$apiKey = _ref2.apiKey,
|
|
62723
|
+
apiKey = _ref2$apiKey === void 0 ? '' : _ref2$apiKey;
|
|
62724
|
+
// Hooks
|
|
62725
|
+
var authProvider = useAuth();
|
|
62726
|
+
var searchParams = new URLSearchParams((_window = window) === null || _window === void 0 || (_window = _window.location) === null || _window === void 0 ? void 0 : _window.search);
|
|
62727
|
+
|
|
62728
|
+
// UI States
|
|
62729
|
+
var _useState = React.useState(false),
|
|
62730
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62731
|
+
isLoading = _useState2[0],
|
|
62732
|
+
setIsLoading = _useState2[1];
|
|
62733
|
+
var _React$useState = React.useState(false),
|
|
62734
|
+
_React$useState2 = _slicedToArray(_React$useState, 2);
|
|
62735
|
+
_React$useState2[0];
|
|
62736
|
+
_React$useState2[1];
|
|
62737
|
+
|
|
62738
|
+
// Entity states
|
|
62739
|
+
var _useState3 = React.useState(''),
|
|
62740
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
62741
|
+
email = _useState4[0],
|
|
62742
|
+
setEmail = _useState4[1];
|
|
62743
|
+
var showError = function showError(_ref3) {
|
|
62744
|
+
var title = _ref3.title,
|
|
62745
|
+
message = _ref3.message;
|
|
62746
|
+
Swal.fire({
|
|
62747
|
+
title: title || 'Failed to sign-in',
|
|
62748
|
+
text: message || '',
|
|
62749
|
+
icon: 'error'
|
|
62750
|
+
}).then(function () {
|
|
62751
|
+
var _window2;
|
|
62752
|
+
searchParams["delete"]('error');
|
|
62753
|
+
window.location.replace("".concat((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.location) === null || _window2 === void 0 ? void 0 : _window2.pathname, "?").concat(searchParams.toString()));
|
|
62754
|
+
});
|
|
62755
|
+
};
|
|
62756
|
+
var setErrors = function setErrors() {
|
|
62757
|
+
var error = searchParams.get('error');
|
|
62758
|
+
switch (error) {
|
|
62759
|
+
case 'insufficient_permissions':
|
|
62760
|
+
showError({
|
|
62761
|
+
title: 'Insufficient permissions',
|
|
62762
|
+
message: 'You do not have sufficient permissions to enter.'
|
|
62763
|
+
});
|
|
62764
|
+
break;
|
|
62765
|
+
case 'access_denied':
|
|
62766
|
+
showError({
|
|
62767
|
+
title: 'Access denied',
|
|
62768
|
+
message: 'Your account does not have access to this application.'
|
|
62769
|
+
});
|
|
62770
|
+
break;
|
|
62771
|
+
}
|
|
62772
|
+
};
|
|
62773
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
62774
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
62775
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
62776
|
+
while (1) switch (_context.prev = _context.next) {
|
|
62777
|
+
case 0:
|
|
62778
|
+
_context.prev = 0;
|
|
62779
|
+
event.preventDefault();
|
|
62780
|
+
setIsLoading(true);
|
|
62781
|
+
if (email) {
|
|
62782
|
+
_context.next = 7;
|
|
62783
|
+
break;
|
|
62784
|
+
}
|
|
62785
|
+
_context.next = 6;
|
|
62786
|
+
return swal$2.fire({
|
|
62787
|
+
title: 'Error entering',
|
|
62788
|
+
text: 'Please enter an email.',
|
|
62789
|
+
icon: 'error'
|
|
62790
|
+
});
|
|
62791
|
+
case 6:
|
|
62792
|
+
return _context.abrupt("return");
|
|
62793
|
+
case 7:
|
|
62794
|
+
_context.next = 9;
|
|
62795
|
+
return signInStandard$1({
|
|
62796
|
+
payload: {
|
|
62797
|
+
email: email
|
|
62798
|
+
},
|
|
62799
|
+
authProvider: authProvider,
|
|
62800
|
+
redirectUrl: redirectUrl,
|
|
62801
|
+
apiKey: apiKey,
|
|
62802
|
+
debug: debug
|
|
62803
|
+
});
|
|
62804
|
+
case 9:
|
|
62805
|
+
_context.next = 14;
|
|
62806
|
+
break;
|
|
62807
|
+
case 11:
|
|
62808
|
+
_context.prev = 11;
|
|
62809
|
+
_context.t0 = _context["catch"](0);
|
|
62810
|
+
console.error(_context.t0);
|
|
62811
|
+
case 14:
|
|
62812
|
+
_context.prev = 14;
|
|
62813
|
+
setIsLoading(false);
|
|
62814
|
+
return _context.finish(14);
|
|
62815
|
+
case 17:
|
|
62816
|
+
case "end":
|
|
62817
|
+
return _context.stop();
|
|
62818
|
+
}
|
|
62819
|
+
}, _callee, null, [[0, 11, 14, 17]]);
|
|
62820
|
+
}));
|
|
62821
|
+
return function handleSubmit(_x2) {
|
|
62822
|
+
return _ref4.apply(this, arguments);
|
|
62823
|
+
};
|
|
62824
|
+
}();
|
|
62825
|
+
var initializeComponent = function initializeComponent() {
|
|
62826
|
+
setErrors();
|
|
62827
|
+
};
|
|
62828
|
+
React.useEffect(function () {
|
|
62829
|
+
initializeComponent();
|
|
62830
|
+
}, []);
|
|
62831
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StandardContainer, null, /*#__PURE__*/React.createElement("header", {
|
|
62832
|
+
style: {
|
|
62833
|
+
textAlign: 'center'
|
|
62834
|
+
}
|
|
62835
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
62836
|
+
href: "/"
|
|
62837
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
62838
|
+
src: organization === null || organization === void 0 ? void 0 : organization.logoSrc,
|
|
62839
|
+
alt: "",
|
|
62840
|
+
height: "75",
|
|
62841
|
+
style: {
|
|
62842
|
+
display: 'block',
|
|
62843
|
+
margin: '0 auto'
|
|
62844
|
+
}
|
|
62845
|
+
})), /*#__PURE__*/React.createElement(Typography$1, {
|
|
62846
|
+
variant: "body2",
|
|
62847
|
+
style: {
|
|
62848
|
+
marginTop: '16px',
|
|
62849
|
+
marginBottom: '24px',
|
|
62850
|
+
color: '#98a6ad',
|
|
62851
|
+
fontWeight: 300
|
|
62852
|
+
}
|
|
62853
|
+
}, organization === null || organization === void 0 ? void 0 : organization.slogan)), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
|
|
62854
|
+
style: {
|
|
62855
|
+
textAlign: 'center',
|
|
62856
|
+
marginBottom: '32px'
|
|
62857
|
+
}
|
|
62858
|
+
}, /*#__PURE__*/React.createElement(KarlaTypography, {
|
|
62859
|
+
style: {
|
|
62860
|
+
color: '#343a40'
|
|
62861
|
+
}
|
|
62862
|
+
}, "Recover password")), /*#__PURE__*/React.createElement("form", {
|
|
62863
|
+
onSubmit: handleSubmit,
|
|
62864
|
+
autoComplete: "off"
|
|
62865
|
+
}, /*#__PURE__*/React.createElement("section", {
|
|
62866
|
+
style: {
|
|
62867
|
+
marginBottom: '16px',
|
|
62868
|
+
margin: '10px 0'
|
|
62869
|
+
}
|
|
62870
|
+
}, /*#__PURE__*/React.createElement(TextField$1, {
|
|
62871
|
+
fullWidth: true,
|
|
62872
|
+
type: "email",
|
|
62873
|
+
id: "email-input",
|
|
62874
|
+
label: "Email address",
|
|
62875
|
+
value: email,
|
|
62876
|
+
placeholder: "Type your email",
|
|
62877
|
+
required: true,
|
|
62878
|
+
onChange: function onChange(e) {
|
|
62879
|
+
return setEmail(e.target.value);
|
|
62880
|
+
},
|
|
62881
|
+
autoComplete: "etrune-email",
|
|
62882
|
+
InputLabelProps: {
|
|
62883
|
+
shrink: true
|
|
62884
|
+
}
|
|
62885
|
+
})), /*#__PURE__*/React.createElement("footer", {
|
|
62886
|
+
style: {
|
|
62887
|
+
marginBottom: '16px',
|
|
62888
|
+
display: 'flex',
|
|
62889
|
+
justifyContent: 'center'
|
|
62890
|
+
}
|
|
62891
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
62892
|
+
type: "submit",
|
|
62893
|
+
variant: "contained",
|
|
62894
|
+
disabled: isLoading,
|
|
62895
|
+
sx: {
|
|
62896
|
+
display: 'flex',
|
|
62897
|
+
alignItems: 'center',
|
|
62898
|
+
border: '2px solid #232931',
|
|
62899
|
+
backgroundColor: '#323a46',
|
|
62900
|
+
color: '#fff',
|
|
62901
|
+
'&:hover': {
|
|
62902
|
+
backgroundColor: '#3d4c61'
|
|
62903
|
+
},
|
|
62904
|
+
width: '100%'
|
|
62905
|
+
}
|
|
62906
|
+
}, isLoading && /*#__PURE__*/React.createElement(CircularProgress$1, {
|
|
62907
|
+
size: 20,
|
|
62908
|
+
style: {
|
|
62909
|
+
marginRight: '8px',
|
|
62910
|
+
color: '#fff'
|
|
62911
|
+
}
|
|
62912
|
+
}), isLoading ? 'Recovering...' : 'Recover'))))));
|
|
62913
|
+
};
|
|
62914
|
+
|
|
62915
|
+
var swal$1 = withReactContent(Swal);
|
|
62916
|
+
var statusCodeMessages$1 = {
|
|
62917
|
+
461: 'The data provided does not match any registered application',
|
|
62918
|
+
462: 'Unauthorized user. After 3 failed attempts, your account will be locked for 24 hours.',
|
|
62919
|
+
463: 'The user is not registered in this application, needs to register',
|
|
62920
|
+
464: 'Unauthorized. After 3 failed attempts, your account will be locked for 24 hours.',
|
|
62921
|
+
465: 'API key is missing or invalid',
|
|
62922
|
+
401: 'Error authenticating'
|
|
62923
|
+
};
|
|
62924
|
+
function signInStandard(_x) {
|
|
62925
|
+
return _signInStandard.apply(this, arguments);
|
|
62926
|
+
}
|
|
62927
|
+
function _signInStandard() {
|
|
62928
|
+
_signInStandard = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
62929
|
+
var payload, authProvider, redirectUrl, apiKey, debug, entityService, entityResponse;
|
|
62930
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
62931
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
62932
|
+
case 0:
|
|
62933
|
+
payload = _ref.payload, authProvider = _ref.authProvider, redirectUrl = _ref.redirectUrl, apiKey = _ref.apiKey, debug = _ref.debug;
|
|
62934
|
+
entityService = new SecurityService({
|
|
62935
|
+
apiKey: apiKey,
|
|
62936
|
+
settings: {
|
|
62937
|
+
debug: debug
|
|
62938
|
+
}
|
|
62939
|
+
});
|
|
62940
|
+
_context2.next = 4;
|
|
62941
|
+
return entityService.signInStandard(payload);
|
|
62942
|
+
case 4:
|
|
62943
|
+
entityResponse = _context2.sent;
|
|
62944
|
+
if (!(!entityResponse || !entityResponse.result)) {
|
|
62945
|
+
_context2.next = 9;
|
|
62946
|
+
break;
|
|
62947
|
+
}
|
|
62948
|
+
_context2.next = 8;
|
|
62949
|
+
return swal$1.fire({
|
|
62950
|
+
title: 'Sign-in error',
|
|
62951
|
+
text: statusCodeMessages$1[entityResponse.status] || 'An error occurred',
|
|
62952
|
+
icon: 'error'
|
|
62953
|
+
});
|
|
62954
|
+
case 8:
|
|
62955
|
+
return _context2.abrupt("return");
|
|
62956
|
+
case 9:
|
|
62957
|
+
authProvider.login({
|
|
62958
|
+
user: entityResponse.result || {},
|
|
62959
|
+
redirectUrl: redirectUrl
|
|
62960
|
+
});
|
|
62961
|
+
case 10:
|
|
62962
|
+
case "end":
|
|
62963
|
+
return _context2.stop();
|
|
62964
|
+
}
|
|
62965
|
+
}, _callee2);
|
|
62966
|
+
}));
|
|
62967
|
+
return _signInStandard.apply(this, arguments);
|
|
62968
|
+
}
|
|
62969
|
+
var VeripassNewPassword = function VeripassNewPassword(_ref2) {
|
|
62970
|
+
var _window;
|
|
62971
|
+
var _ref2$organization = _ref2.organization,
|
|
62972
|
+
organization = _ref2$organization === void 0 ? {
|
|
62973
|
+
logoSrc: '',
|
|
62974
|
+
slogan: ''
|
|
62975
|
+
} : _ref2$organization,
|
|
62976
|
+
_ref2$redirectUrl = _ref2.redirectUrl,
|
|
62977
|
+
redirectUrl = _ref2$redirectUrl === void 0 ? '' : _ref2$redirectUrl,
|
|
62978
|
+
_ref2$debug = _ref2.debug,
|
|
62979
|
+
debug = _ref2$debug === void 0 ? false : _ref2$debug,
|
|
62980
|
+
_ref2$apiKey = _ref2.apiKey,
|
|
62981
|
+
apiKey = _ref2$apiKey === void 0 ? '' : _ref2$apiKey;
|
|
62982
|
+
// Hooks
|
|
62983
|
+
var authProvider = useAuth();
|
|
62984
|
+
var searchParams = new URLSearchParams((_window = window) === null || _window === void 0 || (_window = _window.location) === null || _window === void 0 ? void 0 : _window.search);
|
|
62985
|
+
|
|
62986
|
+
// UI States
|
|
62987
|
+
var _useState = React.useState(false),
|
|
62988
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62989
|
+
isLoading = _useState2[0],
|
|
62990
|
+
setIsLoading = _useState2[1];
|
|
62991
|
+
var _React$useState = React.useState(false),
|
|
62992
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
62993
|
+
showPassword = _React$useState2[0],
|
|
62994
|
+
setShowPassword = _React$useState2[1];
|
|
62995
|
+
|
|
62996
|
+
// Entity states
|
|
62997
|
+
var _useState3 = React.useState(''),
|
|
62998
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
62999
|
+
password = _useState4[0],
|
|
63000
|
+
setPassword = _useState4[1];
|
|
63001
|
+
var showError = function showError(_ref3) {
|
|
63002
|
+
var title = _ref3.title,
|
|
63003
|
+
message = _ref3.message;
|
|
63004
|
+
Swal.fire({
|
|
63005
|
+
title: title || 'Failed to sign-in',
|
|
63006
|
+
text: message || '',
|
|
63007
|
+
icon: 'error'
|
|
63008
|
+
}).then(function () {
|
|
63009
|
+
var _window2;
|
|
63010
|
+
searchParams["delete"]('error');
|
|
63011
|
+
window.location.replace("".concat((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.location) === null || _window2 === void 0 ? void 0 : _window2.pathname, "?").concat(searchParams.toString()));
|
|
63012
|
+
});
|
|
63013
|
+
};
|
|
63014
|
+
var setErrors = function setErrors() {
|
|
63015
|
+
var error = searchParams.get('error');
|
|
63016
|
+
switch (error) {
|
|
63017
|
+
case 'insufficient_permissions':
|
|
63018
|
+
showError({
|
|
63019
|
+
title: 'Insufficient permissions',
|
|
63020
|
+
message: 'You do not have sufficient permissions to enter.'
|
|
63021
|
+
});
|
|
63022
|
+
break;
|
|
63023
|
+
case 'access_denied':
|
|
63024
|
+
showError({
|
|
63025
|
+
title: 'Access denied',
|
|
63026
|
+
message: 'Your account does not have access to this application.'
|
|
63027
|
+
});
|
|
63028
|
+
break;
|
|
63029
|
+
}
|
|
63030
|
+
};
|
|
63031
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
63032
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
63033
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
63034
|
+
while (1) switch (_context.prev = _context.next) {
|
|
63035
|
+
case 0:
|
|
63036
|
+
_context.prev = 0;
|
|
63037
|
+
event.preventDefault();
|
|
63038
|
+
setIsLoading(true);
|
|
63039
|
+
if (password) {
|
|
63040
|
+
_context.next = 7;
|
|
63041
|
+
break;
|
|
63042
|
+
}
|
|
63043
|
+
_context.next = 6;
|
|
63044
|
+
return swal$1.fire({
|
|
63045
|
+
title: 'Error entering',
|
|
63046
|
+
text: 'Please enter a password.',
|
|
63047
|
+
icon: 'error'
|
|
63048
|
+
});
|
|
63049
|
+
case 6:
|
|
63050
|
+
return _context.abrupt("return");
|
|
63051
|
+
case 7:
|
|
63052
|
+
_context.next = 9;
|
|
63053
|
+
return signInStandard({
|
|
63054
|
+
payload: {
|
|
63055
|
+
password: password
|
|
63056
|
+
},
|
|
63057
|
+
authProvider: authProvider,
|
|
63058
|
+
redirectUrl: redirectUrl,
|
|
63059
|
+
apiKey: apiKey,
|
|
63060
|
+
debug: debug
|
|
63061
|
+
});
|
|
63062
|
+
case 9:
|
|
63063
|
+
_context.next = 14;
|
|
63064
|
+
break;
|
|
63065
|
+
case 11:
|
|
63066
|
+
_context.prev = 11;
|
|
63067
|
+
_context.t0 = _context["catch"](0);
|
|
63068
|
+
console.error(_context.t0);
|
|
63069
|
+
case 14:
|
|
63070
|
+
_context.prev = 14;
|
|
63071
|
+
setIsLoading(false);
|
|
63072
|
+
return _context.finish(14);
|
|
63073
|
+
case 17:
|
|
63074
|
+
case "end":
|
|
63075
|
+
return _context.stop();
|
|
63076
|
+
}
|
|
63077
|
+
}, _callee, null, [[0, 11, 14, 17]]);
|
|
63078
|
+
}));
|
|
63079
|
+
return function handleSubmit(_x2) {
|
|
63080
|
+
return _ref4.apply(this, arguments);
|
|
63081
|
+
};
|
|
63082
|
+
}();
|
|
63083
|
+
var initializeComponent = function initializeComponent() {
|
|
63084
|
+
setErrors();
|
|
63085
|
+
};
|
|
63086
|
+
React.useEffect(function () {
|
|
63087
|
+
initializeComponent();
|
|
63088
|
+
}, []);
|
|
63089
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StandardContainer, null, /*#__PURE__*/React.createElement("header", {
|
|
63090
|
+
style: {
|
|
63091
|
+
textAlign: 'center'
|
|
63092
|
+
}
|
|
63093
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
63094
|
+
href: "/"
|
|
63095
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
63096
|
+
src: organization === null || organization === void 0 ? void 0 : organization.logoSrc,
|
|
63097
|
+
alt: "",
|
|
63098
|
+
height: "75",
|
|
63099
|
+
style: {
|
|
63100
|
+
display: 'block',
|
|
63101
|
+
margin: '0 auto'
|
|
63102
|
+
}
|
|
63103
|
+
})), /*#__PURE__*/React.createElement(Typography$1, {
|
|
63104
|
+
variant: "body2",
|
|
63105
|
+
style: {
|
|
63106
|
+
marginTop: '16px',
|
|
63107
|
+
marginBottom: '24px',
|
|
63108
|
+
color: '#98a6ad',
|
|
63109
|
+
fontWeight: 300
|
|
63110
|
+
}
|
|
63111
|
+
}, organization === null || organization === void 0 ? void 0 : organization.slogan)), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
|
|
63112
|
+
style: {
|
|
63113
|
+
textAlign: 'center',
|
|
63114
|
+
marginBottom: '32px'
|
|
63115
|
+
}
|
|
63116
|
+
}, /*#__PURE__*/React.createElement(KarlaTypography, {
|
|
63117
|
+
style: {
|
|
63118
|
+
color: '#343a40'
|
|
63119
|
+
}
|
|
63120
|
+
}, "New password")), /*#__PURE__*/React.createElement("form", {
|
|
63121
|
+
onSubmit: handleSubmit,
|
|
63122
|
+
autoComplete: "off"
|
|
63123
|
+
}, /*#__PURE__*/React.createElement("section", {
|
|
63124
|
+
style: {
|
|
63125
|
+
marginBottom: '16px'
|
|
63126
|
+
}
|
|
63127
|
+
}, /*#__PURE__*/React.createElement(TextField$1, {
|
|
63128
|
+
fullWidth: true,
|
|
63129
|
+
label: "Password",
|
|
63130
|
+
type: showPassword ? 'text' : 'password',
|
|
63131
|
+
value: password,
|
|
63132
|
+
onChange: function onChange(event) {
|
|
63133
|
+
return setPassword(event.target.value);
|
|
63134
|
+
},
|
|
63135
|
+
InputProps: {
|
|
63136
|
+
endAdornment: /*#__PURE__*/React.createElement(InputAdornment$1, {
|
|
63137
|
+
position: "end"
|
|
63138
|
+
}, /*#__PURE__*/React.createElement(IconButton$1, {
|
|
63139
|
+
"aria-label": "toggle password visibility",
|
|
63140
|
+
onClick: function onClick() {
|
|
63141
|
+
return setShowPassword(function (show) {
|
|
63142
|
+
return !show;
|
|
63143
|
+
});
|
|
63144
|
+
},
|
|
63145
|
+
onMouseDown: function onMouseDown(event) {
|
|
63146
|
+
event.preventDefault();
|
|
63147
|
+
},
|
|
63148
|
+
edge: "end"
|
|
63149
|
+
}, showPassword ? /*#__PURE__*/React.createElement(VisibilityIcon, null) : /*#__PURE__*/React.createElement(VisibilityOffIcon, null)))
|
|
63150
|
+
},
|
|
63151
|
+
InputLabelProps: {
|
|
63152
|
+
shrink: true
|
|
63153
|
+
}
|
|
63154
|
+
})), /*#__PURE__*/React.createElement("footer", {
|
|
63155
|
+
style: {
|
|
63156
|
+
marginBottom: '16px',
|
|
63157
|
+
display: 'flex',
|
|
63158
|
+
justifyContent: 'center'
|
|
63159
|
+
}
|
|
63160
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
63161
|
+
type: "submit",
|
|
63162
|
+
variant: "contained",
|
|
63163
|
+
disabled: isLoading,
|
|
63164
|
+
sx: {
|
|
63165
|
+
display: 'flex',
|
|
63166
|
+
alignItems: 'center',
|
|
63167
|
+
border: '2px solid #232931',
|
|
63168
|
+
backgroundColor: '#323a46',
|
|
63169
|
+
color: '#fff',
|
|
63170
|
+
'&:hover': {
|
|
63171
|
+
backgroundColor: '#3d4c61'
|
|
63172
|
+
},
|
|
63173
|
+
width: '100%'
|
|
63174
|
+
}
|
|
63175
|
+
}, isLoading && /*#__PURE__*/React.createElement(CircularProgress$1, {
|
|
63176
|
+
size: 20,
|
|
63177
|
+
style: {
|
|
63178
|
+
marginRight: '8px',
|
|
63179
|
+
color: '#fff'
|
|
63180
|
+
}
|
|
63181
|
+
}), isLoading ? 'Changing...' : 'Change password'))))));
|
|
63182
|
+
};
|
|
63183
|
+
|
|
63184
|
+
var swal = withReactContent(Swal);
|
|
63185
|
+
var statusCodeMessages = {
|
|
63186
|
+
461: 'The data provided does not match any registered application',
|
|
63187
|
+
462: 'Unauthorized user. After 3 failed attempts, your account will be locked for 24 hours.',
|
|
63188
|
+
463: 'The user is not registered in this application, needs to register',
|
|
63189
|
+
464: 'Unauthorized. After 3 failed attempts, your account will be locked for 24 hours.',
|
|
63190
|
+
465: 'API key is missing or invalid',
|
|
63191
|
+
401: 'Error authenticating'
|
|
63192
|
+
};
|
|
63193
|
+
function unlockStandard(_x) {
|
|
63194
|
+
return _unlockStandard.apply(this, arguments);
|
|
63195
|
+
}
|
|
63196
|
+
function _unlockStandard() {
|
|
63197
|
+
_unlockStandard = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
63198
|
+
var payload, authProvider, redirectUrl, apiKey, debug, entityService, entityResponse;
|
|
63199
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
63200
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
63201
|
+
case 0:
|
|
63202
|
+
payload = _ref.payload, authProvider = _ref.authProvider, redirectUrl = _ref.redirectUrl, apiKey = _ref.apiKey, debug = _ref.debug;
|
|
63203
|
+
entityService = new SecurityService({
|
|
63204
|
+
apiKey: apiKey,
|
|
63205
|
+
settings: {
|
|
63206
|
+
debug: debug
|
|
63207
|
+
}
|
|
63208
|
+
});
|
|
63209
|
+
_context2.next = 4;
|
|
63210
|
+
return entityService.signInStandard(payload);
|
|
63211
|
+
case 4:
|
|
63212
|
+
entityResponse = _context2.sent;
|
|
63213
|
+
if (!(!entityResponse || !entityResponse.result)) {
|
|
63214
|
+
_context2.next = 9;
|
|
63215
|
+
break;
|
|
63216
|
+
}
|
|
63217
|
+
_context2.next = 8;
|
|
63218
|
+
return swal.fire({
|
|
63219
|
+
title: 'Sign-in error',
|
|
63220
|
+
text: statusCodeMessages[entityResponse.status] || 'An error occurred',
|
|
63221
|
+
icon: 'error'
|
|
63222
|
+
});
|
|
63223
|
+
case 8:
|
|
63224
|
+
return _context2.abrupt("return");
|
|
63225
|
+
case 9:
|
|
63226
|
+
authProvider.login({
|
|
63227
|
+
user: entityResponse.result || {},
|
|
63228
|
+
redirectUrl: redirectUrl
|
|
63229
|
+
});
|
|
63230
|
+
case 10:
|
|
63231
|
+
case "end":
|
|
63232
|
+
return _context2.stop();
|
|
63233
|
+
}
|
|
63234
|
+
}, _callee2);
|
|
63235
|
+
}));
|
|
63236
|
+
return _unlockStandard.apply(this, arguments);
|
|
63237
|
+
}
|
|
63238
|
+
var VeripassStandardUnlock = function VeripassStandardUnlock(_ref2) {
|
|
63239
|
+
var _window;
|
|
63240
|
+
var _ref2$organization = _ref2.organization,
|
|
63241
|
+
organization = _ref2$organization === void 0 ? {
|
|
63242
|
+
logoSrc: '',
|
|
63243
|
+
slogan: ''
|
|
63244
|
+
} : _ref2$organization,
|
|
63245
|
+
_ref2$redirectUrl = _ref2.redirectUrl,
|
|
63246
|
+
redirectUrl = _ref2$redirectUrl === void 0 ? '' : _ref2$redirectUrl,
|
|
63247
|
+
_ref2$debug = _ref2.debug,
|
|
63248
|
+
debug = _ref2$debug === void 0 ? false : _ref2$debug,
|
|
63249
|
+
_ref2$apiKey = _ref2.apiKey,
|
|
63250
|
+
apiKey = _ref2$apiKey === void 0 ? '' : _ref2$apiKey;
|
|
63251
|
+
// Hooks
|
|
63252
|
+
var authProvider = useAuth();
|
|
63253
|
+
var searchParams = new URLSearchParams((_window = window) === null || _window === void 0 || (_window = _window.location) === null || _window === void 0 ? void 0 : _window.search);
|
|
63254
|
+
|
|
63255
|
+
// UI States
|
|
63256
|
+
var _useState = React.useState(false),
|
|
63257
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
63258
|
+
isLoading = _useState2[0],
|
|
63259
|
+
setIsLoading = _useState2[1];
|
|
63260
|
+
var _React$useState = React.useState(false),
|
|
63261
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
63262
|
+
showPassword = _React$useState2[0],
|
|
63263
|
+
setShowPassword = _React$useState2[1];
|
|
63264
|
+
|
|
63265
|
+
// Entity states
|
|
63266
|
+
var _useState3 = React.useState(''),
|
|
63267
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
63268
|
+
password = _useState4[0],
|
|
63269
|
+
setPassword = _useState4[1];
|
|
63270
|
+
var showError = function showError(_ref3) {
|
|
63271
|
+
var title = _ref3.title,
|
|
63272
|
+
message = _ref3.message;
|
|
63273
|
+
Swal.fire({
|
|
63274
|
+
title: title || 'Failed to sign-in',
|
|
63275
|
+
text: message || '',
|
|
63276
|
+
icon: 'error'
|
|
63277
|
+
}).then(function () {
|
|
63278
|
+
var _window2;
|
|
63279
|
+
searchParams["delete"]('error');
|
|
63280
|
+
window.location.replace("".concat((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.location) === null || _window2 === void 0 ? void 0 : _window2.pathname, "?").concat(searchParams.toString()));
|
|
63281
|
+
});
|
|
63282
|
+
};
|
|
63283
|
+
var setErrors = function setErrors() {
|
|
63284
|
+
var error = searchParams.get('error');
|
|
63285
|
+
switch (error) {
|
|
63286
|
+
case 'insufficient_permissions':
|
|
63287
|
+
showError({
|
|
63288
|
+
title: 'Insufficient permissions',
|
|
63289
|
+
message: 'You do not have sufficient permissions to enter.'
|
|
63290
|
+
});
|
|
63291
|
+
break;
|
|
63292
|
+
case 'access_denied':
|
|
63293
|
+
showError({
|
|
63294
|
+
title: 'Access denied',
|
|
63295
|
+
message: 'Your account does not have access to this application.'
|
|
63296
|
+
});
|
|
63297
|
+
break;
|
|
63298
|
+
}
|
|
63299
|
+
};
|
|
63300
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
63301
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
63302
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
63303
|
+
while (1) switch (_context.prev = _context.next) {
|
|
63304
|
+
case 0:
|
|
63305
|
+
_context.prev = 0;
|
|
63306
|
+
event.preventDefault();
|
|
63307
|
+
setIsLoading(true);
|
|
63308
|
+
if (password) {
|
|
63309
|
+
_context.next = 7;
|
|
63310
|
+
break;
|
|
63311
|
+
}
|
|
63312
|
+
_context.next = 6;
|
|
63313
|
+
return swal.fire({
|
|
63314
|
+
title: 'Error entering',
|
|
63315
|
+
text: 'Please enter a password.',
|
|
63316
|
+
icon: 'error'
|
|
63317
|
+
});
|
|
63318
|
+
case 6:
|
|
63319
|
+
return _context.abrupt("return");
|
|
63320
|
+
case 7:
|
|
63321
|
+
_context.next = 9;
|
|
63322
|
+
return unlockStandard({
|
|
63323
|
+
payload: {
|
|
63324
|
+
password: password
|
|
63325
|
+
},
|
|
63326
|
+
authProvider: authProvider,
|
|
63327
|
+
redirectUrl: redirectUrl,
|
|
63328
|
+
apiKey: apiKey,
|
|
63329
|
+
debug: debug
|
|
63330
|
+
});
|
|
63331
|
+
case 9:
|
|
63332
|
+
_context.next = 14;
|
|
63333
|
+
break;
|
|
63334
|
+
case 11:
|
|
63335
|
+
_context.prev = 11;
|
|
63336
|
+
_context.t0 = _context["catch"](0);
|
|
63337
|
+
console.error(_context.t0);
|
|
63338
|
+
case 14:
|
|
63339
|
+
_context.prev = 14;
|
|
63340
|
+
setIsLoading(false);
|
|
63341
|
+
return _context.finish(14);
|
|
63342
|
+
case 17:
|
|
63343
|
+
case "end":
|
|
63344
|
+
return _context.stop();
|
|
63345
|
+
}
|
|
63346
|
+
}, _callee, null, [[0, 11, 14, 17]]);
|
|
63347
|
+
}));
|
|
63348
|
+
return function handleSubmit(_x2) {
|
|
63349
|
+
return _ref4.apply(this, arguments);
|
|
63350
|
+
};
|
|
63351
|
+
}();
|
|
63352
|
+
var initializeComponent = function initializeComponent() {
|
|
63353
|
+
setErrors();
|
|
63354
|
+
};
|
|
63355
|
+
React.useEffect(function () {
|
|
63356
|
+
initializeComponent();
|
|
63357
|
+
}, []);
|
|
63358
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StandardContainer, null, /*#__PURE__*/React.createElement("header", {
|
|
63359
|
+
style: {
|
|
63360
|
+
textAlign: 'center'
|
|
63361
|
+
}
|
|
63362
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
63363
|
+
href: "/"
|
|
63364
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
63365
|
+
src: organization === null || organization === void 0 ? void 0 : organization.logoSrc,
|
|
63366
|
+
alt: "",
|
|
63367
|
+
height: "75",
|
|
63368
|
+
style: {
|
|
63369
|
+
display: 'block',
|
|
63370
|
+
margin: '0 auto'
|
|
63371
|
+
}
|
|
63372
|
+
})), /*#__PURE__*/React.createElement(Typography$1, {
|
|
63373
|
+
variant: "body2",
|
|
63374
|
+
style: {
|
|
63375
|
+
marginTop: '16px',
|
|
63376
|
+
marginBottom: '24px',
|
|
63377
|
+
color: '#98a6ad',
|
|
63378
|
+
fontWeight: 300
|
|
63379
|
+
}
|
|
63380
|
+
}, organization === null || organization === void 0 ? void 0 : organization.slogan)), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
|
|
63381
|
+
style: {
|
|
63382
|
+
textAlign: 'center',
|
|
63383
|
+
marginBottom: '32px'
|
|
63384
|
+
}
|
|
63385
|
+
}, /*#__PURE__*/React.createElement(KarlaTypography, {
|
|
63386
|
+
style: {
|
|
63387
|
+
color: '#343a40'
|
|
63388
|
+
}
|
|
63389
|
+
}, "Welcome again")), /*#__PURE__*/React.createElement("form", {
|
|
63390
|
+
onSubmit: handleSubmit,
|
|
63391
|
+
autoComplete: "off"
|
|
63392
|
+
}, /*#__PURE__*/React.createElement("section", {
|
|
63393
|
+
style: {
|
|
63394
|
+
marginBottom: '16px'
|
|
63395
|
+
}
|
|
63396
|
+
}, /*#__PURE__*/React.createElement(TextField$1, {
|
|
63397
|
+
fullWidth: true,
|
|
63398
|
+
label: "Password",
|
|
63399
|
+
type: showPassword ? 'text' : 'password',
|
|
63400
|
+
value: password,
|
|
63401
|
+
onChange: function onChange(event) {
|
|
63402
|
+
return setPassword(event.target.value);
|
|
63403
|
+
},
|
|
63404
|
+
InputProps: {
|
|
63405
|
+
endAdornment: /*#__PURE__*/React.createElement(InputAdornment$1, {
|
|
63406
|
+
position: "end"
|
|
63407
|
+
}, /*#__PURE__*/React.createElement(IconButton$1, {
|
|
63408
|
+
"aria-label": "toggle password visibility",
|
|
63409
|
+
onClick: function onClick() {
|
|
63410
|
+
return setShowPassword(function (show) {
|
|
63411
|
+
return !show;
|
|
63412
|
+
});
|
|
63413
|
+
},
|
|
63414
|
+
onMouseDown: function onMouseDown(event) {
|
|
63415
|
+
event.preventDefault();
|
|
63416
|
+
},
|
|
63417
|
+
edge: "end"
|
|
63418
|
+
}, showPassword ? /*#__PURE__*/React.createElement(VisibilityIcon, null) : /*#__PURE__*/React.createElement(VisibilityOffIcon, null)))
|
|
63419
|
+
},
|
|
63420
|
+
InputLabelProps: {
|
|
63421
|
+
shrink: true
|
|
63422
|
+
}
|
|
63423
|
+
})), /*#__PURE__*/React.createElement("section", {
|
|
63424
|
+
style: {
|
|
63425
|
+
marginBottom: '16px',
|
|
63426
|
+
width: '100%'
|
|
63427
|
+
}
|
|
63428
|
+
}, /*#__PURE__*/React.createElement(Link$1, {
|
|
63429
|
+
href: "recover-password",
|
|
63430
|
+
underline: "hover",
|
|
63431
|
+
style: {
|
|
63432
|
+
marginLeft: '8px',
|
|
63433
|
+
color: 'gray',
|
|
63434
|
+
width: '100%',
|
|
63435
|
+
display: 'flex',
|
|
63436
|
+
justifyContent: 'flex-end',
|
|
63437
|
+
textDecoration: 'none'
|
|
63438
|
+
}
|
|
63439
|
+
}, /*#__PURE__*/React.createElement(LockIcon, {
|
|
63440
|
+
style: {
|
|
63441
|
+
marginRight: '5px',
|
|
63442
|
+
color: '#98a6ad',
|
|
63443
|
+
fontSize: '18px'
|
|
63444
|
+
}
|
|
63445
|
+
}), /*#__PURE__*/React.createElement(Typography$1, {
|
|
63446
|
+
variant: "body2",
|
|
63447
|
+
style: {
|
|
63448
|
+
color: '#98a6ad',
|
|
63449
|
+
fontWeight: '400'
|
|
63450
|
+
}
|
|
63451
|
+
}, "Forgot password?"))), /*#__PURE__*/React.createElement("footer", {
|
|
63452
|
+
style: {
|
|
63453
|
+
marginBottom: '16px',
|
|
63454
|
+
display: 'flex',
|
|
63455
|
+
justifyContent: 'center'
|
|
63456
|
+
}
|
|
63457
|
+
}, /*#__PURE__*/React.createElement(Button$1, {
|
|
63458
|
+
type: "submit",
|
|
63459
|
+
variant: "contained",
|
|
63460
|
+
disabled: isLoading,
|
|
63461
|
+
sx: {
|
|
63462
|
+
display: 'flex',
|
|
63463
|
+
alignItems: 'center',
|
|
63464
|
+
border: '2px solid #232931',
|
|
63465
|
+
backgroundColor: '#323a46',
|
|
63466
|
+
color: '#fff',
|
|
63467
|
+
'&:hover': {
|
|
63468
|
+
backgroundColor: '#3d4c61'
|
|
63469
|
+
},
|
|
63470
|
+
width: '100%'
|
|
63471
|
+
}
|
|
63472
|
+
}, isLoading && /*#__PURE__*/React.createElement(CircularProgress$1, {
|
|
63473
|
+
size: 20,
|
|
63474
|
+
style: {
|
|
63475
|
+
marginRight: '8px',
|
|
63476
|
+
color: '#fff'
|
|
63477
|
+
}
|
|
63478
|
+
}), isLoading ? 'Unlocking...' : 'Unlock'))))));
|
|
63479
|
+
};
|
|
63480
|
+
|
|
62659
63481
|
exports.AuthContext = AuthContext;
|
|
62660
63482
|
exports.AuthProvider = AuthProvider;
|
|
62661
63483
|
exports.VeripassLogoutSuccess = VeripassLogoutSuccess;
|
|
63484
|
+
exports.VeripassNewPassword = VeripassNewPassword;
|
|
63485
|
+
exports.VeripassStandardRecoverPassword = VeripassStandardRecoverPassword;
|
|
62662
63486
|
exports.VeripassStandardSignin = VeripassStandardSignin;
|
|
63487
|
+
exports.VeripassStandardUnlock = VeripassStandardUnlock;
|
|
62663
63488
|
exports.useAuth = useAuth;
|
|
62664
63489
|
exports.useLocalStorage = useLocalStorage;
|
|
62665
63490
|
//# sourceMappingURL=react-sdk.cjs.js.map
|