/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/@checkr/web-sdk@0.0.62/dist/web-sdk.umd.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&typeof module<"u"?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).Checkr={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var t=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function i(e){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=e,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function n(e,t){return function(e){return Array.prototype.slice.call(e)}((t||document).querySelectorAll(e))}function o(e){(e.querySelector("[autofocus]")||e).focus()}function s(e){return n(t.join(","),e).filter(function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)})}function r(){n("[data-a11y-dialog]").forEach(function(e){new i(e)})}i.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=n('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(e){e.addEventListener("click",this._show)}.bind(this)),this._closers=n("[data-a11y-dialog-hide]",this.$el).concat(n('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(e){e.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},i.prototype.show=function(e){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,o(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",e)),this},i.prototype.hide=function(e){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",e),this):this},i.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(e){e.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(e){e.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},i.prototype.on=function(e,t){return void 0===this._listeners[e]&&(this._listeners[e]=[]),this._listeners[e].push(t),this},i.prototype.off=function(e,t){var i=(this._listeners[e]||[]).indexOf(t);return i>-1&&this._listeners[e].splice(i,1),this},i.prototype._fire=function(e,t){var i=this._listeners[e]||[],n=new CustomEvent(e,{detail:t});this.$el.dispatchEvent(n),i.forEach(function(e){e(this.$el,t)}.bind(this))},i.prototype._bindKeypress=function(e){this.$el.contains(document.activeElement)&&(this.shown&&27===e.which&&"alertdialog"!==this.$el.getAttribute("role")&&(e.preventDefault(),this.hide(e)),this.shown&&9===e.which&&function(e,t){var i=s(e),n=i.indexOf(document.activeElement);t.shiftKey&&0===n?(i[i.length-1].focus(),t.preventDefault()):!t.shiftKey&&n===i.length-1&&(i[0].focus(),t.preventDefault())}(this.$el,e))},i.prototype._maintainFocus=function(e){this.shown&&!e.target.closest('[aria-modal="true"]')&&!e.target.closest("[data-a11y-dialog-ignore-focus-trap]")&&o(this.$el)},typeof document<"u"&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):window.requestAnimationFrame?window.requestAnimationFrame(r):window.setTimeout(r,16));var a='\n  <div\n    class="checkr-dialog-container"\n    id="checkr-dialog"\n    data-testid="checkr-dialog"\n    aria-hidden="true"\n    aria-labelledby="checkr-dialog-title"\n    aria-describedby="checkr-dialog-description"\n  >\n    <div class="checkr-dialog-overlay" data-a11y-dialog-hide></div>\n    <div class="checkr-dialog-content" role="document">\n      <button\n        data-a11y-dialog-hide\n        class="checkr-dialog-close"\n        aria-label="Close this dialog window"\n      >\n        &times;\n      </button>\n    </div>\n  </div>\n',d="https://web-sdk-services.checkr.com",c="https://mr-x-web-sdk-services.checkr-sandbox.com",h=d;function l(e){let t=window.devWebSDKServicesURL?window.devWebSDKServicesURL:(e=>e?e.toLowerCase().startsWith("prod")?d:e.toLowerCase().startsWith("staging")?"https://web-sdk-services.checkr-staging.com":e.toLowerCase().startsWith("sandbox")?"https://web-sdk-services.checkr-sandbox.com":e.toLowerCase().startsWith("mr")?c.replace("mr-x",e.toLowerCase()):e.toLowerCase().startsWith("local")?"https://web-sdk-services.checkr.localhost":h:h)(e),i=(e,t,n=0)=>{window.CheckrEmbedDefinitions&&e(),n>=20?t():setTimeout(()=>{i(e,t,n+1)},300)};return new Promise((e,n)=>{let o=document.head||document.body||document.documentElement,s=o.querySelector(`script[src*="${t}"]`),r=()=>{e(window.CheckrEmbedDefinitions)},a=()=>{n(Error(`Failed to load script: ${t}`))};if(s)return void i(r,a);let d=document.createElement("script"),c=()=>{d.onerror=null,d.onload=null};d.onerror=()=>{c(),a()},d.onload=()=>{c(),r()},d.async=!0,d.src=`${t}/lib/checkr-embed-definitions.js`,o.appendChild(d)})}function u(e){var t;let n={closeModal:()=>{let e=document.getElementById("checkr-modal-container"),t=document.getElementById("checkr-modal-styles"),n=new i(document.querySelector("#checkr-dialog"));e.remove(),t.remove(),n.destroy()},isOpenedAsModal:()=>!!document.getElementById("checkr-modal-container"),callbackOauthToken:t=>async function(e,t){let i=await fetch(e,{method:"POST",headers:{"Content-type":"application/json"},body:JSON.stringify({code:t})});if(!i.ok)throw Error(JSON.stringify({status:i.status,message:await i.json()}));return!0}(e.oauthTokenPath,t),callbackOauthRedirect:e=>(e=>{window.location.href=e})(e),onSessionTokenNeed:()=>async function(e,t=()=>({})){let i=await fetch(e,{method:"POST",headers:{"Content-type":"application/json",...t()}});if(!i.ok)throw Error(JSON.stringify({status:i.status,message:await i.json()}));try{return(await i.json()).token}catch{return null}}(e.sessionTokenPath,e.sessionTokenRequestHeaders),webSdkVersion:"0.0.62",parentHost:null==(t=window)||null==(t=t.location)?void 0:t.hostname};return{...e,...n}}var m=class{constructor(e){this.props=u(e)}render(e){l(this.props.env).then(t=>{t[Object.getPrototypeOf(this).constructor.embedName()](this.props).render(e)})}modal(e={width:"600px"}){((e,t,n)=>{let o=document.createElement("div");o.id="checkr-modal-container",o.innerHTML=a,document.body.appendChild(o);let s=document.createElement("style");n&&s.setAttribute("nonce",n),s.innerHTML=`.checkr-dialog-content {width: ${t.width};}.checkr-dialog-container{z-index:100;justify-content:center;align-items:center;display:flex;position:fixed;top:0;bottom:0;left:0;right:0;overflow:auto}.checkr-dialog-container[aria-hidden=true]{display:none}.checkr-dialog-overlay{background-color:#2b2e3880;animation:.1s both checkr-fade-in;position:fixed;top:0;bottom:0;left:0;right:0}.checkr-dialog-content{z-index:100;background-color:#fff;border-radius:.1rem;width:80%;max-width:800px;max-height:80vh;margin:auto;padding:2rem;animation:.1s .2s both checkr-fade-in,.4s .2s both checkr-slide-up;position:relative;overflow-y:auto}@keyframes checkr-fade-in{0%{opacity:0}}@keyframes checkr-slide-up{0%{transform:translateY(10%)}}.checkr-dialog-close{text-align:center;cursor:pointer;background-color:#0000;border:0;width:1.2em;height:1.2em;padding:0;font-size:1.25em;font-weight:700;transition:all .15s;position:absolute;top:.5em;right:.5em}@media screen and (max-width:480px){.checkr-dialog-content{width:100%}}`,document.getElementsByTagName("head")[0].appendChild(s);let r=new i(document.querySelector("#checkr-dialog"));r.on("hide",()=>{o.remove(),s.remove(),r.destroy()}),r.on("show",()=>{e(".checkr-dialog-content")}),r.show()})(e=>{this.render(e)},e,this.props.cspNonce)}static useReact(e,t){return i=>{let n=this.embedName(),[o,s]=e.useState(null),[r,a]=e.useState(null);if(e.useEffect(()=>{a(u(i))},[i]),e.useEffect(()=>{r&&l(null==r?void 0:r.env).then(e=>{s(e)})},[r]),r&&o){let i=o[n].driver("react",{React:e,ReactDOM:t});return e.createElement(i,r,null)}return e.createElement("div",null)}}};e.Embeds={NewInvitation:class extends m{constructor(e={}){super(e)}static embedName(){return"NewInvitation"}},ReportsOverview:class extends m{constructor(e={}){super(e)}static embedName(){return"ReportsOverview"}},DisclosureConsent:class extends m{constructor(e={}){super(e)}static embedName(){return"DisclosureConsent"}},SignUpFlow:class extends m{constructor(e={}){super(e)}static embedName(){return"SignUpFlow"}}}});
//# sourceMappingURL=/sm/de1ca37d9cf9955de8e7c3c9b1e539dc3f043e77e0d1be551a71f2110209c3ad.map