react-cookie-disclaimer
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);t.default=n.CookieDisclaimer},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CookieDisclaimer=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(2),u=c(o),i=c(r(5));function c(e){return e&&e.__esModule?e:{default:e}}r(8);var f=t.CookieDisclaimer=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"render",value:function(){return u.default.createElement("div",{className:"cookie-disclaimer"},this.props.text)}}]),t}(o.Component);f.propTypes={text:i.default.string},f.defaultProps={text:"We use cookies to operate the website and platform, for analytical purposes, and for advertising/targeting purposes."}},function(e,t,r){"use strict";e.exports=r(3)},function(e,t,r){"use strict"; | ||
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);t.default=n.CookieDisclaimer},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CookieDisclaimer=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(2),u=a(o),i=a(r(5)),c=r(8);function a(e){return e&&e.__esModule?e:{default:e}}r(9);var l=t.CookieDisclaimer=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={close:!1},r.closeDisclaimer=r.closeDisclaimer.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"closeDisclaimer",value:function(){this.setState({close:!0}),c.Cookie.set("react-cookie-disclaimer",!0,{"max-age":this.props.maxAge})}},{key:"render",value:function(){var e=c.Cookie.get("react-cookie-disclaimer"),t=c.LocalStorage.get("react-cookie-disclaimer");if(e||t)return null;var r=this.state.close;return u.default.createElement("div",{className:"cookie-disclaimer",style:r?{visibility:"hidden"}:{}},u.default.createElement("div",{className:"cookie-disclaimer__close",onClick:this.closeDisclaimer}),this.props.text)}}]),t}(o.Component);l.propTypes={text:i.default.string,maxAge:i.default.number},l.defaultProps={text:"We use cookies to operate the website and platform, for analytical purposes, and for advertising/targeting purposes.",maxAge:3600}},function(e,t,r){"use strict";e.exports=r(3)},function(e,t,r){"use strict"; | ||
/** @license React v16.12.0 | ||
@@ -9,3 +9,3 @@ * react.production.min.js | ||
* LICENSE file in the root directory of this source tree. | ||
*/var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(4),u="function"==typeof Symbol&&Symbol.for,i=u?Symbol.for("react.element"):60103,c=u?Symbol.for("react.portal"):60106,f=u?Symbol.for("react.fragment"):60107,l=u?Symbol.for("react.strict_mode"):60108,a=u?Symbol.for("react.profiler"):60114,s=u?Symbol.for("react.provider"):60109,p=u?Symbol.for("react.context"):60110,y=u?Symbol.for("react.forward_ref"):60112,d=u?Symbol.for("react.suspense"):60113;u&&Symbol.for("react.suspense_list");var b=u?Symbol.for("react.memo"):60115,m=u?Symbol.for("react.lazy"):60116;u&&Symbol.for("react.fundamental"),u&&Symbol.for("react.responder"),u&&Symbol.for("react.scope");var v="function"==typeof Symbol&&Symbol.iterator;function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g={};function O(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||_}function S(){}function j(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||_}O.prototype.isReactComponent={},O.prototype.setState=function(e,t){if("object"!==(void 0===e?"undefined":n(e))&&"function"!=typeof e&&null!=e)throw Error(h(85));this.updater.enqueueSetState(this,e,t,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=O.prototype;var w=j.prototype=new S;w.constructor=j,o(w,O.prototype),w.isPureReactComponent=!0;var k={current:null},P={current:null},x=Object.prototype.hasOwnProperty,C={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,r){var n,o={},u=null,c=null;if(null!=t)for(n in void 0!==t.ref&&(c=t.ref),void 0!==t.key&&(u=""+t.key),t)x.call(t,n)&&!C.hasOwnProperty(n)&&(o[n]=t[n]);var f=arguments.length-2;if(1===f)o.children=r;else if(1<f){for(var l=Array(f),a=0;a<f;a++)l[a]=arguments[a+2];o.children=l}if(e&&e.defaultProps)for(n in f=e.defaultProps)void 0===o[n]&&(o[n]=f[n]);return{$$typeof:i,type:e,key:u,ref:c,props:o,_owner:P.current}}function R(e){return"object"===(void 0===e?"undefined":n(e))&&null!==e&&e.$$typeof===i}var $=/\/+/g,T=[];function I(e,t,r,n){if(T.length){var o=T.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function M(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>T.length&&T.push(e)}function A(e,t,r){return null==e?0:function e(t,r,o,u){var f=void 0===t?"undefined":n(t);"undefined"!==f&&"boolean"!==f||(t=null);var l=!1;if(null===t)l=!0;else switch(f){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case i:case c:l=!0}}if(l)return o(u,t,""===r?"."+D(t,0):r),1;if(l=0,r=""===r?".":r+":",Array.isArray(t))for(var a=0;a<t.length;a++){var s=r+D(f=t[a],a);l+=e(f,s,o,u)}else if(null===t||"object"!==(void 0===t?"undefined":n(t))?s=null:s="function"==typeof(s=v&&t[v]||t["@@iterator"])?s:null,"function"==typeof s)for(t=s.call(t),a=0;!(f=t.next()).done;)l+=e(f=f.value,s=r+D(f,a++),o,u);else if("object"===f)throw o=""+t,Error(h(31,"[object Object]"===o?"object with keys {"+Object.keys(t).join(", ")+"}":o,""));return l}(e,"",t,r)}function D(e,t){return"object"===(void 0===e?"undefined":n(e))&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function U(e,t){e.func.call(e.context,t,e.count++)}function q(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?L(e,n,r,(function(e){return e})):null!=e&&(R(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace($,"$&/")+"/")+r)),n.push(e))}function L(e,t,r,n,o){var u="";null!=r&&(u=(""+r).replace($,"$&/")+"/"),A(e,q,t=I(t,u,n,o)),M(t)}function N(){var e=k.current;if(null===e)throw Error(h(321));return e}var F={Children:{map:function(e,t,r){if(null==e)return e;var n=[];return L(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;A(e,U,t=I(null,null,t,r)),M(t)},count:function(e){return A(e,(function(){return null}),null)},toArray:function(e){var t=[];return L(e,t,null,(function(e){return e})),t},only:function(e){if(!R(e))throw Error(h(143));return e}},createRef:function(){return{current:null}},Component:O,PureComponent:j,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:p,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:y,render:e}},lazy:function(e){return{$$typeof:m,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:b,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return N().useCallback(e,t)},useContext:function(e,t){return N().useContext(e,t)},useEffect:function(e,t){return N().useEffect(e,t)},useImperativeHandle:function(e,t,r){return N().useImperativeHandle(e,t,r)},useDebugValue:function(){},useLayoutEffect:function(e,t){return N().useLayoutEffect(e,t)},useMemo:function(e,t){return N().useMemo(e,t)},useReducer:function(e,t,r){return N().useReducer(e,t,r)},useRef:function(e){return N().useRef(e)},useState:function(e){return N().useState(e)},Fragment:f,Profiler:a,StrictMode:l,Suspense:d,createElement:E,cloneElement:function(e,t,r){if(null==e)throw Error(h(267,e));var n=o({},e.props),u=e.key,c=e.ref,f=e._owner;if(null!=t){if(void 0!==t.ref&&(c=t.ref,f=P.current),void 0!==t.key&&(u=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)x.call(t,a)&&!C.hasOwnProperty(a)&&(n[a]=void 0===t[a]&&void 0!==l?l[a]:t[a])}var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){l=Array(a);for(var s=0;s<a;s++)l[s]=arguments[s+2];n.children=l}return{$$typeof:i,type:e.type,key:u,ref:c,props:n,_owner:f}},createFactory:function(e){var t=E.bind(null,e);return t.type=e,t},isValidElement:R,version:"16.12.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:k,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:P,IsSomeRendererActing:{current:!1},assign:o}},V={default:F},W=V&&F||V;e.exports=W.default||W},function(e,t,r){"use strict"; | ||
*/var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(4),u="function"==typeof Symbol&&Symbol.for,i=u?Symbol.for("react.element"):60103,c=u?Symbol.for("react.portal"):60106,a=u?Symbol.for("react.fragment"):60107,l=u?Symbol.for("react.strict_mode"):60108,f=u?Symbol.for("react.profiler"):60114,s=u?Symbol.for("react.provider"):60109,p=u?Symbol.for("react.context"):60110,y=u?Symbol.for("react.forward_ref"):60112,d=u?Symbol.for("react.suspense"):60113;u&&Symbol.for("react.suspense_list");var m=u?Symbol.for("react.memo"):60115,b=u?Symbol.for("react.lazy"):60116;u&&Symbol.for("react.fundamental"),u&&Symbol.for("react.responder"),u&&Symbol.for("react.scope");var v="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S={};function O(e,t,r){this.props=e,this.context=t,this.refs=S,this.updater=r||h}function _(){}function j(e,t,r){this.props=e,this.context=t,this.refs=S,this.updater=r||h}O.prototype.isReactComponent={},O.prototype.setState=function(e,t){if("object"!==(void 0===e?"undefined":n(e))&&"function"!=typeof e&&null!=e)throw Error(g(85));this.updater.enqueueSetState(this,e,t,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=O.prototype;var k=j.prototype=new _;k.constructor=j,o(k,O.prototype),k.isPureReactComponent=!0;var x={current:null},w={current:null},C=Object.prototype.hasOwnProperty,P={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,r){var n,o={},u=null,c=null;if(null!=t)for(n in void 0!==t.ref&&(c=t.ref),void 0!==t.key&&(u=""+t.key),t)C.call(t,n)&&!P.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var l=Array(a),f=0;f<a;f++)l[f]=arguments[f+2];o.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:i,type:e,key:u,ref:c,props:o,_owner:w.current}}function I(e){return"object"===(void 0===e?"undefined":n(e))&&null!==e&&e.$$typeof===i}var R=/\/+/g,$=[];function T(e,t,r,n){if($.length){var o=$.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function N(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>$.length&&$.push(e)}function A(e,t,r){return null==e?0:function e(t,r,o,u){var a=void 0===t?"undefined":n(t);"undefined"!==a&&"boolean"!==a||(t=null);var l=!1;if(null===t)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case i:case c:l=!0}}if(l)return o(u,t,""===r?"."+D(t,0):r),1;if(l=0,r=""===r?".":r+":",Array.isArray(t))for(var f=0;f<t.length;f++){var s=r+D(a=t[f],f);l+=e(a,s,o,u)}else if(null===t||"object"!==(void 0===t?"undefined":n(t))?s=null:s="function"==typeof(s=v&&t[v]||t["@@iterator"])?s:null,"function"==typeof s)for(t=s.call(t),f=0;!(a=t.next()).done;)l+=e(a=a.value,s=r+D(a,f++),o,u);else if("object"===a)throw o=""+t,Error(g(31,"[object Object]"===o?"object with keys {"+Object.keys(t).join(", ")+"}":o,""));return l}(e,"",t,r)}function D(e,t){return"object"===(void 0===e?"undefined":n(e))&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function U(e,t){e.func.call(e.context,t,e.count++)}function M(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?L(e,n,r,(function(e){return e})):null!=e&&(I(e)&&(e=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(R,"$&/")+"/")+r)),n.push(e))}function L(e,t,r,n,o){var u="";null!=r&&(u=(""+r).replace(R,"$&/")+"/"),A(e,M,t=T(t,u,n,o)),N(t)}function q(){var e=x.current;if(null===e)throw Error(g(321));return e}var F={Children:{map:function(e,t,r){if(null==e)return e;var n=[];return L(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;A(e,U,t=T(null,null,t,r)),N(t)},count:function(e){return A(e,(function(){return null}),null)},toArray:function(e){var t=[];return L(e,t,null,(function(e){return e})),t},only:function(e){if(!I(e))throw Error(g(143));return e}},createRef:function(){return{current:null}},Component:O,PureComponent:j,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:p,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:y,render:e}},lazy:function(e){return{$$typeof:b,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:m,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return q().useCallback(e,t)},useContext:function(e,t){return q().useContext(e,t)},useEffect:function(e,t){return q().useEffect(e,t)},useImperativeHandle:function(e,t,r){return q().useImperativeHandle(e,t,r)},useDebugValue:function(){},useLayoutEffect:function(e,t){return q().useLayoutEffect(e,t)},useMemo:function(e,t){return q().useMemo(e,t)},useReducer:function(e,t,r){return q().useReducer(e,t,r)},useRef:function(e){return q().useRef(e)},useState:function(e){return q().useState(e)},Fragment:a,Profiler:f,StrictMode:l,Suspense:d,createElement:E,cloneElement:function(e,t,r){if(null==e)throw Error(g(267,e));var n=o({},e.props),u=e.key,c=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(c=t.ref,a=w.current),void 0!==t.key&&(u=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(f in t)C.call(t,f)&&!P.hasOwnProperty(f)&&(n[f]=void 0===t[f]&&void 0!==l?l[f]:t[f])}var f=arguments.length-2;if(1===f)n.children=r;else if(1<f){l=Array(f);for(var s=0;s<f;s++)l[s]=arguments[s+2];n.children=l}return{$$typeof:i,type:e.type,key:u,ref:c,props:n,_owner:a}},createFactory:function(e){var t=E.bind(null,e);return t.type=e,t},isValidElement:I,version:"16.12.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:x,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:o}},J={default:F},V=J&&F||J;e.exports=V.default||V},function(e,t,r){"use strict"; | ||
/* | ||
@@ -15,2 +15,2 @@ object-assign | ||
@license MIT | ||
*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,c,f=i(e),l=1;l<arguments.length;l++){for(var a in r=Object(arguments[l]))o.call(r,a)&&(f[a]=r[a]);if(n){c=n(r);for(var s=0;s<c.length;s++)u.call(r,c[s])&&(f[c[s]]=r[c[s]])}}return f}},function(e,t,r){"use strict";e.exports=r(6)()},function(e,t,r){"use strict";var n=r(7);function o(){}function u(){}u.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,u,i){if(i!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:u,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){}]); | ||
*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,c,a=i(e),l=1;l<arguments.length;l++){for(var f in r=Object(arguments[l]))o.call(r,f)&&(a[f]=r[f]);if(n){c=n(r);for(var s=0;s<c.length;s++)u.call(r,c[s])&&(a[c[s]]=r[c[s]])}}return a}},function(e,t,r){"use strict";e.exports=r(6)()},function(e,t,r){"use strict";var n=r(7);function o(){}function u(){}u.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,u,i){if(i!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:u,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n={Cookie:{get:function(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):void 0},set:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Object.assign({path:"/"},r);n.expires&&(n.expires=n.expires.toUTCString());var o=encodeURIComponent(e)+"="+encodeURIComponent(t);for(var u in n){o+="; "+u;var i=n[u];!0!==i&&(o+="="+i)}document.cookie=o},remove:function(e){this.set(e,"",{"max-age":-1})}},LocalStorage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)?localStorage.getItem(e):null},setObject:function(e,t){localStorage.setItem(e,JSON.stringify(t))},getObject:function(e){return JSON.parse(localStorage.getItem(e))?JSON.parse(localStorage.getItem(e)):{}},remove:function(e){localStorage.removeItem(e)},clear:function(){localStorage.clear()}},SessionStorage:{set:function(e,t){sessionStorage.setItem(e,t)},get:function(e){return sessionStorage.getItem(e)?sessionStorage.getItem(e):null},setObject:function(e,t){sessionStorage.setItem(e,JSON.stringify(t))},getObject:function(e){return JSON.parse(sessionStorage.getItem(e))?JSON.parse(sessionStorage.getItem(e)):null},remove:function(e){sessionStorage.removeItem(e)},clear:function(){sessionStorage.clear()}}};e.exports=n},function(e,t,r){}]); |
{ | ||
"name": "react-cookie-disclaimer", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Cookie disclaimer", | ||
@@ -38,4 +38,5 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"combo-storage": "^1.1.0", | ||
"react": "^16.12.0" | ||
} | ||
} |
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { LocalStorage, Cookie } from 'combo-storage'; | ||
// Styles | ||
@@ -7,13 +8,34 @@ import './CookieDisclaimer.css'; | ||
export class CookieDisclaimer extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
close: false, | ||
}; | ||
this.closeDisclaimer = this.closeDisclaimer.bind(this); | ||
} | ||
static propTypes = { | ||
text: PropTypes.string | ||
text: PropTypes.string, | ||
maxAge: PropTypes.number, | ||
}; | ||
static defaultProps = { | ||
text: 'We use cookies to operate the website and platform, for analytical purposes, and for advertising/targeting purposes.' | ||
text: 'We use cookies to operate the website and platform, for analytical purposes, and for advertising/targeting purposes.', | ||
maxAge: 3600 | ||
}; | ||
closeDisclaimer(){ | ||
this.setState({close: true}); | ||
Cookie.set('react-cookie-disclaimer', true, {'max-age': this.props.maxAge}) | ||
} | ||
render() { | ||
const hasCookie = Cookie.get('react-cookie-disclaimer'); | ||
const hasStorage = LocalStorage.get('react-cookie-disclaimer'); | ||
if(hasCookie || hasStorage) { | ||
return null; | ||
} | ||
const closeDisclaimer = this.state.close; | ||
return( | ||
<div className='cookie-disclaimer'> | ||
<div className='cookie-disclaimer__close' /> | ||
<div className='cookie-disclaimer' style={closeDisclaimer ? {visibility: 'hidden'} : {}}> | ||
<div className='cookie-disclaimer__close' onClick={this.closeDisclaimer} /> | ||
{this.props.text} | ||
@@ -20,0 +42,0 @@ </div> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
18030
188
0
2
+ Addedcombo-storage@^1.1.0
+ Addedcombo-storage@1.1.3(transitive)