window.FontAwesomeKitConfig={"id":69626484,"version":"7.1.0","token":"010d8599bc","method":"js","minify":{"enabled":true},"baseUrl":"https://ka-p.fontawesome.com","license":"pro","asyncLoading":{"enabled":false},"autoA11y":{"enabled":false},"baseUrlKit":"https://kit.fontawesome.com","detectConflictsUntil":null,"iconUploads":{},"startupFilename":"pro.min.js","v4FontFaceShim":{"enabled":true},"v4shim":{"enabled":true},"v5FontFaceShim":{"enabled":true},"uploadsUrl":"https://kit-uploads.fontawesome.com"};
!function(t){"function"==typeof define&&define.amd?define("kit-loader",t):t()}((function(){"use strict";function t(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 e(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=i.call(n)).done)&&(c.push(o.value),c.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return c}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var c,l,u,f,s,d="thumbprint",h=(o(c={},"classic","Classic"),o(c,"duotone","Duotone"),o(c,"sharp","Sharp"),o(c,"sharp-duotone","Sharp Duotone"),o(c,"chisel","Chisel"),o(c,"etch","Etch"),o(c,"jelly","Jelly"),o(c,"jelly-duo","Jelly Duo"),o(c,"jelly-fill","Jelly Fill"),o(c,"notdog","Notdog"),o(c,"notdog-duo","Notdog Duo"),o(c,"slab","Slab"),o(c,"slab-press","Slab Press"),o(c,"thumbprint","Thumbprint"),o(c,"utility","Utility"),o(c,"utility-duo","Utility Duo"),o(c,"utility-fill","Utility Fill"),o(c,"whiteboard","Whiteboard"),["fak","fa-kit","fakd","fa-kit-duotone"]),p=(o(l={},"kit","Kit"),o(l,"kit-duotone","Kit Duotone"),"duotone-group"),b="swap-opacity",y="primary",m="secondary",v=(o(u={},"classic","Classic"),o(u,"duotone","Duotone"),o(u,"sharp","Sharp"),o(u,"sharp-duotone","Sharp Duotone"),o(u,"chisel","Chisel"),o(u,"etch","Etch"),o(u,"jelly","Jelly"),o(u,"jelly-duo","Jelly Duo"),o(u,"jelly-fill","Jelly Fill"),o(u,"notdog","Notdog"),o(u,"notdog-duo","Notdog Duo"),o(u,"slab","Slab"),o(u,"slab-press","Slab Press"),o(u,"thumbprint","Thumbprint"),o(u,"utility","Utility"),o(u,"utility-duo","Utility Duo"),o(u,"utility-fill","Utility Fill"),o(u,"whiteboard","Whiteboard"),o(f={},"kit","Kit"),o(f,"kit-duotone","Kit Duotone"),["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt","faslr","faslpr","fawsb","fatl","fans","fands","faes","fajr","fajfr","fajdr","facr","fausb","faudsb","faufsb"].concat(["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-thumbprint","fa-whiteboard","fa-notdog","fa-notdog-duo","fa-chisel","fa-etch","fa-jelly","fa-jelly-fill","fa-jelly-duo","fa-slab","fa-slab-press","fa-utility","fa-utility-duo","fa-utility-fill"],["fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands","fa-semibold"])),g=[1,2,3,4,5,6,7,8,9,10],w=g.concat([11,12,13,14,15,16,17,18,19,20]);[].concat((s=Object.keys({classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"],slab:["faslr"],"slab-press":["faslpr"],whiteboard:["fawsb"],thumbprint:["fatl"],notdog:["fans"],"notdog-duo":["fands"],etch:["faes"],jelly:["fajr"],"jelly-fill":["fajfr"],"jelly-duo":["fajdr"],chisel:["facr"],utility:["fausb"],"utility-duo":["faudsb"],"utility-fill":["faufsb"]}),function(t){if(Array.isArray(t))return a(t)}(s)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(s)||i(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),["solid","regular","light","thin","duotone","brands","semibold"],["aw","fw","pull-left","pull-right"],["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","inverse","layers","layers-bottom-left","layers-bottom-right","layers-counter","layers-text","layers-top-left","layers-top-right","li","pull-end","pull-start","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul","width-auto","width-fixed",p,b,y,m]).concat(g.map((function(t){return"".concat(t,"x")}))).concat(w.map((function(t){return"w-".concat(t)})));function j(t,e){var n=e&&e.addOn||"",o=e&&e.baseFilename||t.license+n,r=e&&e.minify?".min":"",i=e&&e.fileSuffix||t.method,a=e&&e.filename?e.filename:o+r+"."+i,c=e&&e.subdir||t.method;return t.baseUrl+"/releases/"+("latest"===t.version?"latest":"v".concat(t.version))+"/"+c+"/"+a}function A(t,e){var n=e||["fa"],o="."+Array.prototype.join.call(n,",."),r=t.querySelectorAll(o);Array.prototype.forEach.call(r,(function(e){var n=e.getAttribute("title");e.setAttribute("aria-hidden","true");var o=!e.nextElementSibling||!e.nextElementSibling.classList.contains("sr-only");if(n&&o){var r=t.createElement("span");r.innerHTML=n,r.classList.add("sr-only"),e.parentNode.insertBefore(r,e.nextSibling)}}))}var S,O=function(){},E="undefined"!=typeof global&&void 0!==global.process&&"function"==typeof global.process.emit,P="undefined"==typeof setImmediate?setTimeout:setImmediate,F=[];function k(){for(var t=0;t<F.length;t++)F[t][0](F[t][1]);F=[],S=!1}function _(t,e){F.push([t,e]),S||(S=!0,P(k,0))}function C(t){var e=t.owner,n=e._state,o=e._data,r=t[n],i=t.then;if("function"==typeof r){n="fulfilled";try{o=r(o)}catch(t){I(i,t)}}U(i,o)||("fulfilled"===n&&x(i,o),"rejected"===n&&I(i,o))}function U(t,e){var o;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"===n(e))){var r=e.then;if("function"==typeof r)return r.call(e,(function(n){o||(o=!0,e===n?D(t,n):x(t,n))}),(function(e){o||(o=!0,I(t,e))})),!0}}catch(e){return o||I(t,e),!0}return!1}function x(t,e){t!==e&&U(t,e)||D(t,e)}function D(t,e){"pending"===t._state&&(t._state="settled",t._data=e,_(L,t))}function I(t,e){"pending"===t._state&&(t._state="settled",t._data=e,_(N,t))}function T(t){t._then=t._then.forEach(C)}function L(t){t._state="fulfilled",T(t)}function N(t){t._state="rejected",T(t),!t._handled&&E&&global.process.emit("unhandledRejection",t._data,t)}function K(t){global.process.emit("rejectionHandled",t)}function M(t){if("function"!=typeof t)throw new TypeError("Promise resolver "+t+" is not a function");if(this instanceof M==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(t,e){function n(t){I(e,t)}try{t((function(t){x(e,t)}),n)}catch(t){n(t)}}(t,this)}M.prototype={constructor:M,_state:"pending",_then:null,_data:void 0,_handled:!1,then:function(t,e){var n={owner:this,then:new this.constructor(O),fulfilled:t,rejected:e};return!e&&!t||this._handled||(this._handled=!0,"rejected"===this._state&&E&&_(K,this)),"fulfilled"===this._state||"rejected"===this._state?_(C,n):this._then.push(n),n.then},catch:function(t){return this.then(null,t)}},M.all=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.all().");return new M((function(e,n){var o=[],r=0;function i(t){return r++,function(n){o[t]=n,--r||e(o)}}for(var a,c=0;c<t.length;c++)(a=t[c])&&"function"==typeof a.then?a.then(i(c),n):o[c]=a;r||e(o)}))},M.race=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.race().");return new M((function(e,n){for(var o,r=0;r<t.length;r++)(o=t[r])&&"function"==typeof o.then?o.then(e,n):e(o)}))},M.resolve=function(t){return t&&"object"===n(t)&&t.constructor===M?t:new M((function(e){e(t)}))},M.reject=function(t){return new M((function(e,n){n(t)}))};var R="function"==typeof Promise?Promise:M;function J(t,e){var n=e.fetch,o=e.XMLHttpRequest,r=e.token,i=t;return r&&!function(t){return t.indexOf("kit-upload.css")>-1}(t)&&("URLSearchParams"in window?(i=new URL(t)).searchParams.set("token",r):i=i+"?token="+encodeURIComponent(r)),i=i.toString(),new R((function(t,e){if("function"==typeof n)n(i,{mode:"cors",cache:"default"}).then((function(t){if(t.ok)return t.text();throw new Error("")})).then((function(e){t(e)})).catch(e);else if("function"==typeof o){var r=new o;r.addEventListener("loadend",(function(){this.responseText?t(this.responseText):e(new Error(""))}));["abort","error","timeout"].map((function(t){r.addEventListener(t,(function(){e(new Error(""))}))})),r.open("GET",i),r.send()}else{e(new Error(""))}}))}function H(t,e,n){var o=t;return[[/(url\("?)\.\.\/\.\.\/\.\./g,function(t,n){return"".concat(n).concat(e)}],[/(url\("?)\.\.\/webfonts/g,function(t,o){return"".concat(o).concat(e,"/releases/v").concat(n,"/webfonts")}],[/(url\("?)https:\/\/kit-free([^.])*\.fontawesome\.com/g,function(t,n){return"".concat(n).concat(e)}]].forEach((function(t){var e=r(t,2),n=e[0],i=e[1];o=o.replace(n,i)})),o}function q(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=n.document||r,i=A.bind(A,r,[].concat(v,h.map((function(t){return"fa-".concat(t)}))));t.autoA11y.enabled&&o(i);var a=t.subsetPath&&t.baseUrl+"/"+t.subsetPath,c=[];if(a?c.push({id:"fa-main",addOn:void 0,url:a}):c.push({id:"fa-main",addOn:void 0,url:j(t,{filename:t.startupFilename,minify:t.minify.enabled})}),t.v4shim&&t.v4shim.enabled&&c.push({id:"fa-v4-shims",addOn:"-v4-shims"}),t.v5FontFaceShim&&t.v5FontFaceShim.enabled&&c.push({id:"fa-v5-font-face",addOn:"-v5-font-face"}),t.v4FontFaceShim&&t.v4FontFaceShim.enabled&&c.push({id:"fa-v4-font-face",addOn:"-v4-font-face"}),!a&&t.customIconsCssPath){var l=t.customIconsCssPath.indexOf("kit-upload.css")>-1?t.baseUrlKit:t.baseUrl,u=l+"/"+t.customIconsCssPath;c.push({id:"fa-kit-upload",url:u})}var f=c.map((function(o){return new R((function(r,i){var a=o.url||j(t,{addOn:o.addOn,minify:t.minify.enabled}),c={id:o.id},l=t.subset?c:e(e(e({},n),c),{},{baseUrl:t.baseUrl,version:t.version,id:o.id,contentFilter:function(t,e){return H(t,e.baseUrl,e.version)}});J(a,n).then((function(t){r(X(t,l))})).catch(i)}))}));return R.all(f)}function X(t,e){var n=e.contentFilter||function(t,e){return t},o=document.createElement("style"),r=document.createTextNode(n(t,e));return o.appendChild(r),o.media="all",e.id&&o.setAttribute("id",e.id),e&&e.detectingConflicts&&e.detectionIgnoreAttr&&o.setAttributeNode(document.createAttribute(e.detectionIgnoreAttr)),o}function B(t,n){n.autoA11y=t.autoA11y.enabled,"pro"===t.license&&(n.autoFetchSvg=!0,n.fetchSvgFrom=t.baseUrl+"/releases/"+("latest"===t.version?"latest":"v".concat(t.version))+"/svgs",n.fetchUploadedSvgFrom=t.uploadsUrl);var o=[];return t.v4shim.enabled&&o.push(new R((function(o,r){J(j(t,{addOn:"-v4-shims",minify:t.minify.enabled}),n).then((function(t){o(W(t,e(e({},n),{},{id:"fa-v4-shims"})))})).catch(r)}))),o.push(new R((function(o,r){J(t.subsetPath&&t.baseUrl+"/"+t.subsetPath||j(t,{filename:t.startupFilename,minify:t.minify.enabled}),n).then((function(t){var r=W(t,e(e({},n),{},{id:"fa-main"}));o(function(t,e){var n=e&&void 0!==e.autoFetchSvg?e.autoFetchSvg:void 0,o=e&&void 0!==e.autoA11y?e.autoA11y:void 0;void 0!==o&&t.setAttribute("data-auto-a11y",o?"true":"false");n&&(t.setAttributeNode(document.createAttribute("data-auto-fetch-svg")),t.setAttribute("data-fetch-svg-from",e.fetchSvgFrom),t.setAttribute("data-fetch-uploaded-svg-from",e.fetchUploadedSvgFrom));return t}(r,n))})).catch(r)}))),R.all(o)}function W(t,e){var n=document.createElement("SCRIPT"),o=document.createTextNode(t);return n.appendChild(o),n.referrerPolicy="strict-origin",e.id&&n.setAttribute("id",e.id),e&&e.detectingConflicts&&e.detectionIgnoreAttr&&n.setAttributeNode(document.createAttribute(e.detectionIgnoreAttr)),n}function Y(t){var e,n=[],o=document,r=o.documentElement.doScroll,i=(r?/^loaded|^c/:/^loaded|^i|^c/).test(o.readyState);i||o.addEventListener("DOMContentLoaded",e=function(){for(o.removeEventListener("DOMContentLoaded",e),i=1;e=n.shift();)e()}),i?setTimeout(t,0):n.push(t)}function z(t){"undefined"!=typeof MutationObserver&&new MutationObserver(t).observe(document,{childList:!0,subtree:!0})}try{if(window.FontAwesomeKitConfig){var G=window.FontAwesomeKitConfig,$={detectingConflicts:G.detectConflictsUntil&&new Date<=new Date(G.detectConflictsUntil),detectionIgnoreAttr:"data-fa-detection-ignore",fetch:window.fetch,token:G.token,XMLHttpRequest:window.XMLHttpRequest,document:document},Q=document.currentScript,V=Q?Q.parentElement:document.head;(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"js"===t.method?B(t,e):"css"===t.method?q(t,e,(function(t){Y(t),z(t)})):void 0})(G,$).then((function(t){t.map((function(t){try{V.insertBefore(t,Q?Q.nextSibling:null)}catch(e){V.appendChild(t)}})),$.detectingConflicts&&Q&&Y((function(){Q.setAttributeNode(document.createAttribute($.detectionIgnoreAttr));var t=function(t,e){var n=document.createElement("script");return e&&e.detectionIgnoreAttr&&n.setAttributeNode(document.createAttribute(e.detectionIgnoreAttr)),n.src=j(t,{baseFilename:"conflict-detection",fileSuffix:"js",subdir:"js",minify:t.minify.enabled}),n}(G,$);document.body.appendChild(t)}))})).catch((function(t){console.error("".concat("Font Awesome Kit:"," ").concat(t))}))}}catch(d){console.error("".concat("Font Awesome Kit:"," ").concat(d))}}));
class SilktideCookieBanner {
constructor(config){
this.config=config;
this.wrapper=null;
this.banner=null;
this.modal=null;
this.cookieIcon=null;
this.backdrop=null;
this.createWrapper();
if(this.shouldShowBackdrop()){
this.createBackdrop();
}
this.createCookieIcon();
this.createModal();
if(this.shouldShowBanner()){
this.createBanner();
this.showBackdrop();
}else{
this.showCookieIcon();
}
this.setupEventListeners();
if(this.hasSetInitialCookieChoices()){
this.loadRequiredCookies();
this.runAcceptedCookieCallbacks();
}}
destroyCookieBanner(){
if(this.wrapper&&this.wrapper.parentNode){
this.wrapper.parentNode.removeChild(this.wrapper);
}
this.allowBodyScroll();
this.wrapper=null;
this.banner=null;
this.modal=null;
this.cookieIcon=null;
this.backdrop=null;
}
createWrapper(){
this.wrapper=document.createElement('div');
this.wrapper.id='silktide-wrapper';
document.body.insertBefore(this.wrapper, document.body.firstChild);
}
createWrapperChild(htmlContent, id){
const child=document.createElement('div');
child.id=id;
child.innerHTML=htmlContent;
if(!this.wrapper||!document.body.contains(this.wrapper)){
this.createWrapper();
}
this.wrapper.appendChild(child);
return child;
}
createBackdrop(){
this.backdrop=this.createWrapperChild(null, 'silktide-backdrop');
}
showBackdrop(){
if(this.backdrop){
this.backdrop.style.display='block';
}
if(typeof this.config.onBackdropOpen==='function'){
this.config.onBackdropOpen();
}}
hideBackdrop(){
if(this.backdrop){
this.backdrop.style.display='none';
}
if(typeof this.config.onBackdropClose==='function'){
this.config.onBackdropClose();
}}
shouldShowBackdrop(){
return this.config?.background?.showBackground||false;
}
updateCheckboxState(saveToStorage=false){
const preferencesSection=this.modal.querySelector('#cookie-preferences');
const checkboxes=preferencesSection.querySelectorAll('input[type="checkbox"]');
checkboxes.forEach((checkbox)=> {
const [, cookieId]=checkbox.id.split('cookies-');
const cookieType=this.config.cookieTypes.find(type=> type.id===cookieId);
if(!cookieType) return;
if(saveToStorage){
const currentState=checkbox.checked;
if(cookieType.required){
localStorage.setItem(`silktideCookieChoice_${cookieId}${this.getBannerSuffix()}`,
'true'
);
}else{
localStorage.setItem(`silktideCookieChoice_${cookieId}${this.getBannerSuffix()}`,
currentState.toString()
);
if(currentState&&typeof cookieType.onAccept==='function'){
cookieType.onAccept();
}else if(!currentState&&typeof cookieType.onReject==='function'){
cookieType.onReject();
}}
}else{
if(cookieType.required){
checkbox.checked=true;
checkbox.disabled=true;
}else{
const storedValue=localStorage.getItem(`silktideCookieChoice_${cookieId}${this.getBannerSuffix()}`
);
if(storedValue!==null){
checkbox.checked=storedValue==='true';
}else{
checkbox.checked = !!cookieType.defaultValue;
}}
}});
}
setInitialCookieChoiceMade(){
window.localStorage.setItem(`silktideCookieBanner_InitialChoice${this.getBannerSuffix()}`, 1);
}
handleCookieChoice(accepted){
this.setInitialCookieChoiceMade();
this.removeBanner();
this.hideBackdrop();
this.toggleModal(false);
this.showCookieIcon();
this.config.cookieTypes.forEach((type)=> {
if(type.required==true){
localStorage.setItem(`silktideCookieChoice_${type.id}${this.getBannerSuffix()}`, 'true');
if(typeof type.onAccept==='function'){ type.onAccept() }}else{
localStorage.setItem(`silktideCookieChoice_${type.id}${this.getBannerSuffix()}`,
accepted.toString(),
);
if(accepted){
if(typeof type.onAccept==='function'){ type.onAccept(); }}else{
if(typeof type.onReject==='function'){ type.onReject(); }}
}});
if(accepted&&typeof this.config.onAcceptAll==='function'){
if(typeof this.config.onAcceptAll==='function'){ this.config.onAcceptAll(); }}else if(typeof this.config.onRejectAll==='function'){
if(typeof this.config.onRejectAll==='function'){ this.config.onRejectAll(); }}
this.updateCheckboxState();
}
getAcceptedCookies(){
return (this.config.cookieTypes||[]).reduce((acc, cookieType)=> {
acc[cookieType.id] =
localStorage.getItem(`silktideCookieChoice_${cookieType.id}${this.getBannerSuffix()}`)==='true';
return acc;
}, {});
}
runAcceptedCookieCallbacks(){
if(!this.config.cookieTypes) return;
const acceptedCookies=this.getAcceptedCookies();
this.config.cookieTypes.forEach((type)=> {
if(type.required) return;
if(acceptedCookies[type.id]&&typeof type.onAccept==='function'){
if(typeof type.onAccept==='function'){ type.onAccept(); }}
});
}
runRejectedCookieCallbacks(){
if(!this.config.cookieTypes) return;
const rejectedCookies=this.getRejectedCookies();
this.config.cookieTypes.forEach((type)=> {
if(rejectedCookies[type.id]&&typeof type.onReject==='function'){
if(typeof type.onReject==='function'){ type.onReject(); }}
});
}
runStoredCookiePreferenceCallbacks(){
this.config.cookieTypes.forEach((type)=> {
const accepted =
localStorage.getItem(`silktideCookieChoice_${type.id}${this.getBannerSuffix()}`)==='true';
if(accepted){
if(typeof type.onAccept==='function'){ type.onAccept(); }}else{
if(typeof type.onReject==='function'){ type.onReject(); }}
});
}
loadRequiredCookies(){
if(!this.config.cookieTypes) return;
this.config.cookieTypes.forEach((cookie)=> {
if(cookie.required&&typeof cookie.onAccept==='function'){
if(typeof cookie.onAccept==='function'){ cookie.onAccept(); }}
});
}
getBannerContent(){
const bannerDescription =
this.config.text?.banner?.description ||
"<p>We use cookies on our site to enhance your user experience, provide personalized content, and analyze our traffic.</p>";
const acceptAllButtonText=this.config.text?.banner?.acceptAllButtonText||'Accept all';
const acceptAllButtonLabel=this.config.text?.banner?.acceptAllButtonAccessibleLabel;
const acceptAllButton=`<button class="accept-all st-button st-button--primary"${
acceptAllButtonLabel&&acceptAllButtonLabel!==acceptAllButtonText
? ` aria-label="${acceptAllButtonLabel}"`
: ''
}>${acceptAllButtonText}</button>`;
const rejectNonEssentialButtonText=this.config.text?.banner?.rejectNonEssentialButtonText||'Reject non-essential';
const rejectNonEssentialButtonLabel=this.config.text?.banner?.rejectNonEssentialButtonAccessibleLabel;
const rejectNonEssentialButton=`<button class="reject-all st-button st-button--primary"${
rejectNonEssentialButtonLabel&&rejectNonEssentialButtonLabel!==rejectNonEssentialButtonText
? ` aria-label="${rejectNonEssentialButtonLabel}"`
: ''
}>${rejectNonEssentialButtonText}</button>`;
const preferencesButtonText=this.config.text?.banner?.preferencesButtonText||'Preferences';
const preferencesButtonLabel=this.config.text?.banner?.preferencesButtonAccessibleLabel;
const preferencesButton=`<button class="preferences"${
preferencesButtonLabel&&preferencesButtonLabel!==preferencesButtonText
? ` aria-label="${preferencesButtonLabel}"`
: ''
}><span>${preferencesButtonText}</span></button>`;
const silktideLogo=`
<a class="silktide-logo" href="https://silktide.com/consent-manager" target="_blank" rel="noreferrer" aria-label="Visit the Silktide Consent Manager page">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="25" viewBox="0 0 24 25" fill="inherit">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.1096 16.7745C13.8895 17.2055 13.3537 17.3805 12.9129 17.1653L8.28443 14.9055L2.73192 17.7651L11.1025 21.9814C11.909 22.3876 12.8725 22.3591 13.6524 21.9058L20.4345 17.9645C21.2845 17.4704 21.7797 16.5522 21.7164 15.5872L21.7088 15.4704C21.6487 14.5561 21.0962 13.7419 20.2579 13.3326L15.6793 11.0972L10.2283 13.9045L13.71 15.6043C14.1507 15.8195 14.3297 16.3434 14.1096 16.7745ZM8.2627 12.9448L13.7136 10.1375L10.2889 8.46543C9.84803 8.25021 9.66911 7.72629 9.88916 7.29524C10.1093 6.86417 10.6451 6.68921 11.0859 6.90442L15.6575 9.13647L21.2171 6.27325L12.8808 2.03496C12.0675 1.62147 11.0928 1.65154 10.3078 2.11432L3.54908 6.09869C2.70732 6.59492 2.21846 7.50845 2.28139 8.46761L2.29003 8.59923C2.35002 9.51362 2.9026 10.3278 3.7409 10.7371L8.2627 12.9448ZM6.31884 13.9458L2.94386 12.2981C1.53727 11.6113 0.610092 10.2451 0.509431 8.71094L0.500795 8.57933C0.3952 6.96993 1.21547 5.4371 2.62787 4.60447L9.38662 0.620092C10.7038 -0.156419 12.3392 -0.206861 13.7039 0.486938L23.3799 5.40639C23.4551 5.44459 23.5224 5.4918 23.5811 5.54596C23.7105 5.62499 23.8209 5.73754 23.897 5.87906C24.1266 6.30534 23.9594 6.83293 23.5234 7.05744L17.6231 10.0961L21.0549 11.7716C22.4615 12.4583 23.3887 13.8245 23.4893 15.3587L23.497 15.4755C23.6033 17.0947 22.7724 18.6354 21.346 19.4644L14.5639 23.4057C13.2554 24.1661 11.6386 24.214 10.2854 23.5324L0.621855 18.6649C0.477299 18.592 0.361696 18.4859 0.279794 18.361C0.210188 18.2968 0.150054 18.2204 0.10296 18.133C-0.126635 17.7067 0.0406445 17.1792 0.47659 16.9546L6.31884 13.9458Z" fill="inherit"/>
</svg>
</a>
`;
const bannerContent=`
${bannerDescription}
<div class="actions">
${acceptAllButton}
${rejectNonEssentialButton}
<div class="actions-row">
${preferencesButton}
${silktideLogo}
</div>
</div>
`;
return bannerContent;
}
hasSetInitialCookieChoices(){
return !!localStorage.getItem(`silktideCookieBanner_InitialChoice${this.getBannerSuffix()}`);
}
createBanner(){
this.banner=this.createWrapperChild(this.getBannerContent(), 'silktide-banner');
if(this.banner&&this.config.position?.banner){
this.banner.classList.add(this.config.position.banner);
}
if(this.banner&&typeof this.config.onBannerOpen==='function'){
this.config.onBannerOpen();
}}
removeBanner(){
if(this.banner&&this.banner.parentNode){
this.banner.parentNode.removeChild(this.banner);
this.banner=null;
if(typeof this.config.onBannerClose==='function'){
this.config.onBannerClose();
}}
}
shouldShowBanner(){
if(this.config.showBanner===false){
return false;
}
return (
localStorage.getItem(`silktideCookieBanner_InitialChoice${this.getBannerSuffix()}`)===null
);
}
getModalContent(){
const preferencesTitle =
this.config.text?.preferences?.title||'Customize your cookie preferences';
const preferencesDescription =
this.config.text?.preferences?.description ||
"<p>We respect your right to privacy. You can choose not to allow some types of cookies. Your cookie preferences will apply across our website.</p>";
const preferencesButtonLabel=this.config.text?.banner?.preferencesButtonAccessibleLabel;
const closeModalButton=`<button class="modal-close"${preferencesButtonLabel ? ` aria-label="${preferencesButtonLabel}"`:''}>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.4081 3.41559C20.189 2.6347 20.189 1.36655 19.4081 0.585663C18.6272 -0.195221 17.3591 -0.195221 16.5782 0.585663L10 7.17008L3.41559 0.59191C2.6347 -0.188974 1.36655 -0.188974 0.585663 0.59191C-0.195221 1.37279 -0.195221 2.64095 0.585663 3.42183L7.17008 10L0.59191 16.5844C-0.188974 17.3653 -0.188974 18.6335 0.59191 19.4143C1.37279 20.1952 2.64095 20.1952 3.42183 19.4143L10 12.8299L16.5844 19.4081C17.3653 20.189 18.6335 20.189 19.4143 19.4081C20.1952 18.6272 20.1952 17.3591 19.4143 16.5782L12.8299 10L19.4081 3.41559Z"/>
</svg>
</button>`;
const cookieTypes=this.config.cookieTypes||[];
const acceptedCookieMap=this.getAcceptedCookies();
const acceptAllButtonText=this.config.text?.banner?.acceptAllButtonText||'Accept all';
const acceptAllButtonLabel=this.config.text?.banner?.acceptAllButtonAccessibleLabel;
const acceptAllButton=`<button class="preferences-accept-all st-button st-button--primary"${
acceptAllButtonLabel&&acceptAllButtonLabel!==acceptAllButtonText
? ` aria-label="${acceptAllButtonLabel}"`
: ''
}>${acceptAllButtonText}</button>`;
const rejectNonEssentialButtonText=this.config.text?.banner?.rejectNonEssentialButtonText||'Reject non-essential';
const rejectNonEssentialButtonLabel=this.config.text?.banner?.rejectNonEssentialButtonAccessibleLabel;
const rejectNonEssentialButton=`<button class="preferences-reject-all st-button st-button--primary"${
rejectNonEssentialButtonLabel&&rejectNonEssentialButtonLabel!==rejectNonEssentialButtonText
? ` aria-label="${rejectNonEssentialButtonLabel}"`
: ''
}>${rejectNonEssentialButtonText}</button>`;
const creditLinkText=this.config.text?.preferences?.creditLinkText||'Get this banner for free';
const creditLinkAccessibleLabel=this.config.text?.preferences?.creditLinkAccessibleLabel;
const creditLink=`<a href="https://silktide.com/consent-manager" target="_blank" rel="noreferrer"${
creditLinkAccessibleLabel&&creditLinkAccessibleLabel!==creditLinkText
? ` aria-label="${creditLinkAccessibleLabel}"`
: ''
}>${creditLinkText}</a>`;
const modalContent=`
<header>
<h1>${preferencesTitle}</h1>
${closeModalButton}
</header>
${preferencesDescription}
<section id="cookie-preferences">
${cookieTypes
.map((type)=> {
const accepted=acceptedCookieMap[type.id];
let isChecked=false;
if(accepted){
isChecked=true;
}
if(!accepted&&!this.hasSetInitialCookieChoices()){
isChecked=type.defaultValue;
}
return `
<fieldset>
<legend>${type.name}</legend>
<div class="cookie-type-content">
<div class="cookie-type-description">${type.description}</div>
<label class="switch" for="cookies-${type.id}">
<input type="checkbox" id="cookies-${type.id}" ${
type.required ? 'checked disabled':isChecked ? 'checked':''
} />
<span class="switch__pill" aria-hidden="true"></span>
<span class="switch__dot" aria-hidden="true"></span>
<span class="switch__off" aria-hidden="true">Off</span>
<span class="switch__on" aria-hidden="true">On</span>
</label>
</div>
</fieldset>
`;
})
.join('')}
</section>
<footer>
${acceptAllButton}
${rejectNonEssentialButton}
${creditLink}
</footer>
`;
return modalContent;
}
createModal(){
this.modal=this.createWrapperChild(this.getModalContent(), 'silktide-modal');
}
toggleModal(show){
if(!this.modal) return;
this.modal.style.display=show ? 'flex':'none';
if(show){
this.showBackdrop();
this.hideCookieIcon();
this.removeBanner();
this.preventBodyScroll();
const modalCloseButton=this.modal.querySelector('.modal-close');
modalCloseButton.focus();
if(typeof this.config.onPreferencesOpen==='function'){
this.config.onPreferencesOpen();
}
this.updateCheckboxState(false);
}else{
this.setInitialCookieChoiceMade();
this.updateCheckboxState(true);
this.hideBackdrop();
this.showCookieIcon();
this.allowBodyScroll();
if(typeof this.config.onPreferencesClose==='function'){
this.config.onPreferencesClose();
}}
}
getCookieIconContent(){
return `
<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.1172 1.15625C19.0547 0.734374 18.7344 0.390624 18.3125 0.328124C16.5859 0.0859365 14.8281 0.398437 13.2813 1.21875L7.5 4.30469C5.96094 5.125 4.71875 6.41406 3.95313 7.98437L1.08594 13.8906C0.320314 15.4609 0.0703136 17.2422 0.375001 18.9609L1.50781 25.4297C1.8125 27.1562 2.64844 28.7344 3.90625 29.9531L8.61719 34.5156C9.875 35.7344 11.4766 36.5156 13.2031 36.7578L19.6875 37.6719C21.4141 37.9141 23.1719 37.6016 24.7188 36.7812L30.5 33.6953C32.0391 32.875 33.2813 31.5859 34.0469 30.0078L36.9141 24.1094C37.6797 22.5391 37.9297 20.7578 37.625 19.0391C37.5547 18.625 37.2109 18.3125 36.7969 18.25C32.7734 17.6094 29.5469 14.5703 28.6328 10.6406C28.4922 10.0469 28.0078 9.59375 27.4063 9.5C23.1406 8.82031 19.7734 5.4375 19.1094 1.15625H19.1172ZM15.25 10.25C15.913 10.25 16.5489 10.5134 17.0178 10.9822C17.4866 11.4511 17.75 12.087 17.75 12.75C17.75 13.413 17.4866 14.0489 17.0178 14.5178C16.5489 14.9866 15.913 15.25 15.25 15.25C14.587 15.25 13.9511 14.9866 13.4822 14.5178C13.0134 14.0489 12.75 13.413 12.75 12.75C12.75 12.087 13.0134 11.4511 13.4822 10.9822C13.9511 10.5134 14.587 10.25 15.25 10.25ZM10.25 25.25C10.25 24.587 10.5134 23.9511 10.9822 23.4822C11.4511 23.0134 12.087 22.75 12.75 22.75C13.413 22.75 14.0489 23.0134 14.5178 23.4822C14.9866 23.9511 15.25 24.587 15.25 25.25C15.25 25.913 14.9866 26.5489 14.5178 27.0178C14.0489 27.4866 13.413 27.75 12.75 27.75C12.087 27.75 11.4511 27.4866 10.9822 27.0178C10.5134 26.5489 10.25 25.913 10.25 25.25ZM27.75 20.25C28.413 20.25 29.0489 20.5134 29.5178 20.9822C29.9866 21.4511 30.25 22.087 30.25 22.75C30.25 23.413 29.9866 24.0489 29.5178 24.5178C29.0489 24.9866 28.413 25.25 27.75 25.25C27.087 25.25 26.4511 24.9866 25.9822 24.5178C25.5134 24.0489 25.25 23.413 25.25 22.75C25.25 22.087 25.5134 21.4511 25.9822 20.9822C26.4511 20.5134 27.087 20.25 27.75 20.25Z" />
</svg>
`;
}
createCookieIcon(){
this.cookieIcon=document.createElement('button');
this.cookieIcon.id='silktide-cookie-icon';
this.cookieIcon.title='Manage your cookie preferences for this site';
this.cookieIcon.innerHTML=this.getCookieIconContent();
if(this.config.text?.banner?.preferencesButtonAccessibleLabel){
this.cookieIcon.ariaLabel=this.config.text?.banner?.preferencesButtonAccessibleLabel;
}
if(!this.wrapper||!document.body.contains(this.wrapper)){
this.createWrapper();
}
this.wrapper.appendChild(this.cookieIcon);
if(this.cookieIcon&&this.config.cookieIcon?.position){
this.cookieIcon.classList.add(this.config.cookieIcon.position);
}
if(this.cookieIcon&&this.config.cookieIcon?.colorScheme){
this.cookieIcon.classList.add(this.config.cookieIcon.colorScheme);
}}
showCookieIcon(){
if(this.cookieIcon){
this.cookieIcon.style.display='flex';
}}
hideCookieIcon(){
if(this.cookieIcon){
this.cookieIcon.style.display='none';
}}
handleClosedWithNoChoice(){
this.config.cookieTypes.forEach((type)=> {
let accepted=true;
if(type.required==true||type.defaultValue){
localStorage.setItem(`silktideCookieChoice_${type.id}${this.getBannerSuffix()}`,
accepted.toString(),
);
}else{
accepted=false;
localStorage.setItem(`silktideCookieChoice_${type.id}${this.getBannerSuffix()}`,
accepted.toString(),
);
}
if(accepted){
if(typeof type.onAccept==='function'){ type.onAccept(); }}else{
if(typeof type.onReject==='function'){ type.onReject(); }}
this.setInitialCookieChoiceMade();
this.updateCheckboxState();
});
}
getFocusableElements(element){
return element.querySelectorAll('button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"])',
);
}
setupEventListeners(){
if(this.banner){
const acceptButton=this.banner.querySelector('.accept-all');
const rejectButton=this.banner.querySelector('.reject-all');
const preferencesButton=this.banner.querySelector('.preferences');
acceptButton?.addEventListener('click', ()=> this.handleCookieChoice(true));
rejectButton?.addEventListener('click', ()=> this.handleCookieChoice(false));
preferencesButton?.addEventListener('click', ()=> {
this.showBackdrop();
this.toggleModal(true);
});
const focusableElements=this.getFocusableElements(this.banner);
const firstFocusableEl=focusableElements[0];
const lastFocusableEl=focusableElements[focusableElements.length - 1];
this.banner.addEventListener('keydown', (e)=> {
if(e.key==='Tab'){
if(e.shiftKey){
if(document.activeElement===firstFocusableEl){
lastFocusableEl.focus();
e.preventDefault();
}}else{
if(document.activeElement===lastFocusableEl){
firstFocusableEl.focus();
e.preventDefault();
}}
}});
if(this.config.mode!=='wizard'){
acceptButton?.focus();
}}
if(this.modal){
const closeButton=this.modal.querySelector('.modal-close');
const acceptAllButton=this.modal.querySelector('.preferences-accept-all');
const rejectAllButton=this.modal.querySelector('.preferences-reject-all');
closeButton?.addEventListener('click', ()=> {
this.toggleModal(false);
const hasMadeFirstChoice=this.hasSetInitialCookieChoices();
if(hasMadeFirstChoice){
this.runStoredCookiePreferenceCallbacks();
}else{
this.handleClosedWithNoChoice();
}});
acceptAllButton?.addEventListener('click', ()=> this.handleCookieChoice(true));
rejectAllButton?.addEventListener('click', ()=> this.handleCookieChoice(false));
const focusableElements=this.getFocusableElements(this.modal);
const firstFocusableEl=focusableElements[0];
const lastFocusableEl=focusableElements[focusableElements.length - 1];
this.modal.addEventListener('keydown', (e)=> {
if(e.key==='Tab'){
if(e.shiftKey){
if(document.activeElement===firstFocusableEl){
lastFocusableEl.focus();
e.preventDefault();
}}else{
if(document.activeElement===lastFocusableEl){
firstFocusableEl.focus();
e.preventDefault();
}}
}
if(e.key==='Escape'){
this.toggleModal(false);
}});
closeButton?.focus();
const preferencesSection=this.modal.querySelector('#cookie-preferences');
const checkboxes=preferencesSection.querySelectorAll('input[type="checkbox"]');
checkboxes.forEach(checkbox=> {
checkbox.addEventListener('change', (event)=> {
const [, cookieId]=event.target.id.split('cookies-');
const isAccepted=event.target.checked;
const previousValue=localStorage.getItem(`silktideCookieChoice_${cookieId}${this.getBannerSuffix()}`
)==='true';
if(isAccepted!==previousValue){
const cookieType=this.config.cookieTypes.find(type=> type.id===cookieId);
if(cookieType){
localStorage.setItem(`silktideCookieChoice_${cookieId}${this.getBannerSuffix()}`,
isAccepted.toString()
);
if(isAccepted&&typeof cookieType.onAccept==='function'){
cookieType.onAccept();
}else if(!isAccepted&&typeof cookieType.onReject==='function'){
cookieType.onReject();
}}
}});
});
}
if(this.cookieIcon){
this.cookieIcon.addEventListener('click', ()=> {
if(!this.modal){
this.createModal();
this.toggleModal(true);
this.hideCookieIcon();
}
else if(this.modal.style.display==='none'||this.modal.style.display===''){
this.toggleModal(true);
this.hideCookieIcon();
}else{
this.toggleModal(false);
}});
}}
getBannerSuffix(){
if(this.config.bannerSuffix){
return '_' + this.config.bannerSuffix;
}
return '';
}
preventBodyScroll(){
document.body.style.overflow='hidden';
document.body.style.position='fixed';
document.body.style.width='100%';
}
allowBodyScroll(){
document.body.style.overflow='';
document.body.style.position='';
document.body.style.width='';
}}
(function (){
window.silktideCookieBannerManager={};
let config={};
let cookieBanner;
function updateCookieBannerConfig(userConfig={}){
config={...config, ...userConfig};
if(cookieBanner){
cookieBanner.destroyCookieBanner();
cookieBanner=null;
}
if(document.body){
initCookieBanner();
}else{
document.addEventListener('DOMContentLoaded', initCookieBanner, {once: true});
}}
function initCookieBanner(){
if(!cookieBanner){
cookieBanner=new SilktideCookieBanner(config);
}}
function injectScript(url, loadOption){
const existingScript=document.querySelector(`script[src="${url}"]`);
if(existingScript){
return;
}
const script=document.createElement('script');
script.src=url;
if(loadOption==='async'){
script.async=true;
}else if(loadOption==='defer'){
script.defer=true;
}
document.head.appendChild(script);
}
window.silktideCookieBannerManager.initCookieBanner=initCookieBanner;
window.silktideCookieBannerManager.updateCookieBannerConfig=updateCookieBannerConfig;
window.silktideCookieBannerManager.injectScript=injectScript;
if(document.readyState==='loading'){
document.addEventListener('DOMContentLoaded', initCookieBanner, {once: true});
}else{
initCookieBanner();
}})();