mirror of
https://github.com/bitwarden/web
synced 2025-12-06 00:03:28 +00:00
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2 lines
5.2 KiB
JavaScript
2 lines
5.2 KiB
JavaScript
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1362)}({1362:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,c){function i(e){try{u(r.next(e))}catch(t){c(t)}}function a(e){try{u(r.throw(e))}catch(t){c(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,c,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return c={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function a(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(a){c=[6,a],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var c=n(167);window.location.pathname.includes("mobile")?n(1363):n(1364),document.addEventListener("DOMContentLoaded",(function(){!function(){r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,s()];case 1:return e.sent(),window.addEventListener("message",(function(e){e.origin&&""!==e.origin&&e.origin===a&&"start"===e.data&&s()}),!1),[2]}}))}))}()})),window.captchaSuccess=function(e){u?document.location.replace("bitwarden://captcha-callback?token="+encodeURIComponent(e)):function(e){if(l)return;parent.postMessage("success|"+e,i),l=!0}(e)},window.captchaError=function(){d("An error occurred with the captcha. Try again.")};var i=null,a=null,u=null,l=!1;function s(){var e;return r(this,void 0,void 0,(function(){var t,n,s,p,h;return o(this,(function(b){if(l=!1,!(t=c.getQsParam("data")))return d("No data."),[2];if(!(i=c.getQsParam("parent")))return d("No parent."),[2];i=decodeURIComponent(i),a=new URL(i).origin;try{n=JSON.parse(c.b64Decode(t))}catch(m){return d("Cannot parse data."),[2]}return u=null!=n.callbackUri||!0===n.mobile,s="https://hcaptcha.com/1/api.js?render=explicit",n.locale&&(s+="&hl="+(null!==(e=encodeURIComponent(n.locale))&&void 0!==e?e:"en")),p=document.getElementById("captchaRequired"),n.captchaRequiredText&&p&&(p.textContent=n.captchaRequiredText),(h=document.createElement("script")).src=s,h.async=!0,h.defer=!0,h.addEventListener("load",(function(e){hcaptcha.render("captcha",{sitekey:encodeURIComponent(n.siteKey),callback:"captchaSuccess","error-callback":"captchaError"}),function(){r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:e=document.body.lastChild,t.label=1;case 1:return n={height:"hidden"===e.style.visibility?document.documentElement.offsetHeight:document.documentElement.scrollHeight,width:document.documentElement.scrollWidth},parent.postMessage("info|"+JSON.stringify(n),i),[4,f(100)];case 2:return t.sent(),[3,1];case 3:return[2]}var n}))}))}()})),document.head.appendChild(h),[2]}))}))}function d(e){parent.postMessage("error|"+e,i)}function f(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t){return setTimeout(t,e)}))];case 1:return t.sent(),[2]}}))}))}},1363:function(e,t,n){"use strict";n.r(t)},1364:function(e,t,n){"use strict";n.r(t)},167:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64Decode=t.getQsParam=void 0,t.getQsParam=function(e){var t=window.location.href;e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},t.b64Decode=function(e){return decodeURIComponent(Array.prototype.map.call(atob(e),(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}}});
|
|
//# sourceMappingURL=captcha.656f1dffa218e8467958.js.map
|