@castleio/castle-js
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -5,3 +5,3 @@ if(typeof window !=="undefined"){(function(){var o=["Onpxfcnpr","Qryrgr","Fcnpr","Ragre","Gno","nhqvb","ivqrb","anzr","vq","fgevat","nqqRiragYvfgrare","nggnpuRirag","qrgnpuRirag","erzbirRiragYvfgrare","ba","trgBjaCebcreglAnzrf","trgCebgbglcrBs","trgBjaCebcreglQrfpevcgbe","cyngsbez","iraqbe","hfreNtrag","cebqhpgFho","ynathntr","uneqjnerPbapheerapl","qrivprZrzbel","zvzrGlcrf","wninRanoyrq","pbbxvrRanoyrq","perqragvnyf","oyhrgbbgu","fgbentr","crezvffvbaf","freivprJbexre","qbAbgGenpx","cyhtvaf","ohvyqVQ","qrcgu","riny","bfpch","qbphzragZbqr", | ||
"gbb%zhpu%erphefvba","Pnaabg%ernq%cebcregl%'o'%bs%haqrsvarq","(ibvq%0)%vf%haqrsvarq","haqrsvarq%vf%abg%na%bowrpg%(rinyhngvat%'(ibvq%0).o')","Pnaabg%ernq%cebcregvrf%bs%haqrsvarq%(ernqvat%'o')","Reebe","ZnpVagry","Jva32","vCubar","Yvahk%nezi8y","raHF","rfRF","seSE","cgOE","raTO","qrQR","ehEH","Tbbtyr%Vap.","Nccyr%Pbzchgre,%Vap.","rznvy","cubar","ertvfgrerq_ng","genvgf","fvtangher","wjg","hey","ersreere","inyhrf","cebcregvrf","Zngu"];function n(n){for(var r,t,e,u=o[n],i="",c=13%26,f=0;f<u.length;f++)i+= | ||
(t=c,65<=(e=(r=u.charAt(f)).charCodeAt())&&e<=90?String.fromCharCode((e-65+t)%26+65):97<=e&&e<=122?String.fromCharCode((e-97+t)%26+97):32==e?"%":r);return i}var t,d,a,q,m,z,w,M,k,I,x,R,j,S,C,E,T,O,P,F,A,N,Q,V,G,D,J,L,Z,H,B,K,Y,X,U,$,W,nn,rn,tn,en,un,cn,r=n(0),e=n(1),u=n(2),i=n(3),c=n(4),v=[r,e,8+"",46+""],fn=v.concat([u,i,c,32+"",13+"",10+""]),on="2.1.1",p=0,an=void 0,s=null,vn=Object,_n=n(5),sn=n(6),r=n(7),e=n(8),hn=255,bn=15,gn=n(9),pn=1535E6,yn=function(){},ln=[],dn=vn.assign||function(){for(var n= | ||
(t=c,65<=(e=(r=u.charAt(f)).charCodeAt())&&e<=90?String.fromCharCode((e-65+t)%26+65):97<=e&&e<=122?String.fromCharCode((e-97+t)%26+97):32==e?"%":r);return i}var t,d,a,q,m,z,w,M,k,I,x,R,j,S,C,E,T,O,P,F,A,N,Q,V,G,D,J,L,Z,H,B,K,Y,X,U,$,W,nn,rn,tn,en,un,cn,r=n(0),e=n(1),u=n(2),i=n(3),c=n(4),v=[r,e,8+"",46+""],fn=v.concat([u,i,c,32+"",13+"",10+""]),on="2.1.2",p=0,an=void 0,s=null,vn=Object,_n=n(5),sn=n(6),r=n(7),e=n(8),hn=255,bn=15,gn=n(9),pn=1535E6,yn=function(){},ln=[],dn=vn.assign||function(){for(var n= | ||
[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var t=n[0],e=void 0,u=1,i=n.length;u<i;u++)for(var c in e=n[u])e.hasOwnProperty(c)&&(t[c]=e[c]);return t},h=function(n){return n!==an&&n!==s},qn=function(n){return h(n)&&""!==n},mn=function(n){return typeof n===gn},zn=function(n){return n!==an},wn=function(n){return n||an},Mn=function(n){return n?1:0},kn=function(n,r){return-1<n.indexOf(r)},b=function(n){return n.navigator},In=function(n){return n.document},xn=function(n){return n.screen},Rn=function(n){return n.location}, | ||
@@ -46,21 +46,21 @@ jn=function(n,r,t){return n.setAttribute(r,t)},Sn=function(n,r){if(n.getAttribute)return n.getAttribute(r)},Cn=function(n){return JSON.stringify(n)},En=function(n,r){for(var t=[],e=0,u=n;e<u.length;e++){var i=u[e];t.push(r(i))}return t},Tn=function(n){var r,t=[];for(r in n)n.hasOwnProperty(r)&&t.push(n[r]);return t},On=function(n){var r,t=[];for(r in n)n.hasOwnProperty(r)&&t.push(r);return t},Pn=function(n,r){for(var t=Array(n),e=t.length-1;0<=e;e--)t[e]=r;return t},Fn=function(n){if(vn(n)!==n)return{}; | ||
r),u.then=function(n,r){return c.rn!==an?n(c.rn):f.push(n),u},o.onreadystatechange=function(){var n;o.readyState===Ef&&(n=o.status,Tf(f,200<=n&&n<400,c))},t(function(n){c.nn=setTimeout(function(){Tf(f,s,c),o.abort()},i),e(o,Cn(n))}),u):Rf(u,!1)},Af=0,Nf=1,Qf=2,Vf=4,Gf=5,Df=3,Jf=function(n){return mn(n)?n:Cn(n)},Lf=function(n,r,t,e,u,i){return Zf(r,t,e,u,i)+ur(n.length,Df)+rr(n)},Zf=function(v,n,r,_,s){for(var t=[],h=s?Ai:Fi,e=p;e<r.length;e++){var u=r[e],i=mt(_,u)>=p,c=yr(n,u)&&qn(n[u]);if(c||i){var f= | ||
void 0;if(i){var i=c?n[u]:{},o=Fn(i),c=On(o).slice(p,hn);f=y(c.length);for(var a=0,b=c;a<b.length;a++)var g=b[a],f=(f+=Fi(Jf(g)))+Fi(Jf(o[g]))}else f=h(Jf(n[u]));t.push(y(e)+f)}}return y(v)+y(t.length)+t.join("")},Hf=e,Bf=n(121),Kf=n(122),Yf=n(123),Xf=n(124),Uf=n(125),$f=r,Wf=function(n){return Zf(Af,n,[Hf,Bf,Kf,Yf,Xf,Uf,$f],[Xf])},no=n(126),ro=function(n){return Zf(Vf,n,[no],ln,!0)},to=1,eo=function(n,r,t,e){var u=y(Bn(256)),i=tu(ru(Un())),c=y(e.length),r=r.substring(3),t=t+c+e.join(),c=y(t.length& | ||
hn),e=Ge(i,4,i.charAt(3),t+c),t=Ge(r,8,r.charAt(9),i+e),c=y((15&to)<<4),r=nr(c+t,u),i=ir(u+r);return Je(n,i)},uo=n(127),io=r,co=n(128),fo=r,oo=n(129),ao=0,vo=300,_o=r,so=n(130),ho="data-castle-value",bo="data-castle-name",go=r,po=r,yo="castle_request_token",lo="Castle is not configured",qo=function(){if(Ue)return Ue;throw lo;},mo=!0,zo=function(n){var l,r,t,e,u,i,c,v,_,n=n||{};($e=yr(n,"window")?n.window:$e)||"undefined"!=typeof window&&($e=window),$e&&(yr(n,"cookieDomain")&&(c=n.cookieDomain,/\S+\.\S{2,}$/.test(c)&& | ||
(Xe=c)),yr(n,"avoidCookies")&&(c=!!n.avoidCookies,af.B=c),vf().B||(Xe=Xe||function(n){for(var r=0,t=In(n),e=Rn(n).hostname,u="".concat(uf).concat(Un()),i=e.split(".");r<i.length-1&&(e=i.slice(-1-++r).join("."),tf(n,u,u,"domain=".concat(e,";")),!kn(t.cookie,"".concat(u,"=").concat(u))););return ff(n,u),e}($e)),yr(n,"pk")&&(c=n.pk,af.U=qn(c)?c.slice(0,35):an,wf($e)),yr(n,"apiUrl")&&(c=n.apiUrl,af.Y=c),yr(n,"timeout")&&(c=n.timeout,af.X=c),yr(n,"verbose")&&(c=!!n.verbose,af.K=c),mo&&(v=l=$e,Ue=_={createRequestToken:function(){var e= | ||
{then:function(n,r){var t;return lf&&!e._value&&(xf(v),e._value=function(){var n;if(yf)return n=v,(Mf()||If(n,sr())).$}()),e._value?n(e._value):(n=n,t=e,zf(v,vf()),df.push([n,t])),e}};return e},page:function(n){var u=v,r=_.createRequestToken(),i=n,n={},c=vf();if(!h(c.U)||!h(i)||!h(i.user))return c.K&&(c.U?sf(u,Pi):sf(u,Oi)),Rf(n,!1);var f=yr(i,uo)?i[uo]:Rn(u).href,o=yr(i,io)?i[io]:In(u).title||f,a=yr(i,co)?i[co]:In(u).referrer;return Ff(0,c.Y,c.U,function(e){return r.then(function(n){var r=c.U,t= | ||
{user:i.user,name:o,url:f,referrer:a},r=eo(u,r,t.userJwt?ro({jwt:t.userJwt}):Wf(t.user),[Lf(n,Nf,t,[io,uo,co],ln)]);e({data:r})})},Pf,n,c.X)},form:function(n){var e=v,r=_.createRequestToken(),u=n,n={},i=vf();if(!(h(i.U)&&h(u)&&h(u.user)&&h(u.name)))return i.K&&(i.U?sf(e,Pi):sf(e,Oi)),Rf(n,!1);var t=Un();return t-ao<vo?Rf(n,!1):(ao=t,Ff(0,i.Y,i.U,function(t){return r.then(function(n){var r=i.U,n=eo(e,r,(r=u).userJwt?ro({jwt:r.userJwt}):Wf(r.user),[Lf(n,Qf,r,[fo,oo],[oo])]);t({data:n})})},Of,n,i.X))}, | ||
custom:function(n){return e=v,r=_.createRequestToken(),u=n,n={},i=vf(),h(i.U)&&h(u)&&h(u.user)&&h(u.name)?Ff(0,i.Y,i.U,function(t){return r.then(function(n){var r=i.U,n=eo(e,r,(r=u).userJwt?ro({jwt:r.userJwt}):Wf(r.user),[Lf(n,Gf,r,[_o,so],[so])]);t({data:n})})},Of,n,i.X):(i.K&&(i.U?sf(e,Pi):sf(e,Oi)),Rf(n,!1));var e,r,u,i},injectTokenOnSubmit:function(r,t){r.preventDefault?r.preventDefault():r.returnValue=!1;var e=r.target||r.srcElement;_.createRequestToken().then(function(n){jn(function(n,r){for(var t= | ||
0,e=r.childNodes;t<e.length;t++){var u=e[t];if(Sn(u,po)===yo)return u}n=In(n).createElement("input");return jn(n,"type","hidden"),jn(n,po,yo),r.appendChild(n),n}(v,e),"value",n),t?t(r):e.submit()})},formEventOnSubmit:function(n,r,t,e){if(!n.preventDefault)return!e||void e(n,null);n.preventDefault();var u=n.target||n.srcElement,r=dn(mn(r)?{userJwt:r}:{user:r||{}},function(n){for(var r=new FormData(n),t={},e=0,u=n.querySelectorAll("[".concat(ho,"]"));e<u.length;e++){var i=u[e],c=Sn(i,ho),i=Sn(i,go); | ||
r.has(i)&&(t[c]=""+r.get(i))}return{name:Sn(n,bo),values:t}}(u));_.form(r).then(function(r){t&&t.injectToken?_.injectTokenOnSubmit(n,function(n){return e?e(n,r):u.submit()}):e?e(n,r):u.submit()})}},a=Pn(4,s),M=f(Tt,he),k=f(St,he),x=f(Tt,he),R=f(St,he),j=f(Ct,he),I=f(Ct,he,s,s,s,2,!0,pt),X=ve(!1,pt),U=ve(!1,pt),$=ve(!1,pt),W=ve(!1,pt),nn=ve(!1,pt),rn=ve(!1,pt),tn=ve(!1,pt),en=f(Ct,s,s,s,s,2,!0,pt),un=f(Tt,s,s,s,s,2,!0,pt),S=f(Tt,s,[$r,Ur],s,Xt),C=f(Pt,be,[Yr,Kr],s,Xt),E=f(Ot,be,[Yr,Kr],s,Xt),P=f(Tt, | ||
ge,[Yr]),F=f(Tt,ge,[Kr]),T=f(Tt,ge,[Yr,Kr],s,Xt),O=f(Tt,ge,[Kr,Yr],s,Xt),J=f(Tt,s,[nt,Wr,rt],Kt,$t),L=f(Tt,s,[nt,Wr,rt],Kt,Ut),A=f(Et),N=f(Tt,s,[Xr]),V=f(Rt,s,s,s,s,3,!1,pt),G=f(Rt,he,s,s,s,3,!1,pt),D=f(jt,s,s,s,s,3,!1,pt),Q=f(Tt,s,[Xr,Yr],s,Xt),Z=f(Pt,s,[Yr],s,te),H=f(Pt,s,[Yr],s,Wt),B=f(Pt,s,[Yr],s,ne),K=f(Pt,s,[Yr],s,re),Y=f(Tt,s,s,s,s,2,!0,yt),q=zt(Ft,[Yr]),m=zt(Nt),w=zt(s,[nt],Yt),z=zt(s),d=Pn(it.length,0),zc||(Be=function(){var n,r,t,e,u,i,v=r=l,_=it,s=_t,h=void 0;xe=dr(yn,Oe,void 0);for(var b= | ||
v,g=cn=function(n){return je(v,n,_,s,h)},c=_,p=s,f=Br(b),o=c.length-1;0<=o;o--){var y=Re(b,o,p);if(o===ut&&f&&f.query)for(var a=Ee.length-1;0<=a;a--)(function(n,r,t,e){n.query({name:Ee[a]}).then(function(n){n=n.state;Te||n===Ce&&(Te=!0,Dn(r,t,e))})["catch"](yn)})(f,y,c[o],g);else Dn(y,c[o],g)}n=ef(r,Ei),u=function(n,r){try{var t=n.localStorage;return t?t.getItem(r):null}catch(e){return null}}(u=r,Ti)||ef(u,Ti)||(u=r,!(i=n)||61!==i.length&&57!==i.length&&36!==i.length&&75!==i.length?of(u,i)?(u=Le(u, | ||
i),u=rr(u),nr(u.slice(2,u.length-2),u.slice(0,2)).slice(4,36)):sr().replace(/[-]/g,""):i.split("-").slice(0,5).join("")),r=If(i=r,u),n&&ff(i,Ei),vf().B?tf(i,Ti,"","expires=".concat(bf,";")):ff(i,Ti),t=i,kf(e=r),vf().B?qf(t,e.W,function(){return mf(t,e.W)}):(mf(t,e.W),qf(t,e.W)),yf=!0,wf($e)},Ke=function(){return xf(l)},Sc(Qi,(n=l,b(n)[qr]),[Tc,Oc,Pc,Fc]),Sc(Vi,b(n)[mr],[Zc,Hc]),Sc(Gi,function(n){n=b(n);return n[Mr]||n[vr("user",Mr)]||n[vr("browser",Mr)]||n[vr("system",Mr)]}(n),[Lc(Ac),Lc(Nc),Lc(Qc), | ||
Lc(Vc),Lc(Gc),Lc(Dc),Lc(Jc),_r(Lc(Ac)),_r(Lc(Gc))]),jc(Di,wn(b(n)[Ir])),Ic(Ji,ji,Cc(wn(xn(c=n).width),wn(xn(c).availWidth))+Cc(wn(xn(c).height),wn(xn(c).availHeight))),Ic(Li,xi,Hr(n)),Ic(Zi,xi,wn(b(n)[kr])),jc(Hi,(i=xn(u=n),h(i[gu])&&h(i[pu])&&i[gu]>i[pu]?Hn(i[gu],i[pu]):h(u[yu])?u[yu]:1)),Ic(Bi,ji,(i=Xn()[Ku]()/15,(u=Xn()).setDate(1),u.setMonth(0),e=u[Ku](),u.setMonth(6),e=Kn(e,u[Ku]())/15,y(i)+y(e))),Rc(Ki,En(b(n)[xr],function(n){return n.type})),Rc(Yi,En(b(n)[Fr],function(n){return n.name+n.description+ | ||
n.length+n.filename})),Ic(Xi,ji,function(n){n=[si(),In(n)[Gr],n[Lr]||n[Jr],b(n)[Vr],!0===b(n)[Su],n[Dr],b(n)[Or],Br(n),b(n)[Er],b(n)[Cr],b(n)[Sr],b(n)[jr]];return Ec(n)}(n)),Ic(cc,ji,Ec([!!(u=n)["__".concat(Cu)],Ou([mu[0]in(i=u),mu[1]in i,mu[2]in i,mu[3]in i]),(t=(e=In(i=u)).documentElement,Ou([Su in i,"_".concat(Ru)in i,zu in i,"_".concat(xu)in i,"__".concat(Su,"_").concat(ku)in e,"__".concat(wu,"_").concat(Mu)in e,"__".concat(Su,"_").concat(Mu)in e,"__".concat(xu,"_").concat(Mu)in e,"__fx".concat(wu, | ||
"_").concat(Mu)in e,"__".concat(wu,"_").concat(ju)in e,"__".concat(Su,"_").concat(ju)in e,"__".concat(xu,"_").concat(ju)in e,"__fx".concat(wu,"_").concat(ju)in e,"__".concat(Su,"_").concat(ku)in e,"__".concat(Su,"_").concat(Iu)in e,qu(t,xu),qu(t,Su),qu(t,wu)])),!!u.external&&Wn(u.external.toString)&&kn(u.external.toString(),Eu),!!u.spawn,!(!u[Tu]&&!u["".concat(Tu,"Controller")]),!!u.emit,!!u.Buffer])),Ic(Ui,Ii,Zr(n)),(i=function(n){var r;try{r=function(u){var n,r,t,e=In(u).createElement(iu),i=e&& | ||
e.getContext&&e.toDataURL?e.getContext(vu):an;if(i)return{tn:(r=i,(n=e).width=500,n.height=100,t=uu+String.fromCharCode(55357,56836),r.textBaseline="alphabetic",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",r.font=cu,r.fillText(t,2,20),r.fillStyle=ou,r.font=fu,r.fillText(t,4,22),bu(n)),en:function(n,r){n.height=200,n.width=400;var t=2*Math.PI;r.globalCompositeOperation="multiply";for(var e=0,u=[["#f0f",50,50],["#0ff",100,50],["#f70",75,100]];e<u.length;e++){var i=u[e],c=i[0],f=i[1], | ||
i=i[2];r.fillStyle=c,r.beginPath(),r.arc(f,i,50,0,t,!0),r.closePath(),r.fill()}return r.fillStyle="#70f",r.arc(75,75,75,0,t,!0),r.arc(75,75,25,0,t,!0),r.fill(au),bu(n)}(e,i),un:function(){var n=In(u).createElement(iu);try{var r=n.getContext(_u)||n.getContext(su+_u),t=r.getExtension(hu);return t?r.getParameter(t.UNMASKED_RENDERER_WEBGL):an}catch(e){return an}}()}}(n)}catch(t){}return r}(n))&&(Ic($i,Ii,i.tn),Ic(ec,Ii,i.en),Ic(uc,Ii,i.un)),xc(nc,function(n){n=b(n);return n[Pr]||n[vr("ms",Pr)]?1:an}(n)), | ||
xc(rc,function(n){try{var r=b(n)[Rr];return Wn(r)&&r()?1:an}catch(t){return an}}(n)),Sc(tc,b(n)[wr],Kc),Ic(ic,Ii,((e=Xn()).setTime(0),e.toLocaleString())),Ic(fc,xi,(t=n)[Qr]?t[Qr].toString().length:p),Sc(oc,b(n)[Ar],[Bc]),u=vi(),Ic(ac,xi,u.J),Sc(vc,u.L,[hi,bi,gi]),Sc(_c,u.Z,[mi,zi,qi]),Ic(sc,xi,u.H),Ic(hc,ji,(i=function(n){var r,t,e=b(n),u=In(n),i=0;h(e[Pu])?i=e[Pu]:(t=e["ms".concat(Pu)],h(e[t])&&(i=e[t]));try{u.createEvent(Fu),r=!0}catch(c){r=!1}return{"in":i,cn:r,fn:"on".concat(Au)in n}}(i=n),e= | ||
parseInt("".concat(Mn(i.cn)).concat(Mn(i.fn)),2),y((63&i["in"])<<2|e))),Sc(bc,_i(),[pi,yi,li,di]),Rc(gc,function(v){var n=[];if(!(yr(vn,br)&&yr(vn,gr)&&yr(vn,pr)))return n;var r,t=b(v),e=t;do for(var u=0,i=(r=e,vn[br](r));u<i.length;u++){var c=i[u];n.push(c)}while(e=lr(e));for(var f,_=[],o=0,s=n;o<s.length;o++){var c=s[o],a=(a=lr(t),vn[pr](a,c));h(a)?zn(a.value)?f=a.value.toString():zn(a.get)&&(f=a.get.toString()):f="",_.push("".concat(c,"~~~").concat(f))}return _}(n)),Ic(pc,ji,function(n){if(n.length)return ur(parseInt(En(n, | ||
tr).join(""),2),2)}(function(n){try{return t=In(n).createElement(sn),[ni(t,oi),ni(t,fi),ni(t,ci)].concat((r=In(n).createElement(_n),[Wu(r,ii),Wu(r,ui),Wu(r,ei),Wu(r,ti),Wu(r,ri)]))}catch(e){return[]}var r,t}(n))),r=function(n){n.length&&Ic(Wi,ji,Ec([n[Du],n[Gu],n[Vu]]))},mc+=1,Bu.apply(s,[n].concat([function(n){wc?Ke():(r(n),--mc,zc&&mc===p&&Mc())}])),t=yc,u=ki,h(i=Si)&&(qc[t]=Ni(t,u,i)),zc=!0,mc===p?Mc():setTimeout(kc,lc)),mo=!1))},wo=window;wo.Castle={configure:function(n){return zo(dn(n,{window:wo}))}, | ||
page:function(n){return qo().page(n)},form:function(n){return qo().form(n)},custom:function(n){return qo().custom(n)},createRequestToken:function(){return qo().createRequestToken()},getVersion:function(){return on},injectTokenOnSubmit:function(n,r){return qo().injectTokenOnSubmit(n,r)},formEventOnSubmit:function(n,r,t,e){return qo().formEventOnSubmit(n,r,t,e)}}})();} | ||
void 0;if(i){var i=c?n[u]:{},o=Fn(i),c=On(o).slice(p,hn);f=y(c.length);for(var a=0,b=c;a<b.length;a++)var g=b[a],f=(f+=Fi(Jf(g)))+Fi(Jf(o[g]))}else f=h(Jf(n[u]));t.push(y(e)+f)}}return y(v)+y(t.length)+t.join("")},Hf=e,Bf=n(121),Kf=n(122),Yf=n(123),Xf=n(124),Uf=n(125),$f=r,Wf=function(n){return Zf(Af,n,[Hf,Bf,Kf,Yf,Xf,Uf,$f],[Xf])},no=n(126),ro=function(n){return Zf(Vf,n,[no],ln,!0)},to=2,eo=function(n,r,t,e){var u=y(Bn(256)),i=tu(ru(Un())),c=y(e.length),r=r.substring(3),t=t+c+e.join(),c=y(t.length& | ||
hn),e=Ge(i,4,i.charAt(3),t+c),t=Ge(r,8,(r.charCodeAt(9)&bn).toString(16),i+e),c=y((15&to)<<4),r=nr(c+t,u),i=ir(u+r);return Je(n,i)},uo=n(127),io=r,co=n(128),fo=r,oo=n(129),ao=0,vo=300,_o=r,so=n(130),ho="data-castle-value",bo="data-castle-name",go=r,po=r,yo="castle_request_token",lo="Castle is not configured",qo=function(){if(Ue)return Ue;throw lo;},mo=!0,zo=function(n){var l,r,t,e,u,i,c,v,_,n=n||{};($e=yr(n,"window")?n.window:$e)||"undefined"!=typeof window&&($e=window),$e&&(yr(n,"cookieDomain")&& | ||
(c=n.cookieDomain,/\S+\.\S{2,}$/.test(c)&&(Xe=c)),yr(n,"avoidCookies")&&(c=!!n.avoidCookies,af.B=c),vf().B||(Xe=Xe||function(n){for(var r=0,t=In(n),e=Rn(n).hostname,u="".concat(uf).concat(Un()),i=e.split(".");r<i.length-1&&(e=i.slice(-1-++r).join("."),tf(n,u,u,"domain=".concat(e,";")),!kn(t.cookie,"".concat(u,"=").concat(u))););return ff(n,u),e}($e)),yr(n,"pk")&&(c=n.pk,af.U=qn(c)?c.slice(0,35):an,wf($e)),yr(n,"apiUrl")&&(c=n.apiUrl,af.Y=c),yr(n,"timeout")&&(c=n.timeout,af.X=c),yr(n,"verbose")&&(c= | ||
!!n.verbose,af.K=c),mo&&(v=l=$e,Ue=_={createRequestToken:function(){var e={then:function(n,r){var t;return lf&&!e._value&&(xf(v),e._value=function(){var n;if(yf)return n=v,(Mf()||If(n,sr())).$}()),e._value?n(e._value):(n=n,t=e,zf(v,vf()),df.push([n,t])),e}};return e},page:function(n){var u=v,r=_.createRequestToken(),i=n,n={},c=vf();if(!h(c.U)||!h(i)||!h(i.user))return c.K&&(c.U?sf(u,Pi):sf(u,Oi)),Rf(n,!1);var f=yr(i,uo)?i[uo]:Rn(u).href,o=yr(i,io)?i[io]:In(u).title||f,a=yr(i,co)?i[co]:In(u).referrer; | ||
return Ff(0,c.Y,c.U,function(e){return r.then(function(n){var r=c.U,t={user:i.user,name:o,url:f,referrer:a},r=eo(u,r,t.userJwt?ro({jwt:t.userJwt}):Wf(t.user),[Lf(n,Nf,t,[io,uo,co],ln)]);e({data:r})})},Pf,n,c.X)},form:function(n){var e=v,r=_.createRequestToken(),u=n,n={},i=vf();if(!(h(i.U)&&h(u)&&h(u.user)&&h(u.name)))return i.K&&(i.U?sf(e,Pi):sf(e,Oi)),Rf(n,!1);var t=Un();return t-ao<vo?Rf(n,!1):(ao=t,Ff(0,i.Y,i.U,function(t){return r.then(function(n){var r=i.U,n=eo(e,r,(r=u).userJwt?ro({jwt:r.userJwt}): | ||
Wf(r.user),[Lf(n,Qf,r,[fo,oo],[oo])]);t({data:n})})},Of,n,i.X))},custom:function(n){return e=v,r=_.createRequestToken(),u=n,n={},i=vf(),h(i.U)&&h(u)&&h(u.user)&&h(u.name)?Ff(0,i.Y,i.U,function(t){return r.then(function(n){var r=i.U,n=eo(e,r,(r=u).userJwt?ro({jwt:r.userJwt}):Wf(r.user),[Lf(n,Gf,r,[_o,so],[so])]);t({data:n})})},Of,n,i.X):(i.K&&(i.U?sf(e,Pi):sf(e,Oi)),Rf(n,!1));var e,r,u,i},injectTokenOnSubmit:function(r,t){r.preventDefault?r.preventDefault():r.returnValue=!1;var e=r.target||r.srcElement; | ||
_.createRequestToken().then(function(n){jn(function(n,r){for(var t=0,e=r.childNodes;t<e.length;t++){var u=e[t];if(Sn(u,po)===yo)return u}n=In(n).createElement("input");return jn(n,"type","hidden"),jn(n,po,yo),r.appendChild(n),n}(v,e),"value",n),t?t(r):e.submit()})},formEventOnSubmit:function(n,r,t,e){if(!n.preventDefault)return!e||void e(n,null);n.preventDefault();var u=n.target||n.srcElement,r=dn(mn(r)?{userJwt:r}:{user:r||{}},function(n){for(var r=new FormData(n),t={},e=0,u=n.querySelectorAll("[".concat(ho, | ||
"]"));e<u.length;e++){var i=u[e],c=Sn(i,ho),i=Sn(i,go);r.has(i)&&(t[c]=""+r.get(i))}return{name:Sn(n,bo),values:t}}(u));_.form(r).then(function(r){t&&t.injectToken?_.injectTokenOnSubmit(n,function(n){return e?e(n,r):u.submit()}):e?e(n,r):u.submit()})}},a=Pn(4,s),M=f(Tt,he),k=f(St,he),x=f(Tt,he),R=f(St,he),j=f(Ct,he),I=f(Ct,he,s,s,s,2,!0,pt),X=ve(!1,pt),U=ve(!1,pt),$=ve(!1,pt),W=ve(!1,pt),nn=ve(!1,pt),rn=ve(!1,pt),tn=ve(!1,pt),en=f(Ct,s,s,s,s,2,!0,pt),un=f(Tt,s,s,s,s,2,!0,pt),S=f(Tt,s,[$r,Ur],s,Xt), | ||
C=f(Pt,be,[Yr,Kr],s,Xt),E=f(Ot,be,[Yr,Kr],s,Xt),P=f(Tt,ge,[Yr]),F=f(Tt,ge,[Kr]),T=f(Tt,ge,[Yr,Kr],s,Xt),O=f(Tt,ge,[Kr,Yr],s,Xt),J=f(Tt,s,[nt,Wr,rt],Kt,$t),L=f(Tt,s,[nt,Wr,rt],Kt,Ut),A=f(Et),N=f(Tt,s,[Xr]),V=f(Rt,s,s,s,s,3,!1,pt),G=f(Rt,he,s,s,s,3,!1,pt),D=f(jt,s,s,s,s,3,!1,pt),Q=f(Tt,s,[Xr,Yr],s,Xt),Z=f(Pt,s,[Yr],s,te),H=f(Pt,s,[Yr],s,Wt),B=f(Pt,s,[Yr],s,ne),K=f(Pt,s,[Yr],s,re),Y=f(Tt,s,s,s,s,2,!0,yt),q=zt(Ft,[Yr]),m=zt(Nt),w=zt(s,[nt],Yt),z=zt(s),d=Pn(it.length,0),zc||(Be=function(){var n,r,t,e, | ||
u,i,v=r=l,_=it,s=_t,h=void 0;xe=dr(yn,Oe,void 0);for(var b=v,g=cn=function(n){return je(v,n,_,s,h)},c=_,p=s,f=Br(b),o=c.length-1;0<=o;o--){var y=Re(b,o,p);if(o===ut&&f&&f.query)for(var a=Ee.length-1;0<=a;a--)(function(n,r,t,e){n.query({name:Ee[a]}).then(function(n){n=n.state;Te||n===Ce&&(Te=!0,Dn(r,t,e))})["catch"](yn)})(f,y,c[o],g);else Dn(y,c[o],g)}n=ef(r,Ei),u=function(n,r){try{var t=n.localStorage;return t?t.getItem(r):null}catch(e){return null}}(u=r,Ti)||ef(u,Ti)||(u=r,!(i=n)||61!==i.length&& | ||
57!==i.length&&36!==i.length&&75!==i.length?of(u,i)?(u=Le(u,i),u=rr(u),nr(u.slice(2,u.length-2),u.slice(0,2)).slice(4,36)):sr().replace(/[-]/g,""):i.split("-").slice(0,5).join("")),r=If(i=r,u),n&&ff(i,Ei),vf().B?tf(i,Ti,"","expires=".concat(bf,";")):ff(i,Ti),t=i,kf(e=r),vf().B?qf(t,e.W,function(){return mf(t,e.W)}):(mf(t,e.W),qf(t,e.W)),yf=!0,wf($e)},Ke=function(){return xf(l)},Sc(Qi,(n=l,b(n)[qr]),[Tc,Oc,Pc,Fc]),Sc(Vi,b(n)[mr],[Zc,Hc]),Sc(Gi,function(n){n=b(n);return n[Mr]||n[vr("user",Mr)]||n[vr("browser", | ||
Mr)]||n[vr("system",Mr)]}(n),[Lc(Ac),Lc(Nc),Lc(Qc),Lc(Vc),Lc(Gc),Lc(Dc),Lc(Jc),_r(Lc(Ac)),_r(Lc(Gc))]),jc(Di,wn(b(n)[Ir])),Ic(Ji,ji,Cc(wn(xn(c=n).width),wn(xn(c).availWidth))+Cc(wn(xn(c).height),wn(xn(c).availHeight))),Ic(Li,xi,Hr(n)),Ic(Zi,xi,wn(b(n)[kr])),jc(Hi,(i=xn(u=n),h(i[gu])&&h(i[pu])&&i[gu]>i[pu]?Hn(i[gu],i[pu]):h(u[yu])?u[yu]:1)),Ic(Bi,ji,(i=Xn()[Ku]()/15,(u=Xn()).setDate(1),u.setMonth(0),e=u[Ku](),u.setMonth(6),e=Kn(e,u[Ku]())/15,y(i)+y(e))),Rc(Ki,En(b(n)[xr],function(n){return n.type})), | ||
Rc(Yi,En(b(n)[Fr],function(n){return n.name+n.description+n.length+n.filename})),Ic(Xi,ji,function(n){n=[si(),In(n)[Gr],n[Lr]||n[Jr],b(n)[Vr],!0===b(n)[Su],n[Dr],b(n)[Or],Br(n),b(n)[Er],b(n)[Cr],b(n)[Sr],b(n)[jr]];return Ec(n)}(n)),Ic(cc,ji,Ec([!!(u=n)["__".concat(Cu)],Ou([mu[0]in(i=u),mu[1]in i,mu[2]in i,mu[3]in i]),(t=(e=In(i=u)).documentElement,Ou([Su in i,"_".concat(Ru)in i,zu in i,"_".concat(xu)in i,"__".concat(Su,"_").concat(ku)in e,"__".concat(wu,"_").concat(Mu)in e,"__".concat(Su,"_").concat(Mu)in | ||
e,"__".concat(xu,"_").concat(Mu)in e,"__fx".concat(wu,"_").concat(Mu)in e,"__".concat(wu,"_").concat(ju)in e,"__".concat(Su,"_").concat(ju)in e,"__".concat(xu,"_").concat(ju)in e,"__fx".concat(wu,"_").concat(ju)in e,"__".concat(Su,"_").concat(ku)in e,"__".concat(Su,"_").concat(Iu)in e,qu(t,xu),qu(t,Su),qu(t,wu)])),!!u.external&&Wn(u.external.toString)&&kn(u.external.toString(),Eu),!!u.spawn,!(!u[Tu]&&!u["".concat(Tu,"Controller")]),!!u.emit,!!u.Buffer])),Ic(Ui,Ii,Zr(n)),(i=function(n){var r;try{r= | ||
function(u){var n,r,t,e=In(u).createElement(iu),i=e&&e.getContext&&e.toDataURL?e.getContext(vu):an;if(i)return{tn:(r=i,(n=e).width=500,n.height=100,t=uu+String.fromCharCode(55357,56836),r.textBaseline="alphabetic",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",r.font=cu,r.fillText(t,2,20),r.fillStyle=ou,r.font=fu,r.fillText(t,4,22),bu(n)),en:function(n,r){n.height=200,n.width=400;var t=2*Math.PI;r.globalCompositeOperation="multiply";for(var e=0,u=[["#f0f",50,50],["#0ff",100,50],["#f70", | ||
75,100]];e<u.length;e++){var i=u[e],c=i[0],f=i[1],i=i[2];r.fillStyle=c,r.beginPath(),r.arc(f,i,50,0,t,!0),r.closePath(),r.fill()}return r.fillStyle="#70f",r.arc(75,75,75,0,t,!0),r.arc(75,75,25,0,t,!0),r.fill(au),bu(n)}(e,i),un:function(){var n=In(u).createElement(iu);try{var r=n.getContext(_u)||n.getContext(su+_u),t=r.getExtension(hu);return t?r.getParameter(t.UNMASKED_RENDERER_WEBGL):an}catch(e){return an}}()}}(n)}catch(t){}return r}(n))&&(Ic($i,Ii,i.tn),Ic(ec,Ii,i.en),Ic(uc,Ii,i.un)),xc(nc,function(n){n= | ||
b(n);return n[Pr]||n[vr("ms",Pr)]?1:an}(n)),xc(rc,function(n){try{var r=b(n)[Rr];return Wn(r)&&r()?1:an}catch(t){return an}}(n)),Sc(tc,b(n)[wr],Kc),Ic(ic,Ii,((e=Xn()).setTime(0),e.toLocaleString())),Ic(fc,xi,(t=n)[Qr]?t[Qr].toString().length:p),Sc(oc,b(n)[Ar],[Bc]),u=vi(),Ic(ac,xi,u.J),Sc(vc,u.L,[hi,bi,gi]),Sc(_c,u.Z,[mi,zi,qi]),Ic(sc,xi,u.H),Ic(hc,ji,(i=function(n){var r,t,e=b(n),u=In(n),i=0;h(e[Pu])?i=e[Pu]:(t=e["ms".concat(Pu)],h(e[t])&&(i=e[t]));try{u.createEvent(Fu),r=!0}catch(c){r=!1}return{"in":i, | ||
cn:r,fn:"on".concat(Au)in n}}(i=n),e=parseInt("".concat(Mn(i.cn)).concat(Mn(i.fn)),2),y((63&i["in"])<<2|e))),Sc(bc,_i(),[pi,yi,li,di]),Rc(gc,function(v){var n=[];if(!(yr(vn,br)&&yr(vn,gr)&&yr(vn,pr)))return n;var r,t=b(v),e=t;do for(var u=0,i=(r=e,vn[br](r));u<i.length;u++){var c=i[u];n.push(c)}while(e=lr(e));for(var f,_=[],o=0,s=n;o<s.length;o++){var c=s[o],a=(a=lr(t),vn[pr](a,c));h(a)?zn(a.value)?f=a.value.toString():zn(a.get)&&(f=a.get.toString()):f="",_.push("".concat(c,"~~~").concat(f))}return _}(n)), | ||
Ic(pc,ji,function(n){if(n.length)return ur(parseInt(En(n,tr).join(""),2),2)}(function(n){try{return t=In(n).createElement(sn),[ni(t,oi),ni(t,fi),ni(t,ci)].concat((r=In(n).createElement(_n),[Wu(r,ii),Wu(r,ui),Wu(r,ei),Wu(r,ti),Wu(r,ri)]))}catch(e){return[]}var r,t}(n))),r=function(n){n.length&&Ic(Wi,ji,Ec([n[Du],n[Gu],n[Vu]]))},mc+=1,Bu.apply(s,[n].concat([function(n){wc?Ke():(r(n),--mc,zc&&mc===p&&Mc())}])),t=yc,u=ki,h(i=Si)&&(qc[t]=Ni(t,u,i)),zc=!0,mc===p?Mc():setTimeout(kc,lc)),mo=!1))},wo=window; | ||
wo.Castle={configure:function(n){return zo(dn(n,{window:wo}))},page:function(n){return qo().page(n)},form:function(n){return qo().form(n)},custom:function(n){return qo().custom(n)},createRequestToken:function(){return qo().createRequestToken()},getVersion:function(){return on},injectTokenOnSubmit:function(n,r){return qo().injectTokenOnSubmit(n,r)},formEventOnSubmit:function(n,r,t,e){return qo().formEventOnSubmit(n,r,t,e)}}})();} |
@@ -6,3 +6,3 @@ (function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self)["@castleio/castle-js"]={})})(this,function(r){var o=["Onpxfcnpr","Qryrgr","Fcnpr","Ragre","Gno","nhqvb","ivqrb","anzr","vq","fgevat","nqqRiragYvfgrare","nggnpuRirag","qrgnpuRirag","erzbirRiragYvfgrare","ba","trgBjaCebcreglAnzrf","trgCebgbglcrBs","trgBjaCebcreglQrfpevcgbe","cyngsbez","iraqbe","hfreNtrag","cebqhpgFho", | ||
"rfRF","seSE","cgOE","raTO","qrQR","ehEH","Tbbtyr%Vap.","Nccyr%Pbzchgre,%Vap.","rznvy","cubar","ertvfgrerq_ng","genvgf","fvtangher","wjg","hey","ersreere","inyhrf","cebcregvrf","Zngu"];function n(n){for(var r,t,e,u=o[n],i="",c=13%26,f=0;f<u.length;f++)i+=(t=c,65<=(e=(r=u.charAt(f)).charCodeAt())&&e<=90?String.fromCharCode((e-65+t)%26+65):97<=e&&e<=122?String.fromCharCode((e-97+t)%26+97):32==e?"%":r);return i}var t,m,u,z,M,w,k,x,I,j,R,C,S,E,T,P,F,O,A,N,Q,G,V,D,J,L,Z,H,B,K,Y,X,U,p,$,W,nn,rn,tn,en,un, | ||
cn,fn,i=n(0),c=n(1),f=n(2),a=n(3),v=n(4),_=[i,c,8+"",46+""],on=_.concat([f,a,v,32+"",13+"",10+""]),an="2.1.1",g=0,vn=void 0,l=null,_n=Object,sn=n(5),hn=n(6),i=n(7),c=n(8),bn=255,pn=15,gn=n(9),yn=1535E6,ln=function(){},dn=[],qn=function(t,e,u){var i=vn,c=l;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return clearTimeout(c),u?i=t.apply(l,n):c=setTimeout(function(){if(c=l,!u)return i=t.apply(l,n)},e),i}},mn=_n.assign||function(){for(var n=[],r=0;r<arguments.length;r++)n[r]= | ||
cn,fn,i=n(0),c=n(1),f=n(2),a=n(3),v=n(4),_=[i,c,8+"",46+""],on=_.concat([f,a,v,32+"",13+"",10+""]),an="2.1.2",g=0,vn=void 0,l=null,_n=Object,sn=n(5),hn=n(6),i=n(7),c=n(8),bn=255,pn=15,gn=n(9),yn=1535E6,ln=function(){},dn=[],qn=function(t,e,u){var i=vn,c=l;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return clearTimeout(c),u?i=t.apply(l,n):c=setTimeout(function(){if(c=l,!u)return i=t.apply(l,n)},e),i}},mn=_n.assign||function(){for(var n=[],r=0;r<arguments.length;r++)n[r]= | ||
arguments[r];for(var t=n[0],e=void 0,u=1,i=n.length;u<i;u++)for(var c in e=n[u])e.hasOwnProperty(c)&&(t[c]=e[c]);return t},d=function(n){return n!==vn&&n!==l},zn=function(n){return d(n)&&""!==n},Mn=function(n){return typeof n===gn},wn=function(n){return n!==vn},kn=function(n){return n||vn},xn=function(n){return n?1:0},In=function(n,r){return-1<n.indexOf(r)},h=function(n){return n.navigator},jn=function(n){return n.document},Rn=function(n){return n.screen},Cn=function(n){return n.location},Sn=function(n, | ||
@@ -57,7 +57,7 @@ r,t){return n.setAttribute(r,t)},En=function(n,r){if(n.getAttribute)return n.getAttribute(r)},Tn=function(n){return JSON.stringify(n)},Pn=function(n,r){for(var t=[],e=0,u=n;e<u.length;e++){var i=u[e];t.push(r(i))}return t},Fn=function(n){var r,t=[];for(r in n)n.hasOwnProperty(r)&&t.push(n[r]);return t},On=function(n){var r,t=[];for(r in n)n.hasOwnProperty(r)&&t.push(r);return t},An=function(n,r){for(var t=Array(n),e=t.length-1;0<=e;e--)t[e]=r;return t},Nn=function(n){if(_n(n)!==n)return{};for(var r in n)zn(n[r])|| | ||
Jf=3,Lf=function(n){return Mn(n)?n:Tn(n)},Zf=function(n,r,t,e,u,i){return Hf(r,t,e,u,i)+cr(n.length,Jf)+er(n)},Hf=function(v,n,r,_,s){for(var t=[],h=s?Oi:Fi,e=g;e<r.length;e++){var u=r[e],i=zt(_,u)>=g,c=dr(n,u)&&zn(n[u]);if(c||i){var f=void 0;if(i){var i=c?n[u]:{},o=Nn(i),c=On(o).slice(g,bn);f=y(c.length);for(var a=0,b=c;a<b.length;a++)var p=b[a],f=(f+=Fi(Lf(p)))+Fi(Lf(o[p]))}else f=h(Lf(n[u]));t.push(y(e)+f)}}return y(v)+y(t.length)+t.join("")},Bf=c,Kf=n(121),Yf=n(122),Xf=n(123),Uf=n(124),$f=n(125), | ||
Wf=i,no=function(n){return Hf(Nf,n,[Bf,Kf,Yf,Xf,Uf,$f,Wf],[Uf])},ro=n(126),to=function(n){return Hf(Vf,n,[ro],dn,!0)},eo=1,uo=function(n,r,t,e){var u=y(Yn(256)),i=tu(ru(Wn())),c=y(e.length),r=r.substring(3),t=t+c+e.join(),c=y(t.length&bn),e=Ve(i,4,i.charAt(3),t+c),t=Ve(r,8,r.charAt(9),i+e),c=y((15&eo)<<4),r=tr(c+t,u),i=fr(u+r);return Je(n,i)},io=n(127),co=i,fo=n(128),oo=i,ao=n(129),vo=0,_o=300,so=i,ho=n(130),bo="data-castle-value",po="data-castle-name",go=i,yo=i,lo="castle_request_token",qo="Castle is not configured", | ||
mo=function(){if(Ue)return Ue;throw qo;},zo=function(n){var v,_=n;Ue=v={createRequestToken:function(){var e={then:function(n,r){var t;return lf&&!e._value&&(jf(_),e._value=function(n){if(yf)return(kf()||If(n,br()))["in"]}(_)),e._value?n(e._value):(n=n,t=e,zf(_,vf()),df.push([n,t])),e}};return e},page:function(n){var u=_,r=v.createRequestToken(),i=n,n={},c=vf();if(!d(c.$)||!d(i)||!d(i.user))return c.Y&&(c.$?sf(u,Pi):sf(u,Ti)),Rf(n,!1);var f=dr(i,io)?i[io]:Cn(u).href,o=dr(i,co)?i[co]:jn(u).title||f, | ||
a=dr(i,fo)?i[fo]:jn(u).referrer;return Af(0,c.X,c.$,function(e){return r.then(function(n){var r=c.$,t={user:i.user,name:o,url:f,referrer:a},r=uo(u,r,t.userJwt?to({jwt:t.userJwt}):no(t.user),[Zf(n,Qf,t,[co,io,fo],dn)]);e({data:r})})},Of,n,c.U)},form:function(n){var e=_,r=v.createRequestToken(),u=n,n={},i=vf();if(!(d(i.$)&&d(u)&&d(u.user)&&d(u.name)))return i.Y&&(i.$?sf(e,Pi):sf(e,Ti)),Rf(n,!1);var t=Wn();return t-vo<_o?Rf(n,!1):(vo=t,Af(0,i.X,i.$,function(t){return r.then(function(n){var r=i.$,n=uo(e, | ||
r,(r=u).userJwt?to({jwt:r.userJwt}):no(r.user),[Zf(n,Gf,r,[oo,ao],[ao])]);t({data:n})})},Ff,n,i.U))},custom:function(n){return e=_,r=v.createRequestToken(),u=n,n={},i=vf(),d(i.$)&&d(u)&&d(u.user)&&d(u.name)?Af(0,i.X,i.$,function(t){return r.then(function(n){var r=i.$,n=uo(e,r,(r=u).userJwt?to({jwt:r.userJwt}):no(r.user),[Zf(n,Df,r,[so,ho],[ho])]);t({data:n})})},Ff,n,i.U):(i.Y&&(i.$?sf(e,Pi):sf(e,Ti)),Rf(n,!1));var e,r,u,i},injectTokenOnSubmit:function(r,t){r.preventDefault?r.preventDefault():r.returnValue= | ||
!1;var e=r.target||r.srcElement;v.createRequestToken().then(function(n){Sn(function(n,r){for(var t=0,e=r.childNodes;t<e.length;t++){var u=e[t];if(En(u,yo)===lo)return u}n=jn(n).createElement("input");return Sn(n,"type","hidden"),Sn(n,yo,lo),r.appendChild(n),n}(_,e),"value",n),t?t(r):e.submit()})},formEventOnSubmit:function(n,r,t,e){if(!n.preventDefault)return!e||void e(n,null);n.preventDefault();var u=n.target||n.srcElement,r=mn(Mn(r)?{userJwt:r}:{user:r||{}},function(n){for(var r=new FormData(n), | ||
Wf=i,no=function(n){return Hf(Nf,n,[Bf,Kf,Yf,Xf,Uf,$f,Wf],[Uf])},ro=n(126),to=function(n){return Hf(Vf,n,[ro],dn,!0)},eo=2,uo=function(n,r,t,e){var u=y(Yn(256)),i=tu(ru(Wn())),c=y(e.length),r=r.substring(3),t=t+c+e.join(),c=y(t.length&bn),e=Ve(i,4,i.charAt(3),t+c),t=Ve(r,8,(r.charCodeAt(9)&pn).toString(16),i+e),c=y((15&eo)<<4),r=tr(c+t,u),i=fr(u+r);return Je(n,i)},io=n(127),co=i,fo=n(128),oo=i,ao=n(129),vo=0,_o=300,so=i,ho=n(130),bo="data-castle-value",po="data-castle-name",go=i,yo=i,lo="castle_request_token", | ||
qo="Castle is not configured",mo=function(){if(Ue)return Ue;throw qo;},zo=function(n){var v,_=n;Ue=v={createRequestToken:function(){var e={then:function(n,r){var t;return lf&&!e._value&&(jf(_),e._value=function(n){if(yf)return(kf()||If(n,br()))["in"]}(_)),e._value?n(e._value):(n=n,t=e,zf(_,vf()),df.push([n,t])),e}};return e},page:function(n){var u=_,r=v.createRequestToken(),i=n,n={},c=vf();if(!d(c.$)||!d(i)||!d(i.user))return c.Y&&(c.$?sf(u,Pi):sf(u,Ti)),Rf(n,!1);var f=dr(i,io)?i[io]:Cn(u).href,o= | ||
dr(i,co)?i[co]:jn(u).title||f,a=dr(i,fo)?i[fo]:jn(u).referrer;return Af(0,c.X,c.$,function(e){return r.then(function(n){var r=c.$,t={user:i.user,name:o,url:f,referrer:a},r=uo(u,r,t.userJwt?to({jwt:t.userJwt}):no(t.user),[Zf(n,Qf,t,[co,io,fo],dn)]);e({data:r})})},Of,n,c.U)},form:function(n){var e=_,r=v.createRequestToken(),u=n,n={},i=vf();if(!(d(i.$)&&d(u)&&d(u.user)&&d(u.name)))return i.Y&&(i.$?sf(e,Pi):sf(e,Ti)),Rf(n,!1);var t=Wn();return t-vo<_o?Rf(n,!1):(vo=t,Af(0,i.X,i.$,function(t){return r.then(function(n){var r= | ||
i.$,n=uo(e,r,(r=u).userJwt?to({jwt:r.userJwt}):no(r.user),[Zf(n,Gf,r,[oo,ao],[ao])]);t({data:n})})},Ff,n,i.U))},custom:function(n){return e=_,r=v.createRequestToken(),u=n,n={},i=vf(),d(i.$)&&d(u)&&d(u.user)&&d(u.name)?Af(0,i.X,i.$,function(t){return r.then(function(n){var r=i.$,n=uo(e,r,(r=u).userJwt?to({jwt:r.userJwt}):no(r.user),[Zf(n,Df,r,[so,ho],[ho])]);t({data:n})})},Ff,n,i.U):(i.Y&&(i.$?sf(e,Pi):sf(e,Ti)),Rf(n,!1));var e,r,u,i},injectTokenOnSubmit:function(r,t){r.preventDefault?r.preventDefault(): | ||
r.returnValue=!1;var e=r.target||r.srcElement;v.createRequestToken().then(function(n){Sn(function(n,r){for(var t=0,e=r.childNodes;t<e.length;t++){var u=e[t];if(En(u,yo)===lo)return u}n=jn(n).createElement("input");return Sn(n,"type","hidden"),Sn(n,yo,lo),r.appendChild(n),n}(_,e),"value",n),t?t(r):e.submit()})},formEventOnSubmit:function(n,r,t,e){if(!n.preventDefault)return!e||void e(n,null);n.preventDefault();var u=n.target||n.srcElement,r=mn(Mn(r)?{userJwt:r}:{user:r||{}},function(n){for(var r=new FormData(n), | ||
t={},e=0,u=n.querySelectorAll("[".concat(bo,"]"));e<u.length;e++){var i=u[e],c=En(i,bo),i=En(i,go);r.has(i)&&(t[c]=""+r.get(i))}return{name:En(n,po),values:t}}(u));v.form(r).then(function(r){t&&t.injectToken?v.injectTokenOnSubmit(n,function(n){return e?e(n,r):u.submit()}):e?e(n,r):u.submit()})}}},Mo=!0;r.configure=function(n){var r,t,n=n||{};($e=dr(n,"window")?n.window:$e)||"undefined"!=typeof window&&($e=window),$e&&(dr(n,"cookieDomain")&&(r=n.cookieDomain,/\S+\.\S{2,}$/.test(r)&&(Xe=r)),dr(n,"avoidCookies")&& | ||
@@ -64,0 +64,0 @@ (r=!!n.avoidCookies,af.K=r),vf().K||(Xe=Xe||function(n){for(var r=0,t=jn(n),e=Cn(n).hostname,u="".concat(uf).concat(Wn()),i=e.split(".");r<i.length-1&&(e=i.slice(-1-++r).join("."),tf(n,u,u,"domain=".concat(e,";")),!In(t.cookie,"".concat(u,"=").concat(u))););return ff(n,u),e}($e)),dr(n,"pk")&&(r=n.pk,af.$=zn(r)?r.slice(0,35):vn,wf($e)),dr(n,"apiUrl")&&(r=n.apiUrl,af.X=r),dr(n,"timeout")&&(r=n.timeout,af.U=r),dr(n,"verbose")&&(r=!!n.verbose,af.Y=r),Mo&&(zo(t=$e),u=An(4,l),x=e(Pt,be),I=e(St,be),R=e(Pt, |
{ | ||
"name": "@castleio/castle-js", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Castle Fingerprinting Script", | ||
@@ -5,0 +5,0 @@ "main": "dist/castle.js", |
@@ -217,2 +217,3 @@ # Castle Fingerprinting Script | ||
* 2.1.2 – view events bug fixes | ||
* 2.1.1 – internal enhancements and stability improvements | ||
@@ -219,0 +220,0 @@ * 2.1.0 – added page, form, custom events support, changed configuration DSL, added formEventOnSubmit helper, renamed onFormSubmit to injectTokenOnSubmit |
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
74254
247
319