Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@everfund/js-sdk

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everfund/js-sdk - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

dist/js-sdk.js

@@ -1,1 +0,1 @@

var e=require("body-scroll-lock"),n=require("element-closest");require("core-js/features/array/includes"),require("core-js/features/array/fill"),require("core-js/features/promise"),require("core-js/features"),require("element-remove");var o=require("goober");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=/*#__PURE__*/t(n),r=new(/*#__PURE__*/function(){function n(){this.donationWidgetOpen=!1,this.onSuccess=function(){},this.onFailure=function(){},this.onClose=function(){},this.version=void 0,this.setupButtonListeners(),this.version="1.3.0",a.default(window)}var t=n.prototype;return t.modal=function(e){var n=e.code,o=e.domain,t=e.closeOnSuccess,a=e.onSuccess,r=e.onFailure,i=e.onClose;console.warn("everfund.modal is deprecated in the next update, please use everfund.donationWidget instead"),this.donationWidget({code:n,domain:o,closeOnSuccess:t,onSuccess:a,onFailure:r,onClose:i})},t.donationWidget=function(n){var t=n.code,a=n.domain,r=n.closeOnSuccess,i=n.onSuccess,s=n.onFailure,d=n.onClose;this.setupIframeListeners(),i&&(this.onSuccess=i),s&&(this.onFailure=s),d&&(this.onClose=d);var c=window.location.origin,l=function(e){var n=[];for(var o in e)e[o]&&e.hasOwnProperty(o)&&n.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return n.join("&")};try{var u=document.createElement("iframe");u.src="https://"+(a||"evr.fund")+"/"+t+"/modal?"+l({embed_origin:c,embeded:!0,close_on_success:r}),u.allowPaymentRequest=!0;var m=o.css({border:"none",width:"100%",margin:0,height:"100%"});u.id="ef-modal",u.className=m,u.addEventListener("load",function(){var e=document.querySelector(".ldsRing"),n=document.querySelector(".embedModal");null==e||e.remove(),n.style.transform="opacity(1)"});var p=document.createElement("div"),f=o.css({pointerEvents:"all",zIndex:"9999999",display:"flex",width:"100%",transform:"opacity(0)",transition:"transform 0.3s ease",overflowY:"auto","-webkit-overflow-scrolling":"touch",height:"100%"});p.className="embedModal "+f,p.appendChild(u);var v=document.createElement("div");e.disableBodyScroll(v);var h=document.createElement("div"),b=o.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),g=o.css({display:"inline-block",position:"absolute",left:"calc(50% - 32px)",top:"calc(50% - 32px)",width:"64px",height:"64px","& div":{boxSizing:"border-box",display:"block",position:"absolute",width:"51px",height:"51px",margin:"6px",border:"6px solid white",borderRadius:"50%",animation:b+" 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite",borderColor:"white transparent transparent transparent"},"& div:nth-child(1)":{animationDelay:" -0.45s"},"& div:nth-child(2)":{animationDelay:" -0.3s"},"& div:nth-child(3)":{animationDelay:" -0.15s"}});h.className="ldsRing "+g;var y=document.createElement("div");Array(4).fill(4).forEach(function(){h.appendChild(y)});var w=o.css({position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0, 0, 0, 0.7)",zIndex:"9999998",display:"flex",justifyContent:"space-around",alignItems:"stretch",backdropFilter:"blur(8px)"});v.className="embedContainer "+w,v.appendChild(h),v.appendChild(p),document.body.appendChild(v)}catch(e){console.log(e),window.location.replace("https://"+(a||"evr.fund")+"/"+t+"/modal?"+l({return_url:c}))}},t.setupButtonListeners=function(){document.addEventListener("click",function(n){var o=n.target.closest("[data-ef-modal]");if(o&&!r.donationWidgetOpen){n.preventDefault(),n.stopPropagation();var t=o.getAttribute("data-ef-modal");t?(new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t)&&(console.warn("Everfund: url's are deprecated please use a code instead"),t=new URL(t).pathname.replace("/","")),r.donationWidgetOpen=!0,r.donationWidget({code:t,onSuccess:function(){},onFailure:function(){},onClose:function(){e.clearAllBodyScrollLocks()}})):console.error('Everfund: data-ef-modal is required! eg <button data-ef-modal="rjww"> modal </button>')}},!1)},t.setupIframeListeners=function(){window.addEventListener("message",function(n){var o=document.querySelector(".embedContainer");switch(n.data.message){case"everfund:ready":var t=document.querySelector("#ldsRing"),a=document.querySelector(".embedModal");null==t||t.remove(),a.style.transform="opacity(1)";break;case"everfund:success":r.onSuccess(n.data.content);break;case"everfund:failure":r.onFailure(n.data.content);break;case"everfund:close":o&&e.enableBodyScroll(o),o&&o.remove(),r.donationWidgetOpen=!1,r.onClose()}},!1)},n}());module.exports=r;
var e=require("body-scroll-lock"),n=require("element-closest");require("core-js/features/array/includes"),require("core-js/features/array/fill"),require("core-js/features/promise"),require("core-js/features"),require("element-remove");var o=require("goober");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=/*#__PURE__*/t(n),r=new(/*#__PURE__*/function(){function n(){this.donationWidgetOpen=!1,this.onSuccess=function(){},this.onFailure=function(){},this.onClose=function(){},this.version=void 0,this.setupButtonListeners(),this.version="1.3.1",a.default(window)}var t=n.prototype;return t.modal=function(e){var n=e.code,o=e.domain,t=e.closeOnSuccess,a=e.onSuccess,r=e.onFailure,i=e.onClose;console.warn("everfund.modal is deprecated in the next update, please use everfund.donationWidget instead"),this.donationWidget({code:n,domain:o,closeOnSuccess:t,onSuccess:a,onFailure:r,onClose:i})},t.donationWidget=function(n){var t=n.code,a=n.domain,r=n.closeOnSuccess,i=n.onSuccess,s=n.onFailure,d=n.onClose;this.setupIframeListeners(),i&&(this.onSuccess=i),s&&(this.onFailure=s),d&&(this.onClose=d);var c=window.location.origin,l=function(e){var n=[];for(var o in e)e[o]&&e.hasOwnProperty(o)&&n.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return n.join("&")};try{var u=document.createElement("iframe");u.src="https://"+(a||"evr.fund")+"/"+t+"/modal?"+l({embed_origin:c,embeded:!0,close_on_success:r}),u.allowPaymentRequest=!0;var m=o.css({border:"none",width:"100%",margin:0,height:"100%"});u.id="ef-modal",u.className=m,u.addEventListener("load",function(){var e=document.querySelector(".ldsRing"),n=document.querySelector(".embedModal");null==e||e.remove(),n.style.transform="opacity(1)"});var p=document.createElement("div"),f=o.css({pointerEvents:"all",zIndex:"9999999",display:"flex",width:"100%",transform:"opacity(0)",transition:"transform 0.3s ease",overflowY:"auto","-webkit-overflow-scrolling":"touch",height:"100%"});p.className="embedModal "+f,p.appendChild(u);var v=document.createElement("div");e.disableBodyScroll(v);var h=document.createElement("div"),b=o.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),g=o.css({display:"inline-block",position:"absolute",left:"calc(50% - 32px)",top:"calc(50% - 32px)",width:"64px",height:"64px","& div":{boxSizing:"border-box",display:"block",position:"absolute",width:"51px",height:"51px",margin:"6px",border:"6px solid white",borderRadius:"50%",animation:b+" 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite",borderColor:"white transparent transparent transparent"},"& div:nth-child(1)":{animationDelay:" -0.45s"},"& div:nth-child(2)":{animationDelay:" -0.3s"},"& div:nth-child(3)":{animationDelay:" -0.15s"}});h.className="ldsRing "+g;var y=document.createElement("div");Array(4).fill(4).forEach(function(){h.appendChild(y)});var w=o.css({position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0, 0, 0, 0.7)",zIndex:"9999998",display:"flex",justifyContent:"space-around",alignItems:"stretch",backdropFilter:"blur(8px)"});v.className="embedContainer "+w,v.appendChild(h),v.appendChild(p),document.body.appendChild(v)}catch(e){console.log(e),window.location.replace("https://"+(a||"evr.fund")+"/"+t+"/modal?"+l({return_url:c}))}},t.setupButtonListeners=function(){document.addEventListener("click",function(n){var o=n.target.closest("[data-ef-modal]");if(o&&!r.donationWidgetOpen){n.preventDefault(),n.stopPropagation();var t=o.getAttribute("data-ef-modal");t?(new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t)&&(console.warn("Everfund: url's are deprecated please use a code instead"),t=new URL(t).pathname.replace("/","")),r.donationWidgetOpen=!0,r.donationWidget({code:t,onSuccess:function(){},onFailure:function(){},onClose:function(){e.clearAllBodyScrollLocks()}})):console.error('Everfund: data-ef-modal is required! eg <button data-ef-modal="rjww"> modal </button>')}},!1)},t.setupIframeListeners=function(){window.addEventListener("message",function(n){var o=document.querySelector(".embedContainer");switch(n.data.message){case"everfund:ready":var t=document.querySelector("#ldsRing"),a=document.querySelector(".embedModal");null==t||t.remove(),a.style.transform="opacity(1)";break;case"everfund:success":r.onSuccess(n.data.content);break;case"everfund:failure":r.onFailure(n.data.content);break;case"everfund:close":o&&e.enableBodyScroll(o),o&&o.remove(),r.donationWidgetOpen=!1,r.onClose()}},!1)},n}());module.exports=r;

@@ -1,1 +0,1 @@

import{disableBodyScroll as e,clearAllBodyScrollLocks as o,enableBodyScroll as t}from"body-scroll-lock";import n from"element-closest";import"core-js/features/array/includes";import"core-js/features/array/fill";import"core-js/features/promise";import"core-js/features";import"element-remove";import{css as a,keyframes as r}from"goober";var i=new(/*#__PURE__*/function(){function s(){this.donationWidgetOpen=!1,this.onSuccess=function(){},this.onFailure=function(){},this.onClose=function(){},this.version=void 0,this.setupButtonListeners(),this.version="1.3.0",n(window)}var d=s.prototype;return d.modal=function(e){var o=e.code,t=e.domain,n=e.closeOnSuccess,a=e.onSuccess,r=e.onFailure,i=e.onClose;console.warn("everfund.modal is deprecated in the next update, please use everfund.donationWidget instead"),this.donationWidget({code:o,domain:t,closeOnSuccess:n,onSuccess:a,onFailure:r,onClose:i})},d.donationWidget=function(o){var t=o.code,n=o.domain,i=o.closeOnSuccess,s=o.onSuccess,d=o.onFailure,c=o.onClose;this.setupIframeListeners(),s&&(this.onSuccess=s),d&&(this.onFailure=d),c&&(this.onClose=c);var l=window.location.origin,u=function(e){var o=[];for(var t in e)e[t]&&e.hasOwnProperty(t)&&o.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return o.join("&")};try{var m=document.createElement("iframe");m.src="https://"+(n||"evr.fund")+"/"+t+"/modal?"+u({embed_origin:l,embeded:!0,close_on_success:i}),m.allowPaymentRequest=!0;var p=a({border:"none",width:"100%",margin:0,height:"100%"});m.id="ef-modal",m.className=p,m.addEventListener("load",function(){var e=document.querySelector(".ldsRing"),o=document.querySelector(".embedModal");null==e||e.remove(),o.style.transform="opacity(1)"});var f=document.createElement("div"),v=a({pointerEvents:"all",zIndex:"9999999",display:"flex",width:"100%",transform:"opacity(0)",transition:"transform 0.3s ease",overflowY:"auto","-webkit-overflow-scrolling":"touch",height:"100%"});f.className="embedModal "+v,f.appendChild(m);var h=document.createElement("div");e(h);var g=document.createElement("div"),b=r({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),y=a({display:"inline-block",position:"absolute",left:"calc(50% - 32px)",top:"calc(50% - 32px)",width:"64px",height:"64px","& div":{boxSizing:"border-box",display:"block",position:"absolute",width:"51px",height:"51px",margin:"6px",border:"6px solid white",borderRadius:"50%",animation:b+" 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite",borderColor:"white transparent transparent transparent"},"& div:nth-child(1)":{animationDelay:" -0.45s"},"& div:nth-child(2)":{animationDelay:" -0.3s"},"& div:nth-child(3)":{animationDelay:" -0.15s"}});g.className="ldsRing "+y;var w=document.createElement("div");Array(4).fill(4).forEach(function(){g.appendChild(w)});var x=a({position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0, 0, 0, 0.7)",zIndex:"9999998",display:"flex",justifyContent:"space-around",alignItems:"stretch",backdropFilter:"blur(8px)"});h.className="embedContainer "+x,h.appendChild(g),h.appendChild(f),document.body.appendChild(h)}catch(e){console.log(e),window.location.replace("https://"+(n||"evr.fund")+"/"+t+"/modal?"+u({return_url:l}))}},d.setupButtonListeners=function(){document.addEventListener("click",function(e){var t=e.target.closest("[data-ef-modal]");if(t&&!i.donationWidgetOpen){e.preventDefault(),e.stopPropagation();var n=t.getAttribute("data-ef-modal");n?(new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(n)&&(console.warn("Everfund: url's are deprecated please use a code instead"),n=new URL(n).pathname.replace("/","")),i.donationWidgetOpen=!0,i.donationWidget({code:n,onSuccess:function(){},onFailure:function(){},onClose:function(){o()}})):console.error('Everfund: data-ef-modal is required! eg <button data-ef-modal="rjww"> modal </button>')}},!1)},d.setupIframeListeners=function(){window.addEventListener("message",function(e){var o=document.querySelector(".embedContainer");switch(e.data.message){case"everfund:ready":var n=document.querySelector("#ldsRing"),a=document.querySelector(".embedModal");null==n||n.remove(),a.style.transform="opacity(1)";break;case"everfund:success":i.onSuccess(e.data.content);break;case"everfund:failure":i.onFailure(e.data.content);break;case"everfund:close":o&&t(o),o&&o.remove(),i.donationWidgetOpen=!1,i.onClose()}},!1)},s}());export{i as default};
import{disableBodyScroll as e,clearAllBodyScrollLocks as o,enableBodyScroll as t}from"body-scroll-lock";import n from"element-closest";import"core-js/features/array/includes";import"core-js/features/array/fill";import"core-js/features/promise";import"core-js/features";import"element-remove";import{css as a,keyframes as r}from"goober";var i=new(/*#__PURE__*/function(){function s(){this.donationWidgetOpen=!1,this.onSuccess=function(){},this.onFailure=function(){},this.onClose=function(){},this.version=void 0,this.setupButtonListeners(),this.version="1.3.1",n(window)}var d=s.prototype;return d.modal=function(e){var o=e.code,t=e.domain,n=e.closeOnSuccess,a=e.onSuccess,r=e.onFailure,i=e.onClose;console.warn("everfund.modal is deprecated in the next update, please use everfund.donationWidget instead"),this.donationWidget({code:o,domain:t,closeOnSuccess:n,onSuccess:a,onFailure:r,onClose:i})},d.donationWidget=function(o){var t=o.code,n=o.domain,i=o.closeOnSuccess,s=o.onSuccess,d=o.onFailure,c=o.onClose;this.setupIframeListeners(),s&&(this.onSuccess=s),d&&(this.onFailure=d),c&&(this.onClose=c);var l=window.location.origin,u=function(e){var o=[];for(var t in e)e[t]&&e.hasOwnProperty(t)&&o.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return o.join("&")};try{var m=document.createElement("iframe");m.src="https://"+(n||"evr.fund")+"/"+t+"/modal?"+u({embed_origin:l,embeded:!0,close_on_success:i}),m.allowPaymentRequest=!0;var p=a({border:"none",width:"100%",margin:0,height:"100%"});m.id="ef-modal",m.className=p,m.addEventListener("load",function(){var e=document.querySelector(".ldsRing"),o=document.querySelector(".embedModal");null==e||e.remove(),o.style.transform="opacity(1)"});var f=document.createElement("div"),v=a({pointerEvents:"all",zIndex:"9999999",display:"flex",width:"100%",transform:"opacity(0)",transition:"transform 0.3s ease",overflowY:"auto","-webkit-overflow-scrolling":"touch",height:"100%"});f.className="embedModal "+v,f.appendChild(m);var h=document.createElement("div");e(h);var g=document.createElement("div"),b=r({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),y=a({display:"inline-block",position:"absolute",left:"calc(50% - 32px)",top:"calc(50% - 32px)",width:"64px",height:"64px","& div":{boxSizing:"border-box",display:"block",position:"absolute",width:"51px",height:"51px",margin:"6px",border:"6px solid white",borderRadius:"50%",animation:b+" 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite",borderColor:"white transparent transparent transparent"},"& div:nth-child(1)":{animationDelay:" -0.45s"},"& div:nth-child(2)":{animationDelay:" -0.3s"},"& div:nth-child(3)":{animationDelay:" -0.15s"}});g.className="ldsRing "+y;var w=document.createElement("div");Array(4).fill(4).forEach(function(){g.appendChild(w)});var x=a({position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0, 0, 0, 0.7)",zIndex:"9999998",display:"flex",justifyContent:"space-around",alignItems:"stretch",backdropFilter:"blur(8px)"});h.className="embedContainer "+x,h.appendChild(g),h.appendChild(f),document.body.appendChild(h)}catch(e){console.log(e),window.location.replace("https://"+(n||"evr.fund")+"/"+t+"/modal?"+u({return_url:l}))}},d.setupButtonListeners=function(){document.addEventListener("click",function(e){var t=e.target.closest("[data-ef-modal]");if(t&&!i.donationWidgetOpen){e.preventDefault(),e.stopPropagation();var n=t.getAttribute("data-ef-modal");n?(new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(n)&&(console.warn("Everfund: url's are deprecated please use a code instead"),n=new URL(n).pathname.replace("/","")),i.donationWidgetOpen=!0,i.donationWidget({code:n,onSuccess:function(){},onFailure:function(){},onClose:function(){o()}})):console.error('Everfund: data-ef-modal is required! eg <button data-ef-modal="rjww"> modal </button>')}},!1)},d.setupIframeListeners=function(){window.addEventListener("message",function(e){var o=document.querySelector(".embedContainer");switch(e.data.message){case"everfund:ready":var n=document.querySelector("#ldsRing"),a=document.querySelector(".embedModal");null==n||n.remove(),a.style.transform="opacity(1)";break;case"everfund:success":i.onSuccess(e.data.content);break;case"everfund:failure":i.onFailure(e.data.content);break;case"everfund:close":o&&t(o),o&&o.remove(),i.donationWidgetOpen=!1,i.onClose()}},!1)},s}());export{i as default};

@@ -1,1 +0,1 @@

!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("body-scroll-lock"),require("element-closest"),require("core-js/features/array/includes"),require("core-js/features/array/fill"),require("core-js/features/promise"),require("core-js/features"),require("element-remove"),require("goober")):"function"==typeof define&&define.amd?define(["body-scroll-lock","element-closest","core-js/features/array/includes","core-js/features/array/fill","core-js/features/promise","core-js/features","element-remove","goober"],o):(e||self).jsSdk=o(e.bodyScrollLock,e.elementClosest,0,0,0,0,0,e.goober)}(this,function(e,o,n,t,r,a,i,s){function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/d(o),c=new(/*#__PURE__*/function(){function o(){this.donationWidgetOpen=!1,this.onSuccess=function(){},this.onFailure=function(){},this.onClose=function(){},this.version=void 0,this.setupButtonListeners(),this.version="1.3.0",l.default(window)}var n=o.prototype;return n.modal=function(e){var o=e.code,n=e.domain,t=e.closeOnSuccess,r=e.onSuccess,a=e.onFailure,i=e.onClose;console.warn("everfund.modal is deprecated in the next update, please use everfund.donationWidget instead"),this.donationWidget({code:o,domain:n,closeOnSuccess:t,onSuccess:r,onFailure:a,onClose:i})},n.donationWidget=function(o){var n=o.code,t=o.domain,r=o.closeOnSuccess,a=o.onSuccess,i=o.onFailure,d=o.onClose;this.setupIframeListeners(),a&&(this.onSuccess=a),i&&(this.onFailure=i),d&&(this.onClose=d);var l=window.location.origin,c=function(e){var o=[];for(var n in e)e[n]&&e.hasOwnProperty(n)&&o.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return o.join("&")};try{var u=document.createElement("iframe");u.src="https://"+(t||"evr.fund")+"/"+n+"/modal?"+c({embed_origin:l,embeded:!0,close_on_success:r}),u.allowPaymentRequest=!0;var f=s.css({border:"none",width:"100%",margin:0,height:"100%"});u.id="ef-modal",u.className=f,u.addEventListener("load",function(){var e=document.querySelector(".ldsRing"),o=document.querySelector(".embedModal");null==e||e.remove(),o.style.transform="opacity(1)"});var m=document.createElement("div"),p=s.css({pointerEvents:"all",zIndex:"9999999",display:"flex",width:"100%",transform:"opacity(0)",transition:"transform 0.3s ease",overflowY:"auto","-webkit-overflow-scrolling":"touch",height:"100%"});m.className="embedModal "+p,m.appendChild(u);var h=document.createElement("div");e.disableBodyScroll(h);var v=document.createElement("div"),b=s.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),y=s.css({display:"inline-block",position:"absolute",left:"calc(50% - 32px)",top:"calc(50% - 32px)",width:"64px",height:"64px","& div":{boxSizing:"border-box",display:"block",position:"absolute",width:"51px",height:"51px",margin:"6px",border:"6px solid white",borderRadius:"50%",animation:b+" 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite",borderColor:"white transparent transparent transparent"},"& div:nth-child(1)":{animationDelay:" -0.45s"},"& div:nth-child(2)":{animationDelay:" -0.3s"},"& div:nth-child(3)":{animationDelay:" -0.15s"}});v.className="ldsRing "+y;var g=document.createElement("div");Array(4).fill(4).forEach(function(){v.appendChild(g)});var w=s.css({position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0, 0, 0, 0.7)",zIndex:"9999998",display:"flex",justifyContent:"space-around",alignItems:"stretch",backdropFilter:"blur(8px)"});h.className="embedContainer "+w,h.appendChild(v),h.appendChild(m),document.body.appendChild(h)}catch(e){console.log(e),window.location.replace("https://"+(t||"evr.fund")+"/"+n+"/modal?"+c({return_url:l}))}},n.setupButtonListeners=function(){document.addEventListener("click",function(o){var n=o.target.closest("[data-ef-modal]");if(n&&!c.donationWidgetOpen){o.preventDefault(),o.stopPropagation();var t=n.getAttribute("data-ef-modal");t?(new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t)&&(console.warn("Everfund: url's are deprecated please use a code instead"),t=new URL(t).pathname.replace("/","")),c.donationWidgetOpen=!0,c.donationWidget({code:t,onSuccess:function(){},onFailure:function(){},onClose:function(){e.clearAllBodyScrollLocks()}})):console.error('Everfund: data-ef-modal is required! eg <button data-ef-modal="rjww"> modal </button>')}},!1)},n.setupIframeListeners=function(){window.addEventListener("message",function(o){var n=document.querySelector(".embedContainer");switch(o.data.message){case"everfund:ready":var t=document.querySelector("#ldsRing"),r=document.querySelector(".embedModal");null==t||t.remove(),r.style.transform="opacity(1)";break;case"everfund:success":c.onSuccess(o.data.content);break;case"everfund:failure":c.onFailure(o.data.content);break;case"everfund:close":n&&e.enableBodyScroll(n),n&&n.remove(),c.donationWidgetOpen=!1,c.onClose()}},!1)},o}());return c});
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("body-scroll-lock"),require("element-closest"),require("core-js/features/array/includes"),require("core-js/features/array/fill"),require("core-js/features/promise"),require("core-js/features"),require("element-remove"),require("goober")):"function"==typeof define&&define.amd?define(["body-scroll-lock","element-closest","core-js/features/array/includes","core-js/features/array/fill","core-js/features/promise","core-js/features","element-remove","goober"],o):(e||self).jsSdk=o(e.bodyScrollLock,e.elementClosest,0,0,0,0,0,e.goober)}(this,function(e,o,n,t,r,a,i,s){function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/d(o),c=new(/*#__PURE__*/function(){function o(){this.donationWidgetOpen=!1,this.onSuccess=function(){},this.onFailure=function(){},this.onClose=function(){},this.version=void 0,this.setupButtonListeners(),this.version="1.3.1",l.default(window)}var n=o.prototype;return n.modal=function(e){var o=e.code,n=e.domain,t=e.closeOnSuccess,r=e.onSuccess,a=e.onFailure,i=e.onClose;console.warn("everfund.modal is deprecated in the next update, please use everfund.donationWidget instead"),this.donationWidget({code:o,domain:n,closeOnSuccess:t,onSuccess:r,onFailure:a,onClose:i})},n.donationWidget=function(o){var n=o.code,t=o.domain,r=o.closeOnSuccess,a=o.onSuccess,i=o.onFailure,d=o.onClose;this.setupIframeListeners(),a&&(this.onSuccess=a),i&&(this.onFailure=i),d&&(this.onClose=d);var l=window.location.origin,c=function(e){var o=[];for(var n in e)e[n]&&e.hasOwnProperty(n)&&o.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return o.join("&")};try{var u=document.createElement("iframe");u.src="https://"+(t||"evr.fund")+"/"+n+"/modal?"+c({embed_origin:l,embeded:!0,close_on_success:r}),u.allowPaymentRequest=!0;var f=s.css({border:"none",width:"100%",margin:0,height:"100%"});u.id="ef-modal",u.className=f,u.addEventListener("load",function(){var e=document.querySelector(".ldsRing"),o=document.querySelector(".embedModal");null==e||e.remove(),o.style.transform="opacity(1)"});var m=document.createElement("div"),p=s.css({pointerEvents:"all",zIndex:"9999999",display:"flex",width:"100%",transform:"opacity(0)",transition:"transform 0.3s ease",overflowY:"auto","-webkit-overflow-scrolling":"touch",height:"100%"});m.className="embedModal "+p,m.appendChild(u);var h=document.createElement("div");e.disableBodyScroll(h);var v=document.createElement("div"),b=s.keyframes({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),y=s.css({display:"inline-block",position:"absolute",left:"calc(50% - 32px)",top:"calc(50% - 32px)",width:"64px",height:"64px","& div":{boxSizing:"border-box",display:"block",position:"absolute",width:"51px",height:"51px",margin:"6px",border:"6px solid white",borderRadius:"50%",animation:b+" 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite",borderColor:"white transparent transparent transparent"},"& div:nth-child(1)":{animationDelay:" -0.45s"},"& div:nth-child(2)":{animationDelay:" -0.3s"},"& div:nth-child(3)":{animationDelay:" -0.15s"}});v.className="ldsRing "+y;var g=document.createElement("div");Array(4).fill(4).forEach(function(){v.appendChild(g)});var w=s.css({position:"fixed",top:"0",left:"0",right:"0",bottom:"0",background:"rgba(0, 0, 0, 0.7)",zIndex:"9999998",display:"flex",justifyContent:"space-around",alignItems:"stretch",backdropFilter:"blur(8px)"});h.className="embedContainer "+w,h.appendChild(v),h.appendChild(m),document.body.appendChild(h)}catch(e){console.log(e),window.location.replace("https://"+(t||"evr.fund")+"/"+n+"/modal?"+c({return_url:l}))}},n.setupButtonListeners=function(){document.addEventListener("click",function(o){var n=o.target.closest("[data-ef-modal]");if(n&&!c.donationWidgetOpen){o.preventDefault(),o.stopPropagation();var t=n.getAttribute("data-ef-modal");t?(new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t)&&(console.warn("Everfund: url's are deprecated please use a code instead"),t=new URL(t).pathname.replace("/","")),c.donationWidgetOpen=!0,c.donationWidget({code:t,onSuccess:function(){},onFailure:function(){},onClose:function(){e.clearAllBodyScrollLocks()}})):console.error('Everfund: data-ef-modal is required! eg <button data-ef-modal="rjww"> modal </button>')}},!1)},n.setupIframeListeners=function(){window.addEventListener("message",function(o){var n=document.querySelector(".embedContainer");switch(o.data.message){case"everfund:ready":var t=document.querySelector("#ldsRing"),r=document.querySelector(".embedModal");null==t||t.remove(),r.style.transform="opacity(1)";break;case"everfund:success":c.onSuccess(o.data.content);break;case"everfund:failure":c.onFailure(o.data.content);break;case"everfund:close":n&&e.enableBodyScroll(n),n&&n.remove(),c.donationWidgetOpen=!1,c.onClose()}},!1)},o}());return c});

@@ -1,1 +0,1 @@

export declare const version = "1.3.0";
export declare const version = "1.3.1";
{
"name": "@everfund/js-sdk",
"version": "1.3.0",
"version": "1.3.1",
"description": "Plug and Play Donation System",

@@ -8,8 +8,8 @@ "author": "Christopher Burns <christopher@everfund.co.uk>",

"exports": {
"require": "./dist/index.cjs",
"default": "./dist/index.modern.js"
"require": "./dist/js-sdk.cjs",
"default": "./dist/js-sdk.modern.js"
},
"main": "./dist/index.cjs",
"module": "./dist/index.module.js",
"unpkg": "./dist/index.umd.js",
"main": "./dist/js-sdk.cjs",
"module": "./dist/js-sdk.module.js",
"unpkg": "./dist/js-sdk.umd.js",
"scripts": {

@@ -16,0 +16,0 @@ "build:prod": "yarn genversion && microbundle --define process.env.NODE_ENV=production --sourcemap false --output dist --tsconfig ./tsconfig.json",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc