@antistatique/leckerli 1.0.0 → 1.0.2
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 +12 -1
- package/README.md +89 -12
- package/dist/assets/leckerli.min.js +2 -2
- package/dist/index.html +7 -4
- package/index.html +51 -26
- package/package.json +2 -2
- package/src/hooks/useSettings.ts +19 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,9 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.0.2] - 2023-06-28
|
|
10
|
+
### Changed
|
|
11
|
+
- Improve documentation
|
|
12
|
+
- Improve Events
|
|
13
|
+
|
|
14
|
+
## [1.0.1] - 2023-06-27
|
|
15
|
+
### Changed
|
|
16
|
+
- Improve documentation
|
|
17
|
+
|
|
9
18
|
## [1.0.0] - 2023-06-27
|
|
10
19
|
### Added
|
|
11
20
|
- First POC
|
|
12
21
|
|
|
13
|
-
[Unreleased]: https://github.com/antistatique/leckerli/compare/v1.0.
|
|
22
|
+
[Unreleased]: https://github.com/antistatique/leckerli/compare/v1.0.2...HEAD
|
|
23
|
+
[1.0.2]: https://github.com/antistatique/leckerli/compare/v1.0.1...v1.0.2
|
|
24
|
+
[1.0.1]: https://github.com/antistatique/leckerli/compare/v1.0.0...v1.0.1
|
|
14
25
|
[1.0.0]: https://github.com/antistatique/leckerli/releases/tag/v1.0.0
|
package/README.md
CHANGED
|
@@ -1,24 +1,56 @@
|
|
|
1
1
|
# 🍪 Leckerli
|
|
2
2
|
|
|
3
|
-
> Lightweight and customisable GDPR cookie manager
|
|
3
|
+
> Lightweight (~16kB gzip) and customisable GDPR cookie manager
|
|
4
4
|
|
|
5
5
|
## 📗 Usage
|
|
6
6
|
|
|
7
|
+
### Standard approach with CDN
|
|
8
|
+
|
|
7
9
|
To use leckerli into your website, simply add the following CSS/JavaScript in your website:
|
|
8
10
|
|
|
9
11
|
```html
|
|
10
12
|
<html>
|
|
11
13
|
<head>
|
|
12
14
|
<!-- somewhere in the <head /> -->
|
|
13
|
-
<link
|
|
15
|
+
<link
|
|
16
|
+
rel="stylesheet"
|
|
17
|
+
href="https://www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.css"
|
|
18
|
+
/>
|
|
14
19
|
</head>
|
|
15
20
|
<body>
|
|
16
21
|
<!-- at the end of your <body /> -->
|
|
17
|
-
|
|
22
|
+
<script
|
|
23
|
+
defer
|
|
24
|
+
type="module"
|
|
25
|
+
src="https://www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.js"
|
|
26
|
+
></script>
|
|
18
27
|
</body>
|
|
19
28
|
</html>
|
|
20
29
|
```
|
|
21
30
|
|
|
31
|
+
### GTM approach with CDN
|
|
32
|
+
|
|
33
|
+
You can also inject a bit of JavaScript to your website to install Leckerli using Google Tag Manager:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
// For the CSS
|
|
37
|
+
const leckerliStyles = document.createElement('link');
|
|
38
|
+
leckerliStyles.rel = 'stylesheet';
|
|
39
|
+
leckerliStyles.href = '//www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.css';
|
|
40
|
+
document.head.appendChild(leckerliStyles);
|
|
41
|
+
|
|
42
|
+
// For the JavaScript
|
|
43
|
+
const leckerliScript = document.createElement('script');
|
|
44
|
+
leckerliScript.src = '//www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.js';
|
|
45
|
+
document.body.appendChild(leckerliScript);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Local files
|
|
49
|
+
|
|
50
|
+
You can also download locally the CSS & JS files from [each release](https://github.com/antistatique/leckerli/releases) and use the file located in `dist/assets/`.
|
|
51
|
+
|
|
52
|
+
Then follow the Standard approach described above.
|
|
53
|
+
|
|
22
54
|
## ⚙️ Configuration
|
|
23
55
|
|
|
24
56
|
To configure Leckerli, attach a `leckerliSettings` object to your `window`. Something like:
|
|
@@ -33,11 +65,11 @@ To configure Leckerli, attach a `leckerliSettings` object to your `window`. Some
|
|
|
33
65
|
|
|
34
66
|
Here are the settings that you can override:
|
|
35
67
|
|
|
36
|
-
###
|
|
68
|
+
### name
|
|
37
69
|
|
|
38
|
-
It's the name of your cookie.
|
|
70
|
+
It's the `name` of your cookie.
|
|
39
71
|
|
|
40
|
-
###
|
|
72
|
+
### banner
|
|
41
73
|
|
|
42
74
|
`banner` is an object with the text content to override. By default:
|
|
43
75
|
|
|
@@ -55,9 +87,9 @@ window.leckerliSettings = {
|
|
|
55
87
|
}
|
|
56
88
|
```
|
|
57
89
|
|
|
58
|
-
###
|
|
90
|
+
### permissions
|
|
59
91
|
|
|
60
|
-
The core of Leckerli, it's all the permissions that you want to manage. By default:
|
|
92
|
+
The core of Leckerli, it's all the `permissions` that you want to manage. By default:
|
|
61
93
|
|
|
62
94
|
```ts
|
|
63
95
|
window.leckerliSettings = {
|
|
@@ -73,7 +105,7 @@ window.leckerliSettings = {
|
|
|
73
105
|
}
|
|
74
106
|
```
|
|
75
107
|
|
|
76
|
-
###
|
|
108
|
+
### baseData
|
|
77
109
|
|
|
78
110
|
`baseData` is an object of any kind that **will be passed to the final cookie** as well. For example for store consent-id of some sort.
|
|
79
111
|
|
|
@@ -109,6 +141,38 @@ window.leckerliSettings = {
|
|
|
109
141
|
</script>
|
|
110
142
|
```
|
|
111
143
|
|
|
144
|
+
Feel free to split the configuration object if you want to set the banner translations in the template of your website and the rest in Google Tag Manager for example:
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
// In your template
|
|
148
|
+
window.leckerliSettings = {};
|
|
149
|
+
window.leckerliSettings.banner = {
|
|
150
|
+
title: 'Nous respectons votre vie privée.',
|
|
151
|
+
description: 'Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.',
|
|
152
|
+
accept: 'Accepter tout',
|
|
153
|
+
reject: 'Tout rejeter',
|
|
154
|
+
customise: 'Personnaliser',
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// In GTM
|
|
158
|
+
window.leckerliSettings.name = 'website-gdpr';
|
|
159
|
+
window.leckerliSettings.baseData = {
|
|
160
|
+
consentid: 'b638a4a9-a846-475a-a29b-d2bb596cb735',
|
|
161
|
+
};
|
|
162
|
+
window.leckerliSettings.permissions = [
|
|
163
|
+
{
|
|
164
|
+
slug: 'settings',
|
|
165
|
+
title: 'Préférences',
|
|
166
|
+
description: 'Les cookies de préférence permettent à un site web de mémoriser des informations qui modifient le comportement ou l\'apparence du site, comme votre langue préférée ou la région dans laquelle vous vous trouvez.'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
slug: 'ga',
|
|
170
|
+
title: 'Google analytics',
|
|
171
|
+
description: 'Google Analytics permet de mesurer et d\'analyser le comportement des visiteurs d\'un site internet, en fournissant des données clés sur leur provenance, leur navigation et leur engagement, afin d\'aider à optimiser le site et à améliorer l\'expérience utilisateur.'
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
```
|
|
175
|
+
|
|
112
176
|
## 🩻 Cookie structure
|
|
113
177
|
|
|
114
178
|
With the default settings above, here is the value stored in our cookie:
|
|
@@ -130,12 +194,25 @@ Basically, it's the `baseData` values, if there is any, and for each `permission
|
|
|
130
194
|
Here is a list of events you can **listen**:
|
|
131
195
|
|
|
132
196
|
```js
|
|
197
|
+
// To listen the initialisation
|
|
198
|
+
document.addEventListener('leckerli:initialised', (event) => {
|
|
199
|
+
// to get cookie data OR null if the user's choice has not been made
|
|
200
|
+
console.log(event.detail.cookie);
|
|
201
|
+
});
|
|
202
|
+
|
|
133
203
|
// To listen to the permissions / cookie's updates
|
|
134
|
-
document.addEventListener('leckerli:permissions-updated')
|
|
204
|
+
document.addEventListener('leckerli:permissions-updated', (event) => {
|
|
205
|
+
// to get cookie data
|
|
206
|
+
console.log(event.detail.cookie);
|
|
207
|
+
});
|
|
135
208
|
|
|
136
209
|
// To listen the modal states
|
|
137
|
-
document.addEventListener('leckerli:modal-closed')
|
|
138
|
-
|
|
210
|
+
document.addEventListener('leckerli:modal-closed', () => {
|
|
211
|
+
// react to modal closed
|
|
212
|
+
});
|
|
213
|
+
document.addEventListener('leckerli:modal-opened', () => {
|
|
214
|
+
// react to modal opened
|
|
215
|
+
});
|
|
139
216
|
```
|
|
140
217
|
|
|
141
218
|
Here is a list of events you can **dispatch**:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const _ of o.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&r(_)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var V,a,Ze,R,Pe,Qe,pe,Xe,X={},et=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oe=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function tt(e){var t=e.parentNode;t&&t.removeChild(e)}function E(e,t,n){var r,i,o,_={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:_[o]=t[o];if(arguments.length>2&&(_.children=arguments.length>3?V.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,r,i,null)}function I(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Ze};return i==null&&a.vnode!=null&&a.vnode(o),o}function nt(){return{current:null}}function C(e){return e.children}function S(e,t){this.props=e,this.context=t}function F(e,t){if(t==null)return e.__?F(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?F(e):null}function rt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return rt(e)}}function de(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!ee.__r++||Pe!==a.debounceRendering)&&((Pe=a.debounceRendering)||Qe)(ee)}function ee(){var e,t,n,r,i,o,_,c;for(R.sort(pe);e=R.shift();)e.__d&&(t=R.length,r=void 0,i=void 0,_=(o=(n=e).__v).__e,(c=n.__P)&&(r=[],(i=w({},o)).__v=o.__v+1,ye(c,o,i,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[_]:null,r,_??F(o),o.__h),ct(r,o),o.__e!=_&&rt(o)),R.length>t&&R.sort(pe));ee.__r=0}function ot(e,t,n,r,i,o,_,c,l,p){var u,h,f,s,d,$,g,b=r&&r.__k||et,x=b.length;for(n.__k=[],u=0;u<t.length;u++)if((s=n.__k[u]=(s=t[u])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"?I(null,s,null,null,s):oe(s)?I(C,{children:s},null,null,null):s.__b>0?I(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null){if(s.__=n,s.__b=n.__b+1,(f=b[u])===null||f&&s.key==f.key&&s.type===f.type)b[u]=void 0;else for(h=0;h<x;h++){if((f=b[h])&&s.key==f.key&&s.type===f.type){b[h]=void 0;break}f=null}ye(e,s,f=f||X,i,o,_,c,l,p),d=s.__e,(h=s.ref)&&f.ref!=h&&(g||(g=[]),f.ref&&g.push(f.ref,null,s),g.push(h,s.__c||d,s)),d!=null?($==null&&($=d),typeof s.type=="function"&&s.__k===f.__k?s.__d=l=it(s,l,e):l=ut(e,s,f,b,d,l),typeof n.type=="function"&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=F(f))}for(n.__e=$,u=x;u--;)b[u]!=null&&(typeof n.type=="function"&&b[u].__e!=null&&b[u].__e==n.__d&&(n.__d=_t(r).nextSibling),st(b[u],b[u]));if(g)for(u=0;u<g.length;u++)lt(g[u],g[++u],g[++u])}function it(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t=typeof r.type=="function"?it(r,t,n):ut(n,r,r,i,r.__e,t));return t}function P(e,t){return t=t||[],e==null||typeof e=="boolean"||(oe(e)?e.some(function(n){P(n,t)}):t.push(e)),t}function ut(e,t,n,r,i,o){var _,c,l;if(t.__d!==void 0)_=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),_=null;else{for(c=o,l=0;(c=c.nextSibling)&&l<r.length;l+=1)if(c==i)break e;e.insertBefore(i,o),_=o}return _!==void 0?_:i.nextSibling}function _t(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=_t(n)))return r}return null}function Qt(e,t,n,r,i){var o;for(o in n)o==="children"||o==="key"||o in t||te(e,o,null,n[o],r);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||te(e,o,t[o],n[o],r)}function Ne(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zt.test(t)?n:n+"px"}function te(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ne(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ne(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Re:De,o):e.removeEventListener(t,o?Re:De,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function De(e){return this.l[e.type+!1](a.event?a.event(e):e)}function Re(e){return this.l[e.type+!0](a.event?a.event(e):e)}function ye(e,t,n,r,i,o,_,c,l){var p,u,h,f,s,d,$,g,b,x,z,H,Oe,q,le,k=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(l=n.__h,c=t.__e=n.__e,t.__h=null,o=[c]),(p=a.__b)&&p(t);try{e:if(typeof k=="function"){if(g=t.props,b=(p=k.contextType)&&r[p.__c],x=p?b?b.props.value:p.__:r,n.__c?$=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,x):(t.__c=u=new S(g,x),u.constructor=k,u.render=en),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=x,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),k.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=w({},u.__s)),w(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,s=u.state,u.__v=t,h)k.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(k.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,x),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,x)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(K){K&&(K.__=t)}),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[],u.__h.length&&_.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,x),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,s,d)})}if(u.context=x,u.props=g,u.__P=e,H=a.__r,Oe=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++Oe<25);u.state=u.__s,u.getChildContext!=null&&(r=w(w({},r),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(d=u.getSnapshotBeforeUpdate(f,s)),ot(e,oe(le=p!=null&&p.type===C&&p.key==null?p.props.children:p)?le:[le],t,n,r,i,o,_,c,l),u.base=t.__e,t.__h=null,u.__h.length&&_.push(u),$&&(u.__E=u.__=null),u.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Xt(n.__e,t,n,r,i,o,_,l);(p=a.diffed)&&p(t)}catch(K){t.__v=null,(l||o!=null)&&(t.__e=c,t.__h=!!l,o[o.indexOf(c)]=null),a.__e(K,t,n)}}function ct(e,t){a.__c&&a.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){a.__e(r,n.__v)}})}function Xt(e,t,n,r,i,o,_,c){var l,p,u,h=n.props,f=t.props,s=t.type,d=0;if(s==="svg"&&(i=!0),o!=null){for(;d<o.length;d++)if((l=o[d])&&"setAttribute"in l==!!s&&(s?l.localName===s:l.nodeType===3)){e=l,o[d]=null;break}}if(e==null){if(s===null)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s,f.is&&f),o=null,c=!1}if(s===null)h===f||c&&e.data===f||(e.data=f);else{if(o=o&&V.call(e.childNodes),p=(h=n.props||X).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!c){if(o!=null)for(h={},d=0;d<e.attributes.length;d++)h[e.attributes[d].name]=e.attributes[d].value;(u||p)&&(u&&(p&&u.__html==p.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(Qt(e,f,h,i,c),u)t.__k=[];else if(ot(e,oe(d=t.props.children)?d:[d],t,n,r,i&&s!=="foreignObject",o,_,o?o[0]:n.__k&&F(n,0),c),o!=null)for(d=o.length;d--;)o[d]!=null&&tt(o[d]);c||("value"in f&&(d=f.value)!==void 0&&(d!==e.value||s==="progress"&&!d||s==="option"&&d!==h.value)&&te(e,"value",d,h.value,!1),"checked"in f&&(d=f.checked)!==void 0&&d!==e.checked&&te(e,"checked",d,h.checked,!1))}return e}function lt(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){a.__e(r,n)}}function st(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||lt(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){a.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&st(r[i],t,n||typeof e.type!="function");n||e.__e==null||tt(e.__e),e.__=e.__e=e.__d=void 0}function en(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,i,o;a.__&&a.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],ye(t,e=(!r&&n||t).__k=E(C,null,[e]),i||X,X,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?V.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),ct(o,e)}function at(e,t){j(e,t,at)}function tn(e,t,n){var r,i,o,_,c=w({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?i=t[o]:c[o]=t[o]===void 0&&_!==void 0?_[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?V.call(arguments,2):n),I(e.type,c,r||e.key,i||e.ref,null)}function ft(e,t){var n={__c:t="__cC"+Xe++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(_){this.props.value!==_.value&&i.some(function(c){c.__e=!0,de(c)})},this.sub=function(_){i.push(_);var c=_.componentWillUnmount;_.componentWillUnmount=function(){i.splice(i.indexOf(_),1),c&&c.call(_)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}V=et.slice,a={__e:function(e,t,n,r){for(var i,o,_;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),_=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),_=i.__d),_)return i.__E=i}catch(c){e=c}throw e}},Ze=0,S.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},n),this.props)),e&&w(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),de(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),de(this))},S.prototype.render=C,R=[],Qe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pe=function(e,t){return e.__v.__b-t.__v.__b},ee.__r=0,Xe=0;var N,v,se,Ue,T=0,pt=[],Y=[],Ae=a.__b,Me=a.__r,je=a.diffed,Te=a.__c,Le=a.unmount;function U(e,t){a.__h&&a.__h(v,e,T||t),T=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Y}),n.__[e]}function ie(e){return T=1,ge(gt,e)}function ge(e,t,n){var r=U(N++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gt(void 0,t),function(c){var l=r.__N?r.__N[0]:r.__[0],p=r.t(l,c);l!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.u)){var i=function(c,l,p){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,c,l,p);var h=!1;return u.forEach(function(f){if(f.__N){var s=f.__[0];f.__=f.__N,f.__N=void 0,s!==f.__[0]&&(h=!0)}}),!(!h&&r.__c.props===c)&&(!o||o.call(this,c,l,p))};v.u=!0;var o=v.shouldComponentUpdate,_=v.componentWillUpdate;v.componentWillUpdate=function(c,l,p){if(this.__e){var u=o;o=void 0,i(c,l,p),o=u}_&&_.call(this,c,l,p)},v.shouldComponentUpdate=i}return r.__N||r.__}function ue(e,t){var n=U(N++,3);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,v.__H.__h.push(n))}function B(e,t){var n=U(N++,4);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,v.__h.push(n))}function dt(e){return T=5,_e(function(){return{current:e}},[])}function ht(e,t,n){T=6,B(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function _e(e,t){var n=U(N++,7);return ke(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function vt(e,t){return T=8,_e(function(){return e},t)}function mt(e){var t=v.context[e.__c],n=U(N++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(v)),t.props.value):e.__}function be(e,t){a.useDebugValue&&a.useDebugValue(t?t(e):e)}function nn(e){var t=U(N++,10),n=ie();return t.__=e,v.componentDidCatch||(v.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function yt(){var e=U(N++,11);if(!e.__){for(var t=v.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function rn(){for(var e;e=pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Z),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}a.__b=function(e){v=null,Ae&&Ae(e)},a.__r=function(e){Me&&Me(e),N=0;var t=(v=e.__c).__H;t&&(se===v?(t.__h=[],v.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Y,n.__N=n.i=void 0})):(t.__h.forEach(Z),t.__h.forEach(he),t.__h=[],N=0)),se=v},a.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pt.push(t)!==1&&Ue===a.requestAnimationFrame||((Ue=a.requestAnimationFrame)||on)(rn)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Y&&(n.__=n.__V),n.i=void 0,n.__V=Y})),se=v=null},a.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Z),n.__h=n.__h.filter(function(r){return!r.__||he(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],a.__e(r,n.__v)}}),Te&&Te(e,t)},a.unmount=function(e){Le&&Le(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Z(r)}catch(i){t=i}}),n.__H=void 0,t&&a.__e(t,n.__v))};var He=typeof requestAnimationFrame=="function";function on(e){var t,n=function(){clearTimeout(r),He&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);He&&(t=requestAnimationFrame(n))}function Z(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function he(e){var t=v;e.__c=e.__(),v=t}function ke(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gt(e,t){return typeof t=="function"?t(e):t}function m(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function O(e){return function t(n){return arguments.length===0||m(n)?t:e.apply(this,arguments)}}function D(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return m(n)?t:O(function(i){return e(n,i)});default:return m(n)&&m(r)?t:m(n)?O(function(i){return e(i,r)}):m(r)?O(function(i){return e(n,i)}):e(n,r)}}}function bt(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return m(n)?t:D(function(o,_){return e(n,o,_)});case 2:return m(n)&&m(r)?t:m(n)?D(function(o,_){return e(o,r,_)}):m(r)?D(function(o,_){return e(n,o,_)}):O(function(o){return e(n,r,o)});default:return m(n)&&m(r)&&m(i)?t:m(n)&&m(r)?D(function(o,_){return e(o,_,i)}):m(n)&&m(i)?D(function(o,_){return e(o,r,_)}):m(r)&&m(i)?D(function(o,_){return e(n,o,_)}):m(n)?O(function(o){return e(o,r,i)}):m(r)?O(function(o){return e(n,o,i)}):m(i)?O(function(o){return e(n,r,o)}):e(n,r,i)}}}function J(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ie(e){return Object.prototype.toString.call(e)==="[object Object]"}var kt=O(function(t){return t==null}),un=O(function(t){return!kt(t)});const xe=un;var _n=bt(function(t,n,r){var i={},o;n=n||{},r=r||{};for(o in n)J(o,n)&&(i[o]=J(o,r)?t(o,n[o],r[o]):n[o]);for(o in r)J(o,r)&&!J(o,i)&&(i[o]=r[o]);return i}),cn=bt(function e(t,n,r){return _n(function(i,o,_){return Ie(o)&&Ie(_)?e(t,o,_):t(i,o,_)},n,r)}),ln=D(function(t,n){return cn(function(r,i,o){return o},t,n)});const sn=ln,We=e=>{let t;const n=new Set,r=(l,p)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const h=t;t=p??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,h))}},i=()=>t,c={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,c),c},an=e=>e?We(e):We;function xt(e,t){for(var n in t)e[n]=t[n];return e}function ve(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function ae(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function ne(e){this.props=e}function St(e,t){function n(i){var o=this.props.ref,_=o==i.ref;return!_&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!_:ve(this.props,i)}function r(i){return this.shouldComponentUpdate=n,E(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ne.prototype=new S).isPureReactComponent=!0,ne.prototype.shouldComponentUpdate=function(e,t){return ve(this.props,e)||ve(this.state,t)};var Fe=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fe&&Fe(e)};var fn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Et(e){function t(n){var r=xt({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=fn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ve=function(e,t){return e==null?null:P(P(e).map(t))},Ct={map:Ve,forEach:Ve,count:function(e){return e?P(e).length:0},only:function(e){var t=P(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:P},pn=a.__e;a.__e=function(e,t,n,r){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}pn(e,t,n,r)};var Be=a.unmount;function $t(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=xt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return $t(r,t,n)})),e}function wt(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return wt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function W(){this.__u=0,this.t=null,this.__b=null}function Ot(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Pt(e){var t,n,r;function i(o){if(t||(t=e()).then(function(_){n=_.default||_},function(_){r=_}),r)throw r;if(!n)throw t;return E(n,o)}return i.displayName="Lazy",i.__f=!0,i}function A(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Be&&Be(e)},(W.prototype=new S).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=Ot(r.__v),o=!1,_=function(){o||(o=!0,n.__R=null,i?i(c):c())};n.__R=_;var c=function(){if(!--r.__u){if(r.state.__a){var p=r.state.__a;r.__v.__k[0]=wt(p,p.__c.__P,p.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}},l=t.__h===!0;r.__u++||l||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(_,_)},W.prototype.componentWillUnmount=function(){this.t=[]},W.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=$t(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&E(C,null,e.fallback);return i&&(i.__h=null),[E(C,null,t.__a?null:e.children),i]};var ze=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function dn(e){return this.getChildContext=function(){return e.context},e.children}function hn(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),j(E(dn,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Nt(e,t){var n=E(hn,{__v:e,i:t});return n.containerInfo=t,n}(A.prototype=new S).__a=function(e){var t=this,n=Ot(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),ze(t,e,r)):i()};n?n(o):o()}},A.prototype.render=function(e){this.u=null,this.o=new Map;var t=P(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},A.prototype.componentDidUpdate=A.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){ze(e,n,t)})};var Dt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,vn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,mn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,yn=/[A-Z0-9]/g,gn=typeof document<"u",bn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Rt(e,t,n){return t.__k==null&&(t.textContent=""),j(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ut(e,t,n){return at(e,t),typeof n=="function"&&n(),e?e.__c:null}S.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qe=a.event;function kn(){}function xn(){return this.cancelBubble}function Sn(){return this.defaultPrevented}a.event=function(e){return qe&&(e=qe(e)),e.persist=kn,e.isPropagationStopped=xn,e.isDefaultPrevented=Sn,e.nativeEvent=e};var Se,En={enumerable:!1,configurable:!0,get:function(){return this.class}},Ke=a.vnode;a.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,i={};for(var o in n){var _=n[o];if(!(o==="value"&&"defaultValue"in n&&_==null||gn&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var c=o.toLowerCase();o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&_===!0?_="":c==="ondoubleclick"?o="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||bn(n.type)?c==="onfocus"?o="onfocusin":c==="onblur"?o="onfocusout":mn.test(o)?o=c:r.indexOf("-")===-1&&vn.test(o)?o=o.replace(yn,"-$&").toLowerCase():_===null&&(_=void 0):c=o="oninput",c==="oninput"&&i[o=c]&&(o="oninputCapture"),i[o]=_}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=P(n.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",En)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i}(e),e.$$typeof=Dt,Ke&&Ke(e)};var Je=a.__r;a.__r=function(e){Je&&Je(e),Se=e.__c};var Ge=a.diffed;a.diffed=function(e){Ge&&Ge(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Se=null};var At={ReactCurrentDispatcher:{current:{readContext:function(e){return Se.__n[e.__c].props.value}}}},Cn="17.0.2";function Mt(e){return E.bind(null,e)}function Ee(e){return!!e&&e.$$typeof===Dt}function jt(e){return Ee(e)?tn.apply(null,arguments):e}function Tt(e){return!!e.__k&&(j(null,e),!0)}function Lt(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ht=function(e,t){return e(t)},It=function(e,t){return e(t)},Wt=C;function Ce(e){e()}function Ft(e){return e}function Vt(){return[!1,Ce]}var Bt=B;function zt(e,t){var n=t(),r=ie({h:{__:n,v:t}}),i=r[0].h,o=r[1];return B(function(){i.__=n,i.v=t,ae(i.__,t())||o({h:i})},[e,n,t]),ue(function(){return ae(i.__,i.v())||o({h:i}),e(function(){ae(i.__,i.v())||o({h:i})})},[e]),n}var $n={useState:ie,useId:yt,useReducer:ge,useEffect:ue,useLayoutEffect:B,useInsertionEffect:Bt,useTransition:Vt,useDeferredValue:Ft,useSyncExternalStore:zt,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:_e,useCallback:vt,useContext:mt,useDebugValue:be,version:"17.0.2",Children:Ct,render:Rt,hydrate:Ut,unmountComponentAtNode:Tt,createPortal:Nt,createElement:E,createContext:ft,createFactory:Mt,cloneElement:jt,createRef:nt,Fragment:C,isValidElement:Ee,findDOMNode:Lt,Component:S,PureComponent:ne,memo:St,forwardRef:Et,flushSync:It,unstable_batchedUpdates:Ht,StrictMode:Wt,Suspense:W,SuspenseList:A,lazy:Pt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At};const wn=Object.freeze(Object.defineProperty({__proto__:null,Children:Ct,Component:S,Fragment:C,PureComponent:ne,StrictMode:Wt,Suspense:W,SuspenseList:A,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At,cloneElement:jt,createContext:ft,createElement:E,createFactory:Mt,createPortal:Nt,createRef:nt,default:$n,findDOMNode:Lt,flushSync:It,forwardRef:Et,hydrate:Ut,isValidElement:Ee,lazy:Pt,memo:St,render:Rt,startTransition:Ce,unmountComponentAtNode:Tt,unstable_batchedUpdates:Ht,useCallback:vt,useContext:mt,useDebugValue:be,useDeferredValue:Ft,useEffect:ue,useErrorBoundary:nn,useId:yt,useImperativeHandle:ht,useInsertionEffect:Bt,useLayoutEffect:B,useMemo:_e,useReducer:ge,useRef:dt,useState:ie,useSyncExternalStore:zt,useTransition:Vt,version:Cn},Symbol.toStringTag,{value:"Module"}));function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var qt={exports:{}},Kt={};const Jt=Pn(wn);var Gt={exports:{}},Yt={};/**
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const _ of o.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&r(_)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var V,a,Ze,R,Pe,Qe,pe,Xe,X={},et=[],Zt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oe=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function tt(e){var t=e.parentNode;t&&t.removeChild(e)}function S(e,t,n){var r,i,o,_={};for(o in t)o=="key"?r=t[o]:o=="ref"?i=t[o]:_[o]=t[o];if(arguments.length>2&&(_.children=arguments.length>3?V.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)_[o]===void 0&&(_[o]=e.defaultProps[o]);return I(e,_,r,i,null)}function I(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Ze};return i==null&&a.vnode!=null&&a.vnode(o),o}function nt(){return{current:null}}function C(e){return e.children}function E(e,t){this.props=e,this.context=t}function F(e,t){if(t==null)return e.__?F(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?F(e):null}function rt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return rt(e)}}function de(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!ee.__r++||Pe!==a.debounceRendering)&&((Pe=a.debounceRendering)||Qe)(ee)}function ee(){var e,t,n,r,i,o,_,c;for(R.sort(pe);e=R.shift();)e.__d&&(t=R.length,r=void 0,i=void 0,_=(o=(n=e).__v).__e,(c=n.__P)&&(r=[],(i=w({},o)).__v=o.__v+1,ye(c,o,i,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[_]:null,r,_??F(o),o.__h),ct(r,o),o.__e!=_&&rt(o)),R.length>t&&R.sort(pe));ee.__r=0}function ot(e,t,n,r,i,o,_,c,s,p){var u,h,f,l,d,$,g,b=r&&r.__k||et,x=b.length;for(n.__k=[],u=0;u<t.length;u++)if((l=n.__k[u]=(l=t[u])==null||typeof l=="boolean"||typeof l=="function"?null:typeof l=="string"||typeof l=="number"||typeof l=="bigint"?I(null,l,null,null,l):oe(l)?I(C,{children:l},null,null,null):l.__b>0?I(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l)!=null){if(l.__=n,l.__b=n.__b+1,(f=b[u])===null||f&&l.key==f.key&&l.type===f.type)b[u]=void 0;else for(h=0;h<x;h++){if((f=b[h])&&l.key==f.key&&l.type===f.type){b[h]=void 0;break}f=null}ye(e,l,f=f||X,i,o,_,c,s,p),d=l.__e,(h=l.ref)&&f.ref!=h&&(g||(g=[]),f.ref&&g.push(f.ref,null,l),g.push(h,l.__c||d,l)),d!=null?($==null&&($=d),typeof l.type=="function"&&l.__k===f.__k?l.__d=s=it(l,s,e):s=ut(e,l,f,b,d,s),typeof n.type=="function"&&(n.__d=s)):s&&f.__e==s&&s.parentNode!=e&&(s=F(f))}for(n.__e=$,u=x;u--;)b[u]!=null&&(typeof n.type=="function"&&b[u].__e!=null&&b[u].__e==n.__d&&(n.__d=_t(r).nextSibling),lt(b[u],b[u]));if(g)for(u=0;u<g.length;u++)st(g[u],g[++u],g[++u])}function it(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t=typeof r.type=="function"?it(r,t,n):ut(n,r,r,i,r.__e,t));return t}function P(e,t){return t=t||[],e==null||typeof e=="boolean"||(oe(e)?e.some(function(n){P(n,t)}):t.push(e)),t}function ut(e,t,n,r,i,o){var _,c,s;if(t.__d!==void 0)_=t.__d,t.__d=void 0;else if(n==null||i!=o||i.parentNode==null)e:if(o==null||o.parentNode!==e)e.appendChild(i),_=null;else{for(c=o,s=0;(c=c.nextSibling)&&s<r.length;s+=1)if(c==i)break e;e.insertBefore(i,o),_=o}return _!==void 0?_:i.nextSibling}function _t(e){var t,n,r;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=_t(n)))return r}return null}function Qt(e,t,n,r,i){var o;for(o in n)o==="children"||o==="key"||o in t||te(e,o,null,n[o],r);for(o in t)i&&typeof t[o]!="function"||o==="children"||o==="key"||o==="value"||o==="checked"||n[o]===t[o]||te(e,o,t[o],n[o],r)}function Ne(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zt.test(t)?n:n+"px"}function te(e,t,n,r,i){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ne(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ne(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Re:De,o):e.removeEventListener(t,o?Re:De,o);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function De(e){return this.l[e.type+!1](a.event?a.event(e):e)}function Re(e){return this.l[e.type+!0](a.event?a.event(e):e)}function ye(e,t,n,r,i,o,_,c,s){var p,u,h,f,l,d,$,g,b,x,z,H,Oe,q,se,k=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(s=n.__h,c=t.__e=n.__e,t.__h=null,o=[c]),(p=a.__b)&&p(t);try{e:if(typeof k=="function"){if(g=t.props,b=(p=k.contextType)&&r[p.__c],x=p?b?b.props.value:p.__:r,n.__c?$=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,x):(t.__c=u=new E(g,x),u.constructor=k,u.render=en),b&&b.sub(u),u.props=g,u.state||(u.state={}),u.context=x,u.__n=r,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),k.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=w({},u.__s)),w(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,l=u.state,u.__v=t,h)k.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(k.getDerivedStateFromProps==null&&g!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(g,x),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(g,u.__s,x)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(K){K&&(K.__=t)}),z=0;z<u._sb.length;z++)u.__h.push(u._sb[z]);u._sb=[],u.__h.length&&_.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(g,u.__s,x),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,l,d)})}if(u.context=x,u.props=g,u.__P=e,H=a.__r,Oe=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do u.__d=!1,H&&H(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++Oe<25);u.state=u.__s,u.getChildContext!=null&&(r=w(w({},r),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(d=u.getSnapshotBeforeUpdate(f,l)),ot(e,oe(se=p!=null&&p.type===C&&p.key==null?p.props.children:p)?se:[se],t,n,r,i,o,_,c,s),u.base=t.__e,t.__h=null,u.__h.length&&_.push(u),$&&(u.__E=u.__=null),u.__e=!1}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Xt(n.__e,t,n,r,i,o,_,s);(p=a.diffed)&&p(t)}catch(K){t.__v=null,(s||o!=null)&&(t.__e=c,t.__h=!!s,o[o.indexOf(c)]=null),a.__e(K,t,n)}}function ct(e,t){a.__c&&a.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(r){r.call(n)})}catch(r){a.__e(r,n.__v)}})}function Xt(e,t,n,r,i,o,_,c){var s,p,u,h=n.props,f=t.props,l=t.type,d=0;if(l==="svg"&&(i=!0),o!=null){for(;d<o.length;d++)if((s=o[d])&&"setAttribute"in s==!!l&&(l?s.localName===l:s.nodeType===3)){e=s,o[d]=null;break}}if(e==null){if(l===null)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l,f.is&&f),o=null,c=!1}if(l===null)h===f||c&&e.data===f||(e.data=f);else{if(o=o&&V.call(e.childNodes),p=(h=n.props||X).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!c){if(o!=null)for(h={},d=0;d<e.attributes.length;d++)h[e.attributes[d].name]=e.attributes[d].value;(u||p)&&(u&&(p&&u.__html==p.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(Qt(e,f,h,i,c),u)t.__k=[];else if(ot(e,oe(d=t.props.children)?d:[d],t,n,r,i&&l!=="foreignObject",o,_,o?o[0]:n.__k&&F(n,0),c),o!=null)for(d=o.length;d--;)o[d]!=null&&tt(o[d]);c||("value"in f&&(d=f.value)!==void 0&&(d!==e.value||l==="progress"&&!d||l==="option"&&d!==h.value)&&te(e,"value",d,h.value,!1),"checked"in f&&(d=f.checked)!==void 0&&d!==e.checked&&te(e,"checked",d,h.checked,!1))}return e}function st(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){a.__e(r,n)}}function lt(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||st(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){a.__e(o,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&<(r[i],t,n||typeof e.type!="function");n||e.__e==null||tt(e.__e),e.__=e.__e=e.__d=void 0}function en(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,i,o;a.__&&a.__(e,t),i=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],ye(t,e=(!r&&n||t).__k=S(C,null,[e]),i||X,X,t.ownerSVGElement!==void 0,!r&&n?[n]:i?null:t.firstChild?V.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),ct(o,e)}function at(e,t){j(e,t,at)}function tn(e,t,n){var r,i,o,_,c=w({},e.props);for(o in e.type&&e.type.defaultProps&&(_=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?i=t[o]:c[o]=t[o]===void 0&&_!==void 0?_[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?V.call(arguments,2):n),I(e.type,c,r||e.key,i||e.ref,null)}function ft(e,t){var n={__c:t="__cC"+Xe++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,o;return this.getChildContext||(i=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(_){this.props.value!==_.value&&i.some(function(c){c.__e=!0,de(c)})},this.sub=function(_){i.push(_);var c=_.componentWillUnmount;_.componentWillUnmount=function(){i.splice(i.indexOf(_),1),c&&c.call(_)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}V=et.slice,a={__e:function(e,t,n,r){for(var i,o,_;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),_=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),_=i.__d),_)return i.__E=i}catch(c){e=c}throw e}},Ze=0,E.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},n),this.props)),e&&w(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),de(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),de(this))},E.prototype.render=C,R=[],Qe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pe=function(e,t){return e.__v.__b-t.__v.__b},ee.__r=0,Xe=0;var N,m,le,Ue,T=0,pt=[],Y=[],Ae=a.__b,Me=a.__r,je=a.diffed,Te=a.__c,Le=a.unmount;function U(e,t){a.__h&&a.__h(m,e,T||t),T=0;var n=m.__H||(m.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Y}),n.__[e]}function ie(e){return T=1,ge(gt,e)}function ge(e,t,n){var r=U(N++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gt(void 0,t),function(c){var s=r.__N?r.__N[0]:r.__[0],p=r.t(s,c);s!==p&&(r.__N=[p,r.__[1]],r.__c.setState({}))}],r.__c=m,!m.u)){var i=function(c,s,p){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,c,s,p);var h=!1;return u.forEach(function(f){if(f.__N){var l=f.__[0];f.__=f.__N,f.__N=void 0,l!==f.__[0]&&(h=!0)}}),!(!h&&r.__c.props===c)&&(!o||o.call(this,c,s,p))};m.u=!0;var o=m.shouldComponentUpdate,_=m.componentWillUpdate;m.componentWillUpdate=function(c,s,p){if(this.__e){var u=o;o=void 0,i(c,s,p),o=u}_&&_.call(this,c,s,p)},m.shouldComponentUpdate=i}return r.__N||r.__}function ue(e,t){var n=U(N++,3);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function B(e,t){var n=U(N++,4);!a.__s&&ke(n.__H,t)&&(n.__=e,n.i=t,m.__h.push(n))}function dt(e){return T=5,_e(function(){return{current:e}},[])}function ht(e,t,n){T=6,B(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function _e(e,t){var n=U(N++,7);return ke(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function mt(e,t){return T=8,_e(function(){return e},t)}function vt(e){var t=m.context[e.__c],n=U(N++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function be(e,t){a.useDebugValue&&a.useDebugValue(t?t(e):e)}function nn(e){var t=U(N++,10),n=ie();return t.__=e,m.componentDidCatch||(m.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function yt(){var e=U(N++,11);if(!e.__){for(var t=m.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function rn(){for(var e;e=pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Z),e.__H.__h.forEach(he),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}a.__b=function(e){m=null,Ae&&Ae(e)},a.__r=function(e){Me&&Me(e),N=0;var t=(m=e.__c).__H;t&&(le===m?(t.__h=[],m.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Y,n.__N=n.i=void 0})):(t.__h.forEach(Z),t.__h.forEach(he),t.__h=[],N=0)),le=m},a.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pt.push(t)!==1&&Ue===a.requestAnimationFrame||((Ue=a.requestAnimationFrame)||on)(rn)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Y&&(n.__=n.__V),n.i=void 0,n.__V=Y})),le=m=null},a.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Z),n.__h=n.__h.filter(function(r){return!r.__||he(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],a.__e(r,n.__v)}}),Te&&Te(e,t)},a.unmount=function(e){Le&&Le(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Z(r)}catch(i){t=i}}),n.__H=void 0,t&&a.__e(t,n.__v))};var He=typeof requestAnimationFrame=="function";function on(e){var t,n=function(){clearTimeout(r),He&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);He&&(t=requestAnimationFrame(n))}function Z(e){var t=m,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),m=t}function he(e){var t=m;e.__c=e.__(),m=t}function ke(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gt(e,t){return typeof t=="function"?t(e):t}function v(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function O(e){return function t(n){return arguments.length===0||v(n)?t:e.apply(this,arguments)}}function D(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return v(n)?t:O(function(i){return e(n,i)});default:return v(n)&&v(r)?t:v(n)?O(function(i){return e(i,r)}):v(r)?O(function(i){return e(n,i)}):e(n,r)}}}function bt(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return v(n)?t:D(function(o,_){return e(n,o,_)});case 2:return v(n)&&v(r)?t:v(n)?D(function(o,_){return e(o,r,_)}):v(r)?D(function(o,_){return e(n,o,_)}):O(function(o){return e(n,r,o)});default:return v(n)&&v(r)&&v(i)?t:v(n)&&v(r)?D(function(o,_){return e(o,_,i)}):v(n)&&v(i)?D(function(o,_){return e(o,r,_)}):v(r)&&v(i)?D(function(o,_){return e(n,o,_)}):v(n)?O(function(o){return e(o,r,i)}):v(r)?O(function(o){return e(n,o,i)}):v(i)?O(function(o){return e(n,r,o)}):e(n,r,i)}}}function J(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ie(e){return Object.prototype.toString.call(e)==="[object Object]"}var kt=O(function(t){return t==null}),un=O(function(t){return!kt(t)});const xe=un;var _n=bt(function(t,n,r){var i={},o;n=n||{},r=r||{};for(o in n)J(o,n)&&(i[o]=J(o,r)?t(o,n[o],r[o]):n[o]);for(o in r)J(o,r)&&!J(o,i)&&(i[o]=r[o]);return i}),cn=bt(function e(t,n,r){return _n(function(i,o,_){return Ie(o)&&Ie(_)?e(t,o,_):t(i,o,_)},n,r)}),sn=D(function(t,n){return cn(function(r,i,o){return o},t,n)});const ln=sn,We=e=>{let t;const n=new Set,r=(s,p)=>{const u=typeof s=="function"?s(t):s;if(!Object.is(u,t)){const h=t;t=p??typeof u!="object"?u:Object.assign({},t,u),n.forEach(f=>f(t,h))}},i=()=>t,c={setState:r,getState:i,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,c),c},an=e=>e?We(e):We;function xt(e,t){for(var n in t)e[n]=t[n];return e}function me(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function ae(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function ne(e){this.props=e}function Et(e,t){function n(i){var o=this.props.ref,_=o==i.ref;return!_&&o&&(o.call?o(null):o.current=null),t?!t(this.props,i)||!_:me(this.props,i)}function r(i){return this.shouldComponentUpdate=n,S(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ne.prototype=new E).isPureReactComponent=!0,ne.prototype.shouldComponentUpdate=function(e,t){return me(this.props,e)||me(this.state,t)};var Fe=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fe&&Fe(e)};var fn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function St(e){function t(n){var r=xt({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=fn,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Ve=function(e,t){return e==null?null:P(P(e).map(t))},Ct={map:Ve,forEach:Ve,count:function(e){return e?P(e).length:0},only:function(e){var t=P(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:P},pn=a.__e;a.__e=function(e,t,n,r){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}pn(e,t,n,r)};var Be=a.unmount;function $t(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=xt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return $t(r,t,n)})),e}function wt(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return wt(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function W(){this.__u=0,this.t=null,this.__b=null}function Ot(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Pt(e){var t,n,r;function i(o){if(t||(t=e()).then(function(_){n=_.default||_},function(_){r=_}),r)throw r;if(!n)throw t;return S(n,o)}return i.displayName="Lazy",i.__f=!0,i}function A(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),Be&&Be(e)},(W.prototype=new E).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=Ot(r.__v),o=!1,_=function(){o||(o=!0,n.__R=null,i?i(c):c())};n.__R=_;var c=function(){if(!--r.__u){if(r.state.__a){var p=r.state.__a;r.__v.__k[0]=wt(p,p.__c.__P,p.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.t.pop();)u.forceUpdate()}},s=t.__h===!0;r.__u++||s||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(_,_)},W.prototype.componentWillUnmount=function(){this.t=[]},W.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=$t(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&S(C,null,e.fallback);return i&&(i.__h=null),[S(C,null,t.__a?null:e.children),i]};var ze=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function dn(e){return this.getChildContext=function(){return e.context},e.children}function hn(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),j(S(dn,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Nt(e,t){var n=S(hn,{__v:e,i:t});return n.containerInfo=t,n}(A.prototype=new E).__a=function(e){var t=this,n=Ot(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),ze(t,e,r)):i()};n?n(o):o()}},A.prototype.render=function(e){this.u=null,this.o=new Map;var t=P(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},A.prototype.componentDidUpdate=A.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){ze(e,n,t)})};var Dt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,mn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,vn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,yn=/[A-Z0-9]/g,gn=typeof document<"u",bn=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Rt(e,t,n){return t.__k==null&&(t.textContent=""),j(e,t),typeof n=="function"&&n(),e?e.__c:null}function Ut(e,t,n){return at(e,t),typeof n=="function"&&n(),e?e.__c:null}E.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var qe=a.event;function kn(){}function xn(){return this.cancelBubble}function En(){return this.defaultPrevented}a.event=function(e){return qe&&(e=qe(e)),e.persist=kn,e.isPropagationStopped=xn,e.isDefaultPrevented=En,e.nativeEvent=e};var Ee,Sn={enumerable:!1,configurable:!0,get:function(){return this.class}},Ke=a.vnode;a.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,i={};for(var o in n){var _=n[o];if(!(o==="value"&&"defaultValue"in n&&_==null||gn&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var c=o.toLowerCase();o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&_===!0?_="":c==="ondoubleclick"?o="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||bn(n.type)?c==="onfocus"?o="onfocusin":c==="onblur"?o="onfocusout":vn.test(o)?o=c:r.indexOf("-")===-1&&mn.test(o)?o=o.replace(yn,"-$&").toLowerCase():_===null&&(_=void 0):c=o="oninput",c==="oninput"&&i[o=c]&&(o="oninputCapture"),i[o]=_}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach(function(s){s.props.selected=i.value.indexOf(s.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=P(n.children).forEach(function(s){s.props.selected=i.multiple?i.defaultValue.indexOf(s.props.value)!=-1:i.defaultValue==s.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",Sn)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i}(e),e.$$typeof=Dt,Ke&&Ke(e)};var Je=a.__r;a.__r=function(e){Je&&Je(e),Ee=e.__c};var Ge=a.diffed;a.diffed=function(e){Ge&&Ge(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Ee=null};var At={ReactCurrentDispatcher:{current:{readContext:function(e){return Ee.__n[e.__c].props.value}}}},Cn="17.0.2";function Mt(e){return S.bind(null,e)}function Se(e){return!!e&&e.$$typeof===Dt}function jt(e){return Se(e)?tn.apply(null,arguments):e}function Tt(e){return!!e.__k&&(j(null,e),!0)}function Lt(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ht=function(e,t){return e(t)},It=function(e,t){return e(t)},Wt=C;function Ce(e){e()}function Ft(e){return e}function Vt(){return[!1,Ce]}var Bt=B;function zt(e,t){var n=t(),r=ie({h:{__:n,v:t}}),i=r[0].h,o=r[1];return B(function(){i.__=n,i.v=t,ae(i.__,t())||o({h:i})},[e,n,t]),ue(function(){return ae(i.__,i.v())||o({h:i}),e(function(){ae(i.__,i.v())||o({h:i})})},[e]),n}var $n={useState:ie,useId:yt,useReducer:ge,useEffect:ue,useLayoutEffect:B,useInsertionEffect:Bt,useTransition:Vt,useDeferredValue:Ft,useSyncExternalStore:zt,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:_e,useCallback:mt,useContext:vt,useDebugValue:be,version:"17.0.2",Children:Ct,render:Rt,hydrate:Ut,unmountComponentAtNode:Tt,createPortal:Nt,createElement:S,createContext:ft,createFactory:Mt,cloneElement:jt,createRef:nt,Fragment:C,isValidElement:Se,findDOMNode:Lt,Component:E,PureComponent:ne,memo:Et,forwardRef:St,flushSync:It,unstable_batchedUpdates:Ht,StrictMode:Wt,Suspense:W,SuspenseList:A,lazy:Pt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At};const wn=Object.freeze(Object.defineProperty({__proto__:null,Children:Ct,Component:E,Fragment:C,PureComponent:ne,StrictMode:Wt,Suspense:W,SuspenseList:A,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:At,cloneElement:jt,createContext:ft,createElement:S,createFactory:Mt,createPortal:Nt,createRef:nt,default:$n,findDOMNode:Lt,flushSync:It,forwardRef:St,hydrate:Ut,isValidElement:Se,lazy:Pt,memo:Et,render:Rt,startTransition:Ce,unmountComponentAtNode:Tt,unstable_batchedUpdates:Ht,useCallback:mt,useContext:vt,useDebugValue:be,useDeferredValue:Ft,useEffect:ue,useErrorBoundary:nn,useId:yt,useImperativeHandle:ht,useInsertionEffect:Bt,useLayoutEffect:B,useMemo:_e,useReducer:ge,useRef:dt,useState:ie,useSyncExternalStore:zt,useTransition:Vt,version:Cn},Symbol.toStringTag,{value:"Module"}));function On(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var qt={exports:{}},Kt={};const Jt=Pn(wn);var Gt={exports:{}},Yt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.min.js
|
|
4
4
|
*
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ce=Jt,In=Hn;function Wn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fn=typeof Object.is=="function"?Object.is:Wn,Vn=In.useSyncExternalStore,Bn=ce.useRef,zn=ce.useEffect,qn=ce.useMemo,Kn=ce.useDebugValue;Kt.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Bn(null);if(o.current===null){var _={hasValue:!1,value:null};o.current=_}else _=o.current;o=qn(function(){function l
|
|
17
|
+
*/var ce=Jt,In=Hn;function Wn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fn=typeof Object.is=="function"?Object.is:Wn,Vn=In.useSyncExternalStore,Bn=ce.useRef,zn=ce.useEffect,qn=ce.useMemo,Kn=ce.useDebugValue;Kt.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Bn(null);if(o.current===null){var _={hasValue:!1,value:null};o.current=_}else _=o.current;o=qn(function(){function s(l){if(!p){if(p=!0,u=l,l=r(l),i!==void 0&&_.hasValue){var d=_.value;if(i(d,l))return h=d}return h=l}if(d=h,Fn(u,l))return d;var $=r(l);return i!==void 0&&i(d,$)?d:(u=l,h=$)}var p=!1,u,h,f=n===void 0?null:n;return[function(){return s(t())},f===null?void 0:function(){return s(f())}]},[t,n,r,i]);var c=Vn(e,o[0],o[1]);return zn(function(){_.hasValue=!0,_.value=c},[c]),Kn(c),c};qt.exports=Kt;var Jn=qt.exports;const Gn=On(Jn),{useSyncExternalStoreWithSelector:Yn}=Gn;function Zn(e,t=e.getState,n){const r=Yn(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return be(r),r}const Ye=e=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?an(e):e,n=(r,i)=>Zn(t,r,i);return Object.assign(n,t),n},Qn=e=>e?Ye(e):Ye,Xn={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"},permissions:[{slug:"settings",title:"Preferences",description:"Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in."}],baseData:{},cookie:{},choiceMade:!1,settingsOpen:!1};/*! js-cookie v3.0.5 | MIT */function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var er={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ve(e,t){function n(i,o,_){if(!(typeof document>"u")){_=G({},t,_),typeof _.expires=="number"&&(_.expires=new Date(Date.now()+_.expires*864e5)),_.expires&&(_.expires=_.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var s in _)_[s]&&(c+="; "+s,_[s]!==!0&&(c+="="+_[s].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+c}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],_={},c=0;c<o.length;c++){var s=o[c].split("="),p=s.slice(1).join("=");try{var u=decodeURIComponent(s[0]);if(_[u]=e.read(p,u),i===u)break}catch{}}return i?_[i]:_}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",G({},o,{expires:-1}))},withAttributes:function(i){return ve(this.converter,G({},this.attributes,i))},withConverter:function(i){return ve(G({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Q=ve(er,{path:"/"});const M=ln(Xn,window.leckerliSettings??{}),re=Q.get(M.name);M.cookie=xe(re)?JSON.parse(re):M.permissions.reduce((e,t)=>({...e,[t.slug]:!1}),M.baseData);M.choiceMade=xe(re);const $e=Qn((e,t)=>({...M,init:()=>{kt(re)&&t().choiceMade&&Q.set(t().name,JSON.stringify(t().cookie)),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))},setChoice:n=>e(r=>({...r,choiceMade:n})),setModal:n=>e(r=>(document.dispatchEvent(new CustomEvent(`leckerli:modal-${n?"opened":"closed"}`)),{...r,settingsOpen:n})),setPermissions:(n,r)=>e(i=>{const o=Array.isArray(n)?n:[n],_=i.permissions.reduce((c,s)=>(o.includes(s.slug)?c[s.slug]=r:c[s.slug]=i.cookie[s.slug]??!1,c),i.baseData);return Q.set(i.name,JSON.stringify(_)),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated")),{...i,choiceMade:!0,cookie:_}}),togglePermission:n=>e(r=>{const i=r.permissions.reduce((o,_)=>(n===_.slug?o[_.slug]=xe(r.cookie[_.slug])?!r.cookie[_.slug]:!0:o[_.slug]=r.cookie[_.slug]??!1,o),r.baseData);return Q.set(r.name,JSON.stringify(i)),document.dispatchEvent(new CustomEvent("leckerli:permissions-updated")),{...r,choiceMade:!0,cookie:i}}),acceptAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!0)},rejectAll:()=>{t().setPermissions(t().permissions.map(n=>n.slug),!1)}}));var tr=0;function y(e,t,n,r,i,o){var _,c,s={};for(c in t)c=="ref"?_=t[c]:s[c]=t[c];var p={type:e,props:s,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--tr,__source:i,__self:o};if(typeof e=="function"&&(_=e.defaultProps))for(c in _)s[c]===void 0&&(s[c]=_[c]);return a.vnode&&a.vnode(p),p}const nr=()=>{const{banner:e,acceptAll:t,rejectAll:n,setModal:r}=$e();return y("div",{class:"fixed z-[9998] bottom-0 left-0 max-w-md bg-background m-2 px-5 py-4 space-y-4 font-primary text-foreground rounded-md",children:[y("h3",{class:"m-0 font-primary font-semibold text-lg md:text-xl",children:e.title}),y("p",{class:"m-0 leading-snug font-primary text-sm md:text-base",children:e.description}),y("div",{class:"pt-2 space-y-2",children:[y("button",{type:"button",class:"rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:()=>r(!0),children:e.customise}),y("button",{type:"button",class:"rounded mr-2 bg-background font-primary font-semibold text-primary px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:border-primary-hover hover:text-primary-hover active:border-primary-active active:text-primary-active transition-colors",onClick:n,children:e.reject}),y("button",{type:"button",class:"rounded mr-2 bg-primary font-primary font-semibold text-background px-2 md:px-3.5 py-1.5 md:py-2.5 text-sm border-2 border-solid border-primary hover:bg-primary-hover hover:border-primary-hover active:bg-primary-active active:border-primary-active transition-colors",onClick:t,children:e.accept})]})]})},rr=()=>{const{permissions:e,cookie:t,togglePermission:n,banner:r,setModal:i}=$e();return y("div",{class:"fixed z-[9999] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-background text-foreground m-2 px-5 py-4 font-primary text-black rounded-md max-h-full",children:[y("div",{class:"space-y-6",children:[y("h3",{class:"w-10/12 m-0 font-primary font-semibold text-xl md:text-2xl",children:r.customise}),e.map(({slug:o,title:_,description:c})=>y("div",{children:[y("div",{class:"flex items-start justify-between",children:[y("h3",{class:"m-0 font-primary font-semibold text-lg",children:_}),y("button",{type:"button",class:`${t[o]?"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`,role:"switch","aria-checked":"false",onClick:()=>n(o),children:[y("span",{class:"sr-only",children:"Toggle"}),y("span",{"aria-hidden":"true",class:`${t[o]?"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`})]})]}),y("p",{class:"m-0 mt-2 leading-snug font-primary text-sm md:text-base",children:c})]},`setting-${o}`))]}),y("button",{class:"absolute top-0 right-0 w-8 h-8 mt-0 text-xl rounded-full",onClick:()=>i(!1),children:"×"})]})},or=()=>{const{choiceMade:e,init:t,settingsOpen:n}=$e();return ue(()=>{t()},[]),y(C,{children:[!e&&!n&&y(nr,{}),n&&y(rr,{})]})};const we=document.createElement("div");we.id="lkrl-wrapper";document.body.appendChild(we);j(y(or,{}),we);
|
package/dist/index.html
CHANGED
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
<h1>Your website here 🤗</h1>
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
|
|
16
16
|
<script>
|
|
17
|
-
|
|
18
|
-
window.leckerliSettings = {
|
|
17
|
+
window.leckerliSettings.banner = {
|
|
19
18
|
baseData: {
|
|
20
19
|
consentid: 'b638a4a9-a846-475a-a29b-d2bb596cb735',
|
|
21
20
|
},
|
|
@@ -41,7 +40,11 @@
|
|
|
41
40
|
}
|
|
42
41
|
],
|
|
43
42
|
}
|
|
44
|
-
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
document.addEventListener('leckerli:modal-closed', () => console.log('modal closed'))
|
|
46
|
+
document.addEventListener('leckerli:modal-opened', () => console.log('modal opened'))
|
|
47
|
+
document.addEventListener('leckerli:permissions-updated', () => console.log('permissions updated'))
|
|
45
48
|
</script>
|
|
46
49
|
|
|
47
50
|
<style>
|
package/index.html
CHANGED
|
@@ -9,41 +9,66 @@
|
|
|
9
9
|
<h1>Your website here 🤗</h1>
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
<script defer type="module" src="/src/index.tsx"></script
|
|
12
|
+
<!-- <script defer type="module" src="/src/index.tsx"></script>-->
|
|
13
13
|
|
|
14
14
|
<script>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
consentid: 'b638a4a9-a846-475a-a29b-d2bb596cb735',
|
|
19
|
-
},
|
|
20
|
-
banner: {
|
|
15
|
+
window.leckerliSettings = {};
|
|
16
|
+
|
|
17
|
+
window.leckerliSettings.banner = {
|
|
21
18
|
title: 'Nous respectons votre vie privée.',
|
|
22
19
|
description: 'Nous utilisons des cookies pour améliorer votre expérience de navigation, diffuser des publicités ou des contenus personnalisés et analyser notre trafic. En cliquant sur « Tout accepter », vous consentez à notre utilisation des cookies.',
|
|
23
20
|
accept: 'Accepter tout',
|
|
24
21
|
reject: 'Tout rejeter',
|
|
25
22
|
customise: 'Personnaliser',
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
window.leckerliSettings.permissions = [
|
|
28
|
+
{
|
|
29
|
+
slug: 'ga',
|
|
30
|
+
title: 'Google analytics',
|
|
31
|
+
description: 'To track all your actions.'
|
|
32
|
+
|
|
26
33
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
{
|
|
35
|
+
slug: 'settings',
|
|
36
|
+
title: 'Preferences',
|
|
37
|
+
description: 'Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.'
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const leckerliScript = document.createElement('script');
|
|
43
|
+
leckerliScript.src = '//www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.js';
|
|
44
|
+
document.body.appendChild(leckerliScript);
|
|
45
|
+
|
|
46
|
+
const leckerliStyles = document.createElement('link');
|
|
47
|
+
leckerliStyles.rel = 'stylesheet';
|
|
48
|
+
leckerliStyles.href = '//www.unpkg.com/@antistatique/leckerli/dist/assets/leckerli.min.css';
|
|
49
|
+
document.head.appendChild(leckerliStyles);
|
|
50
|
+
|
|
51
|
+
// To listen the initialisation
|
|
52
|
+
document.addEventListener('leckerli:initialised', (event) => {
|
|
53
|
+
// to get cookie data OR null if the user's choice has not been made
|
|
54
|
+
console.log('init', event.detail.cookie);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// To listen to the permissions / cookie's updates
|
|
58
|
+
document.addEventListener('leckerli:permissions-updated', (event) => {
|
|
59
|
+
// to get cookie data
|
|
60
|
+
console.log('update', event.detail.cookie);
|
|
61
|
+
});
|
|
43
62
|
|
|
44
|
-
|
|
45
|
-
document.addEventListener('leckerli:modal-opened', () =>
|
|
46
|
-
|
|
63
|
+
// To listen the modal states
|
|
64
|
+
document.addEventListener('leckerli:modal-opened', () => {
|
|
65
|
+
// react to modal opened
|
|
66
|
+
console.log('modal opened')
|
|
67
|
+
});
|
|
68
|
+
document.addEventListener('leckerli:modal-closed', () => {
|
|
69
|
+
// react to modal closed
|
|
70
|
+
console.log('modal closed')
|
|
71
|
+
});
|
|
47
72
|
</script>
|
|
48
73
|
|
|
49
74
|
<style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antistatique/leckerli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Lightweight and customisable GDPR cookie consent manager",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": "https://github.com/antistatique/leckerli",
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"typescript": "^5.0.2",
|
|
30
30
|
"vite": "^4.3.9"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
package/src/hooks/useSettings.ts
CHANGED
|
@@ -49,6 +49,13 @@ const useSettings = create<SettingsStore>((set, getState) => ({
|
|
|
49
49
|
cookies.set(getState().name, JSON.stringify(getState().cookie));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// Emit initial event and data or null if the choice has not been made
|
|
53
|
+
document.dispatchEvent(
|
|
54
|
+
new CustomEvent('leckerli:initialised', {
|
|
55
|
+
detail: { cookie: getState().choiceMade ? getState().cookie : null },
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
|
|
52
59
|
// Open banner by resseting choiceMade
|
|
53
60
|
document.addEventListener('leckerli:open-banner', () => getState().setChoice(false));
|
|
54
61
|
document.addEventListener('leckerli:close-banner', () => getState().setChoice(true));
|
|
@@ -85,7 +92,12 @@ const useSettings = create<SettingsStore>((set, getState) => ({
|
|
|
85
92
|
|
|
86
93
|
cookies.set(state.name, JSON.stringify(newCookie));
|
|
87
94
|
|
|
88
|
-
|
|
95
|
+
// Emit event and data
|
|
96
|
+
document.dispatchEvent(
|
|
97
|
+
new CustomEvent('leckerli:permissions-updated', {
|
|
98
|
+
detail: { cookie: newCookie },
|
|
99
|
+
})
|
|
100
|
+
);
|
|
89
101
|
|
|
90
102
|
return { ...state, choiceMade: true, cookie: newCookie };
|
|
91
103
|
}),
|
|
@@ -104,7 +116,12 @@ const useSettings = create<SettingsStore>((set, getState) => ({
|
|
|
104
116
|
|
|
105
117
|
cookies.set(state.name, JSON.stringify(newCookie));
|
|
106
118
|
|
|
107
|
-
|
|
119
|
+
// Emit event and data
|
|
120
|
+
document.dispatchEvent(
|
|
121
|
+
new CustomEvent('leckerli:permissions-updated', {
|
|
122
|
+
detail: { cookie: newCookie },
|
|
123
|
+
})
|
|
124
|
+
);
|
|
108
125
|
|
|
109
126
|
return { ...state, choiceMade: true, cookie: newCookie };
|
|
110
127
|
}),
|