@bearer/js
Advanced tools
Comparing version 0.99.0 to 0.99.1
@@ -6,2 +6,14 @@ # Change Log | ||
## [0.99.1](https://github.com/Bearer/bearer/packages/js/compare/v0.99.0...v0.99.1) (2019-03-01) | ||
### Bug Fixes | ||
* add missing type field to packages ([#551](https://github.com/Bearer/bearer/packages/js/issues/551)) ([3d96f83](https://github.com/Bearer/bearer/packages/js/commit/3d96f83)) | ||
* **js:** fix incorrect lookup ([#552](https://github.com/Bearer/bearer/packages/js/issues/552)) ([a9bc997](https://github.com/Bearer/bearer/packages/js/commit/a9bc997)) | ||
# [0.99.0](https://github.com/Bearer/bearer/packages/js/compare/v0.98.0...v0.99.0) (2019-02-28) | ||
@@ -8,0 +20,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).bearer=e()}(this,function(){"use strict";function t(t,e,n,r){return new(n||(n=Promise))(function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(s,a)}c((r=r.apply(t,e||[])).next())})}function e(t,e,n){var r,o,i,s,a;function c(){var u=Date.now()-s;u<e&&u>=0?r=setTimeout(c,e-u):(r=null,n||(a=t.apply(i,o),i=o=null))}null==e&&(e=100);var u=function(){i=this,o=arguments,s=Date.now();var u=n&&!r;return r||(r=setTimeout(c,e)),u&&(a=t.apply(i,o),i=o=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=t.apply(i,o),i=o=null,clearTimeout(r),r=null)},u}e.debounce=e;var n=e,r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o(function(t,e){t.exports=function(){var t=1e3,e=6e4,n=36e5,r=24*n,o=function(o,s){s=s||{};var a=typeof o;if("string"===a&&o.length>0)return function(o){if(!((o=String(o)).length>100)){var i=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*e;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(o);if("number"===a&&!1===isNaN(o))return s.long?function(o){var s=Math.abs(o);return s>=r?i(o,s,r,"day"):s>=n?i(o,s,n,"hour"):s>=e?i(o,s,e,"minute"):s>=t?i(o,s,t,"second"):o+" ms"}(o):function(o){var i=Math.abs(o);return i>=r?Math.round(o/r)+"d":i>=n?Math.round(o/n)+"h":i>=e?Math.round(o/e)+"m":i>=t?Math.round(o/t)+"s":o+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function i(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}var s,a=(function(t,e){e.log=function(...t){return"object"==typeof console&&console.log&&console.log(...t)},e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(o=r))}),e.splice(o,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=function(t){function e(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return n.colors[Math.abs(e)%n.colors.length]}function n(t){let o;function s(...t){if(!s.enabled)return;const e=s,r=Number(new Date),i=r-(o||r);e.diff=i,e.prev=o,e.curr=r,o=r,t[0]=n.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return r;a++;const i=n.formatters[o];if("function"==typeof i){const n=t[a];r=i.call(e,n),t.splice(a,1),a--}return r}),n.formatArgs.call(e,t),(e.log||n.log).apply(e,t)}return s.namespace=t,s.enabled=n.enabled(t),s.useColors=n.useColors(),s.color=e(t),s.destroy=r,s.extend=i,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function r(){const t=n.instances.indexOf(this);return-1!==t&&(n.instances.splice(t,1),!0)}function i(t,e){const r=n(this.namespace+(void 0===e?":":e)+t);return r.log=this.log,r}function s(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(t){return t instanceof Error?t.stack||t.message:t},n.disable=function(){const t=[...n.names.map(s),...n.skips.map(s).map(t=>"-"+t)].join(",");return n.enable(""),t},n.enable=function(t){let e;n.save(t),n.names=[],n.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(e=0;e<o;e++)r[e]&&("-"===(t=r[e].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")));for(e=0;e<n.instances.length;e++){const t=n.instances[e];t.enabled=n.enabled(t.namespace)}},n.enabled=function(t){if("*"===t[t.length-1])return!0;let e,r;for(e=0,r=n.skips.length;e<r;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;e<r;e++)if(n.names[e].test(t))return!0;return!1},n.humanize=o,Object.keys(t).forEach(e=>{n[e]=t[e]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=e,n.enable(n.load()),n}(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(s={exports:{}},s.exports),s.exports);return a.log,a.formatArgs,a.save,a.load,a.useColors,a.storage,a.colors,t=>a(`bearer:${t}`)}()})("js");const s=i.extend("Bearer"),a="bearer",c={integrationHost:"https://int.bearer.sh",domObserver:!0,refreshDebounceDelay:200};class u{constructor(e,r){this.clientId=e,this.config=c,this.registeredIntegrations={},this.loadMissingIntegrations=(()=>{const t=function(t,e=/^bearer-/i){return Array.from(t).filter(t=>e.test(t.tagName)).map(t=>t.tagName.toLowerCase())}(document.getElementsByTagName("*")),e=t.filter(t=>!this.registeredIntegration(t));s(this.registeredIntegrations,t,e),this.sendTags(e)}),this.registeredIntegration=(t=>(this.registeredIntegrations[t]=this.registeredIntegrations[t]||document.createElement(t).constructor!==HTMLElement,this.registeredIntegrations[t])),this.initialIntegrationLoading=(()=>{"complete"===document.readyState||"interactive"===document.readyState?this.debounceRefresh():document.addEventListener("DOMContentLoaded",this.debounceRefresh)}),this.registerDomObserver=(()=>{if("MutationObserver"in window){this.disconnectObserver();const t=document.documentElement||document.body,e={childList:!0,subtree:!0};this.observer=new MutationObserver(this.observerCallback),this.observer.observe(t,e)}}),this.observerCallback=(t=>{for(const e of t)"childList"==e.type&&e.addedNodes.length&&this.debounceRefresh()}),this.disconnectObserver=(()=>{this.observer&&(this.observer.disconnect(),delete this.observer)}),this.sendTags=(e=>t(this,void 0,void 0,function*(){if(!e.length)return Promise.resolve(!0);try{const t=yield fetch(`${this.config.integrationHost}/v1/parse-tags`,{headers:{"content-type":"application/json"},body:JSON.stringify({tags:e,clientId:this.clientId}),method:"POST"});if(t.status>299)throw new Error(`Error while fetching integration tag names: ${e}`);return(yield t.json()).map(t=>{document.querySelector(`#${l(t.uuid)}`)||document.body.appendChild(function(t,e){const n=document.createElement("script");n.type="text/javascript",n.async=!0;const r=e.asset.indexOf("?")>-1?"&":"?";return n.src=[e.asset,[`clientId=${t}`].join("&")].join(r),n.id=l(e.uuid),n}(this.clientId,t))}),!0}catch(t){return!1}})),this.config=Object.assign({},c,r),this.debounceRefresh=n(this.loadMissingIntegrations,this.config.refreshDebounceDelay),this.initialIntegrationLoading(),this.config.domObserver&&this.registerDomObserver()}}function l(t){return`${a}-${t}`}var f=o(function(t,e){var n=200,o="__lodash_hash_undefined__",i=800,s=16,a=9007199254740991,c="[object Arguments]",u="[object AsyncFunction]",l="[object Function]",f="[object GeneratorFunction]",h="[object Null]",d="[object Object]",p="[object Proxy]",v="[object Undefined]",y=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[c]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[l]=_["[object Map]"]=_["[object Number]"]=_[d]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var b="object"==typeof r&&r&&r.Object===Object&&r,C="object"==typeof self&&self&&self.Object===Object&&self,m=b||C||Function("return this")(),F=e&&!e.nodeType&&e,w=F&&t&&!t.nodeType&&t,j=w&&w.exports===F,O=j&&b.process,A=function(){try{return O&&O.binding&&O.binding("util")}catch(t){}}(),x=A&&A.isTypedArray;function E(t,e){return"__proto__"==e?void 0:t[e]}var S,$,I,z=Array.prototype,k=Function.prototype,M=Object.prototype,T=m["__core-js_shared__"],D=k.toString,L=M.hasOwnProperty,N=(S=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",P=M.toString,R=D.call(Object),U=RegExp("^"+D.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=j?m.Buffer:void 0,J=m.Symbol,G=m.Uint8Array,H=B?B.allocUnsafe:void 0,W=($=Object.getPrototypeOf,I=Object,function(t){return $(I(t))}),Z=Object.create,q=M.propertyIsEnumerable,V=z.splice,K=J?J.toStringTag:void 0,Q=function(){try{var t=Ft(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),X=B?B.isBuffer:void 0,Y=Math.max,tt=Date.now,et=Ft(m,"Map"),nt=Ft(Object,"create"),rt=function(){function t(){}return function(e){if(!kt(e))return{};if(Z)return Z(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function st(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function at(t){var e=this.__data__=new it(t);this.size=e.size}function ct(t,e){var n=Et(t),r=!n&&xt(t),o=!n&&!r&&$t(t),i=!n&&!r&&!o&&Tt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!L.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||wt(u,c))||a.push(u);return a}function ut(t,e,n){(void 0===n||At(t[e],n))&&(void 0!==n||e in t)||ht(t,e,n)}function lt(t,e,n){var r=t[e];L.call(t,e)&&At(r,n)&&(void 0!==n||e in t)||ht(t,e,n)}function ft(t,e){for(var n=t.length;n--;)if(At(t[n][0],e))return n;return-1}function ht(t,e,n){"__proto__"==e&&Q?Q(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}ot.prototype.clear=function(){this.__data__=nt?nt(null):{},this.size=0},ot.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ot.prototype.get=function(t){var e=this.__data__;if(nt){var n=e[t];return n===o?void 0:n}return L.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:L.call(e,t)},ot.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nt&&void 0===e?o:e,this},it.prototype.clear=function(){this.__data__=[],this.size=0},it.prototype.delete=function(t){var e=this.__data__,n=ft(e,t);return!(n<0||(n==e.length-1?e.pop():V.call(e,n,1),--this.size,0))},it.prototype.get=function(t){var e=this.__data__,n=ft(e,t);return n<0?void 0:e[n][1]},it.prototype.has=function(t){return ft(this.__data__,t)>-1},it.prototype.set=function(t,e){var n=this.__data__,r=ft(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},st.prototype.clear=function(){this.size=0,this.__data__={hash:new ot,map:new(et||it),string:new ot}},st.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},st.prototype.get=function(t){return mt(this,t).get(t)},st.prototype.has=function(t){return mt(this,t).has(t)},st.prototype.set=function(t,e){var n=mt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},at.prototype.clear=function(){this.__data__=new it,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var o=r.__data__;if(!et||o.length<n-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new st(o)}return r.set(t,e),this.size=r.size,this};var dt,pt=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[dt?s:++r];if(!1===e(o[a],a,o))break}return t};function vt(t){return null==t?void 0===t?v:h:K&&K in Object(t)?function(t){var e=L.call(t,K),n=t[K];try{t[K]=void 0;var r=!0}catch(t){}var o=P.call(t);r&&(e?t[K]=n:delete t[K]);return o}(t):function(t){return P.call(t)}(t)}function yt(t){return Mt(t)&&vt(t)==c}function gt(t){return!(!kt(t)||(e=t,N&&N in e))&&(It(t)?U:y).test(function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function _t(t){if(!kt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=jt(t),n=[];for(var r in t)("constructor"!=r||!e&&L.call(t,r))&&n.push(r);return n}function bt(t,e,n,r,o){t!==e&&pt(e,function(i,s){if(kt(i))o||(o=new at),function(t,e,n,r,o,i,s){var a=E(t,n),c=E(e,n),u=s.get(c);if(u)return void ut(t,n,u);var l=i?i(a,c,n+"",t,e,s):void 0,f=void 0===l;if(f){var h=Et(c),p=!h&&$t(c),v=!h&&!p&&Tt(c);l=c,h||p||v?Et(a)?l=a:Mt(C=a)&&St(C)?l=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(a):p?(f=!1,l=function(t,e){if(e)return t.slice();var n=t.length,r=H?H(n):new t.constructor(n);return t.copy(r),r}(c,!0)):v?(f=!1,y=c,g=!0?(_=y.buffer,b=new _.constructor(_.byteLength),new G(b).set(new G(_)),b):y.buffer,l=new y.constructor(g,y.byteOffset,y.length)):l=[]:function(t){if(!Mt(t)||vt(t)!=d)return!1;var e=W(t);if(null===e)return!0;var n=L.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&D.call(n)==R}(c)||xt(c)?(l=a,xt(a)?l=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,s=e.length;for(;++i<s;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?ht(n,a,c):lt(n,a,c)}return n}(t,Dt(t))}(a):(!kt(a)||r&&It(a))&&(l=function(t){return"function"!=typeof t.constructor||jt(t)?{}:rt(W(t))}(c))):f=!1}var y,g,_,b;var C;f&&(s.set(c,l),o(l,c,r,i,s),s.delete(c));ut(t,n,l)}(t,e,s,n,bt,r,o);else{var a=r?r(E(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),ut(t,s,a)}},Dt)}function Ct(t,e){return Ot(function(t,e,n){return e=Y(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Y(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,a)}}(t,e,Pt),t+"")}function mt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Ft(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return gt(n)?n:void 0}function wt(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&g.test(t))&&t>-1&&t%1==0&&t<e}function jt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||M)}var Ot=function(t){var e=0,n=0;return function(){var r=tt(),o=s-(r-n);if(n=r,o>0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Q?function(t,e){return Q(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Pt);function At(t,e){return t===e||t!=t&&e!=e}var xt=yt(function(){return arguments}())?yt:function(t){return Mt(t)&&L.call(t,"callee")&&!q.call(t,"callee")},Et=Array.isArray;function St(t){return null!=t&&zt(t.length)&&!It(t)}var $t=X||function(){return!1};function It(t){if(!kt(t))return!1;var e=vt(t);return e==l||e==f||e==u||e==p}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function kt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Mt(t){return null!=t&&"object"==typeof t}var Tt=x?function(t){return function(e){return t(e)}}(x):function(t){return Mt(t)&&zt(t.length)&&!!_[vt(t)]};function Dt(t){return St(t)?ct(t,!0):_t(t)}var Lt,Nt=(Lt=function(t,e,n){bt(t,e,n)},Ct(function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Lt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!kt(n))return!1;var r=typeof e;return!!("number"==r?St(n)&&wt(e,n.length):"string"==r&&e in n)&&At(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Lt(t,s,n,o)}return t}));function Pt(t){return t}t.exports=Nt}),h="Expected a function",d="__lodash_hash_undefined__",p=1/0,v="[object Function]",y="[object GeneratorFunction]",g="[object Symbol]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,C=/^\./,m=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,F=/\\(\\)?/g,w=/^\[object .+?Constructor\]$/,j="object"==typeof r&&r&&r.Object===Object&&r,O="object"==typeof self&&self&&self.Object===Object&&self,A=j||O||Function("return this")();var x,E=Array.prototype,S=Function.prototype,$=Object.prototype,I=A["__core-js_shared__"],z=(x=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",k=S.toString,M=$.hasOwnProperty,T=$.toString,D=RegExp("^"+k.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=A.Symbol,N=E.splice,P=K(A,"Map"),R=K(Object,"create"),U=L?L.prototype:void 0,B=U?U.toString:void 0;function J(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function H(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function W(t,e){for(var n,r,o=t.length;o--;)if((n=t[o][0])===(r=e)||n!=n&&r!=r)return o;return-1}function Z(t,e){for(var n,r=0,o=(e=function(t,e){if(tt(t))return!1;var n=typeof t;if("number"==n||"symbol"==n||"boolean"==n||null==t||nt(t))return!0;return b.test(t)||!_.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:tt(n=e)?n:Q(n)).length;null!=t&&r<o;)t=t[X(e[r++])];return r&&r==o?t:void 0}function q(t){return!(!et(t)||(e=t,z&&z in e))&&(function(t){var e=et(t)?T.call(t):"";return e==v||e==y}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?D:w).test(function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function V(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function K(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return q(n)?n:void 0}J.prototype.clear=function(){this.__data__=R?R(null):{}},J.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},J.prototype.get=function(t){var e=this.__data__;if(R){var n=e[t];return n===d?void 0:n}return M.call(e,t)?e[t]:void 0},J.prototype.has=function(t){var e=this.__data__;return R?void 0!==e[t]:M.call(e,t)},J.prototype.set=function(t,e){return this.__data__[t]=R&&void 0===e?d:e,this},G.prototype.clear=function(){this.__data__=[]},G.prototype.delete=function(t){var e=this.__data__,n=W(e,t);return!(n<0||(n==e.length-1?e.pop():N.call(e,n,1),0))},G.prototype.get=function(t){var e=this.__data__,n=W(e,t);return n<0?void 0:e[n][1]},G.prototype.has=function(t){return W(this.__data__,t)>-1},G.prototype.set=function(t,e){var n=this.__data__,r=W(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},H.prototype.clear=function(){this.__data__={hash:new J,map:new(P||G),string:new J}},H.prototype.delete=function(t){return V(this,t).delete(t)},H.prototype.get=function(t){return V(this,t).get(t)},H.prototype.has=function(t){return V(this,t).has(t)},H.prototype.set=function(t,e){return V(this,t).set(t,e),this};var Q=Y(function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(nt(t))return B?B.call(t):"";var e=t+"";return"0"==e&&1/t==-p?"-0":e}(e);var n=[];return C.test(t)&&n.push(""),t.replace(m,function(t,e,r,o){n.push(r?o.replace(F,"$1"):e||t)}),n});function X(t){if("string"==typeof t||nt(t))return t;var e=t+"";return"0"==e&&1/t==-p?"-0":e}function Y(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(h);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s),s};return n.cache=new(Y.Cache||H),n}Y.Cache=H;var tt=Array.isArray;function et(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function nt(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&T.call(t)==g}var rt=function(t,e,n){var r=null==t?void 0:Z(t,e);return void 0===r?n:r};const ot=i.extend("i18n"),it="en",st="bearer-locale-changed";const at=new class{constructor(){this._locale=it,this._dictionnary={[it]:{}},this.load=((e,n,{locale:r=this.locale}={})=>t(this,void 0,void 0,function*(){const t=yield n,o=e?{[e]:t}:t;this._dictionnary[r]=f(rt(this._dictionnary,r),o),this.localeChanged()})),this.get=((t,e,n={})=>{const r=[n.locale||this.locale,t,e].filter(t=>t).join(".");return ot("lookup key",r),rt(this._dictionnary,r)})}localeChanged(){document.dispatchEvent(new CustomEvent(st,{detail:{locale:this.locale}}))}set locale(t){this._locale=t,this.localeChanged()}get locale(){return this._locale}},ct=(t,e)=>new u(t,e);return ct.version="0.99.0",ct.i18n=at,ct}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).bearer=e()}(this,function(){"use strict";function t(t,e,n,r){return new(n||(n=Promise))(function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(s,a)}c((r=r.apply(t,e||[])).next())})}function e(t,e,n){var r,o,i,s,a;function c(){var u=Date.now()-s;u<e&&u>=0?r=setTimeout(c,e-u):(r=null,n||(a=t.apply(i,o),i=o=null))}null==e&&(e=100);var u=function(){i=this,o=arguments,s=Date.now();var u=n&&!r;return r||(r=setTimeout(c,e)),u&&(a=t.apply(i,o),i=o=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=t.apply(i,o),i=o=null,clearTimeout(r),r=null)},u}e.debounce=e;var n=e,r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o(function(t,e){t.exports=function(){var t=1e3,e=6e4,n=36e5,r=24*n,o=function(o,s){s=s||{};var a=typeof o;if("string"===a&&o.length>0)return function(o){if(!((o=String(o)).length>100)){var i=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*e;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(o);if("number"===a&&!1===isNaN(o))return s.long?function(o){var s=Math.abs(o);return s>=r?i(o,s,r,"day"):s>=n?i(o,s,n,"hour"):s>=e?i(o,s,e,"minute"):s>=t?i(o,s,t,"second"):o+" ms"}(o):function(o){var i=Math.abs(o);return i>=r?Math.round(o/r)+"d":i>=n?Math.round(o/n)+"h":i>=e?Math.round(o/e)+"m":i>=t?Math.round(o/t)+"s":o+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function i(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}var s,a=(function(t,e){e.log=function(...t){return"object"==typeof console&&console.log&&console.log(...t)},e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(o=r))}),e.splice(o,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=function(t){function e(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return n.colors[Math.abs(e)%n.colors.length]}function n(t){let o;function s(...t){if(!s.enabled)return;const e=s,r=Number(new Date),i=r-(o||r);e.diff=i,e.prev=o,e.curr=r,o=r,t[0]=n.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return r;a++;const i=n.formatters[o];if("function"==typeof i){const n=t[a];r=i.call(e,n),t.splice(a,1),a--}return r}),n.formatArgs.call(e,t),(e.log||n.log).apply(e,t)}return s.namespace=t,s.enabled=n.enabled(t),s.useColors=n.useColors(),s.color=e(t),s.destroy=r,s.extend=i,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function r(){const t=n.instances.indexOf(this);return-1!==t&&(n.instances.splice(t,1),!0)}function i(t,e){const r=n(this.namespace+(void 0===e?":":e)+t);return r.log=this.log,r}function s(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(t){return t instanceof Error?t.stack||t.message:t},n.disable=function(){const t=[...n.names.map(s),...n.skips.map(s).map(t=>"-"+t)].join(",");return n.enable(""),t},n.enable=function(t){let e;n.save(t),n.names=[],n.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(e=0;e<o;e++)r[e]&&("-"===(t=r[e].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")));for(e=0;e<n.instances.length;e++){const t=n.instances[e];t.enabled=n.enabled(t.namespace)}},n.enabled=function(t){if("*"===t[t.length-1])return!0;let e,r;for(e=0,r=n.skips.length;e<r;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;e<r;e++)if(n.names[e].test(t))return!0;return!1},n.humanize=o,Object.keys(t).forEach(e=>{n[e]=t[e]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=e,n.enable(n.load()),n}(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(s={exports:{}},s.exports),s.exports);return a.log,a.formatArgs,a.save,a.load,a.useColors,a.storage,a.colors,t=>a(`bearer:${t}`)}()})("js");const s=i.extend("Bearer"),a="bearer",c={integrationHost:"https://int.bearer.sh",domObserver:!0,refreshDebounceDelay:200};class u{constructor(e,r){this.clientId=e,this.config=c,this.registeredIntegrations={},this.loadMissingIntegrations=(()=>{const t=function(t,e=/^bearer-/i){return Array.from(t).filter(t=>e.test(t.tagName)).map(t=>t.tagName.toLowerCase())}(document.getElementsByTagName("*")),e=t.filter(t=>!this.registeredIntegration(t));s(this.registeredIntegrations,t,e),this.sendTags(e)}),this.registeredIntegration=(t=>(this.registeredIntegrations[t]=this.registeredIntegrations[t]||document.createElement(t).constructor!==HTMLElement,this.registeredIntegrations[t])),this.initialIntegrationLoading=(()=>{"complete"===document.readyState||"interactive"===document.readyState?this.debounceRefresh():document.addEventListener("DOMContentLoaded",this.debounceRefresh)}),this.registerDomObserver=(()=>{if("MutationObserver"in window){this.disconnectObserver();const t=document.documentElement||document.body,e={childList:!0,subtree:!0};this.observer=new MutationObserver(this.observerCallback),this.observer.observe(t,e)}}),this.observerCallback=(t=>{for(const e of t)"childList"==e.type&&e.addedNodes.length&&this.debounceRefresh()}),this.disconnectObserver=(()=>{this.observer&&(this.observer.disconnect(),delete this.observer)}),this.sendTags=(e=>t(this,void 0,void 0,function*(){if(!e.length)return Promise.resolve(!0);try{const t=yield fetch(`${this.config.integrationHost}/v1/parse-tags`,{headers:{"content-type":"application/json"},body:JSON.stringify({tags:e,clientId:this.clientId}),method:"POST"});if(t.status>299)throw new Error(`Error while fetching integration tag names: ${e}`);return(yield t.json()).map(t=>{document.querySelector(`#${l(t.uuid)}`)||document.body.appendChild(function(t,e){const n=document.createElement("script");n.type="text/javascript",n.async=!0;const r=e.asset.indexOf("?")>-1?"&":"?";return n.src=[e.asset,[`clientId=${t}`].join("&")].join(r),n.id=l(e.uuid),n}(this.clientId,t))}),!0}catch(t){return!1}})),this.config=Object.assign({},c,r),this.debounceRefresh=n(this.loadMissingIntegrations,this.config.refreshDebounceDelay),this.initialIntegrationLoading(),this.config.domObserver&&this.registerDomObserver()}}function l(t){return`${a}-${t}`}var f=o(function(t,e){var n=200,o="__lodash_hash_undefined__",i=800,s=16,a=9007199254740991,c="[object Arguments]",u="[object AsyncFunction]",l="[object Function]",f="[object GeneratorFunction]",h="[object Null]",d="[object Object]",p="[object Proxy]",v="[object Undefined]",y=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,_={};_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_[c]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object Boolean]"]=_["[object DataView]"]=_["[object Date]"]=_["[object Error]"]=_[l]=_["[object Map]"]=_["[object Number]"]=_[d]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object WeakMap]"]=!1;var b="object"==typeof r&&r&&r.Object===Object&&r,C="object"==typeof self&&self&&self.Object===Object&&self,m=b||C||Function("return this")(),F=e&&!e.nodeType&&e,w=F&&t&&!t.nodeType&&t,j=w&&w.exports===F,O=j&&b.process,A=function(){try{return O&&O.binding&&O.binding("util")}catch(t){}}(),x=A&&A.isTypedArray;function E(t,e){return"__proto__"==e?void 0:t[e]}var S,$,I,z=Array.prototype,k=Function.prototype,M=Object.prototype,T=m["__core-js_shared__"],D=k.toString,L=M.hasOwnProperty,N=(S=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",P=M.toString,R=D.call(Object),U=RegExp("^"+D.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=j?m.Buffer:void 0,J=m.Symbol,G=m.Uint8Array,H=B?B.allocUnsafe:void 0,W=($=Object.getPrototypeOf,I=Object,function(t){return $(I(t))}),Z=Object.create,q=M.propertyIsEnumerable,V=z.splice,K=J?J.toStringTag:void 0,Q=function(){try{var t=Ft(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),X=B?B.isBuffer:void 0,Y=Math.max,tt=Date.now,et=Ft(m,"Map"),nt=Ft(Object,"create"),rt=function(){function t(){}return function(e){if(!kt(e))return{};if(Z)return Z(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function st(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function at(t){var e=this.__data__=new it(t);this.size=e.size}function ct(t,e){var n=Et(t),r=!n&&xt(t),o=!n&&!r&&$t(t),i=!n&&!r&&!o&&Tt(t),s=n||r||o||i,a=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!L.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||wt(u,c))||a.push(u);return a}function ut(t,e,n){(void 0===n||At(t[e],n))&&(void 0!==n||e in t)||ht(t,e,n)}function lt(t,e,n){var r=t[e];L.call(t,e)&&At(r,n)&&(void 0!==n||e in t)||ht(t,e,n)}function ft(t,e){for(var n=t.length;n--;)if(At(t[n][0],e))return n;return-1}function ht(t,e,n){"__proto__"==e&&Q?Q(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}ot.prototype.clear=function(){this.__data__=nt?nt(null):{},this.size=0},ot.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ot.prototype.get=function(t){var e=this.__data__;if(nt){var n=e[t];return n===o?void 0:n}return L.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:L.call(e,t)},ot.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nt&&void 0===e?o:e,this},it.prototype.clear=function(){this.__data__=[],this.size=0},it.prototype.delete=function(t){var e=this.__data__,n=ft(e,t);return!(n<0||(n==e.length-1?e.pop():V.call(e,n,1),--this.size,0))},it.prototype.get=function(t){var e=this.__data__,n=ft(e,t);return n<0?void 0:e[n][1]},it.prototype.has=function(t){return ft(this.__data__,t)>-1},it.prototype.set=function(t,e){var n=this.__data__,r=ft(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},st.prototype.clear=function(){this.size=0,this.__data__={hash:new ot,map:new(et||it),string:new ot}},st.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},st.prototype.get=function(t){return mt(this,t).get(t)},st.prototype.has=function(t){return mt(this,t).has(t)},st.prototype.set=function(t,e){var n=mt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},at.prototype.clear=function(){this.__data__=new it,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var o=r.__data__;if(!et||o.length<n-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new st(o)}return r.set(t,e),this.size=r.size,this};var dt,pt=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[dt?s:++r];if(!1===e(o[a],a,o))break}return t};function vt(t){return null==t?void 0===t?v:h:K&&K in Object(t)?function(t){var e=L.call(t,K),n=t[K];try{t[K]=void 0;var r=!0}catch(t){}var o=P.call(t);r&&(e?t[K]=n:delete t[K]);return o}(t):function(t){return P.call(t)}(t)}function yt(t){return Mt(t)&&vt(t)==c}function gt(t){return!(!kt(t)||(e=t,N&&N in e))&&(It(t)?U:y).test(function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function _t(t){if(!kt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=jt(t),n=[];for(var r in t)("constructor"!=r||!e&&L.call(t,r))&&n.push(r);return n}function bt(t,e,n,r,o){t!==e&&pt(e,function(i,s){if(kt(i))o||(o=new at),function(t,e,n,r,o,i,s){var a=E(t,n),c=E(e,n),u=s.get(c);if(u)return void ut(t,n,u);var l=i?i(a,c,n+"",t,e,s):void 0,f=void 0===l;if(f){var h=Et(c),p=!h&&$t(c),v=!h&&!p&&Tt(c);l=c,h||p||v?Et(a)?l=a:Mt(C=a)&&St(C)?l=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(a):p?(f=!1,l=function(t,e){if(e)return t.slice();var n=t.length,r=H?H(n):new t.constructor(n);return t.copy(r),r}(c,!0)):v?(f=!1,y=c,g=!0?(_=y.buffer,b=new _.constructor(_.byteLength),new G(b).set(new G(_)),b):y.buffer,l=new y.constructor(g,y.byteOffset,y.length)):l=[]:function(t){if(!Mt(t)||vt(t)!=d)return!1;var e=W(t);if(null===e)return!0;var n=L.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&D.call(n)==R}(c)||xt(c)?(l=a,xt(a)?l=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,s=e.length;for(;++i<s;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?ht(n,a,c):lt(n,a,c)}return n}(t,Dt(t))}(a):(!kt(a)||r&&It(a))&&(l=function(t){return"function"!=typeof t.constructor||jt(t)?{}:rt(W(t))}(c))):f=!1}var y,g,_,b;var C;f&&(s.set(c,l),o(l,c,r,i,s),s.delete(c));ut(t,n,l)}(t,e,s,n,bt,r,o);else{var a=r?r(E(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),ut(t,s,a)}},Dt)}function Ct(t,e){return Ot(function(t,e,n){return e=Y(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Y(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,a)}}(t,e,Pt),t+"")}function mt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Ft(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return gt(n)?n:void 0}function wt(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&g.test(t))&&t>-1&&t%1==0&&t<e}function jt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||M)}var Ot=function(t){var e=0,n=0;return function(){var r=tt(),o=s-(r-n);if(n=r,o>0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Q?function(t,e){return Q(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Pt);function At(t,e){return t===e||t!=t&&e!=e}var xt=yt(function(){return arguments}())?yt:function(t){return Mt(t)&&L.call(t,"callee")&&!q.call(t,"callee")},Et=Array.isArray;function St(t){return null!=t&&zt(t.length)&&!It(t)}var $t=X||function(){return!1};function It(t){if(!kt(t))return!1;var e=vt(t);return e==l||e==f||e==u||e==p}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function kt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Mt(t){return null!=t&&"object"==typeof t}var Tt=x?function(t){return function(e){return t(e)}}(x):function(t){return Mt(t)&&zt(t.length)&&!!_[vt(t)]};function Dt(t){return St(t)?ct(t,!0):_t(t)}var Lt,Nt=(Lt=function(t,e,n){bt(t,e,n)},Ct(function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Lt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!kt(n))return!1;var r=typeof e;return!!("number"==r?St(n)&&wt(e,n.length):"string"==r&&e in n)&&At(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&Lt(t,s,n,o)}return t}));function Pt(t){return t}t.exports=Nt}),h="Expected a function",d="__lodash_hash_undefined__",p=1/0,v="[object Function]",y="[object GeneratorFunction]",g="[object Symbol]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,b=/^\w*$/,C=/^\./,m=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,F=/\\(\\)?/g,w=/^\[object .+?Constructor\]$/,j="object"==typeof r&&r&&r.Object===Object&&r,O="object"==typeof self&&self&&self.Object===Object&&self,A=j||O||Function("return this")();var x,E=Array.prototype,S=Function.prototype,$=Object.prototype,I=A["__core-js_shared__"],z=(x=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",k=S.toString,M=$.hasOwnProperty,T=$.toString,D=RegExp("^"+k.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=A.Symbol,N=E.splice,P=K(A,"Map"),R=K(Object,"create"),U=L?L.prototype:void 0,B=U?U.toString:void 0;function J(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function H(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function W(t,e){for(var n,r,o=t.length;o--;)if((n=t[o][0])===(r=e)||n!=n&&r!=r)return o;return-1}function Z(t,e){for(var n,r=0,o=(e=function(t,e){if(tt(t))return!1;var n=typeof t;if("number"==n||"symbol"==n||"boolean"==n||null==t||nt(t))return!0;return b.test(t)||!_.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:tt(n=e)?n:Q(n)).length;null!=t&&r<o;)t=t[X(e[r++])];return r&&r==o?t:void 0}function q(t){return!(!et(t)||(e=t,z&&z in e))&&(function(t){var e=et(t)?T.call(t):"";return e==v||e==y}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?D:w).test(function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function V(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function K(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return q(n)?n:void 0}J.prototype.clear=function(){this.__data__=R?R(null):{}},J.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},J.prototype.get=function(t){var e=this.__data__;if(R){var n=e[t];return n===d?void 0:n}return M.call(e,t)?e[t]:void 0},J.prototype.has=function(t){var e=this.__data__;return R?void 0!==e[t]:M.call(e,t)},J.prototype.set=function(t,e){return this.__data__[t]=R&&void 0===e?d:e,this},G.prototype.clear=function(){this.__data__=[]},G.prototype.delete=function(t){var e=this.__data__,n=W(e,t);return!(n<0||(n==e.length-1?e.pop():N.call(e,n,1),0))},G.prototype.get=function(t){var e=this.__data__,n=W(e,t);return n<0?void 0:e[n][1]},G.prototype.has=function(t){return W(this.__data__,t)>-1},G.prototype.set=function(t,e){var n=this.__data__,r=W(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},H.prototype.clear=function(){this.__data__={hash:new J,map:new(P||G),string:new J}},H.prototype.delete=function(t){return V(this,t).delete(t)},H.prototype.get=function(t){return V(this,t).get(t)},H.prototype.has=function(t){return V(this,t).has(t)},H.prototype.set=function(t,e){return V(this,t).set(t,e),this};var Q=Y(function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(nt(t))return B?B.call(t):"";var e=t+"";return"0"==e&&1/t==-p?"-0":e}(e);var n=[];return C.test(t)&&n.push(""),t.replace(m,function(t,e,r,o){n.push(r?o.replace(F,"$1"):e||t)}),n});function X(t){if("string"==typeof t||nt(t))return t;var e=t+"";return"0"==e&&1/t==-p?"-0":e}function Y(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(h);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s),s};return n.cache=new(Y.Cache||H),n}Y.Cache=H;var tt=Array.isArray;function et(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function nt(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&T.call(t)==g}var rt=function(t,e,n){var r=null==t?void 0:Z(t,e);return void 0===r?n:r};const ot=i.extend("i18n"),it="en",st="bearer-locale-changed";const at=new class{constructor(){this._locale=it,this._dictionnary={[it]:{}},this.load=((e,n,{locale:r=this.locale}={})=>t(this,void 0,void 0,function*(){const t=yield n,o=e?{[e]:t}:t;this._dictionnary[r]=f(rt(this._dictionnary,r),o),this.localeChanged()})),this.get=((t,e,n={})=>{const r=[n.locale||this.locale,t,e].filter(t=>t).join(".");return ot("lookup key",r),rt(this._dictionnary,r)})}localeChanged(){document.dispatchEvent(new CustomEvent(st,{detail:{locale:this.locale}}))}set locale(t){this._locale=t,this.localeChanged()}get locale(){return this._locale}},ct=(t,e)=>new u(t,e);return ct.version="0.99.1",ct.i18n=at,ct}); | ||
//# sourceMappingURL=bearer.production.min.js.map |
@@ -1,2 +0,3 @@ | ||
import bearer from './lib/main'; | ||
import bearer, { TBearer } from './lib/main'; | ||
export declare type Bearer = TBearer; | ||
export default bearer; |
@@ -1,2 +0,2 @@ | ||
"use strict";function __awaiter(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(i,s)}c((n=n.apply(e,t||[])).next())})}function debounce(e,t,r){var n,o,a,i,s;function c(){var u=Date.now()-i;u<t&&u>=0?n=setTimeout(c,t-u):(n=null,r||(s=e.apply(a,o),a=o=null))}null==t&&(t=100);var u=function(){a=this,o=arguments,i=Date.now();var u=r&&!n;return n||(n=setTimeout(c,t)),u&&(s=e.apply(a,o),a=o=null),s};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(s=e.apply(a,o),a=o=null,clearTimeout(n),n=null)},u}debounce.debounce=debounce;var debounce_1=debounce,commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var logger_browser=createCommonjsModule(function(e,t){e.exports=function(){var e=1e3,t=6e4,r=36e5,n=24*r,o=function(o,i){i=i||{};var s=typeof o;if("string"===s&&o.length>0)return function(o){if(!((o=String(o)).length>100)){var a=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(a){var i=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"weeks":case"week":case"w":return 6048e5*i;case"days":case"day":case"d":return i*n;case"hours":case"hour":case"hrs":case"hr":case"h":return i*r;case"minutes":case"minute":case"mins":case"min":case"m":return i*t;case"seconds":case"second":case"secs":case"sec":case"s":return i*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(o);if("number"===s&&!1===isNaN(o))return i.long?function(o){var i=Math.abs(o);return i>=n?a(o,i,n,"day"):i>=r?a(o,i,r,"hour"):i>=t?a(o,i,t,"minute"):i>=e?a(o,i,e,"second"):o+" ms"}(o):function(o){var a=Math.abs(o);return a>=n?Math.round(o/n)+"d":a>=r?Math.round(o/r)+"h":a>=t?Math.round(o/t)+"m":a>=e?Math.round(o/e)+"s":o+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}var i,s=(function(e,t){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){let o;function i(...e){if(!i.enabled)return;const t=i,n=Number(new Date),a=n-(o||n);t.diff=a,t.prev=o,t.curr=n,o=n,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return n;s++;const a=r.formatters[o];if("function"==typeof a){const r=e[s];n=a.call(t,r),e.splice(s,1),s--}return n}),r.formatArgs.call(t,e),(t.log||r.log).apply(t,e)}return i.namespace=e,i.enabled=r.enabled(e),i.useColors=r.useColors(),i.color=t(e),i.destroy=n,i.extend=a,"function"==typeof r.init&&r.init(i),r.instances.push(i),i}function n(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function a(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(i),...r.skips.map(i).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){const e=r.instances[t];e.enabled=r.enabled(e.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=o,Object.keys(e).forEach(t=>{r[t]=e[t]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(i={exports:{}},i.exports),i.exports);return s.log,s.formatArgs,s.save,s.load,s.useColors,s.storage,s.colors,e=>s(`bearer:${e}`)}()}),logger=logger_browser("js");const logger$1=logger.extend("Bearer"),prefix="bearer",DEFAULT_OPTIONS={integrationHost:"https://int.bearer.sh",domObserver:!0,refreshDebounceDelay:200};class Bearer{constructor(e,t){this.clientId=e,this.config=DEFAULT_OPTIONS,this.registeredIntegrations={},this.loadMissingIntegrations=(()=>{const e=findElements(document.getElementsByTagName("*")),t=e.filter(e=>!this.registeredIntegration(e));logger$1(this.registeredIntegrations,e,t),this.sendTags(t)}),this.registeredIntegration=(e=>(this.registeredIntegrations[e]=this.registeredIntegrations[e]||document.createElement(e).constructor!==HTMLElement,this.registeredIntegrations[e])),this.initialIntegrationLoading=(()=>{"complete"===document.readyState||"interactive"===document.readyState?this.debounceRefresh():document.addEventListener("DOMContentLoaded",this.debounceRefresh)}),this.registerDomObserver=(()=>{if("MutationObserver"in window){this.disconnectObserver();const e=document.documentElement||document.body,t={childList:!0,subtree:!0};this.observer=new MutationObserver(this.observerCallback),this.observer.observe(e,t)}}),this.observerCallback=(e=>{for(const t of e)"childList"==t.type&&t.addedNodes.length&&this.debounceRefresh()}),this.disconnectObserver=(()=>{this.observer&&(this.observer.disconnect(),delete this.observer)}),this.sendTags=(e=>__awaiter(this,void 0,void 0,function*(){if(!e.length)return Promise.resolve(!0);try{const t=yield fetch(`${this.config.integrationHost}/v1/parse-tags`,{headers:{"content-type":"application/json"},body:JSON.stringify({tags:e,clientId:this.clientId}),method:"POST"});if(t.status>299)throw new Error(`Error while fetching integration tag names: ${e}`);return(yield t.json()).map(e=>{document.querySelector(`#${getScriptId(e.uuid)}`)||document.body.appendChild(getScriptDOM(this.clientId,e))}),!0}catch(e){return!1}})),this.config=Object.assign({},DEFAULT_OPTIONS,t),this.debounceRefresh=debounce_1(this.loadMissingIntegrations,this.config.refreshDebounceDelay),this.initialIntegrationLoading(),this.config.domObserver&&this.registerDomObserver()}}function findElements(e,t=/^bearer-/i){return Array.from(e).filter(e=>t.test(e.tagName)).map(e=>e.tagName.toLowerCase())}function getScriptId(e){return`${prefix}-${e}`}function getScriptDOM(e,t){const r=document.createElement("script");r.type="text/javascript",r.async=!0;const n=t.asset.indexOf("?")>-1?"&":"?";return r.src=[t.asset,[`clientId=${e}`].join("&")].join(n),r.id=getScriptId(t.uuid),r}var lodash_merge=createCommonjsModule(function(e,t){var r=200,n="__lodash_hash_undefined__",o=800,a=16,i=9007199254740991,s="[object Arguments]",c="[object AsyncFunction]",u="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",p="[object Proxy]",d="[object Undefined]",g=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[s]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[u]=v["[object Map]"]=v["[object Number]"]=v[h]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var b="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_="object"==typeof self&&self&&self.Object===Object&&self,C=b||_||Function("return this")(),m=t&&!t.nodeType&&t,j=m&&e&&!e.nodeType&&e,F=j&&j.exports===m,w=F&&b.process,O=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),S=O&&O.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var E,A,T,D=Array.prototype,x=Function.prototype,P=Object.prototype,L=C["__core-js_shared__"],M=x.toString,N=P.hasOwnProperty,$=(E=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",k=P.toString,H=M.call(Object),z=RegExp("^"+M.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=F?C.Buffer:void 0,R=C.Symbol,U=C.Uint8Array,B=G?G.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,T=Object,function(e){return A(T(e))}),J=Object.create,q=P.propertyIsEnumerable,V=D.splice,Y=R?R.toStringTag:void 0,W=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),X=G?G.isBuffer:void 0,Z=Math.max,Q=Date.now,ee=me(C,"Map"),te=me(Object,"create"),re=function(){function e(){}return function(t){if(!xe(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=this.__data__=new oe(e);this.size=t.size}function se(e,t){var r=Ie(e),n=!r&&Se(e),o=!r&&!n&&Ae(e),a=!r&&!n&&!o&&Le(e),i=r||n||o||a,s=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=s.length;for(var u in e)!t&&!N.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||je(u,c))||s.push(u);return s}function ce(e,t,r){(void 0===r||Oe(e[t],r))&&(void 0!==r||t in e)||fe(e,t,r)}function ue(e,t,r){var n=e[t];N.call(e,t)&&Oe(n,r)&&(void 0!==r||t in e)||fe(e,t,r)}function le(e,t){for(var r=e.length;r--;)if(Oe(e[r][0],t))return r;return-1}function fe(e,t,r){"__proto__"==t&&W?W(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===n?void 0:r}return N.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:N.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?n:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=le(t,e);return!(r<0||(r==t.length-1?t.pop():V.call(t,r,1),--this.size,0))},oe.prototype.get=function(e){var t=this.__data__,r=le(t,e);return r<0?void 0:t[r][1]},oe.prototype.has=function(e){return le(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ae.prototype.delete=function(e){var t=Ce(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Ce(this,e).get(e)},ae.prototype.has=function(e){return Ce(this,e).has(e)},ae.prototype.set=function(e,t){var r=Ce(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.clear=function(){this.__data__=new oe,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||o.length<r-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(o)}return n.set(e,t),this.size=n.size,this};var he,pe=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[he?i:++n];if(!1===t(o[s],s,o))break}return e};function de(e){return null==e?void 0===e?d:f:Y&&Y in Object(e)?function(e){var t=N.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=k.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return k.call(e)}(e)}function ge(e){return Pe(e)&&de(e)==s}function ye(e){return!(!xe(e)||(t=e,$&&$ in t))&&(Te(e)?z:g).test(function(e){if(null!=e){try{return M.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function ve(e){if(!xe(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Fe(e),r=[];for(var n in e)("constructor"!=n||!t&&N.call(e,n))&&r.push(n);return r}function be(e,t,r,n,o){e!==t&&pe(t,function(a,i){if(xe(a))o||(o=new ie),function(e,t,r,n,o,a,i){var s=I(e,r),c=I(t,r),u=i.get(c);if(u)return void ce(e,r,u);var l=a?a(s,c,r+"",e,t,i):void 0,f=void 0===l;if(f){var p=Ie(c),d=!p&&Ae(c),g=!p&&!d&&Le(c);l=c,p||d||g?Ie(s)?l=s:Pe(C=s)&&Ee(C)?l=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(s):d?(f=!1,l=function(e,t){if(t)return e.slice();var r=e.length,n=B?B(r):new e.constructor(r);return e.copy(n),n}(c,!0)):g?(f=!1,y=c,v=!0?(b=y.buffer,_=new b.constructor(b.byteLength),new U(_).set(new U(b)),_):y.buffer,l=new y.constructor(v,y.byteOffset,y.length)):l=[]:function(e){if(!Pe(e)||de(e)!=h)return!1;var t=K(e);if(null===t)return!0;var r=N.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&M.call(r)==H}(c)||Se(c)?(l=s,Se(s)?l=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?fe(r,s,c):ue(r,s,c)}return r}(e,Me(e))}(s):(!xe(s)||n&&Te(s))&&(l=function(e){return"function"!=typeof e.constructor||Fe(e)?{}:re(K(e))}(c))):f=!1}var y,v,b,_;var C;f&&(i.set(c,l),o(l,c,n,a,i),i.delete(c));ce(e,r,l)}(e,t,i,r,be,n,o);else{var s=n?n(I(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),ce(e,i,s)}},Me)}function _e(e,t){return we(function(e,t,r){return t=Z(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Z(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,t,ke),e+"")}function Ce(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function me(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&y.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}var we=function(e){var t=0,r=0;return function(){var n=Q(),i=a-(n-r);if(r=n,i>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(W?function(e,t){return W(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:ke);function Oe(e,t){return e===t||e!=e&&t!=t}var Se=ge(function(){return arguments}())?ge:function(e){return Pe(e)&&N.call(e,"callee")&&!q.call(e,"callee")},Ie=Array.isArray;function Ee(e){return null!=e&&De(e.length)&&!Te(e)}var Ae=X||function(){return!1};function Te(e){if(!xe(e))return!1;var t=de(e);return t==u||t==l||t==c||t==p}function De(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Pe(e){return null!=e&&"object"==typeof e}var Le=S?function(e){return function(t){return e(t)}}(S):function(e){return Pe(e)&&De(e.length)&&!!v[de(e)]};function Me(e){return Ee(e)?se(e,!0):ve(e)}var Ne,$e=(Ne=function(e,t,r){be(e,t,r)},_e(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Ne.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!xe(r))return!1;var n=typeof t;return!!("number"==n?Ee(r)&&je(t,r.length):"string"==n&&t in r)&&Oe(r[t],e)}(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Ne(e,i,r,o)}return e}));function ke(e){return e}e.exports=$e}),FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reEscapeChar=/\\(\\)?/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function getValue(e,t){return null==e?void 0:e[t]}function isHostObject(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol$1=root.Symbol,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function Hash(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(e){return this.has(e)&&delete this.__data__[e]}function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty.call(t,e)?t[e]:void 0}function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}function hashSet(e,t){return this.__data__[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function ListCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}function MapCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(e){return getMapData(this,e).delete(e)}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){return getMapData(this,e).set(e,t),this}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseGet(e,t){for(var r=0,n=(t=isKey(t,e)?[t]:castPath(t)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)||isHostObject(e)?reIsNative:reIsHostCtor).test(toSource(e))}function baseToString(e){if("string"==typeof e)return e;if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function castPath(e){return isArray(e)?e:stringToPath(e)}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}function isKey(e,t){if(isArray(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(e){e=toString(e);var t=[];return reLeadingDot.test(e)&&t.push(""),e.replace(rePropName,function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)}),t});function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function memoize(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i),i};return r.cache=new(memoize.Cache||MapCache),r}function eq(e,t){return e===t||e!=e&&t!=t}memoize.Cache=MapCache;var isArray=Array.isArray;function isFunction(e){var t=isObject(e)?objectToString.call(e):"";return t==funcTag||t==genTag}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toString(e){return null==e?"":baseToString(e)}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var lodash_get=get;const debug=logger.extend("i18n"),DEFAULT_LOCALE="en",LOCALE_CHANGED="bearer-locale-changed";class I18n{constructor(){this._locale=DEFAULT_LOCALE,this._dictionnary={[DEFAULT_LOCALE]:{}},this.load=((e,t,{locale:r=this.locale}={})=>__awaiter(this,void 0,void 0,function*(){const n=yield t,o=e?{[e]:n}:n;this._dictionnary[r]=lodash_merge(lodash_get(this._dictionnary,r),o),this.localeChanged()})),this.get=((e,t,r={})=>{const n=[r.locale||this.locale,e,t].filter(e=>e).join(".");return debug("lookup key",n),lodash_get(this._dictionnary,n)})}localeChanged(){document.dispatchEvent(new CustomEvent(LOCALE_CHANGED,{detail:{locale:this.locale}}))}set locale(e){this._locale=e,this.localeChanged()}get locale(){return this._locale}}const i18n=new I18n,bearer=(e,t)=>new Bearer(e,t);bearer.version="0.99.0",bearer.i18n=i18n,module.exports=bearer; | ||
"use strict";function __awaiter(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(i,s)}c((n=n.apply(e,t||[])).next())})}function debounce(e,t,r){var n,o,a,i,s;function c(){var u=Date.now()-i;u<t&&u>=0?n=setTimeout(c,t-u):(n=null,r||(s=e.apply(a,o),a=o=null))}null==t&&(t=100);var u=function(){a=this,o=arguments,i=Date.now();var u=r&&!n;return n||(n=setTimeout(c,t)),u&&(s=e.apply(a,o),a=o=null),s};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(s=e.apply(a,o),a=o=null,clearTimeout(n),n=null)},u}debounce.debounce=debounce;var debounce_1=debounce,commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var logger_browser=createCommonjsModule(function(e,t){e.exports=function(){var e=1e3,t=6e4,r=36e5,n=24*r,o=function(o,i){i=i||{};var s=typeof o;if("string"===s&&o.length>0)return function(o){if(!((o=String(o)).length>100)){var a=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(a){var i=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"weeks":case"week":case"w":return 6048e5*i;case"days":case"day":case"d":return i*n;case"hours":case"hour":case"hrs":case"hr":case"h":return i*r;case"minutes":case"minute":case"mins":case"min":case"m":return i*t;case"seconds":case"second":case"secs":case"sec":case"s":return i*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(o);if("number"===s&&!1===isNaN(o))return i.long?function(o){var i=Math.abs(o);return i>=n?a(o,i,n,"day"):i>=r?a(o,i,r,"hour"):i>=t?a(o,i,t,"minute"):i>=e?a(o,i,e,"second"):o+" ms"}(o):function(o){var a=Math.abs(o);return a>=n?Math.round(o/n)+"d":a>=r?Math.round(o/r)+"h":a>=t?Math.round(o/t)+"m":a>=e?Math.round(o/e)+"s":o+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}var i,s=(function(e,t){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){let o;function i(...e){if(!i.enabled)return;const t=i,n=Number(new Date),a=n-(o||n);t.diff=a,t.prev=o,t.curr=n,o=n,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return n;s++;const a=r.formatters[o];if("function"==typeof a){const r=e[s];n=a.call(t,r),e.splice(s,1),s--}return n}),r.formatArgs.call(t,e),(t.log||r.log).apply(t,e)}return i.namespace=e,i.enabled=r.enabled(e),i.useColors=r.useColors(),i.color=t(e),i.destroy=n,i.extend=a,"function"==typeof r.init&&r.init(i),r.instances.push(i),i}function n(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function a(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(i),...r.skips.map(i).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){const e=r.instances[t];e.enabled=r.enabled(e.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=o,Object.keys(e).forEach(t=>{r[t]=e[t]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(i={exports:{}},i.exports),i.exports);return s.log,s.formatArgs,s.save,s.load,s.useColors,s.storage,s.colors,e=>s(`bearer:${e}`)}()}),logger=logger_browser("js");const logger$1=logger.extend("Bearer"),prefix="bearer",DEFAULT_OPTIONS={integrationHost:"https://int.bearer.sh",domObserver:!0,refreshDebounceDelay:200};class Bearer{constructor(e,t){this.clientId=e,this.config=DEFAULT_OPTIONS,this.registeredIntegrations={},this.loadMissingIntegrations=(()=>{const e=findElements(document.getElementsByTagName("*")),t=e.filter(e=>!this.registeredIntegration(e));logger$1(this.registeredIntegrations,e,t),this.sendTags(t)}),this.registeredIntegration=(e=>(this.registeredIntegrations[e]=this.registeredIntegrations[e]||document.createElement(e).constructor!==HTMLElement,this.registeredIntegrations[e])),this.initialIntegrationLoading=(()=>{"complete"===document.readyState||"interactive"===document.readyState?this.debounceRefresh():document.addEventListener("DOMContentLoaded",this.debounceRefresh)}),this.registerDomObserver=(()=>{if("MutationObserver"in window){this.disconnectObserver();const e=document.documentElement||document.body,t={childList:!0,subtree:!0};this.observer=new MutationObserver(this.observerCallback),this.observer.observe(e,t)}}),this.observerCallback=(e=>{for(const t of e)"childList"==t.type&&t.addedNodes.length&&this.debounceRefresh()}),this.disconnectObserver=(()=>{this.observer&&(this.observer.disconnect(),delete this.observer)}),this.sendTags=(e=>__awaiter(this,void 0,void 0,function*(){if(!e.length)return Promise.resolve(!0);try{const t=yield fetch(`${this.config.integrationHost}/v1/parse-tags`,{headers:{"content-type":"application/json"},body:JSON.stringify({tags:e,clientId:this.clientId}),method:"POST"});if(t.status>299)throw new Error(`Error while fetching integration tag names: ${e}`);return(yield t.json()).map(e=>{document.querySelector(`#${getScriptId(e.uuid)}`)||document.body.appendChild(getScriptDOM(this.clientId,e))}),!0}catch(e){return!1}})),this.config=Object.assign({},DEFAULT_OPTIONS,t),this.debounceRefresh=debounce_1(this.loadMissingIntegrations,this.config.refreshDebounceDelay),this.initialIntegrationLoading(),this.config.domObserver&&this.registerDomObserver()}}function findElements(e,t=/^bearer-/i){return Array.from(e).filter(e=>t.test(e.tagName)).map(e=>e.tagName.toLowerCase())}function getScriptId(e){return`${prefix}-${e}`}function getScriptDOM(e,t){const r=document.createElement("script");r.type="text/javascript",r.async=!0;const n=t.asset.indexOf("?")>-1?"&":"?";return r.src=[t.asset,[`clientId=${e}`].join("&")].join(n),r.id=getScriptId(t.uuid),r}var lodash_merge=createCommonjsModule(function(e,t){var r=200,n="__lodash_hash_undefined__",o=800,a=16,i=9007199254740991,s="[object Arguments]",c="[object AsyncFunction]",u="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",p="[object Proxy]",d="[object Undefined]",g=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[s]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[u]=v["[object Map]"]=v["[object Number]"]=v[h]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var b="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_="object"==typeof self&&self&&self.Object===Object&&self,C=b||_||Function("return this")(),m=t&&!t.nodeType&&t,j=m&&e&&!e.nodeType&&e,F=j&&j.exports===m,w=F&&b.process,O=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),S=O&&O.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var E,A,T,D=Array.prototype,x=Function.prototype,P=Object.prototype,L=C["__core-js_shared__"],M=x.toString,N=P.hasOwnProperty,$=(E=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",k=P.toString,H=M.call(Object),z=RegExp("^"+M.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=F?C.Buffer:void 0,R=C.Symbol,U=C.Uint8Array,B=G?G.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,T=Object,function(e){return A(T(e))}),J=Object.create,q=P.propertyIsEnumerable,V=D.splice,Y=R?R.toStringTag:void 0,W=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),X=G?G.isBuffer:void 0,Z=Math.max,Q=Date.now,ee=me(C,"Map"),te=me(Object,"create"),re=function(){function e(){}return function(t){if(!xe(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=this.__data__=new oe(e);this.size=t.size}function se(e,t){var r=Ie(e),n=!r&&Se(e),o=!r&&!n&&Ae(e),a=!r&&!n&&!o&&Le(e),i=r||n||o||a,s=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=s.length;for(var u in e)!t&&!N.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||je(u,c))||s.push(u);return s}function ce(e,t,r){(void 0===r||Oe(e[t],r))&&(void 0!==r||t in e)||fe(e,t,r)}function ue(e,t,r){var n=e[t];N.call(e,t)&&Oe(n,r)&&(void 0!==r||t in e)||fe(e,t,r)}function le(e,t){for(var r=e.length;r--;)if(Oe(e[r][0],t))return r;return-1}function fe(e,t,r){"__proto__"==t&&W?W(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===n?void 0:r}return N.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:N.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?n:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=le(t,e);return!(r<0||(r==t.length-1?t.pop():V.call(t,r,1),--this.size,0))},oe.prototype.get=function(e){var t=this.__data__,r=le(t,e);return r<0?void 0:t[r][1]},oe.prototype.has=function(e){return le(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ae.prototype.delete=function(e){var t=Ce(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Ce(this,e).get(e)},ae.prototype.has=function(e){return Ce(this,e).has(e)},ae.prototype.set=function(e,t){var r=Ce(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.clear=function(){this.__data__=new oe,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||o.length<r-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(o)}return n.set(e,t),this.size=n.size,this};var he,pe=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[he?i:++n];if(!1===t(o[s],s,o))break}return e};function de(e){return null==e?void 0===e?d:f:Y&&Y in Object(e)?function(e){var t=N.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=k.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return k.call(e)}(e)}function ge(e){return Pe(e)&&de(e)==s}function ye(e){return!(!xe(e)||(t=e,$&&$ in t))&&(Te(e)?z:g).test(function(e){if(null!=e){try{return M.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function ve(e){if(!xe(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Fe(e),r=[];for(var n in e)("constructor"!=n||!t&&N.call(e,n))&&r.push(n);return r}function be(e,t,r,n,o){e!==t&&pe(t,function(a,i){if(xe(a))o||(o=new ie),function(e,t,r,n,o,a,i){var s=I(e,r),c=I(t,r),u=i.get(c);if(u)return void ce(e,r,u);var l=a?a(s,c,r+"",e,t,i):void 0,f=void 0===l;if(f){var p=Ie(c),d=!p&&Ae(c),g=!p&&!d&&Le(c);l=c,p||d||g?Ie(s)?l=s:Pe(C=s)&&Ee(C)?l=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(s):d?(f=!1,l=function(e,t){if(t)return e.slice();var r=e.length,n=B?B(r):new e.constructor(r);return e.copy(n),n}(c,!0)):g?(f=!1,y=c,v=!0?(b=y.buffer,_=new b.constructor(b.byteLength),new U(_).set(new U(b)),_):y.buffer,l=new y.constructor(v,y.byteOffset,y.length)):l=[]:function(e){if(!Pe(e)||de(e)!=h)return!1;var t=K(e);if(null===t)return!0;var r=N.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&M.call(r)==H}(c)||Se(c)?(l=s,Se(s)?l=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?fe(r,s,c):ue(r,s,c)}return r}(e,Me(e))}(s):(!xe(s)||n&&Te(s))&&(l=function(e){return"function"!=typeof e.constructor||Fe(e)?{}:re(K(e))}(c))):f=!1}var y,v,b,_;var C;f&&(i.set(c,l),o(l,c,n,a,i),i.delete(c));ce(e,r,l)}(e,t,i,r,be,n,o);else{var s=n?n(I(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),ce(e,i,s)}},Me)}function _e(e,t){return we(function(e,t,r){return t=Z(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Z(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,t,ke),e+"")}function Ce(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function me(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&y.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}var we=function(e){var t=0,r=0;return function(){var n=Q(),i=a-(n-r);if(r=n,i>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(W?function(e,t){return W(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:ke);function Oe(e,t){return e===t||e!=e&&t!=t}var Se=ge(function(){return arguments}())?ge:function(e){return Pe(e)&&N.call(e,"callee")&&!q.call(e,"callee")},Ie=Array.isArray;function Ee(e){return null!=e&&De(e.length)&&!Te(e)}var Ae=X||function(){return!1};function Te(e){if(!xe(e))return!1;var t=de(e);return t==u||t==l||t==c||t==p}function De(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Pe(e){return null!=e&&"object"==typeof e}var Le=S?function(e){return function(t){return e(t)}}(S):function(e){return Pe(e)&&De(e.length)&&!!v[de(e)]};function Me(e){return Ee(e)?se(e,!0):ve(e)}var Ne,$e=(Ne=function(e,t,r){be(e,t,r)},_e(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Ne.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!xe(r))return!1;var n=typeof t;return!!("number"==n?Ee(r)&&je(t,r.length):"string"==n&&t in r)&&Oe(r[t],e)}(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Ne(e,i,r,o)}return e}));function ke(e){return e}e.exports=$e}),FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reEscapeChar=/\\(\\)?/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function getValue(e,t){return null==e?void 0:e[t]}function isHostObject(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol$1=root.Symbol,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function Hash(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(e){return this.has(e)&&delete this.__data__[e]}function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty.call(t,e)?t[e]:void 0}function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}function hashSet(e,t){return this.__data__[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function ListCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}function MapCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(e){return getMapData(this,e).delete(e)}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){return getMapData(this,e).set(e,t),this}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseGet(e,t){for(var r=0,n=(t=isKey(t,e)?[t]:castPath(t)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)||isHostObject(e)?reIsNative:reIsHostCtor).test(toSource(e))}function baseToString(e){if("string"==typeof e)return e;if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function castPath(e){return isArray(e)?e:stringToPath(e)}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}function isKey(e,t){if(isArray(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(e){e=toString(e);var t=[];return reLeadingDot.test(e)&&t.push(""),e.replace(rePropName,function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)}),t});function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function memoize(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i),i};return r.cache=new(memoize.Cache||MapCache),r}function eq(e,t){return e===t||e!=e&&t!=t}memoize.Cache=MapCache;var isArray=Array.isArray;function isFunction(e){var t=isObject(e)?objectToString.call(e):"";return t==funcTag||t==genTag}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toString(e){return null==e?"":baseToString(e)}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var lodash_get=get;const debug=logger.extend("i18n"),DEFAULT_LOCALE="en",LOCALE_CHANGED="bearer-locale-changed";class I18n{constructor(){this._locale=DEFAULT_LOCALE,this._dictionnary={[DEFAULT_LOCALE]:{}},this.load=((e,t,{locale:r=this.locale}={})=>__awaiter(this,void 0,void 0,function*(){const n=yield t,o=e?{[e]:n}:n;this._dictionnary[r]=lodash_merge(lodash_get(this._dictionnary,r),o),this.localeChanged()})),this.get=((e,t,r={})=>{const n=[r.locale||this.locale,e,t].filter(e=>e).join(".");return debug("lookup key",n),lodash_get(this._dictionnary,n)})}localeChanged(){document.dispatchEvent(new CustomEvent(LOCALE_CHANGED,{detail:{locale:this.locale}}))}set locale(e){this._locale=e,this.localeChanged()}get locale(){return this._locale}}const i18n=new I18n,bearer=(e,t)=>new Bearer(e,t);bearer.version="0.99.1",bearer.i18n=i18n,module.exports=bearer; | ||
//# sourceMappingURL=index.js.map |
import Bearer, { TBearerOptions } from './bearer'; | ||
declare const bearer: { | ||
(token: string, options?: Partial<TBearerOptions> | undefined): Bearer; | ||
import { I18n } from './i18n'; | ||
declare const bearer: TBearer; | ||
export declare type TBearer = { | ||
(token: string, options?: Partial<TBearerOptions>): Bearer; | ||
version: string; | ||
i18n: import("./i18n").I18n; | ||
i18n: I18n; | ||
}; | ||
export default bearer; |
@@ -1,2 +0,3 @@ | ||
import bearer from './lib/main'; | ||
import bearer, { TBearer } from './lib/main'; | ||
export declare type Bearer = TBearer; | ||
export default bearer; |
@@ -1,2 +0,2 @@ | ||
function __awaiter(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(i,s)}c((n=n.apply(e,t||[])).next())})}function debounce(e,t,r){var n,o,a,i,s;function c(){var u=Date.now()-i;u<t&&u>=0?n=setTimeout(c,t-u):(n=null,r||(s=e.apply(a,o),a=o=null))}null==t&&(t=100);var u=function(){a=this,o=arguments,i=Date.now();var u=r&&!n;return n||(n=setTimeout(c,t)),u&&(s=e.apply(a,o),a=o=null),s};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(s=e.apply(a,o),a=o=null,clearTimeout(n),n=null)},u}debounce.debounce=debounce;var debounce_1=debounce,commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var logger_browser=createCommonjsModule(function(e,t){e.exports=function(){var e=1e3,t=6e4,r=36e5,n=24*r,o=function(o,i){i=i||{};var s=typeof o;if("string"===s&&o.length>0)return function(o){if(!((o=String(o)).length>100)){var a=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(a){var i=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"weeks":case"week":case"w":return 6048e5*i;case"days":case"day":case"d":return i*n;case"hours":case"hour":case"hrs":case"hr":case"h":return i*r;case"minutes":case"minute":case"mins":case"min":case"m":return i*t;case"seconds":case"second":case"secs":case"sec":case"s":return i*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(o);if("number"===s&&!1===isNaN(o))return i.long?function(o){var i=Math.abs(o);return i>=n?a(o,i,n,"day"):i>=r?a(o,i,r,"hour"):i>=t?a(o,i,t,"minute"):i>=e?a(o,i,e,"second"):o+" ms"}(o):function(o){var a=Math.abs(o);return a>=n?Math.round(o/n)+"d":a>=r?Math.round(o/r)+"h":a>=t?Math.round(o/t)+"m":a>=e?Math.round(o/e)+"s":o+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}var i,s=(function(e,t){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){let o;function i(...e){if(!i.enabled)return;const t=i,n=Number(new Date),a=n-(o||n);t.diff=a,t.prev=o,t.curr=n,o=n,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return n;s++;const a=r.formatters[o];if("function"==typeof a){const r=e[s];n=a.call(t,r),e.splice(s,1),s--}return n}),r.formatArgs.call(t,e),(t.log||r.log).apply(t,e)}return i.namespace=e,i.enabled=r.enabled(e),i.useColors=r.useColors(),i.color=t(e),i.destroy=n,i.extend=a,"function"==typeof r.init&&r.init(i),r.instances.push(i),i}function n(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function a(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(i),...r.skips.map(i).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){const e=r.instances[t];e.enabled=r.enabled(e.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=o,Object.keys(e).forEach(t=>{r[t]=e[t]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(i={exports:{}},i.exports),i.exports);return s.log,s.formatArgs,s.save,s.load,s.useColors,s.storage,s.colors,e=>s(`bearer:${e}`)}()}),logger=logger_browser("js");const logger$1=logger.extend("Bearer"),prefix="bearer",DEFAULT_OPTIONS={integrationHost:"https://int.bearer.sh",domObserver:!0,refreshDebounceDelay:200};class Bearer{constructor(e,t){this.clientId=e,this.config=DEFAULT_OPTIONS,this.registeredIntegrations={},this.loadMissingIntegrations=(()=>{const e=findElements(document.getElementsByTagName("*")),t=e.filter(e=>!this.registeredIntegration(e));logger$1(this.registeredIntegrations,e,t),this.sendTags(t)}),this.registeredIntegration=(e=>(this.registeredIntegrations[e]=this.registeredIntegrations[e]||document.createElement(e).constructor!==HTMLElement,this.registeredIntegrations[e])),this.initialIntegrationLoading=(()=>{"complete"===document.readyState||"interactive"===document.readyState?this.debounceRefresh():document.addEventListener("DOMContentLoaded",this.debounceRefresh)}),this.registerDomObserver=(()=>{if("MutationObserver"in window){this.disconnectObserver();const e=document.documentElement||document.body,t={childList:!0,subtree:!0};this.observer=new MutationObserver(this.observerCallback),this.observer.observe(e,t)}}),this.observerCallback=(e=>{for(const t of e)"childList"==t.type&&t.addedNodes.length&&this.debounceRefresh()}),this.disconnectObserver=(()=>{this.observer&&(this.observer.disconnect(),delete this.observer)}),this.sendTags=(e=>__awaiter(this,void 0,void 0,function*(){if(!e.length)return Promise.resolve(!0);try{const t=yield fetch(`${this.config.integrationHost}/v1/parse-tags`,{headers:{"content-type":"application/json"},body:JSON.stringify({tags:e,clientId:this.clientId}),method:"POST"});if(t.status>299)throw new Error(`Error while fetching integration tag names: ${e}`);return(yield t.json()).map(e=>{document.querySelector(`#${getScriptId(e.uuid)}`)||document.body.appendChild(getScriptDOM(this.clientId,e))}),!0}catch(e){return!1}})),this.config=Object.assign({},DEFAULT_OPTIONS,t),this.debounceRefresh=debounce_1(this.loadMissingIntegrations,this.config.refreshDebounceDelay),this.initialIntegrationLoading(),this.config.domObserver&&this.registerDomObserver()}}function findElements(e,t=/^bearer-/i){return Array.from(e).filter(e=>t.test(e.tagName)).map(e=>e.tagName.toLowerCase())}function getScriptId(e){return`${prefix}-${e}`}function getScriptDOM(e,t){const r=document.createElement("script");r.type="text/javascript",r.async=!0;const n=t.asset.indexOf("?")>-1?"&":"?";return r.src=[t.asset,[`clientId=${e}`].join("&")].join(n),r.id=getScriptId(t.uuid),r}var lodash_merge=createCommonjsModule(function(e,t){var r=200,n="__lodash_hash_undefined__",o=800,a=16,i=9007199254740991,s="[object Arguments]",c="[object AsyncFunction]",u="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",p="[object Proxy]",d="[object Undefined]",g=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[s]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[u]=v["[object Map]"]=v["[object Number]"]=v[h]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var b="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_="object"==typeof self&&self&&self.Object===Object&&self,C=b||_||Function("return this")(),m=t&&!t.nodeType&&t,j=m&&e&&!e.nodeType&&e,F=j&&j.exports===m,w=F&&b.process,O=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),S=O&&O.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var E,A,T,D=Array.prototype,x=Function.prototype,P=Object.prototype,L=C["__core-js_shared__"],M=x.toString,N=P.hasOwnProperty,$=(E=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",k=P.toString,H=M.call(Object),z=RegExp("^"+M.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=F?C.Buffer:void 0,R=C.Symbol,U=C.Uint8Array,B=G?G.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,T=Object,function(e){return A(T(e))}),J=Object.create,q=P.propertyIsEnumerable,V=D.splice,Y=R?R.toStringTag:void 0,W=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),X=G?G.isBuffer:void 0,Z=Math.max,Q=Date.now,ee=me(C,"Map"),te=me(Object,"create"),re=function(){function e(){}return function(t){if(!xe(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=this.__data__=new oe(e);this.size=t.size}function se(e,t){var r=Ie(e),n=!r&&Se(e),o=!r&&!n&&Ae(e),a=!r&&!n&&!o&&Le(e),i=r||n||o||a,s=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=s.length;for(var u in e)!t&&!N.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||je(u,c))||s.push(u);return s}function ce(e,t,r){(void 0===r||Oe(e[t],r))&&(void 0!==r||t in e)||fe(e,t,r)}function ue(e,t,r){var n=e[t];N.call(e,t)&&Oe(n,r)&&(void 0!==r||t in e)||fe(e,t,r)}function le(e,t){for(var r=e.length;r--;)if(Oe(e[r][0],t))return r;return-1}function fe(e,t,r){"__proto__"==t&&W?W(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===n?void 0:r}return N.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:N.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?n:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=le(t,e);return!(r<0||(r==t.length-1?t.pop():V.call(t,r,1),--this.size,0))},oe.prototype.get=function(e){var t=this.__data__,r=le(t,e);return r<0?void 0:t[r][1]},oe.prototype.has=function(e){return le(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ae.prototype.delete=function(e){var t=Ce(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Ce(this,e).get(e)},ae.prototype.has=function(e){return Ce(this,e).has(e)},ae.prototype.set=function(e,t){var r=Ce(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.clear=function(){this.__data__=new oe,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||o.length<r-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(o)}return n.set(e,t),this.size=n.size,this};var he,pe=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[he?i:++n];if(!1===t(o[s],s,o))break}return e};function de(e){return null==e?void 0===e?d:f:Y&&Y in Object(e)?function(e){var t=N.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=k.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return k.call(e)}(e)}function ge(e){return Pe(e)&&de(e)==s}function ye(e){return!(!xe(e)||(t=e,$&&$ in t))&&(Te(e)?z:g).test(function(e){if(null!=e){try{return M.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function ve(e){if(!xe(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Fe(e),r=[];for(var n in e)("constructor"!=n||!t&&N.call(e,n))&&r.push(n);return r}function be(e,t,r,n,o){e!==t&&pe(t,function(a,i){if(xe(a))o||(o=new ie),function(e,t,r,n,o,a,i){var s=I(e,r),c=I(t,r),u=i.get(c);if(u)return void ce(e,r,u);var l=a?a(s,c,r+"",e,t,i):void 0,f=void 0===l;if(f){var p=Ie(c),d=!p&&Ae(c),g=!p&&!d&&Le(c);l=c,p||d||g?Ie(s)?l=s:Pe(C=s)&&Ee(C)?l=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(s):d?(f=!1,l=function(e,t){if(t)return e.slice();var r=e.length,n=B?B(r):new e.constructor(r);return e.copy(n),n}(c,!0)):g?(f=!1,y=c,v=!0?(b=y.buffer,_=new b.constructor(b.byteLength),new U(_).set(new U(b)),_):y.buffer,l=new y.constructor(v,y.byteOffset,y.length)):l=[]:function(e){if(!Pe(e)||de(e)!=h)return!1;var t=K(e);if(null===t)return!0;var r=N.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&M.call(r)==H}(c)||Se(c)?(l=s,Se(s)?l=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?fe(r,s,c):ue(r,s,c)}return r}(e,Me(e))}(s):(!xe(s)||n&&Te(s))&&(l=function(e){return"function"!=typeof e.constructor||Fe(e)?{}:re(K(e))}(c))):f=!1}var y,v,b,_;var C;f&&(i.set(c,l),o(l,c,n,a,i),i.delete(c));ce(e,r,l)}(e,t,i,r,be,n,o);else{var s=n?n(I(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),ce(e,i,s)}},Me)}function _e(e,t){return we(function(e,t,r){return t=Z(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Z(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,t,ke),e+"")}function Ce(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function me(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&y.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}var we=function(e){var t=0,r=0;return function(){var n=Q(),i=a-(n-r);if(r=n,i>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(W?function(e,t){return W(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:ke);function Oe(e,t){return e===t||e!=e&&t!=t}var Se=ge(function(){return arguments}())?ge:function(e){return Pe(e)&&N.call(e,"callee")&&!q.call(e,"callee")},Ie=Array.isArray;function Ee(e){return null!=e&&De(e.length)&&!Te(e)}var Ae=X||function(){return!1};function Te(e){if(!xe(e))return!1;var t=de(e);return t==u||t==l||t==c||t==p}function De(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Pe(e){return null!=e&&"object"==typeof e}var Le=S?function(e){return function(t){return e(t)}}(S):function(e){return Pe(e)&&De(e.length)&&!!v[de(e)]};function Me(e){return Ee(e)?se(e,!0):ve(e)}var Ne,$e=(Ne=function(e,t,r){be(e,t,r)},_e(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Ne.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!xe(r))return!1;var n=typeof t;return!!("number"==n?Ee(r)&&je(t,r.length):"string"==n&&t in r)&&Oe(r[t],e)}(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Ne(e,i,r,o)}return e}));function ke(e){return e}e.exports=$e}),FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reEscapeChar=/\\(\\)?/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function getValue(e,t){return null==e?void 0:e[t]}function isHostObject(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol$1=root.Symbol,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function Hash(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(e){return this.has(e)&&delete this.__data__[e]}function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty.call(t,e)?t[e]:void 0}function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}function hashSet(e,t){return this.__data__[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function ListCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}function MapCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(e){return getMapData(this,e).delete(e)}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){return getMapData(this,e).set(e,t),this}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseGet(e,t){for(var r=0,n=(t=isKey(t,e)?[t]:castPath(t)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)||isHostObject(e)?reIsNative:reIsHostCtor).test(toSource(e))}function baseToString(e){if("string"==typeof e)return e;if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function castPath(e){return isArray(e)?e:stringToPath(e)}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}function isKey(e,t){if(isArray(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(e){e=toString(e);var t=[];return reLeadingDot.test(e)&&t.push(""),e.replace(rePropName,function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)}),t});function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function memoize(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i),i};return r.cache=new(memoize.Cache||MapCache),r}function eq(e,t){return e===t||e!=e&&t!=t}memoize.Cache=MapCache;var isArray=Array.isArray;function isFunction(e){var t=isObject(e)?objectToString.call(e):"";return t==funcTag||t==genTag}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toString(e){return null==e?"":baseToString(e)}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var lodash_get=get;const debug=logger.extend("i18n"),DEFAULT_LOCALE="en",LOCALE_CHANGED="bearer-locale-changed";class I18n{constructor(){this._locale=DEFAULT_LOCALE,this._dictionnary={[DEFAULT_LOCALE]:{}},this.load=((e,t,{locale:r=this.locale}={})=>__awaiter(this,void 0,void 0,function*(){const n=yield t,o=e?{[e]:n}:n;this._dictionnary[r]=lodash_merge(lodash_get(this._dictionnary,r),o),this.localeChanged()})),this.get=((e,t,r={})=>{const n=[r.locale||this.locale,e,t].filter(e=>e).join(".");return debug("lookup key",n),lodash_get(this._dictionnary,n)})}localeChanged(){document.dispatchEvent(new CustomEvent(LOCALE_CHANGED,{detail:{locale:this.locale}}))}set locale(e){this._locale=e,this.localeChanged()}get locale(){return this._locale}}const i18n=new I18n,bearer=(e,t)=>new Bearer(e,t);bearer.version="0.99.0",bearer.i18n=i18n;export default bearer; | ||
function __awaiter(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(i,s)}c((n=n.apply(e,t||[])).next())})}function debounce(e,t,r){var n,o,a,i,s;function c(){var u=Date.now()-i;u<t&&u>=0?n=setTimeout(c,t-u):(n=null,r||(s=e.apply(a,o),a=o=null))}null==t&&(t=100);var u=function(){a=this,o=arguments,i=Date.now();var u=r&&!n;return n||(n=setTimeout(c,t)),u&&(s=e.apply(a,o),a=o=null),s};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(s=e.apply(a,o),a=o=null,clearTimeout(n),n=null)},u}debounce.debounce=debounce;var debounce_1=debounce,commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var logger_browser=createCommonjsModule(function(e,t){e.exports=function(){var e=1e3,t=6e4,r=36e5,n=24*r,o=function(o,i){i=i||{};var s=typeof o;if("string"===s&&o.length>0)return function(o){if(!((o=String(o)).length>100)){var a=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(a){var i=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"weeks":case"week":case"w":return 6048e5*i;case"days":case"day":case"d":return i*n;case"hours":case"hour":case"hrs":case"hr":case"h":return i*r;case"minutes":case"minute":case"mins":case"min":case"m":return i*t;case"seconds":case"second":case"secs":case"sec":case"s":return i*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(o);if("number"===s&&!1===isNaN(o))return i.long?function(o){var i=Math.abs(o);return i>=n?a(o,i,n,"day"):i>=r?a(o,i,r,"hour"):i>=t?a(o,i,t,"minute"):i>=e?a(o,i,e,"second"):o+" ms"}(o):function(o){var a=Math.abs(o);return a>=n?Math.round(o/n)+"d":a>=r?Math.round(o/r)+"h":a>=t?Math.round(o/t)+"m":a>=e?Math.round(o/e)+"s":o+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}var i,s=(function(e,t){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){let o;function i(...e){if(!i.enabled)return;const t=i,n=Number(new Date),a=n-(o||n);t.diff=a,t.prev=o,t.curr=n,o=n,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return n;s++;const a=r.formatters[o];if("function"==typeof a){const r=e[s];n=a.call(t,r),e.splice(s,1),s--}return n}),r.formatArgs.call(t,e),(t.log||r.log).apply(t,e)}return i.namespace=e,i.enabled=r.enabled(e),i.useColors=r.useColors(),i.color=t(e),i.destroy=n,i.extend=a,"function"==typeof r.init&&r.init(i),r.instances.push(i),i}function n(){const e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function a(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(i),...r.skips.map(i).map(e=>"-"+e)].join(",");return r.enable(""),e},r.enable=function(e){let t;r.save(e),r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){const e=r.instances[t];e.enabled=r.enabled(e.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=o,Object.keys(e).forEach(t=>{r[t]=e[t]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(i={exports:{}},i.exports),i.exports);return s.log,s.formatArgs,s.save,s.load,s.useColors,s.storage,s.colors,e=>s(`bearer:${e}`)}()}),logger=logger_browser("js");const logger$1=logger.extend("Bearer"),prefix="bearer",DEFAULT_OPTIONS={integrationHost:"https://int.bearer.sh",domObserver:!0,refreshDebounceDelay:200};class Bearer{constructor(e,t){this.clientId=e,this.config=DEFAULT_OPTIONS,this.registeredIntegrations={},this.loadMissingIntegrations=(()=>{const e=findElements(document.getElementsByTagName("*")),t=e.filter(e=>!this.registeredIntegration(e));logger$1(this.registeredIntegrations,e,t),this.sendTags(t)}),this.registeredIntegration=(e=>(this.registeredIntegrations[e]=this.registeredIntegrations[e]||document.createElement(e).constructor!==HTMLElement,this.registeredIntegrations[e])),this.initialIntegrationLoading=(()=>{"complete"===document.readyState||"interactive"===document.readyState?this.debounceRefresh():document.addEventListener("DOMContentLoaded",this.debounceRefresh)}),this.registerDomObserver=(()=>{if("MutationObserver"in window){this.disconnectObserver();const e=document.documentElement||document.body,t={childList:!0,subtree:!0};this.observer=new MutationObserver(this.observerCallback),this.observer.observe(e,t)}}),this.observerCallback=(e=>{for(const t of e)"childList"==t.type&&t.addedNodes.length&&this.debounceRefresh()}),this.disconnectObserver=(()=>{this.observer&&(this.observer.disconnect(),delete this.observer)}),this.sendTags=(e=>__awaiter(this,void 0,void 0,function*(){if(!e.length)return Promise.resolve(!0);try{const t=yield fetch(`${this.config.integrationHost}/v1/parse-tags`,{headers:{"content-type":"application/json"},body:JSON.stringify({tags:e,clientId:this.clientId}),method:"POST"});if(t.status>299)throw new Error(`Error while fetching integration tag names: ${e}`);return(yield t.json()).map(e=>{document.querySelector(`#${getScriptId(e.uuid)}`)||document.body.appendChild(getScriptDOM(this.clientId,e))}),!0}catch(e){return!1}})),this.config=Object.assign({},DEFAULT_OPTIONS,t),this.debounceRefresh=debounce_1(this.loadMissingIntegrations,this.config.refreshDebounceDelay),this.initialIntegrationLoading(),this.config.domObserver&&this.registerDomObserver()}}function findElements(e,t=/^bearer-/i){return Array.from(e).filter(e=>t.test(e.tagName)).map(e=>e.tagName.toLowerCase())}function getScriptId(e){return`${prefix}-${e}`}function getScriptDOM(e,t){const r=document.createElement("script");r.type="text/javascript",r.async=!0;const n=t.asset.indexOf("?")>-1?"&":"?";return r.src=[t.asset,[`clientId=${e}`].join("&")].join(n),r.id=getScriptId(t.uuid),r}var lodash_merge=createCommonjsModule(function(e,t){var r=200,n="__lodash_hash_undefined__",o=800,a=16,i=9007199254740991,s="[object Arguments]",c="[object AsyncFunction]",u="[object Function]",l="[object GeneratorFunction]",f="[object Null]",h="[object Object]",p="[object Proxy]",d="[object Undefined]",g=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[s]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[u]=v["[object Map]"]=v["[object Number]"]=v[h]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var b="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_="object"==typeof self&&self&&self.Object===Object&&self,C=b||_||Function("return this")(),m=t&&!t.nodeType&&t,j=m&&e&&!e.nodeType&&e,F=j&&j.exports===m,w=F&&b.process,O=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),S=O&&O.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var E,A,T,D=Array.prototype,x=Function.prototype,P=Object.prototype,L=C["__core-js_shared__"],M=x.toString,N=P.hasOwnProperty,$=(E=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",k=P.toString,H=M.call(Object),z=RegExp("^"+M.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=F?C.Buffer:void 0,R=C.Symbol,U=C.Uint8Array,B=G?G.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,T=Object,function(e){return A(T(e))}),J=Object.create,q=P.propertyIsEnumerable,V=D.splice,Y=R?R.toStringTag:void 0,W=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),X=G?G.isBuffer:void 0,Z=Math.max,Q=Date.now,ee=me(C,"Map"),te=me(Object,"create"),re=function(){function e(){}return function(t){if(!xe(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=this.__data__=new oe(e);this.size=t.size}function se(e,t){var r=Ie(e),n=!r&&Se(e),o=!r&&!n&&Ae(e),a=!r&&!n&&!o&&Le(e),i=r||n||o||a,s=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=s.length;for(var u in e)!t&&!N.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||je(u,c))||s.push(u);return s}function ce(e,t,r){(void 0===r||Oe(e[t],r))&&(void 0!==r||t in e)||fe(e,t,r)}function ue(e,t,r){var n=e[t];N.call(e,t)&&Oe(n,r)&&(void 0!==r||t in e)||fe(e,t,r)}function le(e,t){for(var r=e.length;r--;)if(Oe(e[r][0],t))return r;return-1}function fe(e,t,r){"__proto__"==t&&W?W(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===n?void 0:r}return N.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:N.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?n:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=le(t,e);return!(r<0||(r==t.length-1?t.pop():V.call(t,r,1),--this.size,0))},oe.prototype.get=function(e){var t=this.__data__,r=le(t,e);return r<0?void 0:t[r][1]},oe.prototype.has=function(e){return le(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=le(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ae.prototype.delete=function(e){var t=Ce(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Ce(this,e).get(e)},ae.prototype.has=function(e){return Ce(this,e).has(e)},ae.prototype.set=function(e,t){var r=Ce(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.clear=function(){this.__data__=new oe,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||o.length<r-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(o)}return n.set(e,t),this.size=n.size,this};var he,pe=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[he?i:++n];if(!1===t(o[s],s,o))break}return e};function de(e){return null==e?void 0===e?d:f:Y&&Y in Object(e)?function(e){var t=N.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=k.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return k.call(e)}(e)}function ge(e){return Pe(e)&&de(e)==s}function ye(e){return!(!xe(e)||(t=e,$&&$ in t))&&(Te(e)?z:g).test(function(e){if(null!=e){try{return M.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function ve(e){if(!xe(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Fe(e),r=[];for(var n in e)("constructor"!=n||!t&&N.call(e,n))&&r.push(n);return r}function be(e,t,r,n,o){e!==t&&pe(t,function(a,i){if(xe(a))o||(o=new ie),function(e,t,r,n,o,a,i){var s=I(e,r),c=I(t,r),u=i.get(c);if(u)return void ce(e,r,u);var l=a?a(s,c,r+"",e,t,i):void 0,f=void 0===l;if(f){var p=Ie(c),d=!p&&Ae(c),g=!p&&!d&&Le(c);l=c,p||d||g?Ie(s)?l=s:Pe(C=s)&&Ee(C)?l=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(s):d?(f=!1,l=function(e,t){if(t)return e.slice();var r=e.length,n=B?B(r):new e.constructor(r);return e.copy(n),n}(c,!0)):g?(f=!1,y=c,v=!0?(b=y.buffer,_=new b.constructor(b.byteLength),new U(_).set(new U(b)),_):y.buffer,l=new y.constructor(v,y.byteOffset,y.length)):l=[]:function(e){if(!Pe(e)||de(e)!=h)return!1;var t=K(e);if(null===t)return!0;var r=N.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&M.call(r)==H}(c)||Se(c)?(l=s,Se(s)?l=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?fe(r,s,c):ue(r,s,c)}return r}(e,Me(e))}(s):(!xe(s)||n&&Te(s))&&(l=function(e){return"function"!=typeof e.constructor||Fe(e)?{}:re(K(e))}(c))):f=!1}var y,v,b,_;var C;f&&(i.set(c,l),o(l,c,n,a,i),i.delete(c));ce(e,r,l)}(e,t,i,r,be,n,o);else{var s=n?n(I(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),ce(e,i,s)}},Me)}function _e(e,t){return we(function(e,t,r){return t=Z(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=Z(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,s)}}(e,t,ke),e+"")}function Ce(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function me(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&y.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}var we=function(e){var t=0,r=0;return function(){var n=Q(),i=a-(n-r);if(r=n,i>0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(W?function(e,t){return W(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:ke);function Oe(e,t){return e===t||e!=e&&t!=t}var Se=ge(function(){return arguments}())?ge:function(e){return Pe(e)&&N.call(e,"callee")&&!q.call(e,"callee")},Ie=Array.isArray;function Ee(e){return null!=e&&De(e.length)&&!Te(e)}var Ae=X||function(){return!1};function Te(e){if(!xe(e))return!1;var t=de(e);return t==u||t==l||t==c||t==p}function De(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Pe(e){return null!=e&&"object"==typeof e}var Le=S?function(e){return function(t){return e(t)}}(S):function(e){return Pe(e)&&De(e.length)&&!!v[de(e)]};function Me(e){return Ee(e)?se(e,!0):ve(e)}var Ne,$e=(Ne=function(e,t,r){be(e,t,r)},_e(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Ne.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!xe(r))return!1;var n=typeof t;return!!("number"==n?Ee(r)&&je(t,r.length):"string"==n&&t in r)&&Oe(r[t],e)}(t[0],t[1],a)&&(o=n<3?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Ne(e,i,r,o)}return e}));function ke(e){return e}e.exports=$e}),FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",INFINITY=1/0,funcTag="[object Function]",genTag="[object GeneratorFunction]",symbolTag="[object Symbol]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reEscapeChar=/\\(\\)?/g,reIsHostCtor=/^\[object .+?Constructor\]$/,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();function getValue(e,t){return null==e?void 0:e[t]}function isHostObject(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var e=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol$1=root.Symbol,splice=arrayProto.splice,Map=getNative(root,"Map"),nativeCreate=getNative(Object,"create"),symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function Hash(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{}}function hashDelete(e){return this.has(e)&&delete this.__data__[e]}function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED?void 0:r}return hasOwnProperty.call(t,e)?t[e]:void 0}function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}function hashSet(e,t){return this.__data__[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function ListCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[]}function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}function MapCache(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function mapCacheClear(){this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}function mapCacheDelete(e){return getMapData(this,e).delete(e)}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){return getMapData(this,e).set(e,t),this}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseGet(e,t){for(var r=0,n=(t=isKey(t,e)?[t]:castPath(t)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}function baseIsNative(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)||isHostObject(e)?reIsNative:reIsHostCtor).test(toSource(e))}function baseToString(e){if("string"==typeof e)return e;if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function castPath(e){return isArray(e)?e:stringToPath(e)}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}function isKey(e,t){if(isArray(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var stringToPath=memoize(function(e){e=toString(e);var t=[];return reLeadingDot.test(e)&&t.push(""),e.replace(rePropName,function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)}),t});function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}function toSource(e){if(null!=e){try{return funcToString.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function memoize(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i),i};return r.cache=new(memoize.Cache||MapCache),r}function eq(e,t){return e===t||e!=e&&t!=t}memoize.Cache=MapCache;var isArray=Array.isArray;function isFunction(e){var t=isObject(e)?objectToString.call(e):"";return t==funcTag||t==genTag}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toString(e){return null==e?"":baseToString(e)}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var lodash_get=get;const debug=logger.extend("i18n"),DEFAULT_LOCALE="en",LOCALE_CHANGED="bearer-locale-changed";class I18n{constructor(){this._locale=DEFAULT_LOCALE,this._dictionnary={[DEFAULT_LOCALE]:{}},this.load=((e,t,{locale:r=this.locale}={})=>__awaiter(this,void 0,void 0,function*(){const n=yield t,o=e?{[e]:n}:n;this._dictionnary[r]=lodash_merge(lodash_get(this._dictionnary,r),o),this.localeChanged()})),this.get=((e,t,r={})=>{const n=[r.locale||this.locale,e,t].filter(e=>e).join(".");return debug("lookup key",n),lodash_get(this._dictionnary,n)})}localeChanged(){document.dispatchEvent(new CustomEvent(LOCALE_CHANGED,{detail:{locale:this.locale}}))}set locale(e){this._locale=e,this.localeChanged()}get locale(){return this._locale}}const i18n=new I18n,bearer=(e,t)=>new Bearer(e,t);bearer.version="0.99.1",bearer.i18n=i18n;export default bearer; | ||
//# sourceMappingURL=index.js.map |
import Bearer, { TBearerOptions } from './bearer'; | ||
declare const bearer: { | ||
(token: string, options?: Partial<TBearerOptions> | undefined): Bearer; | ||
import { I18n } from './i18n'; | ||
declare const bearer: TBearer; | ||
export declare type TBearer = { | ||
(token: string, options?: Partial<TBearerOptions>): Bearer; | ||
version: string; | ||
i18n: import("./i18n").I18n; | ||
i18n: I18n; | ||
}; | ||
export default bearer; |
@@ -1,2 +0,3 @@ | ||
import bearer from './lib/main'; | ||
import bearer, { TBearer } from './lib/main'; | ||
export declare type Bearer = TBearer; | ||
export default bearer; |
import Bearer, { TBearerOptions } from './bearer'; | ||
declare const bearer: { | ||
(token: string, options?: Partial<TBearerOptions> | undefined): Bearer; | ||
import { I18n } from './i18n'; | ||
declare const bearer: TBearer; | ||
export declare type TBearer = { | ||
(token: string, options?: Partial<TBearerOptions>): Bearer; | ||
version: string; | ||
i18n: import("./i18n").I18n; | ||
i18n: I18n; | ||
}; | ||
export default bearer; |
{ | ||
"name": "@bearer/js", | ||
"version": "0.99.0", | ||
"version": "0.99.1", | ||
"description": "A JavaScript library for working with Bearer integrations", | ||
@@ -8,2 +8,3 @@ "jsdelivr": "lib/bearer.production.min.js", | ||
"main": "lib/cjs/index.js", | ||
"types": "lib/cjs/index.d.ts", | ||
"module": "lib/es/index.js", | ||
@@ -45,3 +46,3 @@ "repository": "https://github.com/Bearer/bearer/packages/js", | ||
}, | ||
"gitHead": "9ae67f3ab75d156311899f9fc322174383871310" | ||
"gitHead": "0c5360a4e4b274897c12418d6dab1e38cdfaa6a9" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
468422
529