UNPKG

react-bootstrap-button

Version:

This is a quick save for anyone looking to add a loading button for Bootstrap in React.

44 lines (41 loc) 32.2 kB
import*as e from"react";import r,{useContext as t}from"react"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var n=function(){return n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},n.apply(this,arguments)};var o={exports:{}},a={exports:{}},i={},c="function"==typeof Symbol&&Symbol.for,s=c?Symbol.for("react.element"):60103,f=c?Symbol.for("react.portal"):60106,u=c?Symbol.for("react.fragment"):60107,l=c?Symbol.for("react.strict_mode"):60108,p=c?Symbol.for("react.profiler"):60114,y=c?Symbol.for("react.provider"):60109,d=c?Symbol.for("react.context"):60110,m=c?Symbol.for("react.async_mode"):60111,v=c?Symbol.for("react.concurrent_mode"):60111,b=c?Symbol.for("react.forward_ref"):60112,g=c?Symbol.for("react.suspense"):60113,h=c?Symbol.for("react.suspense_list"):60120,O=c?Symbol.for("react.memo"):60115,w=c?Symbol.for("react.lazy"):60116,_=c?Symbol.for("react.block"):60121,S=c?Symbol.for("react.fundamental"):60117,j=c?Symbol.for("react.responder"):60118,E=c?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case s:switch(e=e.type){case m:case v:case u:case p:case l:case g:return e;default:switch(e=e&&e.$$typeof){case d:case b:case w:case O:case y:return e;default:return r}}case f:return r}}}function P(e){return x(e)===v}i.AsyncMode=m,i.ConcurrentMode=v,i.ContextConsumer=d,i.ContextProvider=y,i.Element=s,i.ForwardRef=b,i.Fragment=u,i.Lazy=w,i.Memo=O,i.Portal=f,i.Profiler=p,i.StrictMode=l,i.Suspense=g,i.isAsyncMode=function(e){return P(e)||x(e)===m},i.isConcurrentMode=P,i.isContextConsumer=function(e){return x(e)===d},i.isContextProvider=function(e){return x(e)===y},i.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===s},i.isForwardRef=function(e){return x(e)===b},i.isFragment=function(e){return x(e)===u},i.isLazy=function(e){return x(e)===w},i.isMemo=function(e){return x(e)===O},i.isPortal=function(e){return x(e)===f},i.isProfiler=function(e){return x(e)===p},i.isStrictMode=function(e){return x(e)===l},i.isSuspense=function(e){return x(e)===g},i.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===u||e===v||e===p||e===l||e===g||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===O||e.$$typeof===y||e.$$typeof===d||e.$$typeof===b||e.$$typeof===S||e.$$typeof===j||e.$$typeof===E||e.$$typeof===_)},i.typeOf=x;var $={}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case r:var m=e.type;switch(m){case s:case f:case n:case a:case o:case l:return m;default:var v=m&&m.$$typeof;switch(v){case c:case u:case d:case y:case i:return v;default:return p}}case t:return p}}}var O=s,w=f,_=c,S=i,j=r,E=u,x=n,P=d,k=y,R=t,N=a,T=o,C=l,I=!1;function D(e){return h(e)===f}$.AsyncMode=O,$.ConcurrentMode=w,$.ContextConsumer=_,$.ContextProvider=S,$.Element=j,$.ForwardRef=E,$.Fragment=x,$.Lazy=P,$.Memo=k,$.Portal=R,$.Profiler=N,$.StrictMode=T,$.Suspense=C,$.isAsyncMode=function(e){return I||(I=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(e)||h(e)===s},$.isConcurrentMode=D,$.isContextConsumer=function(e){return h(e)===c},$.isContextProvider=function(e){return h(e)===i},$.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},$.isForwardRef=function(e){return h(e)===u},$.isFragment=function(e){return h(e)===n},$.isLazy=function(e){return h(e)===d},$.isMemo=function(e){return h(e)===y},$.isPortal=function(e){return h(e)===t},$.isProfiler=function(e){return h(e)===a},$.isStrictMode=function(e){return h(e)===o},$.isSuspense=function(e){return h(e)===l},$.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===f||e===a||e===o||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===i||e.$$typeof===c||e.$$typeof===u||e.$$typeof===v||e.$$typeof===b||e.$$typeof===g||e.$$typeof===m)},$.typeOf=h}(),"production"===process.env.NODE_ENV?a.exports=i:a.exports=$ /* object-assign (c) Sindre Sorhus @license MIT */;var k=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;function T(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var C=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(r).map((function(e){return r[e]}));if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var t,n,o=T(e),a=1;a<arguments.length;a++){for(var i in t=Object(arguments[a]))R.call(t,i)&&(o[i]=t[i]);if(k){n=k(t);for(var c=0;c<n.length;c++)N.call(t,n[c])&&(o[n[c]]=t[n[c]])}}return o},I="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",D=Function.call.bind(Object.prototype.hasOwnProperty),F=function(){};if("production"!==process.env.NODE_ENV){var A=I,M={},L=D;F=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function V(e,r,t,n,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(L(e,a)){var i;try{if("function"!=typeof e[a]){var c=Error((n||"React class")+": "+t+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}i=e[a](r,a,n,t,null,A)}catch(e){i=e}if(!i||i instanceof Error||F((n||"React class")+": type specification of "+t+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in M)){M[i.message]=!0;var s=o?o():"";F("Failed "+t+" type: "+i.message+(null!=s?s:""))}}}V.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(M={})};var W=V,z=a.exports,U=C,B=I,Y=D,q=W,J=function(){};function H(){return null}"production"!==process.env.NODE_ENV&&(J=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}});function K(){}function X(){}X.resetWarningCache=K;if("production"!==process.env.NODE_ENV){var G=a.exports;o.exports=function(e,r){var t="function"==typeof Symbol&&Symbol.iterator,n="<<anonymous>>",o={array:s("array"),bigint:s("bigint"),bool:s("boolean"),func:s("function"),number:s("number"),object:s("object"),string:s("string"),symbol:s("symbol"),any:c(H),arrayOf:function(e){return c((function(r,t,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var c=r[t];if(!Array.isArray(c))return new i("Invalid "+o+" `"+a+"` of type `"+l(c)+"` supplied to `"+n+"`, expected an array.");for(var s=0;s<c.length;s++){var f=e(c,s,n,o,a+"["+s+"]",B);if(f instanceof Error)return f}return null}))},element:c((function(r,t,n,o,a){var c=r[t];return e(c)?null:new i("Invalid "+o+" `"+a+"` of type `"+l(c)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:c((function(e,r,t,n,o){var a=e[r];return z.isValidElementType(a)?null:new i("Invalid "+n+" `"+o+"` of type `"+l(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")})),instanceOf:function(e){return c((function(r,t,o,a,c){if(!(r[t]instanceof e)){var s=e.name||n;return new i("Invalid "+a+" `"+c+"` of type `"+((f=r[t]).constructor&&f.constructor.name?f.constructor.name:n)+"` supplied to `"+o+"`, expected instance of `"+s+"`.")}var f;return null}))},node:c((function(e,r,t,n,o){return u(e[r])?null:new i("Invalid "+n+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")})),objectOf:function(e){return c((function(r,t,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var c=r[t],s=l(c);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected an object.");for(var f in c)if(Y(c,f)){var u=e(c,f,n,o,a+"."+f,B);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&J(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),H;function r(r,t,n,o,c){for(var s=r[t],f=0;f<e.length;f++)if(a(s,e[f]))return null;var u=JSON.stringify(e,(function(e,r){return"symbol"===p(r)?String(r):r}));return new i("Invalid "+o+" `"+c+"` of value `"+String(s)+"` supplied to `"+n+"`, expected one of "+u+".")}return c(r)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&J("Invalid argument supplied to oneOfType, expected an instance of array."),H;for(var r=0;r<e.length;r++){var t=e[r];if("function"!=typeof t)return J("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(t)+" at index "+r+"."),H}return c((function(r,t,n,o,a){for(var c=[],s=0;s<e.length;s++){var f=(0,e[s])(r,t,n,o,a,B);if(null==f)return null;f.data&&Y(f.data,"expectedType")&&c.push(f.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+n+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")}))},shape:function(e){return c((function(r,t,n,o,a){var c=r[t],s=l(c);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected `object`.");for(var u in e){var y=e[u];if("function"!=typeof y)return f(n,o,a,u,p(y));var d=y(c,u,n,o,a+"."+u,B);if(d)return d}return null}))},exact:function(e){return c((function(r,t,n,o,a){var c=r[t],s=l(c);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected `object`.");var u=U({},r[t],e);for(var y in u){var d=e[y];if(Y(e,y)&&"function"!=typeof d)return f(n,o,a,y,p(d));if(!d)return new i("Invalid "+o+" `"+a+"` key `"+y+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(r[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=d(c,y,n,o,a+"."+y,B);if(m)return m}return null}))}};function a(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function i(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function c(e){if("production"!==process.env.NODE_ENV)var t={},o=0;function a(a,c,s,f,u,l,p){if(f=f||n,l=l||s,p!==B){if(r){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var d=f+":"+s;!t[d]&&o<3&&(J("You are manually calling a React.PropTypes validation function for the `"+l+"` prop on `"+f+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[d]=!0,o++)}}return null==c[s]?a?null===c[s]?new i("The "+u+" `"+l+"` is marked as required in `"+f+"`, but its value is `null`."):new i("The "+u+" `"+l+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(c,s,f,u,l)}var c=a.bind(null,!1);return c.isRequired=a.bind(null,!0),c}function s(e){return c((function(r,t,n,o,a,c){var s=r[t];return l(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+p(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function f(e,r,t,n,o){return new i((e||"React class")+": "+r+" type `"+t+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function u(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(u);if(null===r||e(r))return!0;var n=function(e){var r=e&&(t&&e[t]||e["@@iterator"]);if("function"==typeof r)return r}(r);if(!n)return!1;var o,a=n.call(r);if(n!==r.entries){for(;!(o=a.next()).done;)if(!u(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!u(i[1]))return!1}return!0;default:return!1}}function l(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function p(e){if(null==e)return""+e;var r=l(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function y(e){var r=p(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return i.prototype=Error.prototype,o.checkPropTypes=q,o.resetWarningCache=q.resetWarningCache,o.PropTypes=o,o}(G.isElement,!0)}else o.exports=function(){function e(e,r,t,n,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:X,resetWarningCache:K};return t.PropTypes=t,t}();var Q,Z=o.exports,ee={exports:{}}; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ Q=ee,function(){var e={}.hasOwnProperty;function r(){for(var t=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var a=typeof o;if("string"===a||"number"===a)t.push(o);else if(Array.isArray(o)){if(o.length){var i=r.apply(null,o);i&&t.push(i)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var c in o)e.call(o,c)&&o[c]&&t.push(c);else t.push(o.toString())}}return t.join(" ")}Q.exports?(r.default=r,Q.exports=r):window.classNames=r}();var re=ee.exports,te={exports:{}},ne={},oe=r,ae=60103;if(ne.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var ie=Symbol.for;ae=ie("react.element"),ne.Fragment=ie("react.fragment")}var ce=oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,se=Object.prototype.hasOwnProperty,fe={key:!0,ref:!0,__self:!0,__source:!0};function ue(e,r,t){var n,o={},a=null,i=null;for(n in void 0!==t&&(a=""+t),void 0!==r.key&&(a=""+r.key),void 0!==r.ref&&(i=r.ref),r)se.call(r,n)&&!fe.hasOwnProperty(n)&&(o[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===o[n]&&(o[n]=r[n]);return{$$typeof:ae,type:e,key:a,ref:i,props:o,_owner:ce.current}}ne.jsx=ue,ne.jsxs=ue;var le,pe={}; /** @license React v17.0.2 * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */le=pe,"production"!==process.env.NODE_ENV&&function(){var e=r,t=C,n=60103,o=60106;le.Fragment=60107;var a=60108,i=60114,c=60109,s=60110,f=60112,u=60113,l=60120,p=60115,y=60116,d=60121,m=60122,v=60117,b=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var h=Symbol.for;n=h("react.element"),o=h("react.portal"),le.Fragment=h("react.fragment"),a=h("react.strict_mode"),i=h("react.profiler"),c=h("react.provider"),s=h("react.context"),f=h("react.forward_ref"),u=h("react.suspense"),l=h("react.suspense_list"),p=h("react.memo"),y=h("react.lazy"),d=h("react.block"),m=h("react.server.block"),v=h("react.fundamental"),h("react.scope"),h("react.opaque.id"),b=h("react.debug_trace_mode"),h("react.offscreen"),g=h("react.legacy_hidden")}var O="function"==typeof Symbol&&Symbol.iterator,w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];S("error",e,t)}function S(e,r,t){var n=w.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(r+="%s",t=t.concat([n]));var o=t.map((function(e){return""+e}));o.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,o)}function j(e){return e.displayName||"Context"}function E(e){if(null==e)return null;if("number"==typeof e.tag&&_("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case le.Fragment:return"Fragment";case o:return"Portal";case i:return"Profiler";case a:return"StrictMode";case u:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return j(e)+".Consumer";case c:return j(e._context)+".Provider";case f:return m=e,v=e.render,b="ForwardRef",g=v.displayName||v.name||"",m.displayName||(""!==g?b+"("+g+")":b);case p:return E(e.type);case d:return E(e._render);case y:var r=e,t=r._payload,n=r._init;try{return E(n(t))}catch(e){return null}}var m,v,b,g;return null}var x,P,$,k,R,N,T,I=0;function D(){}D.__reactDisabledLog=!0;var F,A=w.ReactCurrentDispatcher;function M(e,r,t){if(void 0===F)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);F=n&&n[1]||""}return"\n"+F+e}var L,V=!1,W="function"==typeof WeakMap?WeakMap:Map;function z(e,r){if(!e||V)return"";var n,o=L.get(e);if(void 0!==o)return o;V=!0;var a,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,a=A.current,A.current=null,function(){if(0===I){x=console.log,P=console.info,$=console.warn,k=console.error,R=console.group,N=console.groupCollapsed,T=console.groupEnd;var e={configurable:!0,enumerable:!0,value:D,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}();try{if(r){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(c,[])}catch(e){n=e}Reflect.construct(e,[],c)}else{try{c.call()}catch(e){n=e}e.call(c.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(r){if(r&&n&&"string"==typeof r.stack){for(var s=r.stack.split("\n"),f=n.stack.split("\n"),u=s.length-1,l=f.length-1;u>=1&&l>=0&&s[u]!==f[l];)l--;for(;u>=1&&l>=0;u--,l--)if(s[u]!==f[l]){if(1!==u||1!==l)do{if(u--,--l<0||s[u]!==f[l]){var p="\n"+s[u].replace(" at new "," at ");return"function"==typeof e&&L.set(e,p),p}}while(u>=1&&l>=0);break}}}finally{V=!1,A.current=a,function(){if(0==--I){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},e,{value:x}),info:t({},e,{value:P}),warn:t({},e,{value:$}),error:t({},e,{value:k}),group:t({},e,{value:R}),groupCollapsed:t({},e,{value:N}),groupEnd:t({},e,{value:T})})}I<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var y=e?e.displayName||e.name:"",d=y?M(y):"";return"function"==typeof e&&L.set(e,d),d}function U(e,r,t){return z(e,!1)}function B(e,r,t){if(null==e)return"";if("function"==typeof e)return z(e,!(!(n=e.prototype)||!n.isReactComponent));var n;if("string"==typeof e)return M(e);switch(e){case u:return M("Suspense");case l:return M("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case f:return U(e.render);case p:return B(e.type,r,t);case d:return U(e._render);case y:var o=e,a=o._payload,i=o._init;try{return B(i(a),r,t)}catch(e){}}return""}L=new W;var Y={},q=w.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);q.setExtraStackFrame(t)}else q.setExtraStackFrame(null)}var H,K,X,G=w.ReactCurrentOwner,Q=Object.prototype.hasOwnProperty,Z={key:!0,ref:!0,__self:!0,__source:!0};function ee(e,r,t,o,a){var i,c={},s=null,f=null;for(i in void 0!==t&&(s=""+t),function(e){if(Q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return void 0!==e.key}(r)&&(s=""+r.key),function(e){if(Q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return void 0!==e.ref}(r)&&(f=r.ref,function(e,r){if("string"==typeof e.ref&&G.current&&r&&G.current.stateNode!==r){var t=E(G.current.type);X[t]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(G.current.type),e.ref),X[t]=!0)}}(r,a)),r)Q.call(r,i)&&!Z.hasOwnProperty(i)&&(c[i]=r[i]);if(e&&e.defaultProps){var u=e.defaultProps;for(i in u)void 0===c[i]&&(c[i]=u[i])}if(s||f){var l="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,r){var t=function(){H||(H=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(c,l),f&&function(e,r){var t=function(){K||(K=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}(c,l)}return function(e,r,t,o,a,i,c){var s={$$typeof:n,type:e,key:r,ref:t,props:c,_owner:i,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}(e,s,f,a,o,G.current,c)}X={};var re,te=w.ReactCurrentOwner,ne=w.ReactDebugCurrentFrame;function oe(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);ne.setExtraStackFrame(t)}else ne.setExtraStackFrame(null)}function ae(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function ie(){if(te.current){var e=E(te.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}re=!1;var ce={};function se(e,r){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var t=function(e){var r=ie();if(!r){var t="string"==typeof e?e:e.displayName||e.name;t&&(r="\n\nCheck the top-level render call using <"+t+">.")}return r}(r);if(!ce[t]){ce[t]=!0;var n="";e&&e._owner&&e._owner!==te.current&&(n=" It was passed a child from "+E(e._owner.type)+"."),oe(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),oe(null)}}}function fe(e,r){if("object"==typeof e)if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];ae(n)&&se(n,r)}else if(ae(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var r=O&&e[O]||e["@@iterator"];return"function"==typeof r?r:null}(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)ae(a.value)&&se(a.value,r)}}function ue(e){var r,t=e.type;if(null!=t&&"string"!=typeof t){if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==f&&t.$$typeof!==p)return;r=t.propTypes}if(r){var n=E(t);!function(e,r,t,n,o){var a=Function.call.bind(Object.prototype.hasOwnProperty);for(var i in e)if(a(e,i)){var c=void 0;try{if("function"!=typeof e[i]){var s=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}c=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){c=e}!c||c instanceof Error||(J(o),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof c),J(null)),c instanceof Error&&!(c.message in Y)&&(Y[c.message]=!0,J(o),_("Failed %s type: %s",t,c.message),J(null))}}(r,e.props,"prop",n,e)}else void 0===t.PropTypes||re||(re=!0,_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E(t)||"Unknown"));"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pe(e,r,t,o,h,O){var w=function(e){return"string"==typeof e||"function"==typeof e||e===le.Fragment||e===i||e===b||e===a||e===u||e===l||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===c||e.$$typeof===s||e.$$typeof===f||e.$$typeof===v||e.$$typeof===d||e[0]===m)}(e);if(!w){var S="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j,x=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(h);S+=x||ie(),null===e?j="null":Array.isArray(e)?j="array":void 0!==e&&e.$$typeof===n?(j="<"+(E(e.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):j=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,S)}var P=ee(e,r,t,h,O);if(null==P)return P;if(w){var $=r.children;if(void 0!==$)if(o)if(Array.isArray($)){for(var k=0;k<$.length;k++)fe($[k],e);Object.freeze&&Object.freeze($)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else fe($,e)}return e===le.Fragment?function(e){for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if("children"!==n&&"key"!==n){oe(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),oe(null);break}}null!==e.ref&&(oe(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}(P):ue(P),P}var ye=function(e,r,t){return pe(e,r,t,!1)},de=function(e,r,t){return pe(e,r,t,!0)};le.jsx=ye,le.jsxs=de}(),"production"===process.env.NODE_ENV?te.exports=ne:te.exports=pe;const ye=e.createContext({prefixes:{},breakpoints:["xxl","xl","lg","md","sm","xs"]});function de(e,r){const{prefixes:n}=t(ye);return e||n[r]||r}const me=["as","disabled"];function ve({tagName:e,disabled:r,href:t,target:n,rel:o,onClick:a,tabIndex:i=0,type:c}){e||(e=null!=t||null!=n||null!=o?"a":"button");const s={tagName:e};if("button"===e)return[{type:c||"button",disabled:r},s];const f=n=>{(r||"a"===e&&function(e){return!e||"#"===e.trim()}(t))&&n.preventDefault(),r?n.stopPropagation():null==a||a(n)};return"a"===e&&(t||(t="#"),r&&(t=void 0)),[{role:"button",disabled:void 0,tabIndex:r?void 0:i,href:t,target:"a"===e?n:void 0,"aria-disabled":r||void 0,rel:"a"===e?o:void 0,onClick:f,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),f(e))}},s]}e.forwardRef(((e,r)=>{let{as:t,disabled:n}=e,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,me);const[a,{tagName:i}]=ve(Object.assign({tagName:t,disabled:n},o));return te.exports.jsx(i,Object.assign({},o,a,{ref:r}))})).displayName="Button";const be=e.forwardRef((({as:e,bsPrefix:r,variant:t,size:n,active:o,className:a,...i},c)=>{const s=de(r,"btn"),[f,{tagName:u}]=ve({tagName:e,...i}),l=u;return te.exports.jsx(l,{...f,...i,ref:c,className:re(a,s,o&&"active",t&&`${s}-${t}`,n&&`${s}-${n}`,i.href&&i.disabled&&"disabled")})}));be.displayName="Button",be.defaultProps={variant:"primary",active:!1,disabled:!1};var ge=be;const he=e.forwardRef((({bsPrefix:e,variant:r,animation:t,size:n,as:o="div",className:a,...i},c)=>{const s=`${e=de(e,"spinner")}-${t}`;return te.exports.jsx(o,{ref:c,...i,className:re(a,s,n&&`${s}-${n}`,r&&`text-${r}`)})}));he.displayName="Spinner";var Oe=he,we={children:Z.any,disabled:Z.bool,isLoading:Z.bool,spinnerPosition:Z.oneOf([]),spinnerProps:Z.oneOf([]),loadingMessage:Z.string,leftIcon:Z.node},_e=r.forwardRef((function(e,t){var o=e.disabled,a=e.isLoading,i=e.spinnerPosition,c=e.spinnerProps,s=e.loadingMessage,f=e.leftIcon,u=e.children,l=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}(e,["disabled","isLoading","spinnerPosition","spinnerProps","loadingMessage","leftIcon","children"]);return r.createElement(ge,n({disabled:a||o},l,{ref:t}),r.createElement("div",{className:"d-flex justify-content-between align-items-center"},a&&"left"===i&&r.createElement(Oe,n({"data-testid":"left-spinner",className:"me-2",animation:"border",size:"sm"},c)),!a&&f&&r.createElement("div",{className:"d-flex me-2"},f),r.createElement("div",null,a&&s?s:u),a&&"right"===i&&r.createElement(Oe,n({"data-testid":"right-spinner",className:"ms-2",animation:"border",size:"sm"},c))))}));_e.displayName="BootstrapButton",_e.defaultProps={spinnerPosition:"left",loadingMessage:"Loading..."},_e.propTypes=we;export{_e as BootstrapButton}; //# sourceMappingURL=index.js.map