@antistatique/leckerli 1.2.4 → 1.2.5

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.
package/CHANGELOG.md CHANGED
@@ -6,14 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.2.5] - 2025-08-29
10
+ ### Added
11
+ - Support GTM consent v2 (thanks to @francoisbruneau).
12
+ - Doc for customiseDescription string.
13
+
14
+ ### Fixed
15
+ - Use expires setting value to set cookie (#8).
16
+ - Fix issue on reduce config in GTM javascript environment (#19).
17
+
9
18
  ## [1.2.4] - 2023-11-30
10
19
  ### Added
11
20
  - Add new optional description for the Settings panel
12
21
 
13
22
  ## [1.2.3] - 2023-10-11
14
- - Add documentation for i18n (first approach)
15
-
16
23
  ### Added
24
+ - Add documentation for i18n (first approach)
17
25
  - Add classes to override default settings banner style
18
26
 
19
27
  ## [1.2.1] - 2023-09-25
@@ -79,7 +87,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
79
87
  ### Added
80
88
  - First POC
81
89
 
82
- [Unreleased]: https://github.com/antistatique/leckerli/compare/v1.2.4...HEAD
90
+ [Unreleased]: https://github.com/antistatique/leckerli/compare/v1.2.5...HEAD
91
+ [1.2.5]: https://github.com/antistatique/leckerli/compare/v1.2.4...v1.2.5
83
92
  [1.2.4]: https://github.com/antistatique/leckerli/compare/v1.2.3...v1.2.4
84
93
  [1.2.3]: https://github.com/antistatique/leckerli/compare/v1.2.1...v1.2.3
85
94
  [1.2.1]: https://github.com/antistatique/leckerli/compare/v1.2.0...v1.2.1
package/README.md CHANGED
@@ -62,7 +62,7 @@ It's the `domain` of your cookie, by default the current website (`window.locati
62
62
 
63
63
  ### expires
64
64
 
65
- It's the `expires` of your cookie, by default it is set for a month from the current day. It should be either a Date or a number.
65
+ It's the `expires` of your cookie, by default it is set for 92 days (3 months) from the current day. It should be a number of days.
66
66
 
67
67
  ### banner
68
68
 
@@ -170,6 +170,7 @@ You could have something like:
170
170
  accept: 'Accepter tout',
171
171
  reject: 'Tout rejeter',
172
172
  customise: 'Personnaliser',
173
+ customiseDescription: 'Vous pouvez ajuster vos préférences en acceptant ou refusant chaque catégorie de cookies utilisée sur ce site.',
173
174
  save: 'Sauvegarder',
174
175
  settings: [
175
176
  {
@@ -1 +1 @@
1
- !function(){"use strict";if(window.leckerliSettings.enableGtmAutoLoad){const e=document.createElement("link");e.rel="stylesheet",e.href="//www.unpkg.com/@antistatique/leckerli@1.2.4/dist/assets/leckerli.min.css",document.head.appendChild(e)}if(window.leckerliSettings.enableGtmAutoLoad){const e=document.createElement("script");e.src="//www.unpkg.com/@antistatique/leckerli@1.2.4/dist/assets/leckerli.min.js",document.body.appendChild(e)}document.addEventListener("leckerli:permissions-updated",(e=>{window.leckerliGTMUpdate(e.detail.cookie)}))}();
1
+ !function(){"use strict";if(window.leckerliSettings.enableGtmAutoLoad){const e=document.createElement("link");e.rel="stylesheet",e.href="//www.unpkg.com/@antistatique/leckerli@1.2.5/dist/assets/leckerli.min.css",document.head.appendChild(e)}if(window.leckerliSettings.enableGtmAutoLoad){const e=document.createElement("script");e.src="//www.unpkg.com/@antistatique/leckerli@1.2.5/dist/assets/leckerli.min.js",document.body.appendChild(e)}document.addEventListener("leckerli:permissions-updated",(e=>{window.leckerliGTMUpdate(e.detail.cookie)}))}();
@@ -7,4 +7,4 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var bn="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},En=gn.useSyncExternalStore,kn=vn.useRef,Sn=vn.useEffect,Tn=vn.useMemo,xn=vn.useDebugValue;an.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=kn(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Tn((function(){function e(e){if(!c){if(c=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return l=t}return l=e}if(t=l,bn(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,l=n)}var i,l,c=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,o]);var l=En(e,i[0],i[1]);return Sn((function(){a.hasValue=!0,a.value=l}),[l]),xn(l),l},on.exports=an;var An=nn(on.exports);const{useSyncExternalStoreWithSelector:Nn}=An;let wn=!1;const Cn=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?(e=>e?Je(e):Je)(e):e,n=(e,n)=>function(e,t=e.getState,n){n&&!wn&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),wn=!0);const r=Nn(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return fe(r),r}(t,e,n);return Object.assign(n,t),n},On=Ze({name:"leckerli",banner:{title:"This website uses cookies.",description:'We use cookies to improve your browsing experience, deliver personalised advertising or content and analyse our traffic. By clicking on "Accept all", you consent to our use of cookies.',accept:"Accept all",reject:"Deny",customise:"Customize",customiseDescription:"",save:"Save",settings:[{slug:"analytics_storage",title:"Statistics",description:"Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously."},{slug:"ad_storage",title:"Marketing",description:"Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers."}]},permissions:["analytics_storage","ad_storage"],baseData:{},cookie:{},choiceMade:!1,settingsOpen:!1,domain:window.location.hostname,enableGtmAutoLoad:!1},window.leckerliSettings??{}),Rn=new Date;Rn.setMonth(Rn.getMonth()+1);const Dn={sameSite:"strict",domain:On.domain,expires:Rn},Ln=Ee.get(On.name);On.cookie=$e(Ln)?JSON.parse(Ln):On.permissions.reduce(((e,t)=>({...e,[t]:!1})),On.baseData),On.choiceMade=$e(Ln);const In=(Mn=(e,t)=>({...On,init:()=>{const e=t();Be(Ln)&&e.choiceMade&&Ee.set(e.name,JSON.stringify(e.cookie),Dn),document.dispatchEvent(new CustomEvent("leckerli:initialised",{detail:{cookie:e.choiceMade?e.cookie:null}})),document.addEventListener("leckerli:open-banner",(()=>t().setChoice(!1))),document.addEventListener("leckerli:close-banner",(()=>t().setChoice(!0))),document.addEventListener("leckerli:open-modal",(()=>t().setModal(!0))),document.addEventListener("leckerli:close-modal",(()=>t().setModal(!1)))},propagate(e){const n=t();Ee.set(n.name,JSON.stringify(e),Dn),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated",{detail:{cookie:e}}))},setChoice:t=>e((e=>({...e,choiceMade:t}))),setModal:t=>e((e=>(document.dispatchEvent(new CustomEvent("leckerli:modal-"+(t?"opened":"closed"))),{...e,settingsOpen:t}))),setPermissions:t=>e((e=>{const n=e.permissions.reduce(((e,n)=>({...e,[n]:t[n]??!1})),e.baseData);return e.propagate(n),{...e,choiceMade:!0,cookie:n}})),togglePermission:t=>e((e=>{const n=e.permissions.reduce(((n,r)=>(n[r]=t===r?!$e(e.cookie[r])||!e.cookie[r]:e.cookie[r]??!1,n)),e.baseData);return e.propagate(n),{...e,choiceMade:!0,cookie:n}})),acceptAll:()=>{t().setPermissions(t().permissions.reduce(((e,t)=>({...e,[t]:!0})),{}))},rejectAll:()=>{t().setPermissions(t().permissions.reduce(((e,t)=>({...e,[t]:!1})),{}))}}))?Cn(Mn):Cn;/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */var Mn;const{entries:Pn,setPrototypeOf:Un,isFrozen:Hn,getPrototypeOf:jn,getOwnPropertyDescriptor:Fn}=Object;let{freeze:zn,seal:Wn,create:Bn}=Object,{apply:Vn,construct:Gn}="undefined"!=typeof Reflect&&Reflect;Vn||(Vn=function(e,t,n){return e.apply(t,n)}),zn||(zn=function(e){return e}),Wn||(Wn=function(e){return e}),Gn||(Gn=function(e,t){return new e(...t)});const qn=or(Array.prototype.forEach),Yn=or(Array.prototype.pop),$n=or(Array.prototype.push),Xn=or(String.prototype.toLowerCase),Kn=or(String.prototype.toString),Zn=or(String.prototype.match),Jn=or(String.prototype.replace),Qn=or(String.prototype.indexOf),er=or(String.prototype.trim),tr=or(RegExp.prototype.test),nr=(rr=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gn(rr,t)});var rr;function or(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Vn(e,t,r)}}function ir(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:Xn,Un&&Un(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"==typeof r){const e=n(r);e!==r&&(Hn(t)||(t[o]=e),r=e)}e[r]=!0}return e}function ar(e){const t=Bn(null);for(const[n,r]of Pn(e))t[n]=r;return t}function lr(e,t){for(;null!==e;){const n=Fn(e,t);if(n){if(n.get)return or(n.get);if("function"==typeof n.value)return or(n.value)}e=jn(e)}return function(e){return console.warn("fallback value for",e),null}}const cr=zn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ur=zn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),sr=zn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fr=zn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_r=zn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),pr=zn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dr=zn(["#text"]),mr=zn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),hr=zn(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yr=zn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),vr=zn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),gr=Wn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),br=Wn(/<%[\w\W]*|[\w\W]*%>/gm),Er=Wn(/\${[\w\W]*}/gm),kr=Wn(/^data-[\-\w.\u00B7-\uFFFF]/),Sr=Wn(/^aria-[\-\w]+$/),Tr=Wn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xr=Wn(/^(?:\w+script|data):/i),Ar=Wn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Nr=Wn(/^html$/i);var wr=Object.freeze({__proto__:null,MUSTACHE_EXPR:gr,ERB_EXPR:br,TMPLIT_EXPR:Er,DATA_ATTR:kr,ARIA_ATTR:Sr,IS_ALLOWED_URI:Tr,IS_SCRIPT_OR_DATA:xr,ATTR_WHITESPACE:Ar,DOCTYPE_NAME:Nr});const Cr=()=>"undefined"==typeof window?null:window;var Or=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Cr();const n=t=>e(t);if(n.version="3.0.5",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;const r=t.document,o=r.currentScript;let{document:i}=t;const{DocumentFragment:a,HTMLTemplateElement:l,Node:c,Element:u,NodeFilter:s,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:_,DOMParser:p,trustedTypes:d}=t,m=u.prototype,h=lr(m,"cloneNode"),y=lr(m,"nextSibling"),v=lr(m,"childNodes"),g=lr(m,"parentNode");if("function"==typeof l){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let b,E="";const{implementation:k,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:x}=i,{importNode:A}=r;let N={};n.isSupported="function"==typeof Pn&&"function"==typeof g&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:w,ERB_EXPR:C,TMPLIT_EXPR:O,DATA_ATTR:R,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:I}=wr;let{IS_ALLOWED_URI:M}=wr,P=null;const U=ir({},[...cr,...ur,...sr,..._r,...dr]);let H=null;const j=ir({},[...mr,...hr,...yr,...vr]);let F=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,W=null,B=!0,V=!0,G=!1,q=!0,Y=!1,$=!1,X=!1,K=!1,Z=!1,J=!1,Q=!1,ee=!0,te=!1,ne=!0,re=!1,oe={},ie=null;const ae=ir({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let le=null;const ce=ir({},["audio","video","img","source","image","track"]);let ue=null;const se=ir({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",_e="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let de=pe,me=!1,he=null;const ye=ir({},[fe,_e,pe],Kn);let ve;const ge=["application/xhtml+xml","text/html"];let be,Ee=null;const ke=i.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},Te=function(e){if(!Ee||Ee!==e){if(e&&"object"==typeof e||(e={}),e=ar(e),ve=ve=-1===ge.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,be="application/xhtml+xml"===ve?Kn:Xn,P="ALLOWED_TAGS"in e?ir({},e.ALLOWED_TAGS,be):U,H="ALLOWED_ATTR"in e?ir({},e.ALLOWED_ATTR,be):j,he="ALLOWED_NAMESPACES"in e?ir({},e.ALLOWED_NAMESPACES,Kn):ye,ue="ADD_URI_SAFE_ATTR"in e?ir(ar(se),e.ADD_URI_SAFE_ATTR,be):se,le="ADD_DATA_URI_TAGS"in e?ir(ar(ce),e.ADD_DATA_URI_TAGS,be):ce,ie="FORBID_CONTENTS"in e?ir({},e.FORBID_CONTENTS,be):ae,z="FORBID_TAGS"in e?ir({},e.FORBID_TAGS,be):{},W="FORBID_ATTR"in e?ir({},e.FORBID_ATTR,be):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,B=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,$=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,Q=e.RETURN_TRUSTED_TYPE||!1,K=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,ne=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,M=e.ALLOWED_URI_REGEXP||Tr,de=e.NAMESPACE||pe,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(V=!1),J&&(Z=!0),oe&&(P=ir({},[...dr]),H=[],!0===oe.html&&(ir(P,cr),ir(H,mr)),!0===oe.svg&&(ir(P,ur),ir(H,hr),ir(H,vr)),!0===oe.svgFilters&&(ir(P,sr),ir(H,hr),ir(H,vr)),!0===oe.mathMl&&(ir(P,_r),ir(H,yr),ir(H,vr))),e.ADD_TAGS&&(P===U&&(P=ar(P)),ir(P,e.ADD_TAGS,be)),e.ADD_ATTR&&(H===j&&(H=ar(H)),ir(H,e.ADD_ATTR,be)),e.ADD_URI_SAFE_ATTR&&ir(ue,e.ADD_URI_SAFE_ATTR,be),e.FORBID_CONTENTS&&(ie===ae&&(ie=ar(ie)),ir(ie,e.FORBID_CONTENTS,be)),ne&&(P["#text"]=!0),$&&ir(P,["html","head","body"]),P.table&&(ir(P,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw nr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw nr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=e.TRUSTED_TYPES_POLICY,E=b.createHTML("")}else void 0===b&&(b=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(d,o)),null!==b&&"string"==typeof E&&(E=b.createHTML(""));zn&&zn(e),Ee=e}},xe=ir({},["mi","mo","mn","ms","mtext"]),Ae=ir({},["foreignobject","desc","title","annotation-xml"]),Ne=ir({},["title","style","font","a","script"]),we=ir({},ur);ir(we,sr),ir(we,fr);const Ce=ir({},_r);ir(Ce,pr);const Oe=function(e){$n(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Re=function(e,t){try{$n(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){$n(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!H[e])if(Z||J)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t,n;if(K)e="<remove></remove>"+e;else{const t=Zn(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ve&&de===pe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=b?b.createHTML(e):e;if(de===pe)try{t=(new p).parseFromString(r,ve)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(de,"template",null);try{t.documentElement.innerHTML=me?E:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),de===pe?x.call(t,$?"html":"body")[0]:$?t.documentElement:o},Le=function(e){return S.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},Ie=function(e){return"object"==typeof c?e instanceof c:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Me=function(e,t,r){N[e]&&qn(N[e],(e=>{e.call(n,t,r,Ee)}))},Pe=function(e){let t;if(Me("beforeSanitizeElements",e,null),(r=e)instanceof _&&("string"!=typeof r.nodeName||"string"!=typeof r.textContent||"function"!=typeof r.removeChild||!(r.attributes instanceof f)||"function"!=typeof r.removeAttribute||"function"!=typeof r.setAttribute||"string"!=typeof r.namespaceURI||"function"!=typeof r.insertBefore||"function"!=typeof r.hasChildNodes))return Oe(e),!0;var r;const o=be(e.nodeName);if(Me("uponSanitizeElement",e,{tagName:o,allowedTags:P}),e.hasChildNodes()&&!Ie(e.firstElementChild)&&(!Ie(e.content)||!Ie(e.content.firstElementChild))&&tr(/<[/\w]/g,e.innerHTML)&&tr(/<[/\w]/g,e.textContent))return Oe(e),!0;if(!P[o]||z[o]){if(!z[o]&&He(o)){if(F.tagNameCheck instanceof RegExp&&tr(F.tagNameCheck,o))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(o))return!1}if(ne&&!ie[o]){const t=g(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r)t.insertBefore(h(n[r],!0),y(e))}}return Oe(e),!0}return e instanceof u&&!function(e){let t=g(e);t&&t.tagName||(t={namespaceURI:de,tagName:"template"});const n=Xn(e.tagName),r=Xn(t.tagName);return!!he[e.namespaceURI]&&(e.namespaceURI===_e?t.namespaceURI===pe?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===r||xe[r]):Boolean(we[n]):e.namespaceURI===fe?t.namespaceURI===pe?"math"===n:t.namespaceURI===_e?"math"===n&&Ae[r]:Boolean(Ce[n]):e.namespaceURI===pe?!(t.namespaceURI===_e&&!Ae[r])&&!(t.namespaceURI===fe&&!xe[r])&&!Ce[n]&&(Ne[n]||!we[n]):!("application/xhtml+xml"!==ve||!he[e.namespaceURI]))}(e)?(Oe(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!tr(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,t=Jn(t,w," "),t=Jn(t,C," "),t=Jn(t,O," "),e.textContent!==t&&($n(n.removed,{element:e.cloneNode()}),e.textContent=t)),Me("afterSanitizeElements",e,null),!1):(Oe(e),!0)},Ue=function(e,t,n){if(ee&&("id"===t||"name"===t)&&(n in i||n in ke))return!1;if(V&&!W[t]&&tr(R,t));else if(B&&tr(D,t));else if(!H[t]||W[t]){if(!(He(e)&&(F.tagNameCheck instanceof RegExp&&tr(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&tr(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&tr(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n))))return!1}else if(ue[t]);else if(tr(M,Jn(n,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Qn(n,"data:")||!le[e]){if(G&&!tr(L,Jn(n,I,"")));else if(n)return!1}else;return!0},He=function(e){return e.indexOf("-")>0},je=function(e){let t,r,o,i;Me("beforeSanitizeAttributes",e,null);const{attributes:a}=e;if(!a)return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H};for(i=a.length;i--;){t=a[i];const{name:c,namespaceURI:u}=t;if(r="value"===c?t.value:er(t.value),o=be(c),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,Me("uponSanitizeAttribute",e,l),r=l.attrValue,l.forceKeepAttr)continue;if(Re(c,e),!l.keepAttr)continue;if(!q&&tr(/\/>/i,r)){Re(c,e);continue}Y&&(r=Jn(r,w," "),r=Jn(r,C," "),r=Jn(r,O," "));const s=be(e.nodeName);if(Ue(s,o,r)){if(!te||"id"!==o&&"name"!==o||(Re(c,e),r="user-content-"+r),b&&"object"==typeof d&&"function"==typeof d.getAttributeType)if(u);else switch(d.getAttributeType(s,o)){case"TrustedHTML":r=b.createHTML(r);break;case"TrustedScriptURL":r=b.createScriptURL(r)}try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),Yn(n.removed)}catch(e){}}}Me("afterSanitizeAttributes",e,null)},Fe=function e(t){let n;const r=Le(t);for(Me("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Me("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof a&&e(n.content),je(n));Me("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t,o,i,l,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw nr("toString is not a function");if("string"!=typeof(e=e.toString()))throw nr("dirty is not a string, aborting")}if(!n.isSupported)return e;if(X||Te(u),n.removed=[],"string"==typeof e&&(re=!1),re){if(e.nodeName){const t=be(e.nodeName);if(!P[t]||z[t])throw nr("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)t=De("\x3c!----\x3e"),o=t.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?t=o:t.appendChild(o);else{if(!Z&&!Y&&!$&&-1===e.indexOf("<"))return b&&Q?b.createHTML(e):e;if(t=De(e),!t)return Z?null:Q?E:""}t&&K&&Oe(t.firstChild);const s=Le(re?e:t);for(;i=s.nextNode();)Pe(i)||(i.content instanceof a&&Fe(i.content),je(i));if(re)return e;if(Z){if(J)for(l=T.call(t.ownerDocument);t.firstChild;)l.appendChild(t.firstChild);else l=t;return(H.shadowroot||H.shadowrootmode)&&(l=A.call(r,l,!0)),l}let f=$?t.outerHTML:t.innerHTML;return $&&P["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&tr(Nr,t.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+t.ownerDocument.doctype.name+">\n"+f),Y&&(f=Jn(f,w," "),f=Jn(f,C," "),f=Jn(f,O," ")),b&&Q?b.createHTML(f):f},n.setConfig=function(e){Te(e),X=!0},n.clearConfig=function(){Ee=null,X=!1},n.isValidAttribute=function(e,t,n){Ee||Te({});const r=be(e),o=be(t);return Ue(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(N[e]=N[e]||[],$n(N[e],t))},n.removeHook=function(e){if(N[e])return Yn(N[e])},n.removeHooks=function(e){N[e]&&(N[e]=[])},n.removeAllHooks=function(){N={}},n}();const Rr=()=>{const{banner:e,acceptAll:t,rejectAll:n,setModal:r}=In();return W("div",{className:"fixed bottom-0 left-0 max-w-md px-5 py-4 m-2 shadow-md shadow-black/25 z-[9998] bg-background space-y-4 font-primary text-foreground rounded-md banner-wrapper",children:[e.title&&W("h3",{className:"m-0 text-lg font-semibold font-primary md:text-xl banner-title",children:e.title}),e.description&&W("p",{className:"m-0 text-sm leading-snug font-primary md:text-base banner-description",dangerouslySetInnerHTML:{__html:Or.sanitize(e.description,{USE_PROFILES:{html:!0},ALLOWED_TAGS:["b","i","em","strong","p","ul","li","ol","span","h2","h3","h4","h5","h6","a","div"],ALLOWED_ATTR:["href","target"]})}}),W("div",{className:"pt-2 space-y-2 banner-btns",children:[!qe(e.settings)&&W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors banner-btn-customise",onClick:()=>r(!0),children:e.customise}),W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors banner-btn-reject",onClick:n,children:e.reject}),W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-primary font-primary text-background md:px-3.5 py-1.5 md:py-2.5 border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors banner-btn-accept",onClick:t,children:e.accept})]})]})},Dr=()=>{const{cookie:e,setPermissions:t,banner:n,setModal:r}=In(),[o,i]=ne(e);return W("div",{className:"fixed bottom-0 left-0 w-full max-w-lg max-h-full px-5 py-4 m-2 overflow-y-auto text-black shadow-md shadow-black/25 z-[9999] bg-background text-foreground font-primary rounded-md banner-wrapper",children:[W("div",{className:"space-y-6",children:[W("div",{children:[W("h3",{className:"w-10/12 m-0 text-xl font-semibold font-primary md:text-2xl banner-title",children:n.customise}),n.customiseDescription&&W("p",{className:"m-0 mt-2 text-sm leading-snug font-primary md:text-base banner-settings-general-description",dangerouslySetInnerHTML:{__html:Or.sanitize(n.customiseDescription,{USE_PROFILES:{html:!0},ALLOWED_TAGS:["b","i","em","strong","p","ul","li","ol","span","h2","h3","h4","h5","h6","a","div"],ALLOWED_ATTR:["href","target"]})}})]}),n.settings.map((({slug:e,title:t,description:n})=>W("div",{children:[W("div",{className:"flex items-start justify-between",children:[W("h3",{className:"m-0 text-lg font-semibold font-primary banner-settings-title",children:t}),W("button",{type:"button",className:(o[e]?"bg-primary":"bg-gray-200")+" relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5 banner-settings-toggle",role:"switch","aria-checked":"false",onClick:()=>i({...o,[e]:!o[e]}),children:[W("span",{className:"sr-only",children:"Toggle"}),W("span",{"aria-hidden":"true",className:(o[e]?"translate-x-5":"translate-x-0")+" pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out"})]})]}),W("p",{className:"m-0 mt-2 text-sm leading-snug font-primary md:text-base banner-settings-description",children:n})]},`setting-${e}`))),W("div",{className:"pt-4",children:W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-primary font-primary text-background md:px-3.5 py-1.5 md:py-2.5 border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors banner-settings-save",onClick:()=>{t(o),r(!1)},children:n.save})})]}),W("button",{type:"button",className:"absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full banner-settings-close",onClick:()=>r(!1),children:"×"})]})},Lr=document.createElement("div");Lr.id="lkrl-wrapper",document.body.appendChild(Lr),U(W((()=>{const{choiceMade:e,init:t,settingsOpen:n}=In();return oe((()=>{t()}),[]),W(y,{children:[!e&&!n&&W(Rr,{}),n&&W(Dr,{})]})}),{}),Lr)}();
10
+ */var bn="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},En=gn.useSyncExternalStore,kn=vn.useRef,Sn=vn.useEffect,Tn=vn.useMemo,xn=vn.useDebugValue;an.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=kn(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Tn((function(){function e(e){if(!c){if(c=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return l=t}return l=e}if(t=l,bn(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,l=n)}var i,l,c=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,o]);var l=En(e,i[0],i[1]);return Sn((function(){a.hasValue=!0,a.value=l}),[l]),xn(l),l},on.exports=an;var An=nn(on.exports);const{useSyncExternalStoreWithSelector:Nn}=An;let wn=!1;const Cn=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?(e=>e?Je(e):Je)(e):e,n=(e,n)=>function(e,t=e.getState,n){n&&!wn&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),wn=!0);const r=Nn(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return fe(r),r}(t,e,n);return Object.assign(n,t),n},On=Ze({name:"leckerli",expires:92,banner:{title:"This website uses cookies.",description:'We use cookies to improve your browsing experience, deliver personalised advertising or content and analyse our traffic. By clicking on "Accept all", you consent to our use of cookies.',accept:"Accept all",reject:"Deny",customise:"Customize",customiseDescription:"",save:"Save",settings:[{slug:"analytics_storage",title:"Statistics",description:"Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously."},{slug:"ad_storage",title:"Marketing",description:"Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers."}]},permissions:["analytics_storage","ad_storage"],baseData:{},cookie:{},choiceMade:!1,settingsOpen:!1,domain:window.location.hostname,enableGtmAutoLoad:!1},window.leckerliSettings??{}),Rn={sameSite:"strict",domain:On.domain,expires:On.expires},Dn=Ee.get(On.name);On.cookie=$e(Dn)?JSON.parse(Dn):On.permissions.reduce(((e,t)=>({...e,[t]:!1})),On.baseData),On.choiceMade=$e(Dn);const Ln=(In=(e,t)=>({...On,init:()=>{const e=t();Be(Dn)&&e.choiceMade&&Ee.set(e.name,JSON.stringify(e.cookie),Rn),document.dispatchEvent(new CustomEvent("leckerli:initialised",{detail:{cookie:e.choiceMade?e.cookie:null}})),document.addEventListener("leckerli:open-banner",(()=>t().setChoice(!1))),document.addEventListener("leckerli:close-banner",(()=>t().setChoice(!0))),document.addEventListener("leckerli:open-modal",(()=>t().setModal(!0))),document.addEventListener("leckerli:close-modal",(()=>t().setModal(!1)))},propagate(e){const n=t();Ee.set(n.name,JSON.stringify(e),Rn),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated",{detail:{cookie:e}}))},setChoice:t=>e((e=>({...e,choiceMade:t}))),setModal:t=>e((e=>(document.dispatchEvent(new CustomEvent("leckerli:modal-"+(t?"opened":"closed"))),{...e,settingsOpen:t}))),setPermissions:t=>e((e=>{const n=e.permissions.reduce(((e,n)=>({...e,[n]:t[n]??!1})),e.baseData);return e.propagate(n),{...e,choiceMade:!0,cookie:n}})),togglePermission:t=>e((e=>{const n=e.permissions.reduce(((n,r)=>(n[r]=t===r?!$e(e.cookie[r])||!e.cookie[r]:e.cookie[r]??!1,n)),e.baseData);return e.propagate(n),{...e,choiceMade:!0,cookie:n}})),acceptAll:()=>{t().setPermissions(t().permissions.reduce(((e,t)=>({...e,[t]:!0})),{}))},rejectAll:()=>{t().setPermissions(t().permissions.reduce(((e,t)=>({...e,[t]:!1})),{}))}}))?Cn(In):Cn;/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */var In;const{entries:Mn,setPrototypeOf:Pn,isFrozen:Un,getPrototypeOf:Hn,getOwnPropertyDescriptor:jn}=Object;let{freeze:Fn,seal:zn,create:Wn}=Object,{apply:Bn,construct:Vn}="undefined"!=typeof Reflect&&Reflect;Bn||(Bn=function(e,t,n){return e.apply(t,n)}),Fn||(Fn=function(e){return e}),zn||(zn=function(e){return e}),Vn||(Vn=function(e,t){return new e(...t)});const Gn=rr(Array.prototype.forEach),qn=rr(Array.prototype.pop),Yn=rr(Array.prototype.push),$n=rr(String.prototype.toLowerCase),Xn=rr(String.prototype.toString),Kn=rr(String.prototype.match),Zn=rr(String.prototype.replace),Jn=rr(String.prototype.indexOf),Qn=rr(String.prototype.trim),er=rr(RegExp.prototype.test),tr=(nr=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Vn(nr,t)});var nr;function rr(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Bn(e,t,r)}}function or(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:$n,Pn&&Pn(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"==typeof r){const e=n(r);e!==r&&(Un(t)||(t[o]=e),r=e)}e[r]=!0}return e}function ir(e){const t=Wn(null);for(const[n,r]of Mn(e))t[n]=r;return t}function ar(e,t){for(;null!==e;){const n=jn(e,t);if(n){if(n.get)return rr(n.get);if("function"==typeof n.value)return rr(n.value)}e=Hn(e)}return function(e){return console.warn("fallback value for",e),null}}const lr=Fn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cr=Fn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ur=Fn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sr=Fn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fr=Fn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_r=Fn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pr=Fn(["#text"]),dr=Fn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),mr=Fn(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hr=Fn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yr=Fn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vr=zn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),gr=zn(/<%[\w\W]*|[\w\W]*%>/gm),br=zn(/\${[\w\W]*}/gm),Er=zn(/^data-[\-\w.\u00B7-\uFFFF]/),kr=zn(/^aria-[\-\w]+$/),Sr=zn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Tr=zn(/^(?:\w+script|data):/i),xr=zn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ar=zn(/^html$/i);var Nr=Object.freeze({__proto__:null,MUSTACHE_EXPR:vr,ERB_EXPR:gr,TMPLIT_EXPR:br,DATA_ATTR:Er,ARIA_ATTR:kr,IS_ALLOWED_URI:Sr,IS_SCRIPT_OR_DATA:Tr,ATTR_WHITESPACE:xr,DOCTYPE_NAME:Ar});const wr=()=>"undefined"==typeof window?null:window;var Cr=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wr();const n=t=>e(t);if(n.version="3.0.5",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;const r=t.document,o=r.currentScript;let{document:i}=t;const{DocumentFragment:a,HTMLTemplateElement:l,Node:c,Element:u,NodeFilter:s,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:_,DOMParser:p,trustedTypes:d}=t,m=u.prototype,h=ar(m,"cloneNode"),y=ar(m,"nextSibling"),v=ar(m,"childNodes"),g=ar(m,"parentNode");if("function"==typeof l){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let b,E="";const{implementation:k,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:x}=i,{importNode:A}=r;let N={};n.isSupported="function"==typeof Mn&&"function"==typeof g&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:w,ERB_EXPR:C,TMPLIT_EXPR:O,DATA_ATTR:R,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:I}=Nr;let{IS_ALLOWED_URI:M}=Nr,P=null;const U=or({},[...lr,...cr,...ur,...fr,...pr]);let H=null;const j=or({},[...dr,...mr,...hr,...yr]);let F=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,W=null,B=!0,V=!0,G=!1,q=!0,Y=!1,$=!1,X=!1,K=!1,Z=!1,J=!1,Q=!1,ee=!0,te=!1,ne=!0,re=!1,oe={},ie=null;const ae=or({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let le=null;const ce=or({},["audio","video","img","source","image","track"]);let ue=null;const se=or({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",_e="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let de=pe,me=!1,he=null;const ye=or({},[fe,_e,pe],Xn);let ve;const ge=["application/xhtml+xml","text/html"];let be,Ee=null;const ke=i.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},Te=function(e){if(!Ee||Ee!==e){if(e&&"object"==typeof e||(e={}),e=ir(e),ve=ve=-1===ge.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,be="application/xhtml+xml"===ve?Xn:$n,P="ALLOWED_TAGS"in e?or({},e.ALLOWED_TAGS,be):U,H="ALLOWED_ATTR"in e?or({},e.ALLOWED_ATTR,be):j,he="ALLOWED_NAMESPACES"in e?or({},e.ALLOWED_NAMESPACES,Xn):ye,ue="ADD_URI_SAFE_ATTR"in e?or(ir(se),e.ADD_URI_SAFE_ATTR,be):se,le="ADD_DATA_URI_TAGS"in e?or(ir(ce),e.ADD_DATA_URI_TAGS,be):ce,ie="FORBID_CONTENTS"in e?or({},e.FORBID_CONTENTS,be):ae,z="FORBID_TAGS"in e?or({},e.FORBID_TAGS,be):{},W="FORBID_ATTR"in e?or({},e.FORBID_ATTR,be):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,B=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,$=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,Q=e.RETURN_TRUSTED_TYPE||!1,K=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,ne=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,M=e.ALLOWED_URI_REGEXP||Sr,de=e.NAMESPACE||pe,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(V=!1),J&&(Z=!0),oe&&(P=or({},[...pr]),H=[],!0===oe.html&&(or(P,lr),or(H,dr)),!0===oe.svg&&(or(P,cr),or(H,mr),or(H,yr)),!0===oe.svgFilters&&(or(P,ur),or(H,mr),or(H,yr)),!0===oe.mathMl&&(or(P,fr),or(H,hr),or(H,yr))),e.ADD_TAGS&&(P===U&&(P=ir(P)),or(P,e.ADD_TAGS,be)),e.ADD_ATTR&&(H===j&&(H=ir(H)),or(H,e.ADD_ATTR,be)),e.ADD_URI_SAFE_ATTR&&or(ue,e.ADD_URI_SAFE_ATTR,be),e.FORBID_CONTENTS&&(ie===ae&&(ie=ir(ie)),or(ie,e.FORBID_CONTENTS,be)),ne&&(P["#text"]=!0),$&&or(P,["html","head","body"]),P.table&&(or(P,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw tr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw tr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=e.TRUSTED_TYPES_POLICY,E=b.createHTML("")}else void 0===b&&(b=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(d,o)),null!==b&&"string"==typeof E&&(E=b.createHTML(""));Fn&&Fn(e),Ee=e}},xe=or({},["mi","mo","mn","ms","mtext"]),Ae=or({},["foreignobject","desc","title","annotation-xml"]),Ne=or({},["title","style","font","a","script"]),we=or({},cr);or(we,ur),or(we,sr);const Ce=or({},fr);or(Ce,_r);const Oe=function(e){Yn(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Re=function(e,t){try{Yn(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Yn(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!H[e])if(Z||J)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t,n;if(K)e="<remove></remove>"+e;else{const t=Kn(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ve&&de===pe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=b?b.createHTML(e):e;if(de===pe)try{t=(new p).parseFromString(r,ve)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(de,"template",null);try{t.documentElement.innerHTML=me?E:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),de===pe?x.call(t,$?"html":"body")[0]:$?t.documentElement:o},Le=function(e){return S.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},Ie=function(e){return"object"==typeof c?e instanceof c:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Me=function(e,t,r){N[e]&&Gn(N[e],(e=>{e.call(n,t,r,Ee)}))},Pe=function(e){let t;if(Me("beforeSanitizeElements",e,null),(r=e)instanceof _&&("string"!=typeof r.nodeName||"string"!=typeof r.textContent||"function"!=typeof r.removeChild||!(r.attributes instanceof f)||"function"!=typeof r.removeAttribute||"function"!=typeof r.setAttribute||"string"!=typeof r.namespaceURI||"function"!=typeof r.insertBefore||"function"!=typeof r.hasChildNodes))return Oe(e),!0;var r;const o=be(e.nodeName);if(Me("uponSanitizeElement",e,{tagName:o,allowedTags:P}),e.hasChildNodes()&&!Ie(e.firstElementChild)&&(!Ie(e.content)||!Ie(e.content.firstElementChild))&&er(/<[/\w]/g,e.innerHTML)&&er(/<[/\w]/g,e.textContent))return Oe(e),!0;if(!P[o]||z[o]){if(!z[o]&&He(o)){if(F.tagNameCheck instanceof RegExp&&er(F.tagNameCheck,o))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(o))return!1}if(ne&&!ie[o]){const t=g(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r)t.insertBefore(h(n[r],!0),y(e))}}return Oe(e),!0}return e instanceof u&&!function(e){let t=g(e);t&&t.tagName||(t={namespaceURI:de,tagName:"template"});const n=$n(e.tagName),r=$n(t.tagName);return!!he[e.namespaceURI]&&(e.namespaceURI===_e?t.namespaceURI===pe?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===r||xe[r]):Boolean(we[n]):e.namespaceURI===fe?t.namespaceURI===pe?"math"===n:t.namespaceURI===_e?"math"===n&&Ae[r]:Boolean(Ce[n]):e.namespaceURI===pe?!(t.namespaceURI===_e&&!Ae[r])&&!(t.namespaceURI===fe&&!xe[r])&&!Ce[n]&&(Ne[n]||!we[n]):!("application/xhtml+xml"!==ve||!he[e.namespaceURI]))}(e)?(Oe(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!er(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,t=Zn(t,w," "),t=Zn(t,C," "),t=Zn(t,O," "),e.textContent!==t&&(Yn(n.removed,{element:e.cloneNode()}),e.textContent=t)),Me("afterSanitizeElements",e,null),!1):(Oe(e),!0)},Ue=function(e,t,n){if(ee&&("id"===t||"name"===t)&&(n in i||n in ke))return!1;if(V&&!W[t]&&er(R,t));else if(B&&er(D,t));else if(!H[t]||W[t]){if(!(He(e)&&(F.tagNameCheck instanceof RegExp&&er(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&er(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&er(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n))))return!1}else if(ue[t]);else if(er(M,Zn(n,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Jn(n,"data:")||!le[e]){if(G&&!er(L,Zn(n,I,"")));else if(n)return!1}else;return!0},He=function(e){return e.indexOf("-")>0},je=function(e){let t,r,o,i;Me("beforeSanitizeAttributes",e,null);const{attributes:a}=e;if(!a)return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H};for(i=a.length;i--;){t=a[i];const{name:c,namespaceURI:u}=t;if(r="value"===c?t.value:Qn(t.value),o=be(c),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,Me("uponSanitizeAttribute",e,l),r=l.attrValue,l.forceKeepAttr)continue;if(Re(c,e),!l.keepAttr)continue;if(!q&&er(/\/>/i,r)){Re(c,e);continue}Y&&(r=Zn(r,w," "),r=Zn(r,C," "),r=Zn(r,O," "));const s=be(e.nodeName);if(Ue(s,o,r)){if(!te||"id"!==o&&"name"!==o||(Re(c,e),r="user-content-"+r),b&&"object"==typeof d&&"function"==typeof d.getAttributeType)if(u);else switch(d.getAttributeType(s,o)){case"TrustedHTML":r=b.createHTML(r);break;case"TrustedScriptURL":r=b.createScriptURL(r)}try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),qn(n.removed)}catch(e){}}}Me("afterSanitizeAttributes",e,null)},Fe=function e(t){let n;const r=Le(t);for(Me("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Me("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof a&&e(n.content),je(n));Me("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t,o,i,l,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw tr("toString is not a function");if("string"!=typeof(e=e.toString()))throw tr("dirty is not a string, aborting")}if(!n.isSupported)return e;if(X||Te(u),n.removed=[],"string"==typeof e&&(re=!1),re){if(e.nodeName){const t=be(e.nodeName);if(!P[t]||z[t])throw tr("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)t=De("\x3c!----\x3e"),o=t.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?t=o:t.appendChild(o);else{if(!Z&&!Y&&!$&&-1===e.indexOf("<"))return b&&Q?b.createHTML(e):e;if(t=De(e),!t)return Z?null:Q?E:""}t&&K&&Oe(t.firstChild);const s=Le(re?e:t);for(;i=s.nextNode();)Pe(i)||(i.content instanceof a&&Fe(i.content),je(i));if(re)return e;if(Z){if(J)for(l=T.call(t.ownerDocument);t.firstChild;)l.appendChild(t.firstChild);else l=t;return(H.shadowroot||H.shadowrootmode)&&(l=A.call(r,l,!0)),l}let f=$?t.outerHTML:t.innerHTML;return $&&P["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&er(Ar,t.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+t.ownerDocument.doctype.name+">\n"+f),Y&&(f=Zn(f,w," "),f=Zn(f,C," "),f=Zn(f,O," ")),b&&Q?b.createHTML(f):f},n.setConfig=function(e){Te(e),X=!0},n.clearConfig=function(){Ee=null,X=!1},n.isValidAttribute=function(e,t,n){Ee||Te({});const r=be(e),o=be(t);return Ue(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(N[e]=N[e]||[],Yn(N[e],t))},n.removeHook=function(e){if(N[e])return qn(N[e])},n.removeHooks=function(e){N[e]&&(N[e]=[])},n.removeAllHooks=function(){N={}},n}();const Or=()=>{const{banner:e,acceptAll:t,rejectAll:n,setModal:r}=Ln();return W("div",{className:"fixed bottom-0 left-0 max-w-md px-5 py-4 m-2 shadow-md shadow-black/25 z-[9998] bg-background space-y-4 font-primary text-foreground rounded-md banner-wrapper",children:[e.title&&W("h3",{className:"m-0 text-lg font-semibold font-primary md:text-xl banner-title",children:e.title}),e.description&&W("p",{className:"m-0 text-sm leading-snug font-primary md:text-base banner-description",dangerouslySetInnerHTML:{__html:Cr.sanitize(e.description,{USE_PROFILES:{html:!0},ALLOWED_TAGS:["b","i","em","strong","p","ul","li","ol","span","h2","h3","h4","h5","h6","a","div"],ALLOWED_ATTR:["href","target"]})}}),W("div",{className:"pt-2 space-y-2 banner-btns",children:[!qe(e.settings)&&W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors banner-btn-customise",onClick:()=>r(!0),children:e.customise}),W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-background font-primary text-primary md:px-3.5 py-1.5 md:py-2.5 border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors banner-btn-reject",onClick:n,children:e.reject}),W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-primary font-primary text-background md:px-3.5 py-1.5 md:py-2.5 border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors banner-btn-accept",onClick:t,children:e.accept})]})]})},Rr=()=>{const{cookie:e,setPermissions:t,banner:n,setModal:r}=Ln(),[o,i]=ne(e);return W("div",{className:"fixed bottom-0 left-0 w-full max-w-lg max-h-full px-5 py-4 m-2 overflow-y-auto text-black shadow-md shadow-black/25 z-[9999] bg-background text-foreground font-primary rounded-md banner-wrapper",children:[W("div",{className:"space-y-6",children:[W("div",{children:[W("h3",{className:"w-10/12 m-0 text-xl font-semibold font-primary md:text-2xl banner-title",children:n.customise}),n.customiseDescription&&W("p",{className:"m-0 mt-2 text-sm leading-snug font-primary md:text-base banner-settings-general-description",dangerouslySetInnerHTML:{__html:Cr.sanitize(n.customiseDescription,{USE_PROFILES:{html:!0},ALLOWED_TAGS:["b","i","em","strong","p","ul","li","ol","span","h2","h3","h4","h5","h6","a","div"],ALLOWED_ATTR:["href","target"]})}})]}),n.settings.map((({slug:e,title:t,description:n})=>W("div",{children:[W("div",{className:"flex items-start justify-between",children:[W("h3",{className:"m-0 text-lg font-semibold font-primary banner-settings-title",children:t}),W("button",{type:"button",className:(o[e]?"bg-primary":"bg-gray-200")+" relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 mt-0.5 banner-settings-toggle",role:"switch","aria-checked":"false",onClick:()=>i({...o,[e]:!o[e]}),children:[W("span",{className:"sr-only",children:"Toggle"}),W("span",{"aria-hidden":"true",className:(o[e]?"translate-x-5":"translate-x-0")+" pointer-events-none inline-block h-5 w-5 transform rounded-full bg-background shadow ring-0 transition duration-200 ease-in-out"})]})]}),W("p",{className:"m-0 mt-2 text-sm leading-snug font-primary md:text-base banner-settings-description",children:n})]},`setting-${e}`))),W("div",{className:"pt-4",children:W("button",{type:"button",className:"px-2 mr-2 text-sm font-semibold border-2 border-solid rounded bg-primary font-primary text-background md:px-3.5 py-1.5 md:py-2.5 border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors banner-settings-save",onClick:()=>{t(o),r(!1)},children:n.save})})]}),W("button",{type:"button",className:"absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full banner-settings-close",onClick:()=>r(!1),children:"×"})]})},Dr=document.createElement("div");Dr.id="lkrl-wrapper",document.body.appendChild(Dr),U(W((()=>{const{choiceMade:e,init:t,settingsOpen:n}=Ln();return oe((()=>{t()}),[]),W(y,{children:[!e&&!n&&W(Or,{}),n&&W(Rr,{})]})}),{}),Dr)}();
@@ -29,7 +29,7 @@ Then you can add the tag and configure it.
29
29
  4. Click on the _Tag Configuration_ block and select _Leckerli Cookie Banner_ in the _Custom_ section.
30
30
  5. (Optional) Click on _Tag permissions_ and review them.
31
31
  6. Set the _leckerli settings_ according to the configuration section below and the [Leckerli README](../README.md). The field must be a valid JSON string and can have multiple lines. You should at least remove not required consent from the permissions array.
32
- 7. (Optional) Change the default consent (this is the consent values before the user's consent settings are updated). The default is set to _denied_ for all consents (_ad_storage_, _analytics_storage_, _functionality_storage_, _personalization_storage_, and _security_storage_).
32
+ 7. (Optional) Change the default consent (this is the consent values before the user's consent settings are updated). The default is set to _denied_ for all consents (_ad_storage_, _analytics_storage_, _ad_user_data_, _ad_personalization_, _functionality_storage_, _personalization_storage_, and _security_storage_).
33
33
  8. Click on the _Save_ button and optionally choose another tag name.
34
34
 
35
35
  ### (Optional) Create Leckerli trigger event
@@ -61,6 +61,7 @@ Using the html[lang] attribute, a _Trigger_ and a _Tag_ dedicated for each langu
61
61
  "accept": "Alles akzeptieren",
62
62
  "reject": "Alles ablehnen",
63
63
  "customise": "Anpassen",
64
+ "customiseDescription": "Beim Surfen im Internet werden Daten, meist Cookies, auf Ihrem Gerät gespeichert oder abgerufen. Diese dienen hauptsächlich der Funktionalität der Website und können auch für Statistik, Sicherheit, Überwachung und Marketing genutzt werden. Obwohl sie Sie meist nicht direkt identifizieren, ermöglichen sie ein personalisiertes Erlebnis. Sie können Ihre Cookie-Präferenzen anpassen, aber die Ablehnung bestimmter Cookies kann Ihr Surferlebnis beeinträchtigen.",
64
65
  "save": "Speichern",
65
66
  "settings": [
66
67
  {
@@ -1,6 +1,7 @@
1
1
  const copyFromWindow = require('copyFromWindow');
2
2
  const createQueue = require('createQueue');
3
3
  const getCookieValues = require('getCookieValues');
4
+ const gtagSet = require('gtagSet');
4
5
  const injectScript = require('injectScript');
5
6
  const JSON = require('JSON');
6
7
  const log = require('logToConsole');
@@ -12,6 +13,8 @@ const updateConsentState = require('updateConsentState');
12
13
  const DEFAULT_CONSENT_STATE = {
13
14
  ad_storage: 'denied',
14
15
  analytics_storage: 'denied',
16
+ ad_user_data: 'denied',
17
+ ad_personalization: 'denied',
15
18
  functionality_storage: 'denied',
16
19
  personalization_storage: 'denied',
17
20
  security_storage: 'denied',
@@ -57,18 +60,19 @@ const updateLeckerliConsent = leckerliConsent => {
57
60
  */
58
61
  const main = (data) => {
59
62
  // Set developer ID
60
- // gtagSet('developer_id.<replace_with_your_developer_id>', true);
63
+ gtagSet('developer_id.dM2ExY2', true);
61
64
 
62
65
  // Set default consent state
63
- const defaultConsentState = { wait_for_update: 500 };
66
+ let defaultConsentState = { wait_for_update: 500 };
64
67
  Object.entries(DEFAULT_CONSENT_STATE).forEach((item) => {
65
68
  defaultConsentState[item[0]] = item[1];
66
69
  });
67
70
 
68
71
  if (typeof data.defaultConsent !== 'undefined')
69
72
  {
70
- data.defaultConsent.reduce((hash, item) => {
73
+ defaultConsentState = data.defaultConsent.reduce((hash, item) => {
71
74
  hash[item.consentName] = item.consentState;
75
+ return hash;
72
76
  }, defaultConsentState);
73
77
  }
74
78
 
@@ -25,7 +25,7 @@ ___TEMPLATE_PARAMETERS___
25
25
  "name": "leckerliSettings",
26
26
  "displayName": "Leckerli Settings",
27
27
  "simpleValueType": true,
28
- "defaultValue": "{\"permissions\": [\"ad_storage\", \"analytics_storage\", \"functionality_storage\", \"personalization_storage\", \"security_storage\"] }",
28
+ "defaultValue": "{\"permissions\": [\"ad_storage\", \"analytics_storage\", \"ad_user_data\", \"ad_personalization\", \"functionality_storage\", \"personalization_storage\", \"security_storage\"] }",
29
29
  "lineCount": 8,
30
30
  "help": "JSON format"
31
31
  },
@@ -57,6 +57,14 @@ ___TEMPLATE_PARAMETERS___
57
57
  "value": "analytics_storage",
58
58
  "displayValue": "analytics_storage"
59
59
  },
60
+ {
61
+ "value": "ad_user_data",
62
+ "displayValue": "ad_user_data"
63
+ },
64
+ {
65
+ "value": "ad_personalization",
66
+ "displayValue": "ad_personalization"
67
+ },
60
68
  {
61
69
  "value": "functionality_storage",
62
70
  "displayValue": "functionality_storage"
@@ -97,6 +105,7 @@ ___SANDBOXED_JS_FOR_WEB_TEMPLATE___
97
105
  const copyFromWindow = require('copyFromWindow');
98
106
  const createQueue = require('createQueue');
99
107
  const getCookieValues = require('getCookieValues');
108
+ const gtagSet = require('gtagSet');
100
109
  const injectScript = require('injectScript');
101
110
  const JSON = require('JSON');
102
111
  const log = require('logToConsole');
@@ -108,6 +117,8 @@ const updateConsentState = require('updateConsentState');
108
117
  const DEFAULT_CONSENT_STATE = {
109
118
  ad_storage: 'denied',
110
119
  analytics_storage: 'denied',
120
+ ad_user_data: 'denied',
121
+ ad_personalization: 'denied',
111
122
  functionality_storage: 'denied',
112
123
  personalization_storage: 'denied',
113
124
  security_storage: 'denied',
@@ -153,18 +164,19 @@ const updateLeckerliConsent = leckerliConsent => {
153
164
  */
154
165
  const main = (data) => {
155
166
  // Set developer ID
156
- // gtagSet('developer_id.<replace_with_your_developer_id>', true);
167
+ gtagSet('developer_id.dM2ExY2', true);
157
168
 
158
169
  // Set default consent state
159
- const defaultConsentState = { wait_for_update: 500 };
170
+ let defaultConsentState = { wait_for_update: 500 };
160
171
  Object.entries(DEFAULT_CONSENT_STATE).forEach((item) => {
161
172
  defaultConsentState[item[0]] = item[1];
162
173
  });
163
174
 
164
175
  if (typeof data.defaultConsent !== 'undefined')
165
176
  {
166
- data.defaultConsent.reduce((hash, item) => {
177
+ defaultConsentState = data.defaultConsent.reduce((hash, item) => {
167
178
  hash[item.consentName] = item.consentState;
179
+ return hash;
168
180
  }, defaultConsentState);
169
181
  }
170
182
 
@@ -395,6 +407,68 @@ ___WEB_PERMISSIONS___
395
407
  }
396
408
  ]
397
409
  },
410
+ {
411
+ "type": 3,
412
+ "mapKey": [
413
+ {
414
+ "type": 1,
415
+ "string": "consentType"
416
+ },
417
+ {
418
+ "type": 1,
419
+ "string": "read"
420
+ },
421
+ {
422
+ "type": 1,
423
+ "string": "write"
424
+ }
425
+ ],
426
+ "mapValue": [
427
+ {
428
+ "type": 1,
429
+ "string": "ad_user_data"
430
+ },
431
+ {
432
+ "type": 8,
433
+ "boolean": true
434
+ },
435
+ {
436
+ "type": 8,
437
+ "boolean": true
438
+ }
439
+ ]
440
+ },
441
+ {
442
+ "type": 3,
443
+ "mapKey": [
444
+ {
445
+ "type": 1,
446
+ "string": "consentType"
447
+ },
448
+ {
449
+ "type": 1,
450
+ "string": "read"
451
+ },
452
+ {
453
+ "type": 1,
454
+ "string": "write"
455
+ }
456
+ ],
457
+ "mapValue": [
458
+ {
459
+ "type": 1,
460
+ "string": "ad_personalization"
461
+ },
462
+ {
463
+ "type": 8,
464
+ "boolean": true
465
+ },
466
+ {
467
+ "type": 8,
468
+ "boolean": true
469
+ }
470
+ ]
471
+ },
398
472
  {
399
473
  "type": 3,
400
474
  "mapKey": [
@@ -633,6 +707,32 @@ ___WEB_PERMISSIONS___
633
707
  "isEditedByUser": true
634
708
  },
635
709
  "isRequired": true
710
+ },
711
+ {
712
+ "instance": {
713
+ "key": {
714
+ "publicId": "write_data_layer",
715
+ "versionId": "1"
716
+ },
717
+ "param": [
718
+ {
719
+ "key": "keyPatterns",
720
+ "value": {
721
+ "type": 2,
722
+ "listItem": [
723
+ {
724
+ "type": 1,
725
+ "string": "developer_id.dM2ExY2"
726
+ }
727
+ ]
728
+ }
729
+ }
730
+ ]
731
+ },
732
+ "clientAnnotations": {
733
+ "isEditedByUser": true
734
+ },
735
+ "isRequired": true
636
736
  }
637
737
  ]
638
738
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antistatique/leckerli",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Lightweight and customisable GDPR cookie consent manager",
5
5
  "private": false,
6
6
  "repository": "https://github.com/antistatique/leckerli",
@@ -1,5 +1,6 @@
1
1
  const defaultSettings = {
2
2
  name: 'leckerli',
3
+ expires: 92,
3
4
  banner: {
4
5
  title: 'This website uses cookies.',
5
6
  description:
@@ -26,19 +26,15 @@ const initialState = mergeDeepRight(
26
26
  window.leckerliSettings ?? {}
27
27
  );
28
28
 
29
- // Build the expiration date
30
- const expirationDate = new Date();
31
- expirationDate.setMonth(expirationDate.getMonth() + 1);
32
-
33
29
  // Define cookie configuration
34
30
  const cookieConfig: {
35
31
  sameSite: 'strict';
36
32
  domain: string;
37
- expires?: number | Date;
33
+ expires: number;
38
34
  } = {
39
35
  sameSite: 'strict',
40
36
  domain: initialState.domain,
41
- expires: expirationDate, // 1 month by default
37
+ expires: initialState.expires, // 3 months by default
42
38
  };
43
39
 
44
40
  // Get cookie value
@@ -3,6 +3,7 @@ import defaultSettings from '../defaultSettings.ts';
3
3
  type Settings = typeof defaultSettings & {
4
4
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
5
  baseData: any;
6
+ expires: number;
6
7
  permissions: string[];
7
8
  enableGtmAutoLoad: boolean;
8
9
  };