@foeewni/web-core 2.2.7 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,7 @@ blockquote{border-color:#ced4da;border-style:double;border-width:.2em 0;padding:
|
|
|
16
16
|
|
|
17
17
|
.close{float:right;font-size:1.5rem;font-weight:600;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}@media (max-width: 1200px){.close{font-size:calc(1.275rem + .3vw) }}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):hover,.close:not(:disabled):not(.disabled):focus{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:transform 0.3s ease-out;transform:translate(0, -50px)}@media (prefers-reduced-motion: reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-header,.modal-dialog-scrollable .modal-footer{flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{flex-direction:column;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,0.2);border-radius:.4rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem;border-bottom:1px solid #e9ecef;border-top-left-radius:calc(.4rem - 1px);border-top-right-radius:calc(.4rem - 1px)}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;flex:1 1 auto;padding:1rem}.modal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:.75rem;border-top:1px solid #e9ecef;border-bottom-right-radius:calc(.4rem - 1px);border-bottom-left-radius:calc(.4rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width: 576px){.modal-dialog{max-width:100%;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem);height:min-content}.modal-sm{max-width:50%}}@media (min-width: 1024px){.modal-lg,.modal-xl{max-width:100%}}@media (min-width: 1366px){.modal-xl{max-width:1140px}}.fade{transition:opacity 0.15s linear}@media (prefers-reduced-motion: reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height 0.35s ease}@media (prefers-reduced-motion: reduce){.collapsing{transition:none}}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
iframe[data-defer-src]{transition:opacity 250ms linear}iframe[data-defer-src].js-defer-is-loading{opacity:0 !important}
|
|
20
20
|
|
|
21
21
|
.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.3rem}.alert-heading{color:inherit}.alert-link{font-weight:600}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;z-index:2;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#2d5345;background-color:#ddece7;border-color:#d0e4dd}.alert-primary hr{border-top-color:#c0dbd1}.alert-primary .alert-link{color:#1b322a}.alert-secondary{color:#3f7562;background-color:#e4f9f2;border-color:#daf7ed}.alert-secondary hr{border-top-color:#c5f2e3}.alert-secondary .alert-link{color:#2d5446}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1f4642;background-color:#d8e7e5;border-color:#c8dddb}.alert-dark hr{border-top-color:#b8d3d1}.alert-dark .alert-link{color:#0f2321}.alert-accent{color:#1b714e;background-color:#d6f8ea;border-color:#c6f5e2}.alert-accent hr{border-top-color:#b0f1d7}.alert-accent .alert-link{color:#114832}.alert-extradark{color:#121826;background-color:#d3d5db;border-color:#c1c5cc}.alert-extradark hr{border-top-color:#b3b8c0}.alert-extradark .alert-link{color:#020203}.alert-sunset{color:#7a3030;background-color:#fbdede;border-color:#f9d1d1}.alert-sunset hr{border-top-color:#f6baba}.alert-sunset .alert-link{color:#522}.alert-donate{color:#7a2525;background-color:#fbdada;border-color:#f9cccc}.alert-donate hr{border-top-color:#f6b5b5}.alert-donate .alert-link{color:#531919}.alert-join{color:#857c10;background-color:#fffcd2;border-color:#fffbc0}.alert-join hr{border-top-color:#fff9a7}.alert-join .alert-link{color:#57520b}.alert-offwhite{color:#7e7e80;background-color:#fdfdfd;border-color:#fcfcfd}.alert-offwhite hr{border-top-color:#ededf3}.alert-offwhite .alert-link{color:#656566}
|
|
22
22
|
|
package/dist/js/foe.main.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t={1112:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},4639:t=>{function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0},1230:t=>{t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},6378:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},6395:(t,e,n)=>{var r=n(2861).default;function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}t.exports=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=a?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n},t.exports.default=t.exports,t.exports.__esModule=!0},2861:t=>{function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},3800:(t,e,n)=>{var r=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(n(1112)),a=r(n(4639)),i=r(n(3609)),s=r(n(9859)),l="bs.alert",c=".".concat(l),u=i.default.fn.alert,f="close".concat(c),d="closed".concat(c),p="click".concat(c).concat(".data-api"),h=function(){function t(e){(0,o.default)(this,t),this._element=e}return(0,a.default)(t,[{key:"close",value:function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)}},{key:"dispose",value:function(){i.default.removeData(this._element,l),this._element=null}},{key:"_getRootElement",value:function(t){var e=s.default.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=(0,i.default)(t).closest(".".concat("alert"))[0]),n}},{key:"_triggerCloseEvent",value:function(t){var e=i.default.Event(f);return(0,i.default)(t).trigger(e),e}},{key:"_removeElement",value:function(t){var e=this;if((0,i.default)(t).removeClass("show"),(0,i.default)(t).hasClass("fade")){var n=s.default.getTransitionDurationFromElement(t);(0,i.default)(t).one(s.default.TRANSITION_END,(function(n){return e._destroyElement(t,n)})).emulateTransitionEnd(n)}else this._destroyElement(t)}},{key:"_destroyElement",value:function(t){(0,i.default)(t).detach().trigger(d).remove()}}],[{key:"VERSION",get:function(){return"4.6.0"}},{key:"_jQueryInterface",value:function(e){return this.each((function(){var n=(0,i.default)(this),r=n.data(l);r||(r=new t(this),n.data(l,r)),"close"===e&&r[e](this)}))}},{key:"_handleDismiss",value:function(t){return function(e){e&&e.preventDefault(),t.close(this)}}}]),t}();(0,i.default)(document).on(p,'[data-dismiss="alert"]',h._handleDismiss(new h)),i.default.fn.alert=h._jQueryInterface,i.default.fn.alert.Constructor=h,i.default.fn.alert.noConflict=function(){return i.default.fn.alert=u,h._jQueryInterface};var g=h;e.default=g},6874:(t,e,n)=>{var r=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(n(2861)),a=r(n(1230)),i=r(n(1112)),s=r(n(4639)),l=r(n(3609)),c=r(n(9859));function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){(0,a.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d="scrollspy",p="bs.scrollspy",h=".".concat(p),g=l.default.fn[d],m={offset:10,method:"auto",target:""},v={offset:"number",method:"string",target:"(string|element)"},y="activate".concat(h),_="scroll".concat(h),w="load".concat(h).concat(".data-api"),b="active",k=".nav, .list-group",x=".nav-link",E=".list-group-item",O="position",T=function(){function t(e,n){var r=this;(0,i.default)(this,t),this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector="".concat(this._config.target," ").concat(x,",")+"".concat(this._config.target," ").concat(E,",")+"".concat(this._config.target," ").concat(".dropdown-item"),this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,(0,l.default)(this._scrollElement).on(_,(function(t){return r._process(t)})),this.refresh(),this._process()}return(0,s.default)(t,[{key:"refresh",value:function(){var t=this,e=this._scrollElement===this._scrollElement.window?"offset":O,n="auto"===this._config.method?e:this._config.method,r=n===O?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var e,o=c.default.getSelectorFromElement(t);if(o&&(e=document.querySelector(o)),e){var a=e.getBoundingClientRect();if(a.width||a.height)return[(0,l.default)(e)[n]().top+r,o]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))}},{key:"dispose",value:function(){l.default.removeData(this._element,p),(0,l.default)(this._scrollElement).off(h),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null}},{key:"_getConfig",value:function(t){if("string"!=typeof(t=f(f({},m),"object"===(0,o.default)(t)&&t?t:{})).target&&c.default.isElement(t.target)){var e=(0,l.default)(t.target).attr("id");e||(e=c.default.getUID(d),(0,l.default)(t.target).attr("id",e)),t.target="#".concat(e)}return c.default.typeCheckConfig(d,t,v),t}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_getOffsetHeight",value:function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}},{key:"_process",value:function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var r=this._targets[this._targets.length-1];this._activeTarget!==r&&this._activate(r)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}}},{key:"_activate",value:function(t){this._activeTarget=t,this._clear();var e=this._selector.split(",").map((function(e){return"".concat(e,'[data-target="').concat(t,'"],').concat(e,'[href="').concat(t,'"]')})),n=(0,l.default)([].slice.call(document.querySelectorAll(e.join(","))));n.hasClass("dropdown-item")?(n.closest(".dropdown").find(".dropdown-toggle").addClass(b),n.addClass(b)):(n.addClass(b),n.parents(k).prev("".concat(x,", ").concat(E)).addClass(b),n.parents(k).prev(".nav-item").children(x).addClass(b)),(0,l.default)(this._scrollElement).trigger(y,{relatedTarget:t})}},{key:"_clear",value:function(){[].slice.call(document.querySelectorAll(this._selector)).filter((function(t){return t.classList.contains(b)})).forEach((function(t){return t.classList.remove(b)}))}}],[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return m}},{key:"_jQueryInterface",value:function(e){return this.each((function(){var n=(0,l.default)(this).data(p),r="object"===(0,o.default)(e)&&e;if(n||(n=new t(this,r),(0,l.default)(this).data(p,n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}]),t}();(0,l.default)(window).on(w,(function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),e=t.length;e--;){var n=(0,l.default)(t[e]);T._jQueryInterface.call(n,n.data())}})),l.default.fn[d]=T._jQueryInterface,l.default.fn[d].Constructor=T,l.default.fn[d].noConflict=function(){return l.default.fn[d]=g,T._jQueryInterface};var C=T;e.default=C},9859:(t,e,n)=>{var r=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(n(3609)),a="transitionend";function i(t){var e=this,n=!1;return(0,o.default)(this).one(s.TRANSITION_END,(function(){n=!0})),setTimeout((function(){n||s.triggerTransitionEnd(e)}),t),this}var s={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=(0,o.default)(t).css("transition-duration"),n=(0,o.default)(t).css("transition-delay"),r=parseFloat(e),a=parseFloat(n);return r||a?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){(0,o.default)(t).trigger(a)},supportsTransitionEnd:function(){return Boolean(a)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r],a=e[r],i=a&&s.isElement(a)?"element":null==(l=a)?"".concat(l):{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(i))throw new Error("".concat(t.toUpperCase(),": ")+'Option "'.concat(r,'" provided type "').concat(i,'" ')+'but expected type "'.concat(o,'".'))}var l},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?s.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if(void 0===o.default)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=o.default.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};s.jQueryDetection(),o.default.fn.emulateTransitionEnd=i,o.default.event.special[s.TRANSITION_END]={bindType:a,delegateType:a,handle:function(t){if((0,o.default)(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var l=s;e.default=l},3777:(t,e,n)=>{var r=n(2736),o=n(402),a=n(8055),i="localStorage"in n.g&&n.g.localStorage?n.g.localStorage:r;function s(t,e){return 1===arguments.length?l(t):c(t,e)}function l(t){var e=i.getItem(t);return o(e)}function c(t,e){try{return i.setItem(t,JSON.stringify(e)),!0}catch(t){return!1}}s.set=c,s.get=l,s.remove=function(t){return i.removeItem(t)},s.clear=function(){return i.clear()},s.backend=function(t){return t&&(i=t),i},s.on=a.on,s.off=a.off,t.exports=s},402:t=>{t.exports=function(t){var e=function(t){try{return JSON.parse(t)}catch(e){return t}}(t);return void 0===e?null:e}},2736:t=>{var e={};t.exports={getItem:function(t){return t in e?e[t]:null},setItem:function(t,n){return e[t]=n,!0},removeItem:function(t){return!!(t in e)&&delete e[t]},clear:function(){return e={},!0}}},8055:(t,e,n)=>{var r=n(402),o={};function a(t){t||(t=n.g.event);var e=o[t.key];e&&e.forEach((function(e){e(r(t.newValue),r(t.oldValue),t.url||t.uri)}))}t.exports={on:function(t,e){o[t]?o[t].push(e):o[t]=[e],n.g.addEventListener?n.g.addEventListener("storage",a,!1):n.g.attachEvent?n.g.attachEvent("onstorage",a):n.g.onstorage=a},off:function(t,e){var n=o[t];n.length>1?n.splice(n.indexOf(e),1):o[t]=[]}}},3829:(t,e,n)=>{var r,o,a;n(542),r=window.jQuery,o=r("#foe-secondary-nav"),a=r("#campaignnav-menu-items"),r(document).on("click","#js-foe-secondary-trigger",(function(){a.hasClass("collapsing")||(o.toggleClass("nav-open"),a.toggleClass("collapse"))}))},2851:(t,e,n)=>{var r=n(6378)(n(7957));n(9990),function(t){if(t("body").hasClass("foe-page-go-top")){var e=r.default.getScrollFromScreens(2),n=t('<a name="foe-go-top-anchor"></a>'),o=t('\n <a id="foe-go-top" href="#foe-go-top-anchor" title="Return to the top of the page">\n <i class="fas fa-arrow-alt-circle-up"></i>\n <span class="sr-only">Go to top</span>\n </a>\n ');n.prependTo("body"),o.appendTo("body");var a=function(){var t=r.default.getScrollTop();t>=e&&!o.hasClass("visible")&&o.addClass("visible"),t<e&&o.hasClass("visible")&&o.removeClass("visible")};t(window).on("scroll",a),t(window).on("resize",(function(){e=r.default.getScrollFromScreens(2),a()}))}}(window.jQuery)},5969:(t,e,n)=>{n(9766)},2981:()=>{!function(t){var e=/(\.jpg|\.gif|\.png|\.pdf|\.doc|\.docx|\.zip|\.tar|\.gz|\.rar|\.wav|\.mp4|\.giv|\.webm)$/gi;function n(t){var n=t.hostname,r=t.href;return n===window.location.hostname||n.match(/.*foe\.co\.uk/)||n.match(/.*foeshop\.co\.uk/)||n.match(/.*friendsoftheearth\.uk/)||n.match(/.*takeclimateaction\.uk/)?-1!==n.indexOf("act")?"Click to Campaignion":r.match(e)?"download-resource":"Click inbound":"Click outbound"}function r(t){return"".concat(t.textContent.trim()," | ").concat(t.href)}function o(){var t={};if(this.dataset.clickTrack)try{t=JSON.parse(this.dataset.clickTrack)}catch(t){console.warn("Warning: [data-click-track] attribute is not valid",t)}var e,o,a,i,s={eventCategory:(e=this,o="unknown","A"===e.tagName&&(o=e.className.match(/(foe-cta|btn)/)?"Link CTA":"Link Text"),o),eventAction:n(this),eventLabel:r(this)};this.dataset.clickTrack=JSON.stringify((a=s,i=t,Object.keys(i).forEach((function(t){a[t]=i[t]})),a))}t(document).ready((function(){t("a[href]").each(o)}))}(window.jQuery)},5264:(t,e,n)=>{var r,o=n(6378)(n(7957));n(4878),(r=window.jQuery)("[data-defer-src]").each((function(t,e){var n=r(e);if(o.default.elementInViewport(e)){var a=n.attr("data-defer-src");n.removeAttr("data-defer-src").attr("src",a)}else{var i=n.attr("src"),s=n.parent().hasClass("js-defer-loader"),l="IMG"===n[0].nodeName;s||l||n.wrap('<div class="js-defer-loader"></div>'),n.addClass("js-defer-is-loading").attr("data-defer-src",i).removeAttr("src"),r(window).on("scroll",(function t(){if(e.hasAttribute("data-defer-src")&&o.default.elementInViewport(e)){r(window).off("scroll",t),s&&n.unwrap();var a=n.attr("data-defer-src");n.removeAttr("data-defer-src").attr("src",a).on("load",(function(){n.removeClass("js-defer-is-loading")}))}}))}}))},1506:(t,e,n)=>{var r=n(6378)(n(7957));!function(t){function e(e){var n=this.hash,o=!1;if("A"===this.tagName)if(t(this).attr("data-scroll-to"))o=!0;else if("_blank"===this.target||window.location.hostname!==this.hostname||window.location.pathname.replace(/^\//,"")!==this.pathname.replace(/^\//,"")||""===n&&!this.dataset.scrollTo||this.search!==window.location.search)return;var a=/#.{2,}/.test(n)?t(n):t(t(this).attr("data-scroll-to"));if((a=a.length?a:t('[name="'.concat(n.substr(1),'"]'))).length){var i=r.default.getHeaderHeight(),s=parseInt(a.attr("data-scroll-to-padding")||20,10),l=a.offset().top-(i+s);if(t("body").hasClass("user-logged-in"))l-=t("#toolbar-bar").height()+t("#toolbar-item-administration-tray").height()+t(".tabs--primary").height();t("html, body").stop().animate({scrollTop:l},750,"swing"),o||e.preventDefault()}}t(document).on("click","a:not([data-scroll-to])",e),t(document).on("click","[data-scroll-to]",e),t(document).on("load",(function(){window.location.hash&&(setTimeout((function(){window.scrollTo(0,0)}),1),setTimeout((function(){t('[href="'.concat(window.location.hash,'"]')).click()}),1))}))}(window.jQuery)},2445:(t,e,n)=>{var r=n(6395),o=n(6378)(n(2861)),a=r(n(3777));!function(t){var e={analytics:{source:"utm_source",medium:"utm_medium",term:"utm_term",content:"utm_content",campaign:"utm_campaign"},internal:{source:["source",function(t){return t&&t.toUpperCase()}],source_code_first:["source",function(t,e){return e&&"string"==typeof e?e.toUpperCase():t&&"string"==typeof t?t.toUpperCase():null}],mailing:["utm_content",function(t){if(t){var e=t.split("_");if(e[1]&&0===e[1].indexOf("lm"))return e[1].toUpperCase()}return null}],activity_year:["utm_content",function(t){return t&&t.match(/^FY\d\d\d\d/)?t.replace(/^FY(\d\d)(\d\d).*$/,"$1/$2"):null}],activity_month:["utm_content",function(t){return t&&t.match(/^FY\d\d\d\d-\d\d/)?t.replace(/^FY\d\d\d\d-(\d\d).*$/,"$1"):null}]},other:["other","o"],refsid:"refsid",tags:["tags",function(e,n){return e?function(t){if(!t.length)return t;for(var e=t.sort((function(t,e){return t>=e?1:-1})),n=[e[0]],r=1;r<e.length;r++)e[r-1]!==e[r]&&n.push(e[r]);return n}(t.merge(n,e.split(","))):n||[]}]},n=function t(e,n,r){var a;switch((0,o.default)(e)){case"string":return e in n?n[e]:"string"==typeof r?r:null;case"object":if(Array.isArray(e)){for(var i=0,s=e.length;i<s;i++)if("string"==typeof e[i]&&e[i]in n){a=n[e[i]];break}return"function"==typeof e[e.length-1]&&(a=e[e.length-1](a,r)),null!=a?a:"string"==typeof r?r:null}return a={},Object.keys(e).forEach((function(o){var i=t(e[o],n,r[o]||{});a[o]=null!=i?i:null})),a;default:return null}};function r(t,e,n){return t[0]!==e&&t.unshift(e),Number.isInteger(n)&&t.length>n&&(t=t.slice(0,n)),t}function i(t){for(var e=document.getElementsByTagName("meta"),n=0;n<e.length;n++)if(e[n].getAttribute("name")===t)return e[n].getAttribute("content");return null}t(document).ready((function(){var o=Object.assign({history:[],tags:[],source_history:[]},a.get("foe_data"));o.user_id=o.user_id||function(t,e,n,r,o,a){for(n=1,r=o=0;a=t.charCodeAt(o++);r=(r+n)%65521)n=(n+a)%65521;return r<<16|n}(String(Math.random()+Date.now()));var s=function(){for(var t={},e=window.location.search.substring(1).split("&"),n=0;n<e.length;n++){var r=e[n].split("="),o=r[0],a=r[1];t[o]=decodeURIComponent(a)}return t}(),l=window.location.origin||"".concat(window.location.protocol,"//").concat(window.location.hostname),c=n(e,s,o);Object.assign(o,c),void 0===o.external_referer&&(0!==document.referrer.indexOf(l)?o.external_referer=document.referrer:void 0!==s.external_referer&&0!==s.external_referer.indexOf(l)&&(o.external_referer=s.external_referer)),o.internal=o.internal||{},o.internal.topic=i("foe:topic"),o.internal.campaign=i("foe:campaign"),o.internal.page_type=i("foe:page-type"),o.nid=t("[data-nid]").attr("data-nid")||t('[id*="node"]').attr("id")||null,"string"==typeof o.nid&&(o.nid=o.nid.replace("node-",""));var u=t('input[data-form-prefill-write="source_code"]');if(u.length&&(void 0===o.internal.source_code_first&&(o.internal.source_code_first=u.val()),void 0===o.internal.source&&(o.internal.source=u.val())),o.history=r(o.history,window.location.href,10),"string"==typeof s.source){var f={source:s.source,timestamp:Date.now()};o.source_history=r(o.source_history,f,10)}o.version=3,document.cookie="source_code_first=".concat(o.internal.source_code_first,";"),null===o.internal.source||void 0!==sessionStorage.source_code_session&&"null"!==sessionStorage.source_code_session||sessionStorage.setItem("source_code_session",o.internal.source),function(e){var n=JSON.stringify(e),r=t('input[data-form-prefill-write="foe_additional_data"]'),o=t('input[name="submitted[foe_additional_data]"]')||t('input[name="foe_additional_data"]');r.length?r.val(n):o.val(n);var a=t('input[data-form-prefill-write="source_code_first"]');if(a.length&&"string"==typeof e.internal.source_code_first&&a.val(e.internal.source_code_first),void 0!==sessionStorage.source_code_session){var i=sessionStorage.getItem("source_code_session"),s=t('input[data-form-prefill-write="source_code_session"]');null!==i&&i.length&&"string"==typeof i&&s.val(i)}}(o),a.set("foe_data",o)}))}(window.jQuery)},4577:(t,e,n)=>{var r=n(6378)(n(2350));!function(){if(!(window.navigator.userAgent.indexOf("MSIE")>=0||/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.userAgent.match(/Trident.*rv:11\./))){var t={mobileBreak:parseInt(r.default["breakpoint-md"],10),list:[],number:0,stackTop:0,pageBottom:null,init:function(){t.stopObserving(),t.pageBottom&&t.pageBottom.parentNode.removeChild(t.pageBottom);for(var e=0;e<t.number;e++){var n=t.list[e],r=n.placeholder,o=n.element;r.parentNode.removeChild(r),t.removeClass(o,"stickystack-stuck"),o.style.position=null,o.style.top=null,o.style.left=null,o.style.width=null,o.style.marginTop=null,o.style.marginBottom=null}t.pageBottom=document.createElement("div"),t.pageBottom.style.height=0,t.pageBottom.style.width="100%",t.addClass(t.pageBottom,"js-stickystack"),document.body.appendChild(t.pageBottom),t.number=0;var a=document.getElementsByClassName("js-stickystack");if(window.innerWidth<=t.mobileBreak){for(var i=[],s=0;s<a.length;s++)t.hasClass(a[s],"js-stickystack-nomobile")||i.push(a[s]);a=i}t.number=a.length,t.list=[],t.stackTop=0;for(var l=0;l<t.number;l++){var c=window.getComputedStyle(a[l]),u=document.createElement("div");u.style.width=c.getPropertyValue("width"),u.style.height=c.getPropertyValue("height"),u.style.top=c.getPropertyValue("top"),u.style.right=c.getPropertyValue("right"),u.style.bottom=c.getPropertyValue("bottom"),u.style.left=c.getPropertyValue("left"),u.style.margin=c.getPropertyValue("margin"),u.style.padding=c.getPropertyValue("padding"),u.style.border=c.getPropertyValue("border"),u.style.float=c.getPropertyValue("float"),u.style.clear=c.getPropertyValue("clear"),u.style.position=c.getPropertyValue("position"),u.style.display="none",u.style.visibility="hidden",a[l].parentNode.insertBefore(u,a[l]);var f=t.getCoords(a[l]);t.list.push({element:a[l],top:f.top,left:f.left-parseFloat(c.getPropertyValue("margin-left")),width:parseFloat(c.getPropertyValue("width")),placeholder:u,semistuck:t.hasClass(a[l],"js-stickystack-semi"),zIndex:100-l})}t.list.sort(t.sortByTop),t.stackTop=0,a=document.getElementsByClassName("js-stickystack-top");for(var d=0;d<a.length;d++){var p=t.getCoords(a[d]).top;t.stackTop=0===d?p:Math.min(t.stackTop,p)}t.update(),t.startObserving()},update:function(){for(var e=[[t.stackTop,0,document.body.offsetWidth]],n=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,r=0;r<t.number;r++){var o=t.list[r],a=o.element,i=o.placeholder,s=o.left,l=o.width,c=o.top-n,u=t.getOverlap([c,s,l],e);if(u.overlap>0){i.style.display="block",t.addClass(a,"stickystack-stuck");var f=0;if(t.list[r].semistuck&&r+1<t.number)for(var d=[[u.absolute+a.offsetHeight,s,l]],p=r+1;p<t.number;p++){var h=[t.list[p].top-n,t.list[p].left,t.list[p].width],g=t.getOverlap(h,d);if(g.overlap>0){f=g.overlap;break}}a.style.position="fixed",a.style.top="".concat(u.absolute-f,"px"),a.style.left="".concat(s,"px"),a.style.width="".concat(l,"px"),a.style.zIndex=o.zIndex,a.style.marginTop=0,a.style.marginBottom=0;var m=u.absolute+a.offsetHeight-f;e.push([m,a.offsetLeft,a.offsetWidth])}else t.removeClass(a,"stickystack-stuck"),a.style.position=null,a.style.top=null,a.style.left=null,a.style.width=null,a.style.zIndex=null,a.style.marginTop=null,a.style.marginBottom=null,i.style.display="none"}},startObserving:function(){},stopObserving:function(){},getOverlap:function(t,e){for(var n=0,r=0,o=0;o<e.length;o++)t[0]<e[o][0]&&t[1]+t[2]>e[o][1]&&e[o][1]+e[o][2]>t[1]&&(n=Math.max(n,e[o][0]-t[0]),r=Math.max(r,e[o][0]));return{overlap:n,absolute:r}},sortByTop:function(t,e){return t.top-e.top},getCoords:function(t){var e=t.getBoundingClientRect(),n=document,r=n.body,o=n.documentElement,a=window.pageYOffset||o.scrollTop||r.scrollTop,i=window.pageXOffset||o.scrollLeft||r.scrollLeft,s=o.clientTop||r.clientTop||0,l=o.clientLeft||r.clientLeft||0,c=e.top+a-s,u=e.left+i-l;return{top:Math.round(c),left:Math.round(u)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)".concat(e,"(\\s|$)")))},addClass:function(e,n){e.classList?e.classList.add(n):t.hasClass(e,n)||(e.className+=" ".concat(n))},removeClass:function(e,n){if(e.classList)e.classList.remove(n);else if(t.hasClass(e,n)){var r=new RegExp("(\\s|^)".concat(n,"(\\s|$)"));e.className=e.className.replace(r," ")}}};window.addEventListener("DOMContentLoaded",t.init),window.addEventListener("load",t.init),window.addEventListener("resize",t.init),window.addEventListener("scroll",t.update),window.addEventListener("touchmove",t.update),window.ontouchstart=function(){},window.addEventListener("DOMContentLoaded",(function(){setTimeout((function(){t.update()}),500)})),window.addEventListener("load",(function(){setTimeout((function(){t.update()}),500)}))}}()},7957:(t,e,n)=>{var r=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(n(2350)),a={getScrollTop:function(){if(void 0!==window.pageYOffset)return window.pageYOffset;var t=document.body,e=document.documentElement;return(e=e.clientHeight?e:t).scrollTop},getHalfScrollTop:function(){return this.getScrollTop()+window.innerHeight/2},getDocumentHeight:function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)},getScrollFromScreens:function(t){return this.getViewportHeight()*t},getScrollFromPerc:function(t){return this.getDocumentHeight()/100*t},getViewportHeight:function(){return Math.max(document.documentElement.clientHeight,window.innerHeight)},elementInViewport:function(t){var e=(0,window.jQuery)(t).offset().top,n=e+t.clientHeight,r=this.getScrollTop(),o=this.getViewportHeight();return!(n<r||e-o>=r)},getCurrentBreakpoint:function(){var t=[];Object.keys(o.default).forEach((function(e){if(0===e.indexOf("breakpoint")){var n=e.replace("breakpoint-",""),r=parseInt(o.default[e],10);t.push({size:n,width:r})}}));for(var e=0;e<t.length-1&&window.innerWidth>=t[e+1].width;)e+=1;return t[e].size},getHeaderHeight:function(){var t=window.jQuery,e=this.getCurrentBreakpoint();return t(".foe-header").length?parseInt(o.default["foe-header-height-".concat(e)],10):0}};e.default=a},542:(t,e,n)=>{n.r(e)},6978:(t,e,n)=>{n.r(e)},1071:(t,e,n)=>{n.r(e)},9990:(t,e,n)=>{n.r(e)},8237:(t,e,n)=>{n.r(e)},7514:(t,e,n)=>{n.r(e)},2386:(t,e,n)=>{n.r(e)},9766:(t,e,n)=>{n.r(e)},4878:(t,e,n)=>{n.r(e)},6985:(t,e,n)=>{n.r(e)},3207:(t,e,n)=>{n.r(e)},2350:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={"breakpoint-xs":"0","breakpoint-sm":"576px","breakpoint-md":"768px","breakpoint-lg":"1024px","breakpoint-xl":"1366px","breakpoint-xxl":"1536px","container-xl":"1280px","container-xxl":"1420px","foe-header-height-xs":"60px","foe-header-height-sm":"60px","foe-header-height-md":"80px","foe-header-height-lg":"64px","foe-header-height-xl":"64px","foe-header-height-xxl":"64px"}},3609:t=>{t.exports=jQuery}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(6985),n(3207),n(7514),n(1071),n(6978),n(3829),n(2851),n(5969),n(1506),n(2981),n(2445),n(5264),n(4577),n(8237),n(2386),n(9859),n(3800),n(6874),window.FoeWebcore&&window.FoeWebcore.critical||window.console.warn("You have loaded the main bundle without embedding the critical bundle first")})();
|
|
1
|
+
(()=>{"use strict";var t={1112:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},4639:t=>{function e(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}t.exports=function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t},t.exports.default=t.exports,t.exports.__esModule=!0},1230:t=>{t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},6378:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},6395:(t,e,n)=>{var o=n(2861).default;function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}t.exports=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==o(t)&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=a?Object.getOwnPropertyDescriptor(t,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n},t.exports.default=t.exports,t.exports.__esModule=!0},2861:t=>{function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},3800:(t,e,n)=>{var o=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(1112)),a=o(n(4639)),i=o(n(3609)),s=o(n(9859)),l="bs.alert",c=".".concat(l),u=i.default.fn.alert,f="close".concat(c),d="closed".concat(c),p="click".concat(c).concat(".data-api"),h=function(){function t(e){(0,r.default)(this,t),this._element=e}return(0,a.default)(t,[{key:"close",value:function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)}},{key:"dispose",value:function(){i.default.removeData(this._element,l),this._element=null}},{key:"_getRootElement",value:function(t){var e=s.default.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=(0,i.default)(t).closest(".".concat("alert"))[0]),n}},{key:"_triggerCloseEvent",value:function(t){var e=i.default.Event(f);return(0,i.default)(t).trigger(e),e}},{key:"_removeElement",value:function(t){var e=this;if((0,i.default)(t).removeClass("show"),(0,i.default)(t).hasClass("fade")){var n=s.default.getTransitionDurationFromElement(t);(0,i.default)(t).one(s.default.TRANSITION_END,(function(n){return e._destroyElement(t,n)})).emulateTransitionEnd(n)}else this._destroyElement(t)}},{key:"_destroyElement",value:function(t){(0,i.default)(t).detach().trigger(d).remove()}}],[{key:"VERSION",get:function(){return"4.6.0"}},{key:"_jQueryInterface",value:function(e){return this.each((function(){var n=(0,i.default)(this),o=n.data(l);o||(o=new t(this),n.data(l,o)),"close"===e&&o[e](this)}))}},{key:"_handleDismiss",value:function(t){return function(e){e&&e.preventDefault(),t.close(this)}}}]),t}();(0,i.default)(document).on(p,'[data-dismiss="alert"]',h._handleDismiss(new h)),i.default.fn.alert=h._jQueryInterface,i.default.fn.alert.Constructor=h,i.default.fn.alert.noConflict=function(){return i.default.fn.alert=u,h._jQueryInterface};var g=h;e.default=g},6874:(t,e,n)=>{var o=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(2861)),a=o(n(1230)),i=o(n(1112)),s=o(n(4639)),l=o(n(3609)),c=o(n(9859));function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){(0,a.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d="scrollspy",p="bs.scrollspy",h=".".concat(p),g=l.default.fn[d],m={offset:10,method:"auto",target:""},v={offset:"number",method:"string",target:"(string|element)"},y="activate".concat(h),_="scroll".concat(h),w="load".concat(h).concat(".data-api"),b="active",k=".nav, .list-group",x=".nav-link",E=".list-group-item",O="position",T=function(){function t(e,n){var o=this;(0,i.default)(this,t),this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector="".concat(this._config.target," ").concat(x,",")+"".concat(this._config.target," ").concat(E,",")+"".concat(this._config.target," ").concat(".dropdown-item"),this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,(0,l.default)(this._scrollElement).on(_,(function(t){return o._process(t)})),this.refresh(),this._process()}return(0,s.default)(t,[{key:"refresh",value:function(){var t=this,e=this._scrollElement===this._scrollElement.window?"offset":O,n="auto"===this._config.method?e:this._config.method,o=n===O?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var e,r=c.default.getSelectorFromElement(t);if(r&&(e=document.querySelector(r)),e){var a=e.getBoundingClientRect();if(a.width||a.height)return[(0,l.default)(e)[n]().top+o,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))}},{key:"dispose",value:function(){l.default.removeData(this._element,p),(0,l.default)(this._scrollElement).off(h),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null}},{key:"_getConfig",value:function(t){if("string"!=typeof(t=f(f({},m),"object"===(0,r.default)(t)&&t?t:{})).target&&c.default.isElement(t.target)){var e=(0,l.default)(t.target).attr("id");e||(e=c.default.getUID(d),(0,l.default)(t.target).attr("id",e)),t.target="#".concat(e)}return c.default.typeCheckConfig(d,t,v),t}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_getOffsetHeight",value:function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}},{key:"_process",value:function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var o=this._targets[this._targets.length-1];this._activeTarget!==o&&this._activate(o)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var r=this._offsets.length;r--;){this._activeTarget!==this._targets[r]&&t>=this._offsets[r]&&(void 0===this._offsets[r+1]||t<this._offsets[r+1])&&this._activate(this._targets[r])}}}},{key:"_activate",value:function(t){this._activeTarget=t,this._clear();var e=this._selector.split(",").map((function(e){return"".concat(e,'[data-target="').concat(t,'"],').concat(e,'[href="').concat(t,'"]')})),n=(0,l.default)([].slice.call(document.querySelectorAll(e.join(","))));n.hasClass("dropdown-item")?(n.closest(".dropdown").find(".dropdown-toggle").addClass(b),n.addClass(b)):(n.addClass(b),n.parents(k).prev("".concat(x,", ").concat(E)).addClass(b),n.parents(k).prev(".nav-item").children(x).addClass(b)),(0,l.default)(this._scrollElement).trigger(y,{relatedTarget:t})}},{key:"_clear",value:function(){[].slice.call(document.querySelectorAll(this._selector)).filter((function(t){return t.classList.contains(b)})).forEach((function(t){return t.classList.remove(b)}))}}],[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return m}},{key:"_jQueryInterface",value:function(e){return this.each((function(){var n=(0,l.default)(this).data(p),o="object"===(0,r.default)(e)&&e;if(n||(n=new t(this,o),(0,l.default)(this).data(p,n)),"string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}]),t}();(0,l.default)(window).on(w,(function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),e=t.length;e--;){var n=(0,l.default)(t[e]);T._jQueryInterface.call(n,n.data())}})),l.default.fn[d]=T._jQueryInterface,l.default.fn[d].Constructor=T,l.default.fn[d].noConflict=function(){return l.default.fn[d]=g,T._jQueryInterface};var S=T;e.default=S},9859:(t,e,n)=>{var o=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(3609)),a="transitionend";function i(t){var e=this,n=!1;return(0,r.default)(this).one(s.TRANSITION_END,(function(){n=!0})),setTimeout((function(){n||s.triggerTransitionEnd(e)}),t),this}var s={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=(0,r.default)(t).css("transition-duration"),n=(0,r.default)(t).css("transition-delay"),o=parseFloat(e),a=parseFloat(n);return o||a?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){(0,r.default)(t).trigger(a)},supportsTransitionEnd:function(){return Boolean(a)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o],a=e[o],i=a&&s.isElement(a)?"element":null==(l=a)?"".concat(l):{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(r).test(i))throw new Error("".concat(t.toUpperCase(),": ")+'Option "'.concat(o,'" provided type "').concat(i,'" ')+'but expected type "'.concat(r,'".'))}var l},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?s.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if(void 0===r.default)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=r.default.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};s.jQueryDetection(),r.default.fn.emulateTransitionEnd=i,r.default.event.special[s.TRANSITION_END]={bindType:a,delegateType:a,handle:function(t){if((0,r.default)(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var l=s;e.default=l},3777:(t,e,n)=>{var o=n(2736),r=n(402),a=n(8055),i="localStorage"in n.g&&n.g.localStorage?n.g.localStorage:o;function s(t,e){return 1===arguments.length?l(t):c(t,e)}function l(t){var e=i.getItem(t);return r(e)}function c(t,e){try{return i.setItem(t,JSON.stringify(e)),!0}catch(t){return!1}}s.set=c,s.get=l,s.remove=function(t){return i.removeItem(t)},s.clear=function(){return i.clear()},s.backend=function(t){return t&&(i=t),i},s.on=a.on,s.off=a.off,t.exports=s},402:t=>{t.exports=function(t){var e=function(t){try{return JSON.parse(t)}catch(e){return t}}(t);return void 0===e?null:e}},2736:t=>{var e={};t.exports={getItem:function(t){return t in e?e[t]:null},setItem:function(t,n){return e[t]=n,!0},removeItem:function(t){return!!(t in e)&&delete e[t]},clear:function(){return e={},!0}}},8055:(t,e,n)=>{var o=n(402),r={};function a(t){t||(t=n.g.event);var e=r[t.key];e&&e.forEach((function(e){e(o(t.newValue),o(t.oldValue),t.url||t.uri)}))}t.exports={on:function(t,e){r[t]?r[t].push(e):r[t]=[e],n.g.addEventListener?n.g.addEventListener("storage",a,!1):n.g.attachEvent?n.g.attachEvent("onstorage",a):n.g.onstorage=a},off:function(t,e){var n=r[t];n.length>1?n.splice(n.indexOf(e),1):r[t]=[]}}},3829:(t,e,n)=>{var o,r,a;n(542),o=window.jQuery,r=o("#foe-secondary-nav"),a=o("#campaignnav-menu-items"),o(document).on("click","#js-foe-secondary-trigger",(function(){a.hasClass("collapsing")||(r.toggleClass("nav-open"),a.toggleClass("collapse"))}))},2851:(t,e,n)=>{var o=n(6378)(n(7957));n(9990),function(t){if(t("body").hasClass("foe-page-go-top")){var e=o.default.getScrollFromScreens(2),n=t('<a name="foe-go-top-anchor"></a>'),r=t('\n <a id="foe-go-top" href="#foe-go-top-anchor" title="Return to the top of the page">\n <i class="fas fa-arrow-alt-circle-up"></i>\n <span class="sr-only">Go to top</span>\n </a>\n ');n.prependTo("body"),r.appendTo("body");var a=function(){var t=o.default.getScrollTop();t>=e&&!r.hasClass("visible")&&r.addClass("visible"),t<e&&r.hasClass("visible")&&r.removeClass("visible")};t(window).on("scroll",a),t(window).on("resize",(function(){e=o.default.getScrollFromScreens(2),a()}))}}(window.jQuery)},5969:(t,e,n)=>{n(9766)},2981:()=>{!function(t){var e=/(\.jpg|\.gif|\.png|\.pdf|\.doc|\.docx|\.zip|\.tar|\.gz|\.rar|\.wav|\.mp4|\.giv|\.webm)$/gi;function n(t){var n=t.hostname,o=t.href;return n===window.location.hostname||n.match(/.*foe\.co\.uk/)||n.match(/.*foeshop\.co\.uk/)||n.match(/.*friendsoftheearth\.uk/)||n.match(/.*takeclimateaction\.uk/)?-1!==n.indexOf("act")?"Click to Campaignion":o.match(e)?"download-resource":"Click inbound":"Click outbound"}function o(t){return"".concat(t.textContent.trim()," | ").concat(t.href)}function r(){var t={};if(this.dataset.clickTrack)try{t=JSON.parse(this.dataset.clickTrack)}catch(t){console.warn("Warning: [data-click-track] attribute is not valid",t)}var e,r,a,i,s={eventCategory:(e=this,r="unknown","A"===e.tagName&&(r=e.className.match(/(foe-cta|btn)/)?"Link CTA":"Link Text"),r),eventAction:n(this),eventLabel:o(this)};this.dataset.clickTrack=JSON.stringify((a=s,i=t,Object.keys(i).forEach((function(t){a[t]=i[t]})),a))}t(document).ready((function(){t("a[href]").each(r)}))}(window.jQuery)},5264:(t,e,n)=>{n(4878),document.querySelectorAll("[data-defer-src]").forEach((function(t){var e=!1,n=t.dataset.deferSrc;t.classList.add("js-defer-is-loading"),t.addEventListener("load",(function(){t.hasAttribute("src")&&t.classList.remove("js-defer-is-loading")})),new IntersectionObserver((function(o){o.forEach((function(o){!e&&o.intersectionRatio>0&&(e=!0,t.src=n),t.hasAttribute("data-defer-dispose")&&e&&0===o.intersectionRatio&&(e=!1,t.removeAttribute("src"),t.classList.add("js-defer-is-loading"))}))})).observe(t)}))},1506:(t,e,n)=>{var o=n(6378)(n(7957));!function(t){function e(e){var n=this.hash,r=!1;if("A"===this.tagName)if(t(this).attr("data-scroll-to"))r=!0;else if("_blank"===this.target||window.location.hostname!==this.hostname||window.location.pathname.replace(/^\//,"")!==this.pathname.replace(/^\//,"")||""===n&&!this.dataset.scrollTo||this.search!==window.location.search)return;var a=/#.{2,}/.test(n)?t(n):t(t(this).attr("data-scroll-to"));if((a=a.length?a:t('[name="'.concat(n.substr(1),'"]'))).length){var i=o.default.getHeaderHeight(),s=parseInt(a.attr("data-scroll-to-padding")||20,10),l=a.offset().top-(i+s);if(t("body").hasClass("user-logged-in"))l-=t("#toolbar-bar").height()+t("#toolbar-item-administration-tray").height()+t(".tabs--primary").height();t("html, body").stop().animate({scrollTop:l},750,"swing"),r||e.preventDefault()}}t(document).on("click","a:not([data-scroll-to])",e),t(document).on("click","[data-scroll-to]",e),t(document).on("load",(function(){window.location.hash&&(setTimeout((function(){window.scrollTo(0,0)}),1),setTimeout((function(){t('[href="'.concat(window.location.hash,'"]')).click()}),1))}))}(window.jQuery)},2445:(t,e,n)=>{var o=n(6395),r=n(6378)(n(2861)),a=o(n(3777));!function(t){var e={analytics:{source:"utm_source",medium:"utm_medium",term:"utm_term",content:"utm_content",campaign:"utm_campaign"},internal:{source:["source",function(t){return t&&t.toUpperCase()}],source_code_first:["source",function(t,e){return e&&"string"==typeof e?e.toUpperCase():t&&"string"==typeof t?t.toUpperCase():null}],mailing:["utm_content",function(t){if(t){var e=t.split("_");if(e[1]&&0===e[1].indexOf("lm"))return e[1].toUpperCase()}return null}],activity_year:["utm_content",function(t){return t&&t.match(/^FY\d\d\d\d/)?t.replace(/^FY(\d\d)(\d\d).*$/,"$1/$2"):null}],activity_month:["utm_content",function(t){return t&&t.match(/^FY\d\d\d\d-\d\d/)?t.replace(/^FY\d\d\d\d-(\d\d).*$/,"$1"):null}]},other:["other","o"],refsid:"refsid",tags:["tags",function(e,n){return e?function(t){if(!t.length)return t;for(var e=t.sort((function(t,e){return t>=e?1:-1})),n=[e[0]],o=1;o<e.length;o++)e[o-1]!==e[o]&&n.push(e[o]);return n}(t.merge(n,e.split(","))):n||[]}]},n=function t(e,n,o){var a;switch((0,r.default)(e)){case"string":return e in n?n[e]:"string"==typeof o?o:null;case"object":if(Array.isArray(e)){for(var i=0,s=e.length;i<s;i++)if("string"==typeof e[i]&&e[i]in n){a=n[e[i]];break}return"function"==typeof e[e.length-1]&&(a=e[e.length-1](a,o)),null!=a?a:"string"==typeof o?o:null}return a={},Object.keys(e).forEach((function(r){var i=t(e[r],n,o[r]||{});a[r]=null!=i?i:null})),a;default:return null}};function o(t,e,n){return t[0]!==e&&t.unshift(e),Number.isInteger(n)&&t.length>n&&(t=t.slice(0,n)),t}function i(t){for(var e=document.getElementsByTagName("meta"),n=0;n<e.length;n++)if(e[n].getAttribute("name")===t)return e[n].getAttribute("content");return null}t(document).ready((function(){var r=Object.assign({history:[],tags:[],source_history:[]},a.get("foe_data"));r.user_id=r.user_id||function(t,e,n,o,r,a){for(n=1,o=r=0;a=t.charCodeAt(r++);o=(o+n)%65521)n=(n+a)%65521;return o<<16|n}(String(Math.random()+Date.now()));var s=function(){for(var t={},e=window.location.search.substring(1).split("&"),n=0;n<e.length;n++){var o=e[n].split("="),r=o[0],a=o[1];t[r]=decodeURIComponent(a)}return t}(),l=window.location.origin||"".concat(window.location.protocol,"//").concat(window.location.hostname),c=n(e,s,r);Object.assign(r,c),void 0===r.external_referer&&(0!==document.referrer.indexOf(l)?r.external_referer=document.referrer:void 0!==s.external_referer&&0!==s.external_referer.indexOf(l)&&(r.external_referer=s.external_referer)),r.internal=r.internal||{},r.internal.topic=i("foe:topic"),r.internal.campaign=i("foe:campaign"),r.internal.page_type=i("foe:page-type"),r.nid=t("[data-nid]").attr("data-nid")||t('[id*="node"]').attr("id")||null,"string"==typeof r.nid&&(r.nid=r.nid.replace("node-",""));var u=t('input[data-form-prefill-write="source_code"]');if(u.length&&(void 0===r.internal.source_code_first&&(r.internal.source_code_first=u.val()),void 0===r.internal.source&&(r.internal.source=u.val())),r.history=o(r.history,window.location.href,10),"string"==typeof s.source){var f={source:s.source,timestamp:Date.now()};r.source_history=o(r.source_history,f,10)}r.version=3,document.cookie="source_code_first=".concat(r.internal.source_code_first,";"),null===r.internal.source||void 0!==sessionStorage.source_code_session&&"null"!==sessionStorage.source_code_session||sessionStorage.setItem("source_code_session",r.internal.source),function(e){var n=JSON.stringify(e),o=t('input[data-form-prefill-write="foe_additional_data"]'),r=t('input[name="submitted[foe_additional_data]"]')||t('input[name="foe_additional_data"]');o.length?o.val(n):r.val(n);var a=t('input[data-form-prefill-write="source_code_first"]');if(a.length&&"string"==typeof e.internal.source_code_first&&a.val(e.internal.source_code_first),void 0!==sessionStorage.source_code_session){var i=sessionStorage.getItem("source_code_session"),s=t('input[data-form-prefill-write="source_code_session"]');null!==i&&i.length&&"string"==typeof i&&s.val(i)}}(r),a.set("foe_data",r)}))}(window.jQuery)},4577:(t,e,n)=>{var o=n(6378)(n(2350));!function(){if(!(window.navigator.userAgent.indexOf("MSIE")>=0||/iPad|iPhone|iPod/.test(navigator.userAgent)||navigator.userAgent.match(/Trident.*rv:11\./))){var t={mobileBreak:parseInt(o.default["breakpoint-md"],10),list:[],number:0,stackTop:0,pageBottom:null,init:function(){t.stopObserving(),t.pageBottom&&t.pageBottom.parentNode.removeChild(t.pageBottom);for(var e=0;e<t.number;e++){var n=t.list[e],o=n.placeholder,r=n.element;o.parentNode.removeChild(o),t.removeClass(r,"stickystack-stuck"),r.style.position=null,r.style.top=null,r.style.left=null,r.style.width=null,r.style.marginTop=null,r.style.marginBottom=null}t.pageBottom=document.createElement("div"),t.pageBottom.style.height=0,t.pageBottom.style.width="100%",t.addClass(t.pageBottom,"js-stickystack"),document.body.appendChild(t.pageBottom),t.number=0;var a=document.getElementsByClassName("js-stickystack");if(window.innerWidth<=t.mobileBreak){for(var i=[],s=0;s<a.length;s++)t.hasClass(a[s],"js-stickystack-nomobile")||i.push(a[s]);a=i}t.number=a.length,t.list=[],t.stackTop=0;for(var l=0;l<t.number;l++){var c=window.getComputedStyle(a[l]),u=document.createElement("div");u.style.width=c.getPropertyValue("width"),u.style.height=c.getPropertyValue("height"),u.style.top=c.getPropertyValue("top"),u.style.right=c.getPropertyValue("right"),u.style.bottom=c.getPropertyValue("bottom"),u.style.left=c.getPropertyValue("left"),u.style.margin=c.getPropertyValue("margin"),u.style.padding=c.getPropertyValue("padding"),u.style.border=c.getPropertyValue("border"),u.style.float=c.getPropertyValue("float"),u.style.clear=c.getPropertyValue("clear"),u.style.position=c.getPropertyValue("position"),u.style.display="none",u.style.visibility="hidden",a[l].parentNode.insertBefore(u,a[l]);var f=t.getCoords(a[l]);t.list.push({element:a[l],top:f.top,left:f.left-parseFloat(c.getPropertyValue("margin-left")),width:parseFloat(c.getPropertyValue("width")),placeholder:u,semistuck:t.hasClass(a[l],"js-stickystack-semi"),zIndex:100-l})}t.list.sort(t.sortByTop),t.stackTop=0,a=document.getElementsByClassName("js-stickystack-top");for(var d=0;d<a.length;d++){var p=t.getCoords(a[d]).top;t.stackTop=0===d?p:Math.min(t.stackTop,p)}t.update(),t.startObserving()},update:function(){for(var e=[[t.stackTop,0,document.body.offsetWidth]],n=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,o=0;o<t.number;o++){var r=t.list[o],a=r.element,i=r.placeholder,s=r.left,l=r.width,c=r.top-n,u=t.getOverlap([c,s,l],e);if(u.overlap>0){i.style.display="block",t.addClass(a,"stickystack-stuck");var f=0;if(t.list[o].semistuck&&o+1<t.number)for(var d=[[u.absolute+a.offsetHeight,s,l]],p=o+1;p<t.number;p++){var h=[t.list[p].top-n,t.list[p].left,t.list[p].width],g=t.getOverlap(h,d);if(g.overlap>0){f=g.overlap;break}}a.style.position="fixed",a.style.top="".concat(u.absolute-f,"px"),a.style.left="".concat(s,"px"),a.style.width="".concat(l,"px"),a.style.zIndex=r.zIndex,a.style.marginTop=0,a.style.marginBottom=0;var m=u.absolute+a.offsetHeight-f;e.push([m,a.offsetLeft,a.offsetWidth])}else t.removeClass(a,"stickystack-stuck"),a.style.position=null,a.style.top=null,a.style.left=null,a.style.width=null,a.style.zIndex=null,a.style.marginTop=null,a.style.marginBottom=null,i.style.display="none"}},startObserving:function(){},stopObserving:function(){},getOverlap:function(t,e){for(var n=0,o=0,r=0;r<e.length;r++)t[0]<e[r][0]&&t[1]+t[2]>e[r][1]&&e[r][1]+e[r][2]>t[1]&&(n=Math.max(n,e[r][0]-t[0]),o=Math.max(o,e[r][0]));return{overlap:n,absolute:o}},sortByTop:function(t,e){return t.top-e.top},getCoords:function(t){var e=t.getBoundingClientRect(),n=document,o=n.body,r=n.documentElement,a=window.pageYOffset||r.scrollTop||o.scrollTop,i=window.pageXOffset||r.scrollLeft||o.scrollLeft,s=r.clientTop||o.clientTop||0,l=r.clientLeft||o.clientLeft||0,c=e.top+a-s,u=e.left+i-l;return{top:Math.round(c),left:Math.round(u)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)".concat(e,"(\\s|$)")))},addClass:function(e,n){e.classList?e.classList.add(n):t.hasClass(e,n)||(e.className+=" ".concat(n))},removeClass:function(e,n){if(e.classList)e.classList.remove(n);else if(t.hasClass(e,n)){var o=new RegExp("(\\s|^)".concat(n,"(\\s|$)"));e.className=e.className.replace(o," ")}}};window.addEventListener("DOMContentLoaded",t.init),window.addEventListener("load",t.init),window.addEventListener("resize",t.init),window.addEventListener("scroll",t.update),window.addEventListener("touchmove",t.update),window.ontouchstart=function(){},window.addEventListener("DOMContentLoaded",(function(){setTimeout((function(){t.update()}),500)})),window.addEventListener("load",(function(){setTimeout((function(){t.update()}),500)}))}}()},7957:(t,e,n)=>{var o=n(6378);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(2350)),a={getScrollTop:function(){if(void 0!==window.pageYOffset)return window.pageYOffset;var t=document.body,e=document.documentElement;return(e=e.clientHeight?e:t).scrollTop},getHalfScrollTop:function(){return this.getScrollTop()+window.innerHeight/2},getDocumentHeight:function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)},getScrollFromScreens:function(t){return this.getViewportHeight()*t},getScrollFromPerc:function(t){return this.getDocumentHeight()/100*t},getViewportHeight:function(){return Math.max(document.documentElement.clientHeight,window.innerHeight)},elementInViewport:function(t){var e=(0,window.jQuery)(t).offset().top,n=e+t.clientHeight,o=this.getScrollTop(),r=this.getViewportHeight();return!(n<o||e-r>=o)},getCurrentBreakpoint:function(){var t=[];Object.keys(r.default).forEach((function(e){if(0===e.indexOf("breakpoint")){var n=e.replace("breakpoint-",""),o=parseInt(r.default[e],10);t.push({size:n,width:o})}}));for(var e=0;e<t.length-1&&window.innerWidth>=t[e+1].width;)e+=1;return t[e].size},getHeaderHeight:function(){var t=window.jQuery,e=this.getCurrentBreakpoint();return t(".foe-header").length?parseInt(r.default["foe-header-height-".concat(e)],10):0}};e.default=a},542:(t,e,n)=>{n.r(e)},6978:(t,e,n)=>{n.r(e)},1071:(t,e,n)=>{n.r(e)},9990:(t,e,n)=>{n.r(e)},8237:(t,e,n)=>{n.r(e)},7514:(t,e,n)=>{n.r(e)},2386:(t,e,n)=>{n.r(e)},9766:(t,e,n)=>{n.r(e)},4878:(t,e,n)=>{n.r(e)},6985:(t,e,n)=>{n.r(e)},3207:(t,e,n)=>{n.r(e)},2350:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});const o={"breakpoint-xs":"0","breakpoint-sm":"576px","breakpoint-md":"768px","breakpoint-lg":"1024px","breakpoint-xl":"1366px","breakpoint-xxl":"1536px","container-xl":"1280px","container-xxl":"1420px","foe-header-height-xs":"60px","foe-header-height-sm":"60px","foe-header-height-md":"80px","foe-header-height-lg":"64px","foe-header-height-xl":"64px","foe-header-height-xxl":"64px"}},3609:t=>{t.exports=jQuery}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={exports:{}};return t[o](a,a.exports,n),a.exports}n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(6985),n(3207),n(7514),n(1071),n(6978),n(3829),n(2851),n(5969),n(1506),n(2981),n(2445),n(5264),n(4577),n(8237),n(2386),n(9859),n(3800),n(6874),window.FoeWebcore&&window.FoeWebcore.critical||window.console.warn("You have loaded the main bundle without embedding the critical bundle first")})();
|
package/package.json
CHANGED
|
@@ -2,82 +2,69 @@
|
|
|
2
2
|
|
|
3
3
|
# Scripts:Core/Iframe Deferrer
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Use the <code>data-defer-src</code> attribute on iframes to defer/lazy load adding a
|
|
6
|
+
helper loading class.
|
|
6
7
|
|
|
7
8
|
Usage:
|
|
8
9
|
```
|
|
9
10
|
<iframe data-defer-src="<target url>"></iframe>
|
|
10
|
-
<
|
|
11
|
+
<iframe data-defer-src="<target url>" data-defer-dispose />
|
|
11
12
|
```
|
|
12
13
|
|
|
13
14
|
```html_example
|
|
14
|
-
<div class="embed-responsive embed-responsive-16by9">
|
|
15
|
-
<iframe class="embed-responsive-item" data-defer-src="https://player.vimeo.com/video/291108273" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
15
|
<div>
|
|
19
|
-
<
|
|
16
|
+
<p>Native <code>loading="lazy"</code>, not widely supported on iframes.</p>
|
|
17
|
+
<div class="mb-4 embed-responsive embed-responsive-16by9">
|
|
18
|
+
<iframe class="embed-responsive-item" src="https://player.vimeo.com/video/291108273" loading="lazy" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<p>Using <code>data-defer-src</code>.</p>
|
|
22
|
+
<div class="mb-4 embed-responsive embed-responsive-16by9">
|
|
23
|
+
<iframe class="embed-responsive-item" data-defer-src="https://player.vimeo.com/video/291108273" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<p>Combining with <code>data-defer-dispose</code> to free up resources when iframe goes out of the screen.</p>
|
|
27
|
+
<div class="embed-responsive embed-responsive-16by9">
|
|
28
|
+
<iframe class="embed-responsive-item" data-defer-dispose data-defer-src="https://player.vimeo.com/video/291108273" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
|
29
|
+
</div>
|
|
20
30
|
</div>
|
|
21
31
|
```
|
|
22
32
|
|
|
23
33
|
*/
|
|
24
34
|
|
|
25
|
-
import Screen from '../../utils/js/screen.service';
|
|
26
|
-
|
|
27
35
|
import './data-defer-src.scss';
|
|
28
36
|
|
|
29
|
-
((
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
$defers.each((index, el) => {
|
|
33
|
-
const $defer = $(el);
|
|
37
|
+
(() => {
|
|
38
|
+
const elements = document.querySelectorAll('[data-defer-src]');
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.removeAttr('data-defer-src')
|
|
39
|
-
.attr('src', thisUrl);
|
|
40
|
-
} else {
|
|
41
|
-
// Defer iframe load if the iframe is below the loading point's fold
|
|
40
|
+
elements.forEach((el) => {
|
|
41
|
+
let isVisible = false;
|
|
42
|
+
const source = el.dataset.deferSrc;
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
const isWrapped = $defer.parent().hasClass('js-defer-loader');
|
|
45
|
-
const isImage = ($defer[0].nodeName === 'IMG');
|
|
44
|
+
el.classList.add('js-defer-is-loading');
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
// Remove class on load.
|
|
47
|
+
el.addEventListener('load', () => {
|
|
48
|
+
if (el.hasAttribute('src')) {
|
|
49
|
+
el.classList.remove('js-defer-is-loading');
|
|
50
50
|
}
|
|
51
|
+
});
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (el.hasAttribute('data-defer-src')) {
|
|
59
|
-
if (Screen.elementInViewport(el)) {
|
|
60
|
-
// Detach ASAP
|
|
61
|
-
$(window).off('scroll', checkAndLoadSrc);
|
|
62
|
-
|
|
63
|
-
if (isWrapped) {
|
|
64
|
-
$defer.unwrap();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const thisUrl = $defer.attr('data-defer-src');
|
|
53
|
+
const observer = new IntersectionObserver((entries) => {
|
|
54
|
+
entries.forEach((entry) => {
|
|
55
|
+
if (!isVisible && entry.intersectionRatio > 0) {
|
|
56
|
+
isVisible = true;
|
|
57
|
+
el.src = source;
|
|
58
|
+
}
|
|
68
59
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
$defer.removeClass('js-defer-is-loading');
|
|
74
|
-
});
|
|
75
|
-
}
|
|
60
|
+
if (el.hasAttribute('data-defer-dispose') && isVisible && entry.intersectionRatio === 0) {
|
|
61
|
+
isVisible = false;
|
|
62
|
+
el.removeAttribute('src');
|
|
63
|
+
el.classList.add('js-defer-is-loading');
|
|
76
64
|
}
|
|
77
|
-
};
|
|
65
|
+
});
|
|
66
|
+
});
|
|
78
67
|
|
|
79
|
-
|
|
80
|
-
$(window).on('scroll', checkAndLoadSrc);
|
|
81
|
-
}
|
|
68
|
+
observer.observe(el);
|
|
82
69
|
});
|
|
83
|
-
})(
|
|
70
|
+
})();
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
iframe[data-defer-src] {
|
|
2
|
+
transition: opacity 250ms linear;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
background: rgba(0, 0, 0, .3);
|
|
7
|
-
// background-image: #{$encoded-spinner};
|
|
8
|
-
background-position: 50% 50%;
|
|
9
|
-
background-repeat: no-repeat;
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
right: 0;
|
|
14
|
-
bottom: 0;
|
|
15
|
-
z-index: 100;
|
|
16
|
-
border: 1px solid rgba($foe-offwhite, .25);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.js-defer-is-loading {
|
|
20
|
-
opacity: 0 !important;
|
|
4
|
+
&.js-defer-is-loading {
|
|
5
|
+
opacity: 0 !important;
|
|
6
|
+
}
|
|
21
7
|
}
|
|
@@ -40,6 +40,8 @@ export default {
|
|
|
40
40
|
return Math.max(document.documentElement.clientHeight, window.innerHeight);
|
|
41
41
|
},
|
|
42
42
|
|
|
43
|
+
// @todo: legacy function, replace with intersection observer
|
|
44
|
+
// after assessing how many things rely on this utility.
|
|
43
45
|
elementInViewport: function elementInViewport(el) {
|
|
44
46
|
const $ = window.jQuery;
|
|
45
47
|
const { top } = $(el).offset();
|