UNPKG

@c15t/react

Version:

Developer-first CMP for React: cookie banner, consent manager, preferences centre. GDPR ready with minimal setup and rich customization

2 lines 3.46 kB
'use client'; "use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConsentManagerWidget:()=>ConsentManagerWidget});let jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),use_theme_cjs_namespaceObject=require("../../hooks/use-theme.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),dialog_card_cjs_namespaceObject=require("../consent-manager-dialog/atoms/dialog-card.cjs"),accordion_cjs_namespaceObject=require("./atoms/accordion.cjs"),button_cjs_namespaceObject=require("./atoms/button.cjs"),footer_cjs_namespaceObject=require("./atoms/footer.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),ConsentManagerWidget=({hideBrading:e,theme:t,noStyle:a,disableAnimation:c,scrollLock:_,trapFocus:n,...r})=>{let[s,o]=(0,external_react_namespaceObject.useState)([]),{common:i}=(0,use_translations_cjs_namespaceObject.useTranslations)(),j=(0,use_theme_cjs_namespaceObject.useTheme)(),m={theme:{...j.theme,...t},noStyle:a??j.noStyle,disableAnimation:c??j.disableAnimation,scrollLock:_??j.scrollLock,trapFocus:n??j.trapFocus,...r};return(0,jsx_runtime_namespaceObject.jsxs)(root_cjs_namespaceObject.ConsentManagerWidgetRoot,{...m,children:[(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentManagerWidgetAccordion,{themeKey:"widget.accordion",type:"multiple",value:s,onValueChange:o,children:(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentManagerWidgetAccordionItems,{})}),(0,jsx_runtime_namespaceObject.jsxs)(footer_cjs_namespaceObject.ConsentManagerWidgetFooter,{children:[(0,jsx_runtime_namespaceObject.jsxs)(footer_cjs_namespaceObject.ConsentManagerWidgetFooterSubGroup,{themeKey:"widget.footer.sub-group",children:[(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetRejectButton,{themeKey:"widget.footer.reject-button",children:i.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetAcceptAllButton,{themeKey:"widget.footer.accept-button",children:i.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)(button_cjs_namespaceObject.ConsentManagerWidgetSaveButton,{themeKey:"widget.footer.save-button",children:i.save})]}),!e&&(0,jsx_runtime_namespaceObject.jsx)(dialog_card_cjs_namespaceObject.DialogFooter,{themeKey:"widget.branding",children:(0,jsx_runtime_namespaceObject.jsx)(dialog_card_cjs_namespaceObject.BrandingFooter,{})})]})};for(var __webpack_i__ in exports.ConsentManagerWidget=__webpack_exports__.ConsentManagerWidget,__webpack_exports__)-1===["ConsentManagerWidget"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});