window.HarnessWidget=function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=12)}([function(e){e.exports={api:{scheme:"https",url:"staging.harnessapp.com",api_version:"v2.0"},static_path:"https://widget.staging.harnessapp.com/"}},function(e,t,o){var n=o(2);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};o(8)(n,i);n.locals&&(e.exports=n.locals)},function(e,t,o){var n=o(3);(e.exports=o(4)(!1)).push([e.i,"@font-face {\n font-family: proxima-nova;\n font-style: normal;\n font-weight: 400;\n src: url("+n(o(5))+') format("truetype"); }\n\n@font-face {\n font-family: proxima-nova;\n font-style: normal;\n font-weight: 600;\n src: url('+n(o(6))+') format("woff"), url('+n(o(7))+') format("truetype"); }\n\n@keyframes showButtonText {\n 0% {\n opacity: 0; }\n 90% {\n opacity: 0; }\n 100% {\n opacity: 1; } }\n\n@keyframes showOverlay {\n 0% {\n opacity: 0; }\n 100% {\n opacity: .15; } }\n\n.h-widget-wrap {\n font-size: 16px;\n text-align: left;\n font-weight: normal;\n font-family: proxima-nova, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale; }\n .h-widget-wrap .h-widget-overlay {\n display: none; }\n .h-widget-wrap .h-widget-button {\n position: fixed;\n z-index: 10000000;\n bottom: 20px;\n right: 20px;\n width: 150px;\n height: 50px;\n font-size: 22px;\n line-height: 50px;\n background-color: white;\n border-radius: 50px;\n text-align: center;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);\n display: block;\n color: white;\n font-weight: 600;\n text-decoration: none;\n vertical-align: middle;\n transition: width .4s ease-in-out; }\n .h-widget-wrap .h-widget-button > span {\n animation: showButtonText 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; }\n .h-widget-wrap .h-widget-button > span svg {\n width: 19px;\n vertical-align: middle; }\n .h-widget-wrap .h-widget-button > span svg path {\n fill: white; }\n .h-widget-wrap .h-widget-btn-close {\n display: none; }\n .h-widget-wrap .h-widget-frame {\n position: fixed;\n bottom: 85px;\n right: 20px;\n z-index: 10000001;\n border-radius: 10px;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);\n overflow: hidden;\n transform: translateX(415px);\n transition: transform .4s ease-in-out;\n background-color: white; }\n .h-widget-wrap .h-widget-frame iframe {\n display: block;\n height: 605px;\n width: 390px;\n border: none;\n max-height: calc(100vh - 95px); }\n .h-widget-wrap.h-widget-wrap-opened .h-widget-button {\n width: 50px; }\n .h-widget-wrap.h-widget-wrap-opened .h-widget-frame {\n display: block;\n transform: translateX(0); }\n .h-widget-wrap.h-widget-wrap-opened .h-widget-btn-close {\n display: inline-block; }\n .h-widget-wrap.h-widget-wrap-opened .h-widget-btn-open {\n display: none; }\n .h-widget-wrap.h-widget-wrap-opened .h-widget-overlay {\n display: block;\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 9999999;\n background-color: #1f314a;\n animation: showOverlay 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; }\n .h-widget-wrap.h-widget-wrap-mobile .h-widget-button {\n width: 50px; }\n',""])},function(e,t){e.exports=function(e){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=function(e,t){var o=e[1]||"",n=e[3];if(!n)return o;if(t&&"function"==typeof btoa){var i=(a=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),r=n.sources.map((function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"}));return[o].concat(r).concat([i]).join("\n")}var a;return[o].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o})).join("")},t.i=function(e,o){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i=0&&b.splice(t,1)}function G(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var n=function(){0;return o.nc}();n&&(e.attrs.nonce=n)}return u(t,e.attrs),M(e,t),t}function u(e,t){Object.keys(t).forEach((function(o){e.setAttribute(o,t[o])}))}function h(e,t){var o,n,i,r;if(t.transform&&e.css){if(!(r="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=r}if(t.singleton){var a=l++;o=S||(S=G(t)),n=B.bind(null,o,a,!1),i=B.bind(null,o,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(o=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",u(t,e.attrs),M(e,t),t}(t),n=C.bind(null,o,t),i=function(){c(o),o.href&&URL.revokeObjectURL(o.href)}):(o=G(t),n=H.bind(null,o),i=function(){c(o)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var o=d(e,t);return A(o,t),function(e){for(var n=[],i=0;i=0&&(a=a.substring(0,S)+"([\\w._\\+]+)"+a.substring(S+5)),i[T]=new RegExp(a,"i");l.props[n]=i}r(l.oss),r(l.phones),r(l.tablets),r(l.uas),r(l.utils),l.oss0={WindowsPhoneOS:l.oss.WindowsPhoneOS,WindowsMobileOS:l.oss.WindowsMobileOS}}(),t.findMatch=function(e,t){for(var n in e)if(o.call(e,n)&&e[n].test(t))return n;return null},t.findMatches=function(e,t){var n=[];for(var i in e)o.call(e,i)&&e[i].test(t)&&n.push(i);return n},t.getVersionStr=function(e,n){var i,r,a,T,s=t.mobileDetectRules.props;if(o.call(s,e))for(a=(i=s[e]).length,r=0;r1&&(e=t[0]+".",t.shift(),e+=t.join("")),Number(e)},t.isMobileFallback=function(e){return t.detectMobileBrowsers.fullPattern.test(e)||t.detectMobileBrowsers.shortPattern.test(e.substr(0,4))},t.isTabletFallback=function(e){return t.detectMobileBrowsers.tabletPattern.test(e)},t.prepareDetectionCache=function(e,o,n){if( /*!mobile-detect v1.4.3 2018-09-08*/ /*!@license Copyright 2013, Heinrich Goebl, License: MIT, see https://github.com/hgoebl/mobile-detect.js*/ void 0===e.mobile){var i,r,T;if(r=t.findMatch(t.mobileDetectRules.tablets,o))return e.mobile=e.tablet=r,void(e.phone=null);if(i=t.findMatch(t.mobileDetectRules.phones,o))return e.mobile=e.phone=i,void(e.tablet=null);t.isMobileFallback(o)?void 0===(T=a.isPhoneSized(n))?(e.mobile=t.FALLBACK_MOBILE,e.tablet=e.phone=null):T?(e.mobile=e.phone=t.FALLBACK_PHONE,e.tablet=null):(e.mobile=e.tablet=t.FALLBACK_TABLET,e.phone=null):t.isTabletFallback(o)?(e.mobile=e.tablet=t.FALLBACK_TABLET,e.phone=null):e.mobile=e.tablet=e.phone=null}},t.mobileGrade=function(e){var t=null!==e.mobile();return e.os("iOS")&&e.version("iPad")>=4.3||e.os("iOS")&&e.version("iPhone")>=3.1||e.os("iOS")&&e.version("iPod")>=3.1||e.version("Android")>2.1&&e.is("Webkit")||e.version("Windows Phone OS")>=7||e.is("BlackBerry")&&e.version("BlackBerry")>=6||e.match("Playbook.*Tablet")||e.version("webOS")>=1.4&&e.match("Palm|Pre|Pixi")||e.match("hp.*TouchPad")||e.is("Firefox")&&e.version("Firefox")>=12||e.is("Chrome")&&e.is("AndroidOS")&&e.version("Android")>=4||e.is("Skyfire")&&e.version("Skyfire")>=4.1&&e.is("AndroidOS")&&e.version("Android")>=2.3||e.is("Opera")&&e.version("Opera Mobi")>11&&e.is("AndroidOS")||e.is("MeeGoOS")||e.is("Tizen")||e.is("Dolfin")&&e.version("Bada")>=2||(e.is("UC Browser")||e.is("Dolfin"))&&e.version("Android")>=2.3||e.match("Kindle Fire")||e.is("Kindle")&&e.version("Kindle")>=3||e.is("AndroidOS")&&e.is("NookTablet")||e.version("Chrome")>=11&&!t||e.version("Safari")>=5&&!t||e.version("Firefox")>=4&&!t||e.version("MSIE")>=7&&!t||e.version("Opera")>=10&&!t?"A":e.os("iOS")&&e.version("iPad")<4.3||e.os("iOS")&&e.version("iPhone")<3.1||e.os("iOS")&&e.version("iPod")<3.1||e.is("Blackberry")&&e.version("BlackBerry")>=5&&e.version("BlackBerry")<6||e.version("Opera Mini")>=5&&e.version("Opera Mini")<=6.5&&(e.version("Android")>=2.3||e.is("iOS"))||e.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||e.version("Opera Mobi")>=11&&e.is("SymbianOS")?"B":(e.version("BlackBerry")<5||e.match("MSIEMobile|Windows CE.*Mobile")||e.version("Windows Mobile"),"C")},t.detectOS=function(e){return t.findMatch(t.mobileDetectRules.oss0,e)||t.findMatch(t.mobileDetectRules.oss,e)},t.getDeviceSmallerSide=function(){return window.screen.width-1};function b(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function P(e){return"string"!=typeof e&&(e=String(e)),e}function A(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function M(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,o){e.onload=function(){t(e.result)},e.onerror=function(){o(e.error)}}))}function G(e){var t=new FileReader,o=c(t);return t.readAsArrayBuffer(e),o}function u(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:T&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=u(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=u(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=M(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?M(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(G)}),this.text=function(){var e,t,o,n=M(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,o=c(t),t.readAsText(e),o;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),o=new Array(t.length),n=0;n-1?n:o),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function B(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var o=e.split("="),n=o.shift().replace(/\+/g," "),i=o.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function H(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},h.call(f.prototype),h.call(H.prototype),H.prototype.clone=function(){return new H(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},H.error=function(){var e=new H(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];H.redirect=function(e,t){if(-1===C.indexOf(t))throw new RangeError("Invalid status code");return new H(null,{status:t,headers:{location:e}})};var E=self.DOMException;try{new E}catch(e){(E=function(e,t){this.message=e,this.name=t;var o=Error(e);this.stack=o.stack}).prototype=Object.create(Error.prototype),E.prototype.constructor=E}function m(e,t){return new Promise((function(o,n){var i=new f(e,t);if(i.signal&&i.signal.aborted)return n(new E("Aborted","AbortError"));var r=new XMLHttpRequest;function T(){r.abort()}r.onload=function(){var e,t,n={status:r.status,statusText:r.statusText,headers:(e=r.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var o=e.split(":"),n=o.shift().trim();if(n){var i=o.join(":").trim();t.append(n,i)}})),t)};n.url="responseURL"in r?r.responseURL:n.headers.get("X-Request-URL");var i="response"in r?r.response:r.responseText;setTimeout((function(){o(new H(i,n))}),0)},r.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},r.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},r.onabort=function(){setTimeout((function(){n(new E("Aborted","AbortError"))}),0)},r.open(i.method,function(e){try{return""===e&&self.location.href?self.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?r.withCredentials=!0:"omit"===i.credentials&&(r.withCredentials=!1),"responseType"in r&&(a?r.responseType="blob":s&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(r.responseType="arraybuffer")),i.headers.forEach((function(e,t){r.setRequestHeader(t,e)})),i.signal&&(i.signal.addEventListener("abort",T),r.onreadystatechange=function(){4===r.readyState&&i.signal.removeEventListener("abort",T)}),r.send(void 0===i._bodyInit?null:i._bodyInit)}))}m.polyfill=!0,self.fetch||(self.fetch=m,self.Headers=d,self.Request=f,self.Response=H);const I=`${n.api.scheme}://${n.api.url}/${n.api.api_version}`;String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)});o(1);const w=new(o(10))(window.navigator.userAgent);t.default={init:function(e){if(!e.charity_id)return console.warn("charity_id is missing"),!1;var t;(t=e.charity_id,fetch(I+"/whitelabel/"+t+"/config").then(e=>e.json()).catch(e=>console.error({error:e}))).then(e=>{!function(e){const t=e.primary_color,o=e.secondary_color,n=function(){const e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e}();n.sheet.insertRule(`.h-widget-wrap .txt-primary{color: ${t} !important; }`,0),n.sheet.insertRule(`.h-widget-wrap .txt-secondary{color: ${o} !important;} `,0),n.sheet.insertRule(`.h-widget-wrap .bg-primary{background-color: ${t}; border-color: ${t};fill: ${t};}`,0),n.sheet.insertRule(`.h-widget-wrap .bg-secondary{background-color: ${o}; border-color: ${o};fill: ${o};}`,0)}(e);let t=n.api.scheme;"staging.harnessapp.com"===n.api.url&&(t="http");const o=`${t}://${e.subdomain}.${n.api.url}/widget`;if(document.querySelector(".h-widget-wrap"))return!1;const i=document.createElement("div");i.classList.add("h-widget-wrap"),w.mobile()&&i.classList.add("h-widget-wrap-mobile");const r=document.createElement("div");r.classList.add("h-widget-overlay"),r.onclick=e=>{e.preventDefault(),i.classList.toggle("h-widget-wrap-opened")},i.appendChild(r);const a=document.createElement("a");if(a.href=o,a.classList.add("h-widget-button"),a.classList.add("bg-primary"),w.mobile()?a.innerHTML='\n \n ':(a.innerHTML='\n Donate\n \n ',a.onclick=e=>{e.preventDefault(),i.classList.toggle("h-widget-wrap-opened")}),i.appendChild(a),!w.mobile()){const e=document.createElement("div");e.classList.add("h-widget-frame"),e.innerHTML=``,i.appendChild(e)}document.body.appendChild(i)})}}}]).default;