react-cookie-consent-popup 1.0.2 → 1.0.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mas Joobeh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,8 +1,20 @@
1
1
  # react-cookie-consent-popup
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/react-cookie-consent-popup)](https://www.npmjs.com/package/react-cookie-consent-popup)
4
+ [![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-cookie-consent-popup)](https://bundlephobia.com/package/react-cookie-consent-popup)
5
+ [![license](https://img.shields.io/npm/l/react-cookie-consent-popup)](https://github.com/Mas-HJ/react-cookie-consent-popup/blob/main/LICENSE)
6
+
3
7
  A React cookie consent popup component with a centered modal dialog. Supports service management, script loading, cookie/localStorage/sessionStorage cleanup, hash-based consent invalidation, a settings modal with toggles, and light/dark themes.
4
8
 
5
- [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/Mas-HJ/react-cookie-consent-popup/tree/main/demo?file=src/App.tsx)
9
+ ---
10
+
11
+ ### Live Demo
12
+
13
+ > **Try it out instantly!**
14
+ >
15
+ > [![Open in CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/Mas-HJ/react-cookie-consent-popup/tree/main?file=/demo/src/App.tsx)
16
+
17
+ ---
6
18
 
7
19
  ## Installation
8
20
 
package/dist/index.mjs ADDED
@@ -0,0 +1,15 @@
1
+ var vt=Object.create;var Le=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var Ct=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var ee=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(a,l)=>(typeof require<"u"?require:a)[l]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var Z=(i,a)=>()=>(a||i((a={exports:{}}).exports,a),a.exports);var Et=(i,a,l,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of _t(a))!St.call(i,g)&&g!==l&&Le(i,g,{get:()=>a[g],enumerable:!(d=wt(a,g))||d.enumerable});return i};var Pe=(i,a,l)=>(l=i!=null?vt(Ct(i)):{},Et(a||!i||!i.__esModule?Le(l,"default",{value:i,enumerable:!0}):l,i));var Oe=Z((bn,le)=>{(function(){"use strict";var i={}.hasOwnProperty;function a(){for(var g="",A=0;A<arguments.length;A++){var k=arguments[A];k&&(g=d(g,l(k)))}return g}function l(g){if(typeof g=="string"||typeof g=="number")return g;if(typeof g!="object")return"";if(Array.isArray(g))return a.apply(null,g);if(g.toString!==Object.prototype.toString&&!g.toString.toString().includes("[native code]"))return g.toString();var A="";for(var k in g)i.call(g,k)&&g[k]&&(A=d(A,k));return A}function d(g,A){return A?g?g+" "+A:g+A:g}typeof le<"u"&&le.exports?(a.default=a,le.exports=a):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return a}):window.classNames=a})()});var Re=Z((vn,Me)=>{"use strict";var Nt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Me.exports=Nt});var Ve=Z((wn,De)=>{"use strict";var Tt=Re();function je(){}function Fe(){}Fe.resetWarningCache=je;De.exports=function(){function i(d,g,A,k,P,O){if(O!==Tt){var R=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 R.name="Invariant Violation",R}}i.isRequired=i;function a(){return i}var l={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:Fe,resetWarningCache:je};return l.PropTypes=l,l}});var qe=Z((Sn,Ye)=>{Ye.exports=Ve()();var _n,Cn});var Xe=Z(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});var Lt=ee("react"),He=Pt(Lt);function Pt(i){return i&&i.__esModule?i:{default:i}}be.default=function(){return He.default.createElement("svg",{width:"14",height:"11",viewBox:"0 0 14 11"},He.default.createElement("path",{d:"M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0",fill:"#fff",fillRule:"evenodd"}))}});var $e=Z(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var Ut=ee("react"),We=Ot(Ut);function Ot(i){return i&&i.__esModule?i:{default:i}}ve.default=function(){return We.default.createElement("svg",{width:"10",height:"10",viewBox:"0 0 10 10"},We.default.createElement("path",{d:"M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12",fill:"#fff",fillRule:"evenodd"}))}});var Je=Z(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.pointerCoord=Mt;function Mt(i){if(i){var a=i.changedTouches;if(a&&a.length>0){var l=a[0];return{x:l.clientX,y:l.clientY}}var d=i.pageX;if(d!==void 0)return{x:d,y:i.pageY}}return{x:0,y:0}}});var ze=Z(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});var Rt=Object.assign||function(i){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(i[d]=l[d])}return i},jt=(function(){function i(a,l){for(var d=0;d<l.length;d++){var g=l[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(a,g.key,g)}}return function(a,l,d){return l&&i(a.prototype,l),d&&i(a,d),a}})(),Ke=ee("react"),te=se(Ke),Ft=Oe(),Dt=se(Ft),Vt=qe(),W=se(Vt),Yt=Xe(),qt=se(Yt),Ht=$e(),Xt=se(Ht),_e=Je();function se(i){return i&&i.__esModule?i:{default:i}}function Wt(i,a){var l={};for(var d in i)a.indexOf(d)>=0||Object.prototype.hasOwnProperty.call(i,d)&&(l[d]=i[d]);return l}function $t(i,a){if(!(i instanceof a))throw new TypeError("Cannot call a class as a function")}function Jt(i,a){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a&&(typeof a=="object"||typeof a=="function")?a:i}function Kt(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof a);i.prototype=Object.create(a&&a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(i,a):i.__proto__=a)}var fe=(function(i){Kt(a,i);function a(l){$t(this,a);var d=Jt(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,l));return d.handleClick=d.handleClick.bind(d),d.handleTouchStart=d.handleTouchStart.bind(d),d.handleTouchMove=d.handleTouchMove.bind(d),d.handleTouchEnd=d.handleTouchEnd.bind(d),d.handleFocus=d.handleFocus.bind(d),d.handleBlur=d.handleBlur.bind(d),d.previouslyChecked=!!(l.checked||l.defaultChecked),d.state={checked:!!(l.checked||l.defaultChecked),hasFocus:!1},d}return jt(a,[{key:"componentDidUpdate",value:function(d){d.checked!==this.props.checked&&this.setState({checked:!!this.props.checked})}},{key:"handleClick",value:function(d){if(!this.props.disabled){var g=this.input;if(d.target!==g&&!this.moved){this.previouslyChecked=g.checked,d.preventDefault(),g.focus(),g.click();return}var A=this.props.hasOwnProperty("checked")?this.props.checked:g.checked;this.setState({checked:A})}}},{key:"handleTouchStart",value:function(d){this.props.disabled||(this.startX=(0,_e.pointerCoord)(d).x,this.activated=!0)}},{key:"handleTouchMove",value:function(d){if(this.activated&&(this.moved=!0,this.startX)){var g=(0,_e.pointerCoord)(d).x;this.state.checked&&g+15<this.startX?(this.setState({checked:!1}),this.startX=g,this.activated=!0):g-15>this.startX&&(this.setState({checked:!0}),this.startX=g,this.activated=g<this.startX+5)}}},{key:"handleTouchEnd",value:function(d){if(this.moved){var g=this.input;if(d.preventDefault(),this.startX){var A=(0,_e.pointerCoord)(d).x;this.previouslyChecked===!0&&this.startX+4>A?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,g.click()):this.startX-4<A&&this.previouslyChecked!==this.state.checked&&(this.setState({checked:!0}),this.previouslyChecked=this.state.checked,g.click()),this.activated=!1,this.startX=null,this.moved=!1}}}},{key:"handleFocus",value:function(d){var g=this.props.onFocus;g&&g(d),this.setState({hasFocus:!0})}},{key:"handleBlur",value:function(d){var g=this.props.onBlur;g&&g(d),this.setState({hasFocus:!1})}},{key:"getIcon",value:function(d){var g=this.props.icons;return g?g[d]===void 0?a.defaultProps.icons[d]:g[d]:null}},{key:"render",value:function(){var d=this,g=this.props,A=g.className,k=g.icons,P=Wt(g,["className","icons"]),O=(0,Dt.default)("react-toggle",{"react-toggle--checked":this.state.checked,"react-toggle--focus":this.state.hasFocus,"react-toggle--disabled":this.props.disabled},A);return te.default.createElement("div",{className:O,onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd},te.default.createElement("div",{className:"react-toggle-track"},te.default.createElement("div",{className:"react-toggle-track-check"},this.getIcon("checked")),te.default.createElement("div",{className:"react-toggle-track-x"},this.getIcon("unchecked"))),te.default.createElement("div",{className:"react-toggle-thumb"}),te.default.createElement("input",Rt({},P,{ref:function(V){d.input=V},onFocus:this.handleFocus,onBlur:this.handleBlur,className:"react-toggle-screenreader-only",type:"checkbox"})))}}]),a})(Ke.PureComponent);Ce.default=fe;fe.displayName="Toggle";fe.defaultProps={icons:{checked:te.default.createElement(qt.default,null),unchecked:te.default.createElement(Xt.default,null)}};fe.propTypes={checked:W.default.bool,disabled:W.default.bool,defaultChecked:W.default.bool,onChange:W.default.func,onFocus:W.default.func,onBlur:W.default.func,className:W.default.string,name:W.default.string,value:W.default.string,id:W.default.string,"aria-labelledby":W.default.string,"aria-label":W.default.string,icons:W.default.oneOfType([W.default.bool,W.default.shape({checked:W.default.node,unchecked:W.default.node})])}});var rt=Z((tt,nt)=>{(function(i){var a;typeof tt=="object"?nt.exports=i():typeof define=="function"&&define.amd?define(i):(typeof window<"u"?a=window:typeof global<"u"?a=global:typeof self<"u"&&(a=self),a.objectHash=i())})(function(){return(function i(a,l,d){function g(P,O){if(!l[P]){if(!a[P]){var R=typeof ee=="function"&&ee;if(!O&&R)return R(P,!0);if(A)return A(P,!0);throw new Error("Cannot find module '"+P+"'")}O=l[P]={exports:{}},a[P][0].call(O.exports,function(V){var q=a[P][1][V];return g(q||V)},O,O.exports,i,a,l,d)}return l[P].exports}for(var A=typeof ee=="function"&&ee,k=0;k<d.length;k++)g(d[k]);return g})({1:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){"use strict";var _=i("crypto");function x(c,h){h=v(c,h);var n;return(n=h.algorithm!=="passthrough"?_.createHash(h.algorithm):new B).write===void 0&&(n.write=n.update,n.end=n.update),w(h,n).dispatch(c),n.update||n.end(""),n.digest?n.digest(h.encoding==="buffer"?void 0:h.encoding):(c=n.read(),h.encoding!=="buffer"?c.toString(h.encoding):c)}(l=a.exports=x).sha1=function(c){return x(c)},l.keys=function(c){return x(c,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},l.MD5=function(c){return x(c,{algorithm:"md5",encoding:"hex"})},l.keysMD5=function(c){return x(c,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=_.getHashes?_.getHashes().slice():["sha1","md5"],b=(p.push("passthrough"),["buffer","hex","binary","base64"]);function v(c,h){var n={};if(n.algorithm=(h=h||{}).algorithm||"sha1",n.encoding=h.encoding||"hex",n.excludeValues=!!h.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=h.ignoreUnknown===!0,n.respectType=h.respectType!==!1,n.respectFunctionNames=h.respectFunctionNames!==!1,n.respectFunctionProperties=h.respectFunctionProperties!==!1,n.unorderedArrays=h.unorderedArrays===!0,n.unorderedSets=h.unorderedSets!==!1,n.unorderedObjects=h.unorderedObjects!==!1,n.replacer=h.replacer||void 0,n.excludeKeys=h.excludeKeys||void 0,c===void 0)throw new Error("Object argument required.");for(var o=0;o<p.length;++o)p[o].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=p[o]);if(p.indexOf(n.algorithm)===-1)throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+p.join(", "));if(b.indexOf(n.encoding)===-1&&n.algorithm!=="passthrough")throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+b.join(", "));return n}function C(c){if(typeof c=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(c))!=null}function w(c,h,n){n=n||[];function o(t){return h.update?h.update(t,"utf8"):h.write(t,"utf8")}return{dispatch:function(t){return this["_"+((t=c.replacer?c.replacer(t):t)===null?"null":typeof t)](t)},_object:function(t){var u,f=Object.prototype.toString.call(t),T=/\[object (.*)\]/i.exec(f);if(T=(T=T?T[1]:"unknown:["+f+"]").toLowerCase(),0<=(f=n.indexOf(t)))return this.dispatch("[CIRCULAR:"+f+"]");if(n.push(t),A!==void 0&&A.isBuffer&&A.isBuffer(t))return o("buffer:"),o(t);if(T==="object"||T==="function"||T==="asyncfunction")return f=Object.keys(t),c.unorderedObjects&&(f=f.sort()),c.respectType===!1||C(t)||f.splice(0,0,"prototype","__proto__","constructor"),c.excludeKeys&&(f=f.filter(function(N){return!c.excludeKeys(N)})),o("object:"+f.length+":"),u=this,f.forEach(function(N){u.dispatch(N),o(":"),c.excludeValues||u.dispatch(t[N]),o(",")});if(!this["_"+T]){if(c.ignoreUnknown)return o("["+T+"]");throw new Error('Unknown object type "'+T+'"')}this["_"+T](t)},_array:function(t,N){N=N!==void 0?N:c.unorderedArrays!==!1;var f=this;if(o("array:"+t.length+":"),!N||t.length<=1)return t.forEach(function(L){return f.dispatch(L)});var T=[],N=t.map(function(L){var I=new B,j=n.slice();return w(c,I,j).dispatch(L),T=T.concat(j.slice(n.length)),I.read().toString()});return n=n.concat(T),N.sort(),this._array(N,!1)},_date:function(t){return o("date:"+t.toJSON())},_symbol:function(t){return o("symbol:"+t.toString())},_error:function(t){return o("error:"+t.toString())},_boolean:function(t){return o("bool:"+t.toString())},_string:function(t){o("string:"+t.length+":"),o(t.toString())},_function:function(t){o("fn:"),C(t)?this.dispatch("[native]"):this.dispatch(t.toString()),c.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(t.name)),c.respectFunctionProperties&&this._object(t)},_number:function(t){return o("number:"+t.toString())},_xml:function(t){return o("xml:"+t.toString())},_null:function(){return o("Null")},_undefined:function(){return o("Undefined")},_regexp:function(t){return o("regex:"+t.toString())},_uint8array:function(t){return o("uint8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint8clampedarray:function(t){return o("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(t))},_int8array:function(t){return o("int8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint16array:function(t){return o("uint16array:"),this.dispatch(Array.prototype.slice.call(t))},_int16array:function(t){return o("int16array:"),this.dispatch(Array.prototype.slice.call(t))},_uint32array:function(t){return o("uint32array:"),this.dispatch(Array.prototype.slice.call(t))},_int32array:function(t){return o("int32array:"),this.dispatch(Array.prototype.slice.call(t))},_float32array:function(t){return o("float32array:"),this.dispatch(Array.prototype.slice.call(t))},_float64array:function(t){return o("float64array:"),this.dispatch(Array.prototype.slice.call(t))},_arraybuffer:function(t){return o("arraybuffer:"),this.dispatch(new Uint8Array(t))},_url:function(t){return o("url:"+t.toString())},_map:function(t){return o("map:"),t=Array.from(t),this._array(t,c.unorderedSets!==!1)},_set:function(t){return o("set:"),t=Array.from(t),this._array(t,c.unorderedSets!==!1)},_file:function(t){return o("file:"),this.dispatch([t.name,t.size,t.type,t.lastModfied])},_blob:function(){if(c.ignoreUnknown)return o("[blob]");throw Error(`Hashing Blob objects is currently not supported
2
+ (see https://github.com/puleos/object-hash/issues/26)
3
+ Use "options.replacer" or "options.ignoreUnknown"
4
+ `)},_domwindow:function(){return o("domwindow")},_bigint:function(t){return o("bigint:"+t.toString())},_process:function(){return o("process")},_timer:function(){return o("timer")},_pipe:function(){return o("pipe")},_tcp:function(){return o("tcp")},_udp:function(){return o("udp")},_tty:function(){return o("tty")},_statwatcher:function(){return o("statwatcher")},_securecontext:function(){return o("securecontext")},_connection:function(){return o("connection")},_zlib:function(){return o("zlib")},_context:function(){return o("context")},_nodescript:function(){return o("nodescript")},_httpparser:function(){return o("httpparser")},_dataview:function(){return o("dataview")},_signal:function(){return o("signal")},_fsevent:function(){return o("fsevent")},_tlswrap:function(){return o("tlswrap")}}}function B(){return{buf:"",write:function(c){this.buf+=c},end:function(c){this.buf+=c},read:function(){return this.buf}}}l.writeToStream=function(c,h,n){return n===void 0&&(n=h,h={}),w(h=v(c,h),n).dispatch(c)}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){(function(_){"use strict";var x=typeof Uint8Array<"u"?Uint8Array:Array,p=43,b=47,v=48,C=97,w=65,B=45,c=95;function h(n){return n=n.charCodeAt(0),n===p||n===B?62:n===b||n===c?63:n<v?-1:n<v+10?n-v+26+26:n<w+26?n-w:n<C+26?n-C+26:void 0}_.toByteArray=function(n){var o,t;if(0<n.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var u=n.length,u=n.charAt(u-2)==="="?2:n.charAt(u-1)==="="?1:0,f=new x(3*n.length/4-u),T=0<u?n.length-4:n.length,N=0;function L(I){f[N++]=I}for(o=0;o<T;o+=4,0)L((16711680&(t=h(n.charAt(o))<<18|h(n.charAt(o+1))<<12|h(n.charAt(o+2))<<6|h(n.charAt(o+3))))>>16),L((65280&t)>>8),L(255&t);return u==2?L(255&(t=h(n.charAt(o))<<2|h(n.charAt(o+1))>>4)):u==1&&(L((t=h(n.charAt(o))<<10|h(n.charAt(o+1))<<4|h(n.charAt(o+2))>>2)>>8&255),L(255&t)),f},_.fromByteArray=function(n){var o,t,u,f,T=n.length%3,N="";function L(I){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(I)}for(o=0,u=n.length-T;o<u;o+=3)t=(n[o]<<16)+(n[o+1]<<8)+n[o+2],N+=L((f=t)>>18&63)+L(f>>12&63)+L(f>>6&63)+L(63&f);switch(T){case 1:N=(N+=L((t=n[n.length-1])>>2))+L(t<<4&63)+"==";break;case 2:N=(N=(N+=L((t=(n[n.length-2]<<8)+n[n.length-1])>>10))+L(t>>4&63))+L(t<<2&63)+"="}return N}})(l===void 0?this.base64js={}:l)}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(i,a,l){(function(d,g,p,k,P,O,R,V,q){var _=i("base64-js"),x=i("ieee754");function p(e,r,s){if(!(this instanceof p))return new p(e,r,s);var y,m,E,U,D=typeof e;if(r==="base64"&&D=="string")for(e=(U=e).trim?U.trim():U.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if(D=="number")y=$(e);else if(D=="string")y=p.byteLength(e,r);else{if(D!="object")throw new Error("First argument needs to be a number, array or string.");y=$(e.length)}if(p._useTypedArrays?m=p._augment(new Uint8Array(y)):((m=this).length=y,m._isBuffer=!0),p._useTypedArrays&&typeof e.byteLength=="number")m._set(e);else if(F(U=e)||p.isBuffer(U)||U&&typeof U=="object"&&typeof U.length=="number")for(E=0;E<y;E++)p.isBuffer(e)?m[E]=e.readUInt8(E):m[E]=e[E];else if(D=="string")m.write(e,0,r);else if(D=="number"&&!p._useTypedArrays&&!s)for(E=0;E<y;E++)m[E]=0;return m}function b(e,r,s,y){return p._charsWritten=ce((function(m){for(var E=[],U=0;U<m.length;U++)E.push(255&m.charCodeAt(U));return E})(r),e,s,y)}function v(e,r,s,y){return p._charsWritten=ce((function(m){for(var E,U,D=[],H=0;H<m.length;H++)U=m.charCodeAt(H),E=U>>8,U=U%256,D.push(U),D.push(E);return D})(r),e,s,y)}function C(e,r,s){var y="";s=Math.min(e.length,s);for(var m=r;m<s;m++)y+=String.fromCharCode(e[m]);return y}function w(e,r,s,E){E||(S(typeof s=="boolean","missing or invalid endian"),S(r!=null,"missing offset"),S(r+1<e.length,"Trying to read beyond buffer length"));var m,E=e.length;if(!(E<=r))return s?(m=e[r],r+1<E&&(m|=e[r+1]<<8)):(m=e[r]<<8,r+1<E&&(m|=e[r+1])),m}function B(e,r,s,E){E||(S(typeof s=="boolean","missing or invalid endian"),S(r!=null,"missing offset"),S(r+3<e.length,"Trying to read beyond buffer length"));var m,E=e.length;if(!(E<=r))return s?(r+2<E&&(m=e[r+2]<<16),r+1<E&&(m|=e[r+1]<<8),m|=e[r],r+3<E&&(m+=e[r+3]<<24>>>0)):(r+1<E&&(m=e[r+1]<<16),r+2<E&&(m|=e[r+2]<<8),r+3<E&&(m|=e[r+3]),m+=e[r]<<24>>>0),m}function c(e,r,s,y){if(y||(S(typeof s=="boolean","missing or invalid endian"),S(r!=null,"missing offset"),S(r+1<e.length,"Trying to read beyond buffer length")),!(e.length<=r))return y=w(e,r,s,!0),32768&y?-1*(65535-y+1):y}function h(e,r,s,y){if(y||(S(typeof s=="boolean","missing or invalid endian"),S(r!=null,"missing offset"),S(r+3<e.length,"Trying to read beyond buffer length")),!(e.length<=r))return y=B(e,r,s,!0),2147483648&y?-1*(4294967295-y+1):y}function n(e,r,s,y){return y||(S(typeof s=="boolean","missing or invalid endian"),S(r+3<e.length,"Trying to read beyond buffer length")),x.read(e,r,s,23,4)}function o(e,r,s,y){return y||(S(typeof s=="boolean","missing or invalid endian"),S(r+7<e.length,"Trying to read beyond buffer length")),x.read(e,r,s,52,8)}function t(e,r,s,y,m){if(m||(S(r!=null,"missing value"),S(typeof y=="boolean","missing or invalid endian"),S(s!=null,"missing offset"),S(s+1<e.length,"trying to write beyond buffer length"),ge(r,65535)),m=e.length,!(m<=s))for(var E=0,U=Math.min(m-s,2);E<U;E++)e[s+E]=(r&255<<8*(y?E:1-E))>>>8*(y?E:1-E)}function u(e,r,s,y,m){if(m||(S(r!=null,"missing value"),S(typeof y=="boolean","missing or invalid endian"),S(s!=null,"missing offset"),S(s+3<e.length,"trying to write beyond buffer length"),ge(r,4294967295)),m=e.length,!(m<=s))for(var E=0,U=Math.min(m-s,4);E<U;E++)e[s+E]=r>>>8*(y?E:3-E)&255}function f(e,r,s,y,m){m||(S(r!=null,"missing value"),S(typeof y=="boolean","missing or invalid endian"),S(s!=null,"missing offset"),S(s+1<e.length,"Trying to write beyond buffer length"),me(r,32767,-32768)),e.length<=s||t(e,0<=r?r:65535+r+1,s,y,m)}function T(e,r,s,y,m){m||(S(r!=null,"missing value"),S(typeof y=="boolean","missing or invalid endian"),S(s!=null,"missing offset"),S(s+3<e.length,"Trying to write beyond buffer length"),me(r,2147483647,-2147483648)),e.length<=s||u(e,0<=r?r:4294967295+r+1,s,y,m)}function N(e,r,s,y,m){m||(S(r!=null,"missing value"),S(typeof y=="boolean","missing or invalid endian"),S(s!=null,"missing offset"),S(s+3<e.length,"Trying to write beyond buffer length"),Ne(r,34028234663852886e22,-34028234663852886e22)),e.length<=s||x.write(e,r,s,y,23,4)}function L(e,r,s,y,m){m||(S(r!=null,"missing value"),S(typeof y=="boolean","missing or invalid endian"),S(s!=null,"missing offset"),S(s+7<e.length,"Trying to write beyond buffer length"),Ne(r,17976931348623157e292,-17976931348623157e292)),e.length<=s||x.write(e,r,s,y,52,8)}l.Buffer=p,l.SlowBuffer=p,l.INSPECT_MAX_BYTES=50,p.poolSize=8192,p._useTypedArrays=(function(){try{var e=new ArrayBuffer(0),r=new Uint8Array(e);return r.foo=function(){return 42},r.foo()===42&&typeof r.subarray=="function"}catch{return!1}})(),p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.isBuffer=function(e){return!(e==null||!e._isBuffer)},p.byteLength=function(e,r){var s;switch(e+="",r||"utf8"){case"hex":s=e.length/2;break;case"utf8":case"utf-8":s=Q(e).length;break;case"ascii":case"binary":case"raw":s=e.length;break;case"base64":s=Ae(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":s=2*e.length;break;default:throw new Error("Unknown encoding")}return s},p.concat=function(e,r){if(S(F(e),`Usage: Buffer.concat(list, [totalLength])
5
+ list should be an Array.`),e.length===0)return new p(0);if(e.length===1)return e[0];if(typeof r!="number")for(m=r=0;m<e.length;m++)r+=e[m].length;for(var s=new p(r),y=0,m=0;m<e.length;m++){var E=e[m];E.copy(s,y),y+=E.length}return s},p.prototype.write=function(e,r,s,y){isFinite(r)?isFinite(s)||(y=s,s=void 0):(H=y,y=r,r=s,s=H),r=Number(r)||0;var m,E,U,D,H=this.length-r;switch((!s||H<(s=Number(s)))&&(s=H),y=String(y||"utf8").toLowerCase()){case"hex":m=(function(z,J,K,X){K=Number(K)||0;var Y=z.length-K;(!X||Y<(X=Number(X)))&&(X=Y),S((Y=J.length)%2==0,"Invalid hex string"),Y/2<X&&(X=Y/2);for(var oe=0;oe<X;oe++){var Te=parseInt(J.substr(2*oe,2),16);S(!isNaN(Te),"Invalid hex string"),z[K+oe]=Te}return p._charsWritten=2*oe,oe})(this,e,r,s);break;case"utf8":case"utf-8":E=this,U=r,D=s,m=p._charsWritten=ce(Q(e),E,U,D);break;case"ascii":case"binary":m=b(this,e,r,s);break;case"base64":E=this,U=r,D=s,m=p._charsWritten=ce(Ae(e),E,U,D);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":m=v(this,e,r,s);break;default:throw new Error("Unknown encoding")}return m},p.prototype.toString=function(e,r,s){var y,m,E,U,D=this;if(e=String(e||"utf8").toLowerCase(),r=Number(r)||0,(s=s!==void 0?Number(s):D.length)===r)return"";switch(e){case"hex":y=(function(H,z,J){var K=H.length;(!z||z<0)&&(z=0),(!J||J<0||K<J)&&(J=K);for(var X="",Y=z;Y<J;Y++)X+=M(H[Y]);return X})(D,r,s);break;case"utf8":case"utf-8":y=(function(H,z,J){var K="",X="";J=Math.min(H.length,J);for(var Y=z;Y<J;Y++)H[Y]<=127?(K+=Be(X)+String.fromCharCode(H[Y]),X=""):X+="%"+H[Y].toString(16);return K+Be(X)})(D,r,s);break;case"ascii":case"binary":y=C(D,r,s);break;case"base64":m=D,U=s,y=(E=r)===0&&U===m.length?_.fromByteArray(m):_.fromByteArray(m.slice(E,U));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":y=(function(H,z,J){for(var K=H.slice(z,J),X="",Y=0;Y<K.length;Y+=2)X+=String.fromCharCode(K[Y]+256*K[Y+1]);return X})(D,r,s);break;default:throw new Error("Unknown encoding")}return y},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.copy=function(e,r,s,y){if(r=r||0,(y=y||y===0?y:this.length)!==(s=s||0)&&e.length!==0&&this.length!==0){S(s<=y,"sourceEnd < sourceStart"),S(0<=r&&r<e.length,"targetStart out of bounds"),S(0<=s&&s<this.length,"sourceStart out of bounds"),S(0<=y&&y<=this.length,"sourceEnd out of bounds"),y>this.length&&(y=this.length);var m=(y=e.length-r<y-s?e.length-r+s:y)-s;if(m<100||!p._useTypedArrays)for(var E=0;E<m;E++)e[E+r]=this[E+s];else e._set(this.subarray(s,s+m),r)}},p.prototype.slice=function(e,r){var s=this.length;if(e=j(e,s,0),r=j(r,s,s),p._useTypedArrays)return p._augment(this.subarray(e,r));for(var y=r-e,m=new p(y,void 0,!0),E=0;E<y;E++)m[E]=this[E+e];return m},p.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},p.prototype.set=function(e,r){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,r)},p.prototype.readUInt8=function(e,r){if(r||(S(e!=null,"missing offset"),S(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},p.prototype.readUInt16LE=function(e,r){return w(this,e,!0,r)},p.prototype.readUInt16BE=function(e,r){return w(this,e,!1,r)},p.prototype.readUInt32LE=function(e,r){return B(this,e,!0,r)},p.prototype.readUInt32BE=function(e,r){return B(this,e,!1,r)},p.prototype.readInt8=function(e,r){if(r||(S(e!=null,"missing offset"),S(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,r){return c(this,e,!0,r)},p.prototype.readInt16BE=function(e,r){return c(this,e,!1,r)},p.prototype.readInt32LE=function(e,r){return h(this,e,!0,r)},p.prototype.readInt32BE=function(e,r){return h(this,e,!1,r)},p.prototype.readFloatLE=function(e,r){return n(this,e,!0,r)},p.prototype.readFloatBE=function(e,r){return n(this,e,!1,r)},p.prototype.readDoubleLE=function(e,r){return o(this,e,!0,r)},p.prototype.readDoubleBE=function(e,r){return o(this,e,!1,r)},p.prototype.writeUInt8=function(e,r,s){s||(S(e!=null,"missing value"),S(r!=null,"missing offset"),S(r<this.length,"trying to write beyond buffer length"),ge(e,255)),r>=this.length||(this[r]=e)},p.prototype.writeUInt16LE=function(e,r,s){t(this,e,r,!0,s)},p.prototype.writeUInt16BE=function(e,r,s){t(this,e,r,!1,s)},p.prototype.writeUInt32LE=function(e,r,s){u(this,e,r,!0,s)},p.prototype.writeUInt32BE=function(e,r,s){u(this,e,r,!1,s)},p.prototype.writeInt8=function(e,r,s){s||(S(e!=null,"missing value"),S(r!=null,"missing offset"),S(r<this.length,"Trying to write beyond buffer length"),me(e,127,-128)),r>=this.length||(0<=e?this.writeUInt8(e,r,s):this.writeUInt8(255+e+1,r,s))},p.prototype.writeInt16LE=function(e,r,s){f(this,e,r,!0,s)},p.prototype.writeInt16BE=function(e,r,s){f(this,e,r,!1,s)},p.prototype.writeInt32LE=function(e,r,s){T(this,e,r,!0,s)},p.prototype.writeInt32BE=function(e,r,s){T(this,e,r,!1,s)},p.prototype.writeFloatLE=function(e,r,s){N(this,e,r,!0,s)},p.prototype.writeFloatBE=function(e,r,s){N(this,e,r,!1,s)},p.prototype.writeDoubleLE=function(e,r,s){L(this,e,r,!0,s)},p.prototype.writeDoubleBE=function(e,r,s){L(this,e,r,!1,s)},p.prototype.fill=function(e,r,s){if(r=r||0,s=s||this.length,S(typeof(e=typeof(e=e||0)=="string"?e.charCodeAt(0):e)=="number"&&!isNaN(e),"value is not a number"),S(r<=s,"end < start"),s!==r&&this.length!==0){S(0<=r&&r<this.length,"start out of bounds"),S(0<=s&&s<=this.length,"end out of bounds");for(var y=r;y<s;y++)this[y]=e}},p.prototype.inspect=function(){for(var e=[],r=this.length,s=0;s<r;s++)if(e[s]=M(this[s]),s===l.INSPECT_MAX_BYTES){e[s+1]="...";break}return"<Buffer "+e.join(" ")+">"},p.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(p._useTypedArrays)return new p(this).buffer;for(var e=new Uint8Array(this.length),r=0,s=e.length;r<s;r+=1)e[r]=this[r];return e.buffer};var I=p.prototype;function j(e,r,s){return typeof e!="number"?s:r<=(e=~~e)?r:0<=e||0<=(e+=r)?e:0}function $(e){return(e=~~Math.ceil(+e))<0?0:e}function F(e){return(Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"})(e)}function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function Q(e){for(var r=[],s=0;s<e.length;s++){var y=e.charCodeAt(s);if(y<=127)r.push(e.charCodeAt(s));else for(var m=s,E=(55296<=y&&y<=57343&&s++,encodeURIComponent(e.slice(m,s+1)).substr(1).split("%")),U=0;U<E.length;U++)r.push(parseInt(E[U],16))}return r}function Ae(e){return _.toByteArray(e)}function ce(e,r,s,y){for(var m=0;m<y&&!(m+s>=r.length||m>=e.length);m++)r[m+s]=e[m];return m}function Be(e){try{return decodeURIComponent(e)}catch{return"\uFFFD"}}function ge(e,r){S(typeof e=="number","cannot write a non-number as a number"),S(0<=e,"specified a negative value for writing an unsigned value"),S(e<=r,"value is larger than maximum value for type"),S(Math.floor(e)===e,"value has a fractional component")}function me(e,r,s){S(typeof e=="number","cannot write a non-number as a number"),S(e<=r,"value larger than maximum allowed value"),S(s<=e,"value smaller than minimum allowed value"),S(Math.floor(e)===e,"value has a fractional component")}function Ne(e,r,s){S(typeof e=="number","cannot write a non-number as a number"),S(e<=r,"value larger than maximum allowed value"),S(s<=e,"value smaller than minimum allowed value")}function S(e,r){if(!e)throw new Error(r||"Failed assertion")}p._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=I.get,e.set=I.set,e.write=I.write,e.toString=I.toString,e.toLocaleString=I.toString,e.toJSON=I.toJSON,e.copy=I.copy,e.slice=I.slice,e.readUInt8=I.readUInt8,e.readUInt16LE=I.readUInt16LE,e.readUInt16BE=I.readUInt16BE,e.readUInt32LE=I.readUInt32LE,e.readUInt32BE=I.readUInt32BE,e.readInt8=I.readInt8,e.readInt16LE=I.readInt16LE,e.readInt16BE=I.readInt16BE,e.readInt32LE=I.readInt32LE,e.readInt32BE=I.readInt32BE,e.readFloatLE=I.readFloatLE,e.readFloatBE=I.readFloatBE,e.readDoubleLE=I.readDoubleLE,e.readDoubleBE=I.readDoubleBE,e.writeUInt8=I.writeUInt8,e.writeUInt16LE=I.writeUInt16LE,e.writeUInt16BE=I.writeUInt16BE,e.writeUInt32LE=I.writeUInt32LE,e.writeUInt32BE=I.writeUInt32BE,e.writeInt8=I.writeInt8,e.writeInt16LE=I.writeInt16LE,e.writeInt16BE=I.writeInt16BE,e.writeInt32LE=I.writeInt32LE,e.writeInt32BE=I.writeInt32BE,e.writeFloatLE=I.writeFloatLE,e.writeFloatBE=I.writeFloatBE,e.writeDoubleLE=I.writeDoubleLE,e.writeDoubleBE=I.writeDoubleBE,e.fill=I.fill,e.inspect=I.inspect,e.toArrayBuffer=I.toArrayBuffer,e}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(i,a,l){(function(d,g,_,k,P,O,R,V,q){var _=i("buffer").Buffer,x=4,p=new _(x);p.fill(0),a.exports={hash:function(b,v,C,w){for(var B=v((function(t,u){t.length%x!=0&&(f=t.length+(x-t.length%x),t=_.concat([t,p],f));for(var f,T=[],N=u?t.readInt32BE:t.readInt32LE,L=0;L<t.length;L+=x)T.push(N.call(t,L));return T})(b=_.isBuffer(b)?b:new _(b),w),8*b.length),v=w,c=new _(C),h=v?c.writeInt32BE:c.writeInt32LE,n=0;n<B.length;n++)h.call(c,B[n],4*n,!0);return c}}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(i,a,l){(function(d,g,_,k,P,O,R,V,q){var _=i("buffer").Buffer,x=i("./sha"),p=i("./sha256"),b=i("./rng"),v={sha1:x,sha256:p,md5:i("./md5")},C=64,w=new _(C);function B(t,u){var f=v[t=t||"sha1"],T=[];return f||c("algorithm:",t,"is not yet supported"),{update:function(N){return _.isBuffer(N)||(N=new _(N)),T.push(N),N.length,this},digest:function(N){var L=_.concat(T),L=u?(function(I,j,$){_.isBuffer(j)||(j=new _(j)),_.isBuffer($)||($=new _($)),j.length>C?j=I(j):j.length<C&&(j=_.concat([j,w],C));for(var F=new _(C),M=new _(C),Q=0;Q<C;Q++)F[Q]=54^j[Q],M[Q]=92^j[Q];return $=I(_.concat([F,$])),I(_.concat([M,$]))})(f,u,L):f(L);return T=null,N?L.toString(N):L}}}function c(){var t=[].slice.call(arguments).join(" ");throw new Error([t,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
6
+ `))}w.fill(0),l.createHash=function(t){return B(t)},l.createHmac=B,l.randomBytes=function(t,u){if(!u||!u.call)return new _(b(t));try{u.call(this,void 0,new _(b(t)))}catch(f){u(f)}};var h,n=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],o=function(t){l[t]=function(){c("sorry,",t,"is not implemented yet")}};for(h in n)o(n[h],h)}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){var _=i("./helpers");function x(c,h){c[h>>5]|=128<<h%32,c[14+(h+64>>>9<<4)]=h;for(var n=1732584193,o=-271733879,t=-1732584194,u=271733878,f=0;f<c.length;f+=16){var T=n,N=o,L=t,I=u,n=b(n,o,t,u,c[f+0],7,-680876936),u=b(u,n,o,t,c[f+1],12,-389564586),t=b(t,u,n,o,c[f+2],17,606105819),o=b(o,t,u,n,c[f+3],22,-1044525330);n=b(n,o,t,u,c[f+4],7,-176418897),u=b(u,n,o,t,c[f+5],12,1200080426),t=b(t,u,n,o,c[f+6],17,-1473231341),o=b(o,t,u,n,c[f+7],22,-45705983),n=b(n,o,t,u,c[f+8],7,1770035416),u=b(u,n,o,t,c[f+9],12,-1958414417),t=b(t,u,n,o,c[f+10],17,-42063),o=b(o,t,u,n,c[f+11],22,-1990404162),n=b(n,o,t,u,c[f+12],7,1804603682),u=b(u,n,o,t,c[f+13],12,-40341101),t=b(t,u,n,o,c[f+14],17,-1502002290),n=v(n,o=b(o,t,u,n,c[f+15],22,1236535329),t,u,c[f+1],5,-165796510),u=v(u,n,o,t,c[f+6],9,-1069501632),t=v(t,u,n,o,c[f+11],14,643717713),o=v(o,t,u,n,c[f+0],20,-373897302),n=v(n,o,t,u,c[f+5],5,-701558691),u=v(u,n,o,t,c[f+10],9,38016083),t=v(t,u,n,o,c[f+15],14,-660478335),o=v(o,t,u,n,c[f+4],20,-405537848),n=v(n,o,t,u,c[f+9],5,568446438),u=v(u,n,o,t,c[f+14],9,-1019803690),t=v(t,u,n,o,c[f+3],14,-187363961),o=v(o,t,u,n,c[f+8],20,1163531501),n=v(n,o,t,u,c[f+13],5,-1444681467),u=v(u,n,o,t,c[f+2],9,-51403784),t=v(t,u,n,o,c[f+7],14,1735328473),n=C(n,o=v(o,t,u,n,c[f+12],20,-1926607734),t,u,c[f+5],4,-378558),u=C(u,n,o,t,c[f+8],11,-2022574463),t=C(t,u,n,o,c[f+11],16,1839030562),o=C(o,t,u,n,c[f+14],23,-35309556),n=C(n,o,t,u,c[f+1],4,-1530992060),u=C(u,n,o,t,c[f+4],11,1272893353),t=C(t,u,n,o,c[f+7],16,-155497632),o=C(o,t,u,n,c[f+10],23,-1094730640),n=C(n,o,t,u,c[f+13],4,681279174),u=C(u,n,o,t,c[f+0],11,-358537222),t=C(t,u,n,o,c[f+3],16,-722521979),o=C(o,t,u,n,c[f+6],23,76029189),n=C(n,o,t,u,c[f+9],4,-640364487),u=C(u,n,o,t,c[f+12],11,-421815835),t=C(t,u,n,o,c[f+15],16,530742520),n=w(n,o=C(o,t,u,n,c[f+2],23,-995338651),t,u,c[f+0],6,-198630844),u=w(u,n,o,t,c[f+7],10,1126891415),t=w(t,u,n,o,c[f+14],15,-1416354905),o=w(o,t,u,n,c[f+5],21,-57434055),n=w(n,o,t,u,c[f+12],6,1700485571),u=w(u,n,o,t,c[f+3],10,-1894986606),t=w(t,u,n,o,c[f+10],15,-1051523),o=w(o,t,u,n,c[f+1],21,-2054922799),n=w(n,o,t,u,c[f+8],6,1873313359),u=w(u,n,o,t,c[f+15],10,-30611744),t=w(t,u,n,o,c[f+6],15,-1560198380),o=w(o,t,u,n,c[f+13],21,1309151649),n=w(n,o,t,u,c[f+4],6,-145523070),u=w(u,n,o,t,c[f+11],10,-1120210379),t=w(t,u,n,o,c[f+2],15,718787259),o=w(o,t,u,n,c[f+9],21,-343485551),n=B(n,T),o=B(o,N),t=B(t,L),u=B(u,I)}return Array(n,o,t,u)}function p(c,h,n,o,t,u){return B((h=B(B(h,c),B(o,u)))<<t|h>>>32-t,n)}function b(c,h,n,o,t,u,f){return p(h&n|~h&o,c,h,t,u,f)}function v(c,h,n,o,t,u,f){return p(h&o|n&~o,c,h,t,u,f)}function C(c,h,n,o,t,u,f){return p(h^n^o,c,h,t,u,f)}function w(c,h,n,o,t,u,f){return p(n^(h|~o),c,h,t,u,f)}function B(c,h){var n=(65535&c)+(65535&h);return(c>>16)+(h>>16)+(n>>16)<<16|65535&n}a.exports=function(c){return _.hash(c,x,16)}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){var _;a.exports=_||function(x){for(var p,b=new Array(x),v=0;v<x;v++)(3&v)==0&&(p=4294967296*Math.random()),b[v]=p>>>((3&v)<<3)&255;return b}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){var _=i("./helpers");function x(v,C){v[C>>5]|=128<<24-C%32,v[15+(C+64>>9<<4)]=C;for(var w,B,c,h=Array(80),n=1732584193,o=-271733879,t=-1732584194,u=271733878,f=-1009589776,T=0;T<v.length;T+=16){for(var N=n,L=o,I=t,j=u,$=f,F=0;F<80;F++){h[F]=F<16?v[T+F]:b(h[F-3]^h[F-8]^h[F-14]^h[F-16],1);var M=p(p(b(n,5),(M=o,B=t,c=u,(w=F)<20?M&B|~M&c:!(w<40)&&w<60?M&B|M&c|B&c:M^B^c)),p(p(f,h[F]),(w=F)<20?1518500249:w<40?1859775393:w<60?-1894007588:-899497514)),f=u,u=t,t=b(o,30),o=n,n=M}n=p(n,N),o=p(o,L),t=p(t,I),u=p(u,j),f=p(f,$)}return Array(n,o,t,u,f)}function p(v,C){var w=(65535&v)+(65535&C);return(v>>16)+(C>>16)+(w>>16)<<16|65535&w}function b(v,C){return v<<C|v>>>32-C}a.exports=function(v){return _.hash(v,x,20,!0)}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){function _(C,w){var B=(65535&C)+(65535&w);return(C>>16)+(w>>16)+(B>>16)<<16|65535&B}function x(C,w){var B,c=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),h=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),n=new Array(64);C[w>>5]|=128<<24-w%32,C[15+(w+64>>9<<4)]=w;for(var o,t,u=0;u<C.length;u+=16){for(var f=h[0],T=h[1],N=h[2],L=h[3],I=h[4],j=h[5],$=h[6],F=h[7],M=0;M<64;M++)n[M]=M<16?C[M+u]:_(_(_((t=n[M-2],b(t,17)^b(t,19)^v(t,10)),n[M-7]),(t=n[M-15],b(t,7)^b(t,18)^v(t,3))),n[M-16]),B=_(_(_(_(F,b(t=I,6)^b(t,11)^b(t,25)),I&j^~I&$),c[M]),n[M]),o=_(b(o=f,2)^b(o,13)^b(o,22),f&T^f&N^T&N),F=$,$=j,j=I,I=_(L,B),L=N,N=T,T=f,f=_(B,o);h[0]=_(f,h[0]),h[1]=_(T,h[1]),h[2]=_(N,h[2]),h[3]=_(L,h[3]),h[4]=_(I,h[4]),h[5]=_(j,h[5]),h[6]=_($,h[6]),h[7]=_(F,h[7])}return h}var p=i("./helpers"),b=function(C,w){return C>>>w|C<<32-w},v=function(C,w){return C>>>w};a.exports=function(C){return p.hash(C,x,32,!0)}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){l.read=function(_,x,p,b,u){var C,w,B=8*u-b-1,c=(1<<B)-1,h=c>>1,n=-7,o=p?u-1:0,t=p?-1:1,u=_[x+o];for(o+=t,C=u&(1<<-n)-1,u>>=-n,n+=B;0<n;C=256*C+_[x+o],o+=t,n-=8);for(w=C&(1<<-n)-1,C>>=-n,n+=b;0<n;w=256*w+_[x+o],o+=t,n-=8);if(C===0)C=1-h;else{if(C===c)return w?NaN:1/0*(u?-1:1);w+=Math.pow(2,b),C-=h}return(u?-1:1)*w*Math.pow(2,C-b)},l.write=function(_,x,p,b,v,f){var w,B,c=8*f-v-1,h=(1<<c)-1,n=h>>1,o=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,t=b?0:f-1,u=b?1:-1,f=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(B=isNaN(x)?1:0,w=h):(w=Math.floor(Math.log(x)/Math.LN2),x*(b=Math.pow(2,-w))<1&&(w--,b*=2),2<=(x+=1<=w+n?o/b:o*Math.pow(2,1-n))*b&&(w++,b/=2),h<=w+n?(B=0,w=h):1<=w+n?(B=(x*b-1)*Math.pow(2,v),w+=n):(B=x*Math.pow(2,n-1)*Math.pow(2,v),w=0));8<=v;_[p+t]=255&B,t+=u,B/=256,v-=8);for(w=w<<v|B,c+=v;0<c;_[p+t]=255&w,t+=u,w/=256,c-=8);_[p+t-u]|=128*f}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(i,a,l){(function(d,g,A,k,P,O,R,V,q){var _,x,p;function b(){}(d=a.exports={}).nextTick=(x=typeof window<"u"&&window.setImmediate,p=typeof window<"u"&&window.postMessage&&window.addEventListener,x?function(v){return window.setImmediate(v)}:p?(_=[],window.addEventListener("message",function(v){var C=v.source;C!==window&&C!==null||v.data!=="process-tick"||(v.stopPropagation(),0<_.length&&_.shift()())},!0),function(v){_.push(v),window.postMessage("process-tick","*")}):function(v){setTimeout(v,0)}),d.title="browser",d.browser=!0,d.env={},d.argv=[],d.on=b,d.addListener=b,d.once=b,d.off=b,d.removeListener=b,d.removeAllListeners=b,d.emit=b,d.binding=function(v){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(v){throw new Error("process.chdir is not supported")}}).call(this,i("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},i("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})});import{useContext as kt}from"react";import{createContext as It}from"react";var xt={consent:[],services:[],theme:"light",isPopupVisible:!0,isSettingsVisible:!1,setConsent:()=>{},hasConsent:()=>!1,showPopup:()=>{},hidePopup:()=>{},toggleSettings:()=>{}},ie=It(xt);function G(){return kt(ie)}import{useCallback as ye}from"react";function ue(){let{services:i,setConsent:a,hidePopup:l}=G(),d=ye(()=>{a(i.map(k=>k.id)),l()},[i,a,l]),g=ye(k=>{a(k),l()},[a,l]),A=ye(()=>{let k=i.filter(P=>P.mandatory).map(P=>P.id);a(k),l()},[i,a,l]);return{approveAll:d,approveSelected:g,declineAll:A}}import{useState as At,useCallback as Bt}from"react";function Ue(){let{consent:i,services:a}=G(),[l,d]=At(()=>{let A=a.filter(k=>k.mandatory).map(k=>k.id);return[...new Set([...i,...A])]}),g=Bt((A,k)=>{d(P=>k?[...P,A]:P.filter(O=>O!==A))},[]);return{selectedIds:l,toggleService:g}}var Qe=Pe(ze());import{jsx as Se,jsxs as Ge}from"react/jsx-runtime";var zt=Qe.default;function Ze({serviceId:i,name:a,description:l,mandatory:d,onChange:g}){let{hasConsent:A}=G(),k=P=>{g(i,P.target.checked)};return Ge("div",{className:"rcc-settings__item",children:[Ge("div",{className:"rcc-settings__item__info",children:[Se("label",{htmlFor:`rcc-toggle-${i}`,className:"rcc-settings__item__name",children:a}),l&&Se("p",{className:"rcc-settings__item__description",children:l})]}),Se(zt,{id:`rcc-toggle-${i}`,defaultChecked:d||A(i),disabled:d,onChange:k,"aria-label":`Toggle ${a}`})]})}import{jsx as ne,jsxs as Ee}from"react/jsx-runtime";function Ie({onClose:i,modal:a}){let{services:l}=G(),{approveSelected:d,declineAll:g}=ue(),{selectedIds:A,toggleService:k}=Ue(),P=()=>{d(A),i()},O=()=>{g(),i()},R=a?.title??"Cookie Settings",V=a?.approve??"Save Selection",q=a?.decline??"Decline All",_=a?.close??"Close";return ne("div",{className:"rcc-settings",role:"dialog","aria-modal":"true","aria-label":"Cookie Settings",children:Ee("div",{className:"rcc-settings__content",children:[Ee("header",{className:"rcc-settings__header",children:[ne("h2",{className:"rcc-settings__title",children:R}),ne("button",{type:"button",className:"rcc-settings__close",onClick:i,"aria-label":"Close settings",children:_})]}),ne("main",{className:"rcc-settings__body",children:l.map(x=>ne(Ze,{serviceId:x.id,name:x.name,description:x.description,mandatory:x.mandatory,onChange:k},x.id))}),Ee("footer",{className:"rcc-settings__footer",children:[ne("button",{type:"button",className:"rcc-settings__btn rcc-settings__btn--secondary",onClick:O,children:q}),ne("button",{type:"button",className:"rcc-settings__btn rcc-settings__btn--primary",onClick:P,children:V})]})]})})}import{jsx as re,jsxs as et}from"react/jsx-runtime";function Gt({children:i,settings:a,decline:l,approve:d}){let{isPopupVisible:g,isSettingsVisible:A,toggleSettings:k,theme:P}=G(),{approveAll:O,declineAll:R}=ue();if(!g)return null;if(A)return re("div",{className:"rcc-popup","data-theme":P,children:re(Ie,{onClose:k,modal:a?.modal})});let V=a?.label??"Settings",q=l?.label??"Decline",_=d?.label??"Accept All";return re("div",{className:"rcc-popup","data-theme":P,children:et("div",{className:"rcc-popup__card",role:"dialog","aria-modal":"true","aria-label":"Cookie consent",children:[re("div",{className:"rcc-popup__message",children:i??"This website uses cookies to improve your experience."}),et("div",{className:"rcc-popup__actions",children:[!a?.hidden&&re("button",{type:"button",className:"rcc-popup__btn rcc-popup__btn--secondary",onClick:k,children:V}),!l?.hidden&&re("button",{type:"button",className:"rcc-popup__btn rcc-popup__btn--secondary",onClick:R,children:q}),re("button",{type:"button",className:"rcc-popup__btn rcc-popup__btn--primary",onClick:O,children:_})]})]})})}var yt=Pe(rt());import{useState as ke,useCallback as ae,useEffect as en,useRef as tn}from"react";var de="rcc-popup",pe="rcc-popup-consent";function xe(i){let a=localStorage.getItem(pe);if(!a)return{consent:[],isValid:!1};try{let l=JSON.parse(a);return l.hash!==i?{consent:[],isValid:!1}:{consent:l.consent,isValid:!0}}catch{return{consent:[],isValid:!1}}}function ot(i){return"src"in i}function it(i){return"code"in i}function st(i,a){let l=document.createElement("script");l.id=i,l.src=a,l.async=!0,document.body.appendChild(l)}function at(i,a){let l=document.createElement("script");l.id=i,l.innerHTML=a,document.body.appendChild(l)}function Qt(i,a){return`${de}-${i}-${a}`}function ct(i,a){for(let l of a){let d=Qt(i,l.id);document.getElementById(d)||(ot(l)?st(d,l.src):it(l)&&at(d,l.code))}}function he(i){for(let a of i)a.scripts?.length&&ct(a.id,a.scripts)}function ut(i,a){for(let l of a){let d=`${de}-${i}-${l.id}`,g=document.getElementById(d);g&&g.remove()}}function Zt(){return document.cookie.split(";").map(i=>i.trim().split("=")[0]).filter(Boolean)}function lt(i){document.cookie=`${i}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`}function ft(i){let a=Zt();for(let{pattern:l}of i)if(typeof l=="string")lt(l);else for(let d of a)l.test(d)&&lt(d)}function dt(i){for(let a of i)localStorage.removeItem(a)}function pt(i){for(let a of i)sessionStorage.removeItem(a)}function ht(i){for(let a of i)a.scripts?.length&&ut(a.id,a.scripts),a.cookies?.length&&ft(a.cookies),a.localStorage?.length&&dt(a.localStorage),a.sessionStorage?.length&&pt(a.sessionStorage)}function gt(i,a){let l={consent:i,hash:a,timestamp:Date.now()};localStorage.setItem(pe,JSON.stringify(l))}function mt(i,a,l,d){let g=i.filter(k=>l.includes(k.id)&&!a.includes(k.id)),A=i.filter(k=>!l.includes(k.id)&&a.includes(k.id));ht(A),he(g),gt(l,d)}function nn(i){return i.customHash?i.customHash:(0,yt.default)(i.services.map(a=>({id:a.id,name:a.name})))}function bt(i){let a=nn(i),{services:l}=i,[d,g]=ke(()=>{let{consent:b,isValid:v}=xe(a);return v?b:[]}),[A,k]=ke(()=>{let{isValid:b}=xe(a);return!b}),[P,O]=ke(!1),R=tn(d);en(()=>{let b=l.filter(v=>d.includes(v.id));he(b)},[]);let V=ae(b=>{let v=R.current;mt(l,v,b,a),g(b),R.current=b},[l,a]),q=ae(b=>d.includes(b),[d]),_=ae(()=>k(!0),[]),x=ae(()=>k(!1),[]),p=ae(()=>O(b=>!b),[]);return{consent:d,services:l,theme:i.theme??"light",isPopupVisible:A,isSettingsVisible:P,setConsent:V,hasConsent:q,showPopup:_,hidePopup:x,toggleSettings:p}}import{jsx as on}from"react/jsx-runtime";function rn({options:i,children:a}){let l=bt(i);return on(ie.Provider,{value:l,children:a})}export{ie as ConsentContext,Gt as ConsentPopup,rn as ConsentProvider,Ie as ConsentSettings,G as useConsent};
7
+ /*! Bundled license information:
8
+
9
+ classnames/index.js:
10
+ (*!
11
+ Copyright (c) 2018 Jed Watson.
12
+ Licensed under the MIT License (MIT), see
13
+ http://jedwatson.github.io/classnames
14
+ *)
15
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cookie-consent-popup",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A React cookie consent popup component with centered modal dialog, service management, script loading, and light/dark theme support",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,14 +11,25 @@
11
11
  "url": "https://github.com/Mas-HJ/react-cookie-consent-popup/issues"
12
12
  },
13
13
  "main": "./dist/index.js",
14
+ "module": "./dist/index.mjs",
14
15
  "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.mjs",
20
+ "require": "./dist/index.js"
21
+ },
22
+ "./dist/*": "./dist/*"
23
+ },
24
+ "sideEffects": false,
15
25
  "files": [
16
- "dist"
26
+ "dist",
27
+ "LICENSE"
17
28
  ],
18
29
  "scripts": {
19
- "build": "node esbuild.config.mjs",
30
+ "build": "tsx esbuild.config.ts",
20
31
  "postbuild": "tsc --emitDeclarationOnly",
21
- "dev": "node esbuild.config.mjs --watch",
32
+ "dev": "tsx esbuild.config.ts --watch",
22
33
  "test": "jest",
23
34
  "test:dev": "jest --watch",
24
35
  "coverage": "jest --coverage"
@@ -75,6 +86,7 @@
75
86
  "stylelint-prettier": "^5.0.0",
76
87
  "ts-jest": "^29.1.2",
77
88
  "ts-node": "^10.9.2",
89
+ "tsx": "^4.21.0",
78
90
  "typescript": "^5.3.3"
79
91
  }
80
92
  }