@uniformdev/context 12.2.1-alpha.107
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.txt +2 -0
- package/README.md +5 -0
- package/dist/chunk-VUJ3MDY7.mjs +1 -0
- package/dist/cli/cli.d.ts +5 -0
- package/dist/cli/cli.js +88 -0
- package/dist/cli/cli.mjs +88 -0
- package/dist/index.d.ts +876 -0
- package/dist/index.esm.js +3 -0
- package/dist/index.js +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +72 -0
@@ -0,0 +1,3 @@
|
|
1
|
+
import{d as s,e as d,f,g as h,h as a}from"./chunk-VUJ3MDY7.mjs";a();a();a();function nt(i,t){let e={...i};for(let r in t){let o=at(i,r,t,new Set([r]));o!==0&&(e[r]=o)}return e}function at(i,t,e,r){var n;let o=0;for(let c of e[t].inputs){let u=(n=i[c.dim])!=null?n:0;if(!u&&e[c.dim]){if(r.has(c.dim))continue;let S=new Set(r);S.add(c.dim),u=at(i,c.dim,e,S)}if(u!==0)if(c.sign==="c"){o=0;break}else c.sign==="-"?o-=u:o+=u}return o}a();var A,b,X=class{constructor(t,e,r){d(this,A,void 0);d(this,b,void 0);f(this,b,t),this.signal=e,f(this,A,r)}computeSignals(t,e){if(t.scores[s(this,b)]>=this.signal.cap&&this.signal.dur!=="t")return;let o=s(this,A).evaluate(t,this.signal.crit,e,this.signal,s(this,b)),n=this.signal.dur==="s"||this.signal.dur==="t"?"modscoreS":"modscore";if(o)e.push({type:n,data:{dimension:s(this,b),delta:this.signal.str}});else if(this.signal.dur==="t"){let c=t.visitor.sessionScores[s(this,b)];c&&e.push({type:n,data:{dimension:s(this,b),delta:-c}})}}};A=new WeakMap,b=new WeakMap;var ct="_",V,$,R=class{constructor({manifest:t,evaluator:e=new N({})}){d(this,V,void 0);d(this,$,void 0);var r,o,n;f(this,V,(r=t.project)!=null?r:{}),f(this,$,Object.entries((n=(o=s(this,V).pz)==null?void 0:o.sig)!=null?n:[]).map(([c,u])=>new X(c,u,e)))}rollForControlGroup(){var t,e;return Math.random()<((e=(t=s(this,V).pz)==null?void 0:t.control)!=null?e:0)}getTest(t){var e;return(e=s(this,V).test)==null?void 0:e[t]}computeSignals(t){let e=[];return s(this,$).forEach(r=>{r.computeSignals(t,e)}),e}computeAggregateDimensions(t){var e,r;return nt(t,(r=(e=s(this,V).pz)==null?void 0:e.agg)!=null?r:{})}getDimensionByKey(t){var r,o,n,c;let e=t.indexOf(ct);return e<=0?(o=(r=s(this,V).pz)==null?void 0:r.sig)==null?void 0:o[t]:(c=(n=s(this,V).pz)==null?void 0:n.enr)==null?void 0:c[t.substring(0,e)]}static getEnrichmentVectorKey(t,e){return`${t}${ct}${e}`}};V=new WeakMap,$=new WeakMap;a();var ut=(i,t)=>{var o;if(t.type!=="CK")return!1;let e=(o=i.state.cookies)==null?void 0:o[t.cookieName];return x(e,t.match)};a();a();function dt(i,t){var r;if(typeof i=="undefined"||i===null)return!1;let e=Number(i);if(isNaN(e))return!1;switch((r=t==null?void 0:t.op)!=null?r:"="){case"=":return e===t.e;case"!=":return e!==t.e;case">":return e>t.e;case"<":return e<t.e;default:return console.warn(`Unknown match type ${t.op} is false.`),!1}}var Z=R.getEnrichmentVectorKey("$pvc","v"),pt=(i,t,e)=>{var c,u;if(t.type!=="PVC")return!1;let r=!i.previousState||((c=i.state.url)==null?void 0:c.toString())!==((u=i.previousState.url)==null?void 0:u.toString()),n=(i.visitor.sessionScores[Z]||0)+1;if(dt(n,t.match)){let p=e.some(S=>S.type==="modscoreS"&&S.data.dimension===Z);return r&&!p&&e.push({type:"modscoreS",data:{dimension:Z,delta:1}}),!0}return!1};a();var mt=(i,t)=>{var r;if(t.type!=="QS")return!1;let e=(r=i.state.url)==null?void 0:r.searchParams.get(t.queryName);return x(e,t.match)};a();var lt=(i,t,e,r,o)=>{if(t.type!=="QK")return!1;if(typeof window=="undefined"&&r.dur==="t"&&i.scores[o]>0)return!0;let n=i.visitor.quirks[t.key];return x(n,t.match)};a();var ft=(i,t)=>{var e,r;return t.type!=="EVT"?!1:(r=(e=i.state.events)==null?void 0:e.some(o=>x(o.event,t.event)))!=null?r:!1};a();var gt=(i,t)=>{var e;return t.type!=="PV"?!1:x((e=i.state.url)==null?void 0:e.pathname,t.path)};a();var G,N=class{constructor(t){d(this,G,void 0);f(this,G,t)}evaluate(t,e,r,o,n){let c=!(e.op==="&"||!e.op);for(let u of e.clauses){let p;if(u.type==="G")p=this.evaluate(t,u,r,o,n);else{let S=s(this,G)[u.type];if(!S)throw new Error(`${u.type} signal criteria not registered`);p=S(t,u,r,o,n)}if(p===c)return c}return!c}};G=new WeakMap;a();function x(i,t){var n,c,u,p;let e=i,r=t==null?void 0:t.e;((n=t==null?void 0:t.cs)!=null?n:!1)||([e,r]=Mt(e,r));let o=(c=t==null?void 0:t.t)!=null?c:"=";if(o==="*")return i!==null&&typeof i!="undefined";if(o==="!*")return i===null||typeof i=="undefined";if(r===void 0)throw new Error(`Match expression is required for match type ${o}`);switch(o){case"=":return(e!=null?e:"")===r;case"!=":return(e!=null?e:"")!==r;case"~":return(u=(e!=null?e:"").includes(r))!=null?u:!1;case"!~":return!((p=e==null?void 0:e.includes(r))!=null?p:!0);case"//":return new RegExp(t.e,t.cs?"":"i").test(i!=null?i:"");case"!//":return!new RegExp(t.e,t.cs?"":"i").test(i!=null?i:"");default:throw new Error(`Unknown match type ${o}.`)}}function Mt(...i){return i.map(t=>t==null?void 0:t.toUpperCase())}a();var K=()=>({quirks:{},scores:{},sessionScores:{},tests:{},consent:!1,controlGroup:!1});a();a();import Ot from"mitt";import{dequal as Ut}from"dequal/lite";var It="__UNIFORM_DATA__",E,q,j=class{constructor({initialData:t}){d(this,E,void 0);d(this,q,Ot());this.events={on:s(this,q).on,off:s(this,q).off};t&&f(this,E,t)}get data(){return s(this,E)}updateData(t,e){return f(this,E,e),this.handleUpdateData(t,e)}async delete(t){f(this,E,void 0),await this.handleDelete(t)}signalAsyncDataUpdate(t){Ut(this.data,t)||(f(this,E,t),s(this,q).emit("dataUpdatedAsync",t))}getClientTransitionState(){if(typeof document=="undefined")return;let t=document.getElementById(It);return(t==null?void 0:t.textContent)?JSON.parse(t.textContent):void 0}};E=new WeakMap,q=new WeakMap;import{ntob as Rt,bton as qt}from"number-to-base64";var ht=typeof window=="undefined",O,U,Lt=class extends j{constructor({cookieAdapter:t,cookieName:e="ufvd"}){super({initialData:ht?zt(t.get(e)):void 0});d(this,O,void 0);d(this,U,void 0);f(this,O,e),f(this,U,t)}handleDelete(){return s(this,U).remove(s(this,O)),Promise.resolve()}async handleUpdateData(t,e){ht||(e.consent?s(this,U).set(s(this,O),At(e)):s(this,U).remove(s(this,O)))}};O=new WeakMap,U=new WeakMap;var St="~",yt="!",vt="-";function zt(i){if(!i)return;let t=i.split(St);if(t.length>3)return;let[e,r,o]=t;return{consent:!0,sessionScores:Dt(tt(r)),scores:Dt(tt(o)),tests:tt(e)}}function tt(i){return i.split(yt).map(e=>e.split(vt)).reduce((e,r)=>(r.length!==2||(e[r[0]]=r[1]),e),{})}function Dt(i){return Object.entries(i).reduce((t,[e,r])=>(t[e]=qt(r),t),{})}function At(i){return[et(i.tests),et(Ct(i.sessionScores)),et(Ct(i.scores))].join(St)}function Ct(i){return Object.entries(i).reduce((t,[e,r])=>(t[e]=Rt(r),t),{})}function et(i){return Object.entries(i).map(t=>t.join(vt)).join(yt)}a();var J,Nt,$t=class extends j{constructor({cookieAdapter:t,visitorIdCookieName:e="ufvi",...r}){super(r);d(this,J);r.initialData||h(this,J,Nt).call(this).catch(o=>{console.error(o)})}handleDelete(t){throw new Error("Method not implemented.")}async handleUpdateData(t){let e=await new Promise(r=>{setTimeout(()=>{r(void 0)},2e3)});e&&this.signalAsyncDataUpdate(e)}};J=new WeakSet,Nt=async function(){let t=await new Promise(e=>{setTimeout(()=>{e(void 0)},2e3)});t&&this.signalAsyncDataUpdate(t)};a();function Ae(i){let{gracePeriod:t=864e5,decayRate:e=1/30,decayCap:r=.95}=i!=null?i:{};return function({now:n,lastUpd:c,scores:u,sessionScores:p}){if(typeof c!="number")return!1;let M=n-c-t;if(M<=0)return!1;let Q=M/864e5,W=1-Math.min(r,Q*e);return W<=0?!1:(Vt(u,W),Vt(p,W),!0)}}function Vt(i,t){for(let e in i)i[e]*=t}a();import _t from"mitt";import{dequal as it}from"dequal/lite";a();var rt=class{constructor(){this.inMemoryFallback={};this.hasLocalStorageObject=typeof localStorage!="undefined"}get(t){let e=this.inMemoryFallback[t];if(!this.hasLocalStorageObject||e)return e;try{let r=localStorage.getItem(t);return r?JSON.parse(r):void 0}catch(r){return e}}set(t,e,r){if(this.inMemoryFallback[t]=e,!(!this.hasLocalStorageObject||!r))try{localStorage.setItem(t,JSON.stringify(e))}catch(o){console.warn(o)}}delete(t,e){e||delete this.inMemoryFallback[t];try{localStorage.removeItem(t)}catch(r){}}};a();import Gt from"rfdc";var jt=Gt();function xt(i,t,e){let r=t?jt(t):K();return i.forEach(o=>{var n,c;switch(o.type){case"consent":r.consent=o.data;break;case"setquirk":r.quirks[o.data.key]=o.data.value;break;case"settest":r.tests[o.data.test]=o.data.variant;break;case"modscore":if(e)break;let u=(n=r.scores[o.data.dimension])!=null?n:0;r.scores[o.data.dimension]=u+o.data.delta;break;case"modscoreS":if(e)break;let p=(c=r.sessionScores[o.data.dimension])!=null?c:0;r.sessionScores[o.data.dimension]=p+o.data.delta;break;case"identify":break;default:throw new Error("Unknown command")}}),r}var B="ufvisitor",v,I,z,y,D,w,k,L,Y,Ft,H,Qt,_,bt,F,kt,ot=class{constructor(t){d(this,D);d(this,k);d(this,Y);d(this,H);d(this,_);d(this,F);d(this,v,_t());d(this,I,new rt);d(this,z,void 0);d(this,y,void 0);this.events={on:s(this,v).on,off:s(this,v).off};if(f(this,y,t),s(this,D,w)||h(this,k,L).call(this,h(this,F,kt).call(this),!0),t.transitionStore){let e=t.transitionStore.getClientTransitionState();e&&e.quirks&&this.updateData(Object.entries(e.quirks).map(([o,n])=>({type:"setquirk",data:{key:o,value:n}}))),t.transitionStore.events.on("dataUpdatedAsync",o=>{h(this,k,L).call(this,{...s(this,D,w).visitorData,...o})});let r=t.transitionStore.data;r&&h(this,k,L).call(this,{...s(this,D,w).visitorData,...r},!0)}}get data(){let t=s(this,D,w);if(h(this,H,Qt).call(this,t)){let{sessionScores:e,...r}=t.visitorData;return h(this,k,L).call(this,{...r,sessionScores:{}}),s(this,v).emit("log",["info",120]),s(this,D,w).visitorData}return t.visitorData}async updateData(t){var r,o;if(t.length===0)return;s(this,v).emit("log",["debug",101,t]);let e=xt(t,this.data,(r=s(this,D,w))==null?void 0:r.visitorData.controlGroup);t.some(n=>n.type==="consent"&&!n.data)&&s(this,I).delete(B,!0),h(this,k,L).call(this,e),await((o=s(this,y).transitionStore)==null?void 0:o.updateData(t,s(this,D,w).visitorData))}async delete(t){var e;s(this,I).delete(B,!1),await((e=s(this,y).transitionStore)==null?void 0:e.delete(t)),s(this,v).emit("log",["info",103,t]),h(this,k,L).call(this,h(this,F,kt).call(this))}};v=new WeakMap,I=new WeakMap,z=new WeakMap,y=new WeakMap,D=new WeakSet,w=function(){return s(this,I).get(B)},k=new WeakSet,L=function(t,e=!1){var S,M;let r=s(this,D,w),o=Date.now();h(this,_,bt).call(this,t.scores),h(this,_,bt).call(this,t.sessionScores),(M=(S=s(this,y)).decay)==null||M.call(S,{now:o,lastUpd:r==null?void 0:r.updated,scores:t.scores,sessionScores:t.sessionScores});let n=!it(r==null?void 0:r.visitorData.scores,t.scores),c=!it(r==null?void 0:r.visitorData.sessionScores,t.sessionScores),u=!it(r==null?void 0:r.visitorData.quirks,t.quirks),p={updated:o,visitorData:t};h(this,Y,Ft).call(this),s(this,I).set(B,p,!!t.consent),s(this,v).emit("log",["debug",102,t]),e||((n||c)&&s(this,v).emit("scoresUpdated",t),u&&s(this,v).emit("quirksUpdated",t))},Y=new WeakSet,Ft=function(){typeof window=="undefined"||!s(this,y).visitLifespan||(s(this,z)&&window.clearTimeout(s(this,z)),f(this,z,window.setTimeout(()=>{this.data},s(this,y).visitLifespan+50)))},H=new WeakSet,Qt=function(t){let e=s(this,y).visitLifespan;return e?t.updated+e<Date.now():!1},_=new WeakSet,bt=function(t){if(!!s(this,y).manifest)for(let e in t){let r=t[e],o=s(this,y).manifest.getDimensionByKey(e);!o||r>o.cap&&(s(this,v).emit("log",["debug",110,{dim:e,score:r,cap:o.cap}]),t[e]=o.cap)}},F=new WeakSet,kt=function(){var t,e,r;return{...K(),consent:(t=s(this,y).defaultConsent)!=null?t:!1,controlGroup:(r=(e=s(this,y).manifest)==null?void 0:e.rollForControlGroup())!=null?r:!1}};a();import Jt from"mitt";a();a();function Tt({context:i,variations:t,take:e=1}){var u;let r=(u=i.storage.data.controlGroup)!=null?u:!1,o=[],n=!1,c=i.scores;for(let p of t){if(o.length===e)break;if(!p.pz){o.push(p);continue}!r&&Et(p.pz,c)&&(n=!0,o.push(p))}return{personalized:n,variations:o}}a();function Et(i,t){return!i.op||i.op==="&"?i.crit.every(e=>wt(e,t)):i.crit.some(e=>wt(e,t))}function wt(i,t){var c;let{op:e,l:r}=i,o=(c=t[r])!=null?c:0;if(e==="+")return Math.max(...Object.values(t))===o&&o>0;if(e==="-")return Math.min(...Object.values(t))===o&&o>0;let n=i.rDim?t[i.rDim]:i.r;if(n===void 0)return!1;if(e===">")return o>n;if(e==="<")return o<n;if(e==="=")return o===n;if(e==="!=")return o!==n;throw new Error(`Unknown op: ${e}`)}a();var Kt=i=>{let{values:t,total:e,missingDistribution:r}=i.reduce((o,n)=>(n.testDistribution?o.total+=n.testDistribution:++o.missingDistribution,o.values.push(n.testDistribution),o),{values:[],total:0,missingDistribution:0});if(e>100)throw new Error(`Total distribution ${e} is over the maximum 100.`);if(e<100){let n=(100-e)/r;t.forEach((c,u)=>{typeof c=="undefined"&&(t[u]=n)})}return t},st=({name:i,context:t,variations:e})=>{var n;let r,o=t.getTestVariantId(i);if(o===null)return{result:void 0};if(o&&(r=e.find(c=>c.id===o),r||t.log("warn",401,{test:i,variant:o})),!r){let c=Kt(e),u=Math.floor(Math.random()*100),p=0;r=e.find((S,M)=>{let Q=c[M];if(u>p&&u<=p+Q)return S;p+=Q}),r&&t.setTestVariantId(i,(n=r.id)!=null?n:"Unknown")}return{result:r}};var T,P,C,g,Bt=class{constructor(t){d(this,T,void 0);d(this,P,{});d(this,C,void 0);d(this,g,Jt());this.events={on:s(this,g).on,off:s(this,g).off};let{manifest:e,...r}=t;f(this,C,{}),f(this,T,new R({manifest:e,evaluator:new N({CK:ut,QS:mt,QK:lt,PVC:pt,EVT:ft,PV:gt})})),this.storage=new ot({manifest:s(this,T),...r}),this.storage.events.on("log",(...n)=>s(this,g).emit("log",...n));let o=n=>{var u;let c={...n.scores};for(let p in n.sessionScores)c[p]=((u=c[p])!=null?u:0)+n.sessionScores[p];c=s(this,T).computeAggregateDimensions(c),f(this,P,c),s(this,g).emit("scoresUpdated",c),s(this,g).emit("log",["info",3,c])};this.storage.events.on("scoresUpdated",o),o(this.storage.data),this.storage.events.on("quirksUpdated",n=>{let c=s(this,T).computeSignals({scores:s(this,P),state:s(this,C),previousState:s(this,C),visitor:this.storage.data});this.storage.updateData(c),s(this,g).emit("quirksUpdated",n.quirks),s(this,g).emit("log",["info",4,n.quirks])}),s(this,g).emit("log",["debug",1,{options:t,scores:s(this,P)}])}get scores(){return s(this,P)}async update(t){let e=[];s(this,g).emit("log",["info",2,t]),t.quirks&&(e.push(...Object.entries(t.quirks).map(([o,n])=>({type:"setquirk",data:{key:o,value:n}}))),t.quirks=void 0),t.enrichments&&(e.push(...t.enrichments.map(o=>({type:"modscore",data:{dimension:R.getEnrichmentVectorKey(o.cat,o.key),delta:o.str}}))),t.enrichments=void 0);let r=s(this,C);f(this,C,{...s(this,C),...t}),e.push(...s(this,T).computeSignals({state:s(this,C),previousState:r,visitor:this.storage.data,scores:s(this,P)})),await this.storage.updateData(e)}getTestVariantId(t){var r;let e=s(this,T).getTest(t);return e?(r=e.wv)!=null?r:this.storage.data.tests[t]:(s(this,g).emit("log",["warn",401,t]),null)}setTestVariantId(t,e){this.storage.updateData([{type:"settest",data:{test:t,variant:e}}])}log(...t){s(this,g).emit("log",t)}test(t){var r;let e=st({...t,context:this});return s(this,g).emit("testResult",{name:t.name,variantId:(r=e.result)==null?void 0:r.id,control:this.storage.data.controlGroup}),e}personalize(t){let e=Tt({...t,context:this});return t.name?s(this,g).emit("personalizationResult",{name:t.name,variantIds:e.variations.map(r=>{var o;return(o=r.id)!=null?o:"Unknown"}),control:this.storage.data.controlGroup}):this.log("warn",301),e}async forget(t){f(this,C,{}),await this.storage.delete(t)}};T=new WeakMap,P=new WeakMap,C=new WeakMap,g=new WeakMap;a();var Dr=([i,t,...e])=>{console[i](`\u{1F94B} [${i}] Uniform event ID ${t}
|
2
|
+
`,...e.map(r=>JSON.stringify(r,null,2)))};a();a();var Pt={1:({options:i,scores:t})=>["tracker","constructed",i,t],2:i=>["tracker","received data update",i],3:i=>["tracker","new score vector",i],4:i=>["tracker","updated quirks",i],101:i=>["storage","received update commands",i],102:i=>["storage","data was updated",i],103:i=>["storage",`data was deleted ${i?"from all devices":"from this device"}`],110:({dim:i,cap:t,score:e})=>["storage",`${i} score ${e} exceeded cap ${t}. Rounded down.`],120:()=>["storage","visitor data expired and was cleared"],301:()=>["placement","Missing `name` field on personalization. Analytics events will not be triggered."],401:i=>["testing",`${i} was unknown; it will not be run.`],402:({test:i,variant:t})=>["testing",`${i} no longer has visitor's variant ${t}; it will be removed.`],700:()=>["gtag","gtag is not defined, skipping analytics event emission. Ensure you have added the gtag script to your page."],701:()=>["gtag","enabled gtag event signal redirection"]};var br=([i,t,...e])=>{let r=Pt[t],o=`\u{1F94B} [${new Date().toLocaleTimeString()}][${i}]`;r||console[i](`${o} unknown message ID ${t} - ensure all Uniform packages are the same version`,...e);let[n,c,...u]=r(...e);console[i](`${o}[${n}] ${c} (Event ID: ${t})
|
3
|
+
`,...u.map(p=>JSON.stringify(p,null,2)))};a();var Yt=(u=>(u.ListStart="nesi-list-start",u.ListEnd="nesi-list-end",u.ListItem="nesi-list-item-html",u.ListItemSettings="nesi-list-item-settings",u.TestStart="nesi-test-start",u.TestEnd="nesi-test-end",u.Unknown="unknown",u))(Yt||{}),Tr="nesitag";export{Bt as Context,Lt as CookieTransitionDataStore,Tr as EdgeNodeTagName,$t as EdgeTransitionDataStore,N as GroupCriteriaEvaluator,R as ManifestInstance,It as SERVER_STATE_ID,Yt as ScriptType,j as TransitionDataStore,ot as VisitorDataStore,nt as computeAggregateDimensions,Dr as consoleLogDrain,ut as cookieEvaluator,Ae as createLinearDecay,br as debugConsoleLogDrain,K as emptyVisitorData,Et as evaluateVariantMatch,ft as eventEvaluator,x as isStringMatch,Z as pageViewCountDimension,pt as pageViewCountEvaluator,gt as pageVisitedEvaluator,Tt as personalizeVariations,mt as queryStringEvaluator,lt as quirkEvaluator,st as testVariations};
|
package/dist/index.js
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
var _t=Object.create;var K=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Qt=Object.getOwnPropertyNames;var Kt=Object.getPrototypeOf,Jt=Object.prototype.hasOwnProperty;var St=r=>K(r,"__esModule",{value:!0});var Bt=(r,t)=>{St(r);for(var e in t)K(r,e,{get:t[e],enumerable:!0})},Yt=(r,t,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qt(t))!Jt.call(r,i)&&i!=="default"&&K(r,i,{get:()=>t[i],enumerable:!(e=Ft(t,i))||e.enumerable});return r},P=r=>Yt(St(K(r!=null?_t(Kt(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var it=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)};var s=(r,t,e)=>(it(r,t,"read from private field"),e?e.call(r):t.get(r)),u=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},m=(r,t,e,i)=>(it(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e);var f=(r,t,e)=>(it(r,t,"access private method"),e);Bt(exports,{Context:()=>Nt,CookieTransitionDataStore:()=>kt,EdgeNodeTagName:()=>ae,EdgeTransitionDataStore:()=>Ot,GroupCriteriaEvaluator:()=>R,ManifestInstance:()=>M,SERVER_STATE_ID:()=>xt,ScriptType:()=>jt,TransitionDataStore:()=>q,VisitorDataStore:()=>X,computeAggregateDimensions:()=>ot,consoleLogDrain:()=>se,cookieEvaluator:()=>nt,createLinearDecay:()=>te,debugConsoleLogDrain:()=>ne,emptyVisitorData:()=>j,evaluateVariantMatch:()=>ht,eventEvaluator:()=>dt,isStringMatch:()=>y,pageViewCountDimension:()=>J,pageViewCountEvaluator:()=>at,pageVisitedEvaluator:()=>pt,personalizeVariations:()=>gt,queryStringEvaluator:()=>ct,quirkEvaluator:()=>ut,testVariations:()=>et});function ot(r,t){let e={...r};for(let i in t){let o=yt(r,i,t,new Set([i]));o!==0&&(e[i]=o)}return e}function yt(r,t,e,i){var n;let o=0;for(let a of e[t].inputs){let c=(n=r[a.dim])!=null?n:0;if(!c&&e[a.dim]){if(i.has(a.dim))continue;let g=new Set(i);g.add(a.dim),c=yt(r,a.dim,e,g)}if(c!==0)if(a.sign==="c"){o=0;break}else a.sign==="-"?o-=c:o+=c}return o}var $,V,st=class{constructor(t,e,i){u(this,$,void 0);u(this,V,void 0);m(this,V,t),this.signal=e,m(this,$,i)}computeSignals(t,e){if(t.scores[s(this,V)]>=this.signal.cap&&this.signal.dur!=="t")return;let o=s(this,$).evaluate(t,this.signal.crit,e,this.signal,s(this,V)),n=this.signal.dur==="s"||this.signal.dur==="t"?"modscoreS":"modscore";if(o)e.push({type:n,data:{dimension:s(this,V),delta:this.signal.str}});else if(this.signal.dur==="t"){let a=t.visitor.sessionScores[s(this,V)];a&&e.push({type:n,data:{dimension:s(this,V),delta:-a}})}}};$=new WeakMap,V=new WeakMap;var vt="_",C,N,M=class{constructor({manifest:t,evaluator:e=new R({})}){u(this,C,void 0);u(this,N,void 0);var i,o,n;m(this,C,(i=t.project)!=null?i:{}),m(this,N,Object.entries((n=(o=s(this,C).pz)==null?void 0:o.sig)!=null?n:[]).map(([a,c])=>new st(a,c,e)))}rollForControlGroup(){var t,e;return Math.random()<((e=(t=s(this,C).pz)==null?void 0:t.control)!=null?e:0)}getTest(t){var e;return(e=s(this,C).test)==null?void 0:e[t]}computeSignals(t){let e=[];return s(this,N).forEach(i=>{i.computeSignals(t,e)}),e}computeAggregateDimensions(t){var e,i;return ot(t,(i=(e=s(this,C).pz)==null?void 0:e.agg)!=null?i:{})}getDimensionByKey(t){var i,o,n,a;let e=t.indexOf(vt);return e<=0?(o=(i=s(this,C).pz)==null?void 0:i.sig)==null?void 0:o[t]:(a=(n=s(this,C).pz)==null?void 0:n.enr)==null?void 0:a[t.substring(0,e)]}static getEnrichmentVectorKey(t,e){return`${t}${vt}${e}`}};C=new WeakMap,N=new WeakMap;var nt=(r,t)=>{var o;if(t.type!=="CK")return!1;let e=(o=r.state.cookies)==null?void 0:o[t.cookieName];return y(e,t.match)};function Dt(r,t){var i;if(typeof r=="undefined"||r===null)return!1;let e=Number(r);if(isNaN(e))return!1;switch((i=t==null?void 0:t.op)!=null?i:"="){case"=":return e===t.e;case"!=":return e!==t.e;case">":return e>t.e;case"<":return e<t.e;default:return console.warn(`Unknown match type ${t.op} is false.`),!1}}var J=M.getEnrichmentVectorKey("$pvc","v"),at=(r,t,e)=>{var a,c;if(t.type!=="PVC")return!1;let i=!r.previousState||((a=r.state.url)==null?void 0:a.toString())!==((c=r.previousState.url)==null?void 0:c.toString()),n=(r.visitor.sessionScores[J]||0)+1;if(Dt(n,t.match)){let d=e.some(g=>g.type==="modscoreS"&&g.data.dimension===J);return i&&!d&&e.push({type:"modscoreS",data:{dimension:J,delta:1}}),!0}return!1};var ct=(r,t)=>{var i;if(t.type!=="QS")return!1;let e=(i=r.state.url)==null?void 0:i.searchParams.get(t.queryName);return y(e,t.match)};var ut=(r,t,e,i,o)=>{if(t.type!=="QK")return!1;if(typeof window=="undefined"&&i.dur==="t"&&r.scores[o]>0)return!0;let n=r.visitor.quirks[t.key];return y(n,t.match)};var dt=(r,t)=>{var e,i;return t.type!=="EVT"?!1:(i=(e=r.state.events)==null?void 0:e.some(o=>y(o.event,t.event)))!=null?i:!1};var pt=(r,t)=>{var e;return t.type!=="PV"?!1:y((e=r.state.url)==null?void 0:e.pathname,t.path)};var G,R=class{constructor(t){u(this,G,void 0);m(this,G,t)}evaluate(t,e,i,o,n){let a=!(e.op==="&"||!e.op);for(let c of e.clauses){let d;if(c.type==="G")d=this.evaluate(t,c,i,o,n);else{let g=s(this,G)[c.type];if(!g)throw new Error(`${c.type} signal criteria not registered`);d=g(t,c,i,o,n)}if(d===a)return a}return!a}};G=new WeakMap;function y(r,t){var n,a,c,d;let e=r,i=t==null?void 0:t.e;((n=t==null?void 0:t.cs)!=null?n:!1)||([e,i]=Ht(e,i));let o=(a=t==null?void 0:t.t)!=null?a:"=";if(o==="*")return r!==null&&typeof r!="undefined";if(o==="!*")return r===null||typeof r=="undefined";if(i===void 0)throw new Error(`Match expression is required for match type ${o}`);switch(o){case"=":return(e!=null?e:"")===i;case"!=":return(e!=null?e:"")!==i;case"~":return(c=(e!=null?e:"").includes(i))!=null?c:!1;case"!~":return!((d=e==null?void 0:e.includes(i))!=null?d:!0);case"//":return new RegExp(t.e,t.cs?"":"i").test(r!=null?r:"");case"!//":return!new RegExp(t.e,t.cs?"":"i").test(r!=null?r:"");default:throw new Error(`Unknown match type ${o}.`)}}function Ht(...r){return r.map(t=>t==null?void 0:t.toUpperCase())}var j=()=>({quirks:{},scores:{},sessionScores:{},tests:{},consent:!1,controlGroup:!1});var Ct=P(require("mitt")),Vt=P(require("dequal/lite")),xt="__UNIFORM_DATA__",k,L,q=class{constructor({initialData:t}){u(this,k,void 0);u(this,L,(0,Ct.default)());this.events={on:s(this,L).on,off:s(this,L).off};t&&m(this,k,t)}get data(){return s(this,k)}updateData(t,e){return m(this,k,e),this.handleUpdateData(t,e)}async delete(t){m(this,k,void 0),await this.handleDelete(t)}signalAsyncDataUpdate(t){(0,Vt.dequal)(this.data,t)||(m(this,k,t),s(this,L).emit("dataUpdatedAsync",t))}getClientTransitionState(){if(typeof document=="undefined")return;let t=document.getElementById(xt);return(t==null?void 0:t.textContent)?JSON.parse(t.textContent):void 0}};k=new WeakMap,L=new WeakMap;var B=P(require("number-to-base64")),bt=typeof window=="undefined",O,U,kt=class extends q{constructor({cookieAdapter:t,cookieName:e="ufvd"}){super({initialData:bt?Wt(t.get(e)):void 0});u(this,O,void 0);u(this,U,void 0);m(this,O,e),m(this,U,t)}handleDelete(){return s(this,U).remove(s(this,O)),Promise.resolve()}async handleUpdateData(t,e){bt||(e.consent?s(this,U).set(s(this,O),Xt(e)):s(this,U).remove(s(this,O)))}};O=new WeakMap,U=new WeakMap;var Tt="~",Et="!",wt="-";function Wt(r){if(!r)return;let t=r.split(Tt);if(t.length>3)return;let[e,i,o]=t;return{consent:!0,sessionScores:Pt(mt(i)),scores:Pt(mt(o)),tests:mt(e)}}function mt(r){return r.split(Et).map(e=>e.split(wt)).reduce((e,i)=>(i.length!==2||(e[i[0]]=i[1]),e),{})}function Pt(r){return Object.entries(r).reduce((t,[e,i])=>(t[e]=(0,B.bton)(i),t),{})}function Xt(r){return[lt(r.tests),lt(Mt(r.sessionScores)),lt(Mt(r.scores))].join(Tt)}function Mt(r){return Object.entries(r).reduce((t,[e,i])=>(t[e]=(0,B.ntob)(i),t),{})}function lt(r){return Object.entries(r).map(t=>t.join(wt)).join(Et)}var Y,Zt,Ot=class extends q{constructor({cookieAdapter:t,visitorIdCookieName:e="ufvi",...i}){super(i);u(this,Y);i.initialData||f(this,Y,Zt).call(this).catch(o=>{console.error(o)})}handleDelete(t){throw new Error("Method not implemented.")}async handleUpdateData(t){let e=await new Promise(i=>{setTimeout(()=>{i(void 0)},2e3)});e&&this.signalAsyncDataUpdate(e)}};Y=new WeakSet,Zt=async function(){let t=await new Promise(e=>{setTimeout(()=>{e(void 0)},2e3)});t&&this.signalAsyncDataUpdate(t)};function te(r){let{gracePeriod:t=864e5,decayRate:e=1/30,decayCap:i=.95}=r!=null?r:{};return function({now:n,lastUpd:a,scores:c,sessionScores:d}){if(typeof a!="number")return!1;let w=n-a-t;if(w<=0)return!1;let Q=w/864e5,rt=1-Math.min(i,Q*e);return rt<=0?!1:(Ut(c,rt),Ut(d,rt),!0)}}function Ut(r,t){for(let e in r)r[e]*=t}var qt=P(require("mitt")),H=P(require("dequal/lite"));var ft=class{constructor(){this.inMemoryFallback={};this.hasLocalStorageObject=typeof localStorage!="undefined"}get(t){let e=this.inMemoryFallback[t];if(!this.hasLocalStorageObject||e)return e;try{let i=localStorage.getItem(t);return i?JSON.parse(i):void 0}catch(i){return e}}set(t,e,i){if(this.inMemoryFallback[t]=e,!(!this.hasLocalStorageObject||!i))try{localStorage.setItem(t,JSON.stringify(e))}catch(o){console.warn(o)}}delete(t,e){e||delete this.inMemoryFallback[t];try{localStorage.removeItem(t)}catch(i){}}};var It=P(require("rfdc"));var ee=(0,It.default)();function Rt(r,t,e){let i=t?ee(t):j();return r.forEach(o=>{var n,a;switch(o.type){case"consent":i.consent=o.data;break;case"setquirk":i.quirks[o.data.key]=o.data.value;break;case"settest":i.tests[o.data.test]=o.data.variant;break;case"modscore":if(e)break;let c=(n=i.scores[o.data.dimension])!=null?n:0;i.scores[o.data.dimension]=c+o.data.delta;break;case"modscoreS":if(e)break;let d=(a=i.sessionScores[o.data.dimension])!=null?a:0;i.sessionScores[o.data.dimension]=d+o.data.delta;break;case"identify":break;default:throw new Error("Unknown command")}}),i}var W="ufvisitor",S,I,A,h,v,T,x,z,Z,re,tt,ie,_,Lt,F,zt,X=class{constructor(t){u(this,v);u(this,x);u(this,Z);u(this,tt);u(this,_);u(this,F);u(this,S,(0,qt.default)());u(this,I,new ft);u(this,A,void 0);u(this,h,void 0);this.events={on:s(this,S).on,off:s(this,S).off};if(m(this,h,t),s(this,v,T)||f(this,x,z).call(this,f(this,F,zt).call(this),!0),t.transitionStore){let e=t.transitionStore.getClientTransitionState();e&&e.quirks&&this.updateData(Object.entries(e.quirks).map(([o,n])=>({type:"setquirk",data:{key:o,value:n}}))),t.transitionStore.events.on("dataUpdatedAsync",o=>{f(this,x,z).call(this,{...s(this,v,T).visitorData,...o})});let i=t.transitionStore.data;i&&f(this,x,z).call(this,{...s(this,v,T).visitorData,...i},!0)}}get data(){let t=s(this,v,T);if(f(this,tt,ie).call(this,t)){let{sessionScores:e,...i}=t.visitorData;return f(this,x,z).call(this,{...i,sessionScores:{}}),s(this,S).emit("log",["info",120]),s(this,v,T).visitorData}return t.visitorData}async updateData(t){var i,o;if(t.length===0)return;s(this,S).emit("log",["debug",101,t]);let e=Rt(t,this.data,(i=s(this,v,T))==null?void 0:i.visitorData.controlGroup);t.some(n=>n.type==="consent"&&!n.data)&&s(this,I).delete(W,!0),f(this,x,z).call(this,e),await((o=s(this,h).transitionStore)==null?void 0:o.updateData(t,s(this,v,T).visitorData))}async delete(t){var e;s(this,I).delete(W,!1),await((e=s(this,h).transitionStore)==null?void 0:e.delete(t)),s(this,S).emit("log",["info",103,t]),f(this,x,z).call(this,f(this,F,zt).call(this))}};S=new WeakMap,I=new WeakMap,A=new WeakMap,h=new WeakMap,v=new WeakSet,T=function(){return s(this,I).get(W)},x=new WeakSet,z=function(t,e=!1){var g,w;let i=s(this,v,T),o=Date.now();f(this,_,Lt).call(this,t.scores),f(this,_,Lt).call(this,t.sessionScores),(w=(g=s(this,h)).decay)==null||w.call(g,{now:o,lastUpd:i==null?void 0:i.updated,scores:t.scores,sessionScores:t.sessionScores});let n=!(0,H.dequal)(i==null?void 0:i.visitorData.scores,t.scores),a=!(0,H.dequal)(i==null?void 0:i.visitorData.sessionScores,t.sessionScores),c=!(0,H.dequal)(i==null?void 0:i.visitorData.quirks,t.quirks),d={updated:o,visitorData:t};f(this,Z,re).call(this),s(this,I).set(W,d,!!t.consent),s(this,S).emit("log",["debug",102,t]),e||((n||a)&&s(this,S).emit("scoresUpdated",t),c&&s(this,S).emit("quirksUpdated",t))},Z=new WeakSet,re=function(){typeof window=="undefined"||!s(this,h).visitLifespan||(s(this,A)&&window.clearTimeout(s(this,A)),m(this,A,window.setTimeout(()=>{this.data},s(this,h).visitLifespan+50)))},tt=new WeakSet,ie=function(t){let e=s(this,h).visitLifespan;return e?t.updated+e<Date.now():!1},_=new WeakSet,Lt=function(t){if(!!s(this,h).manifest)for(let e in t){let i=t[e],o=s(this,h).manifest.getDimensionByKey(e);!o||i>o.cap&&(s(this,S).emit("log",["debug",110,{dim:e,score:i,cap:o.cap}]),t[e]=o.cap)}},F=new WeakSet,zt=function(){var t,e,i;return{...j(),consent:(t=s(this,h).defaultConsent)!=null?t:!1,controlGroup:(i=(e=s(this,h).manifest)==null?void 0:e.rollForControlGroup())!=null?i:!1}};var $t=P(require("mitt"));function gt({context:r,variations:t,take:e=1}){var c;let i=(c=r.storage.data.controlGroup)!=null?c:!1,o=[],n=!1,a=r.scores;for(let d of t){if(o.length===e)break;if(!d.pz){o.push(d);continue}!i&&ht(d.pz,a)&&(n=!0,o.push(d))}return{personalized:n,variations:o}}function ht(r,t){return!r.op||r.op==="&"?r.crit.every(e=>At(e,t)):r.crit.some(e=>At(e,t))}function At(r,t){var a;let{op:e,l:i}=r,o=(a=t[i])!=null?a:0;if(e==="+")return Math.max(...Object.values(t))===o&&o>0;if(e==="-")return Math.min(...Object.values(t))===o&&o>0;let n=r.rDim?t[r.rDim]:r.r;if(n===void 0)return!1;if(e===">")return o>n;if(e==="<")return o<n;if(e==="=")return o===n;if(e==="!=")return o!==n;throw new Error(`Unknown op: ${e}`)}var oe=r=>{let{values:t,total:e,missingDistribution:i}=r.reduce((o,n)=>(n.testDistribution?o.total+=n.testDistribution:++o.missingDistribution,o.values.push(n.testDistribution),o),{values:[],total:0,missingDistribution:0});if(e>100)throw new Error(`Total distribution ${e} is over the maximum 100.`);if(e<100){let n=(100-e)/i;t.forEach((a,c)=>{typeof a=="undefined"&&(t[c]=n)})}return t},et=({name:r,context:t,variations:e})=>{var n;let i,o=t.getTestVariantId(r);if(o===null)return{result:void 0};if(o&&(i=e.find(a=>a.id===o),i||t.log("warn",401,{test:r,variant:o})),!i){let a=oe(e),c=Math.floor(Math.random()*100),d=0;i=e.find((g,w)=>{let Q=a[w];if(c>d&&c<=d+Q)return g;d+=Q}),i&&t.setTestVariantId(r,(n=i.id)!=null?n:"Unknown")}return{result:i}};var b,E,D,l,Nt=class{constructor(t){u(this,b,void 0);u(this,E,{});u(this,D,void 0);u(this,l,(0,$t.default)());this.events={on:s(this,l).on,off:s(this,l).off};let{manifest:e,...i}=t;m(this,D,{}),m(this,b,new M({manifest:e,evaluator:new R({CK:nt,QS:ct,QK:ut,PVC:at,EVT:dt,PV:pt})})),this.storage=new X({manifest:s(this,b),...i}),this.storage.events.on("log",(...n)=>s(this,l).emit("log",...n));let o=n=>{var c;let a={...n.scores};for(let d in n.sessionScores)a[d]=((c=a[d])!=null?c:0)+n.sessionScores[d];a=s(this,b).computeAggregateDimensions(a),m(this,E,a),s(this,l).emit("scoresUpdated",a),s(this,l).emit("log",["info",3,a])};this.storage.events.on("scoresUpdated",o),o(this.storage.data),this.storage.events.on("quirksUpdated",n=>{let a=s(this,b).computeSignals({scores:s(this,E),state:s(this,D),previousState:s(this,D),visitor:this.storage.data});this.storage.updateData(a),s(this,l).emit("quirksUpdated",n.quirks),s(this,l).emit("log",["info",4,n.quirks])}),s(this,l).emit("log",["debug",1,{options:t,scores:s(this,E)}])}get scores(){return s(this,E)}async update(t){let e=[];s(this,l).emit("log",["info",2,t]),t.quirks&&(e.push(...Object.entries(t.quirks).map(([o,n])=>({type:"setquirk",data:{key:o,value:n}}))),t.quirks=void 0),t.enrichments&&(e.push(...t.enrichments.map(o=>({type:"modscore",data:{dimension:M.getEnrichmentVectorKey(o.cat,o.key),delta:o.str}}))),t.enrichments=void 0);let i=s(this,D);m(this,D,{...s(this,D),...t}),e.push(...s(this,b).computeSignals({state:s(this,D),previousState:i,visitor:this.storage.data,scores:s(this,E)})),await this.storage.updateData(e)}getTestVariantId(t){var i;let e=s(this,b).getTest(t);return e?(i=e.wv)!=null?i:this.storage.data.tests[t]:(s(this,l).emit("log",["warn",401,t]),null)}setTestVariantId(t,e){this.storage.updateData([{type:"settest",data:{test:t,variant:e}}])}log(...t){s(this,l).emit("log",t)}test(t){var i;let e=et({...t,context:this});return s(this,l).emit("testResult",{name:t.name,variantId:(i=e.result)==null?void 0:i.id,control:this.storage.data.controlGroup}),e}personalize(t){let e=gt({...t,context:this});return t.name?s(this,l).emit("personalizationResult",{name:t.name,variantIds:e.variations.map(i=>{var o;return(o=i.id)!=null?o:"Unknown"}),control:this.storage.data.controlGroup}):this.log("warn",301),e}async forget(t){m(this,D,{}),await this.storage.delete(t)}};b=new WeakMap,E=new WeakMap,D=new WeakMap,l=new WeakMap;var se=([r,t,...e])=>{console[r](`\u{1F94B} [${r}] Uniform event ID ${t}
|
2
|
+
`,...e.map(i=>JSON.stringify(i,null,2)))};var Gt={1:({options:r,scores:t})=>["tracker","constructed",r,t],2:r=>["tracker","received data update",r],3:r=>["tracker","new score vector",r],4:r=>["tracker","updated quirks",r],101:r=>["storage","received update commands",r],102:r=>["storage","data was updated",r],103:r=>["storage",`data was deleted ${r?"from all devices":"from this device"}`],110:({dim:r,cap:t,score:e})=>["storage",`${r} score ${e} exceeded cap ${t}. Rounded down.`],120:()=>["storage","visitor data expired and was cleared"],301:()=>["placement","Missing `name` field on personalization. Analytics events will not be triggered."],401:r=>["testing",`${r} was unknown; it will not be run.`],402:({test:r,variant:t})=>["testing",`${r} no longer has visitor's variant ${t}; it will be removed.`],700:()=>["gtag","gtag is not defined, skipping analytics event emission. Ensure you have added the gtag script to your page."],701:()=>["gtag","enabled gtag event signal redirection"]};var ne=([r,t,...e])=>{let i=Gt[t],o=`\u{1F94B} [${new Date().toLocaleTimeString()}][${r}]`;i||console[r](`${o} unknown message ID ${t} - ensure all Uniform packages are the same version`,...e);let[n,a,...c]=i(...e);console[r](`${o}[${n}] ${a} (Event ID: ${t})
|
3
|
+
`,...c.map(d=>JSON.stringify(d,null,2)))};var jt=(c=>(c.ListStart="nesi-list-start",c.ListEnd="nesi-list-end",c.ListItem="nesi-list-item-html",c.ListItemSettings="nesi-list-item-settings",c.TestStart="nesi-test-start",c.TestEnd="nesi-test-end",c.Unknown="unknown",c))(jt||{}),ae="nesitag";0&&(module.exports={Context,CookieTransitionDataStore,EdgeNodeTagName,EdgeTransitionDataStore,GroupCriteriaEvaluator,ManifestInstance,SERVER_STATE_ID,ScriptType,TransitionDataStore,VisitorDataStore,computeAggregateDimensions,consoleLogDrain,cookieEvaluator,createLinearDecay,debugConsoleLogDrain,emptyVisitorData,evaluateVariantMatch,eventEvaluator,isStringMatch,pageViewCountDimension,pageViewCountEvaluator,pageVisitedEvaluator,personalizeVariations,queryStringEvaluator,quirkEvaluator,testVariations});
|
package/dist/index.mjs
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
import{d as s,e as d,f,g as h,h as a}from"./chunk-VUJ3MDY7.mjs";a();a();a();function nt(i,t){let e={...i};for(let r in t){let o=at(i,r,t,new Set([r]));o!==0&&(e[r]=o)}return e}function at(i,t,e,r){var n;let o=0;for(let c of e[t].inputs){let u=(n=i[c.dim])!=null?n:0;if(!u&&e[c.dim]){if(r.has(c.dim))continue;let S=new Set(r);S.add(c.dim),u=at(i,c.dim,e,S)}if(u!==0)if(c.sign==="c"){o=0;break}else c.sign==="-"?o-=u:o+=u}return o}a();var A,b,X=class{constructor(t,e,r){d(this,A,void 0);d(this,b,void 0);f(this,b,t),this.signal=e,f(this,A,r)}computeSignals(t,e){if(t.scores[s(this,b)]>=this.signal.cap&&this.signal.dur!=="t")return;let o=s(this,A).evaluate(t,this.signal.crit,e,this.signal,s(this,b)),n=this.signal.dur==="s"||this.signal.dur==="t"?"modscoreS":"modscore";if(o)e.push({type:n,data:{dimension:s(this,b),delta:this.signal.str}});else if(this.signal.dur==="t"){let c=t.visitor.sessionScores[s(this,b)];c&&e.push({type:n,data:{dimension:s(this,b),delta:-c}})}}};A=new WeakMap,b=new WeakMap;var ct="_",V,$,R=class{constructor({manifest:t,evaluator:e=new N({})}){d(this,V,void 0);d(this,$,void 0);var r,o,n;f(this,V,(r=t.project)!=null?r:{}),f(this,$,Object.entries((n=(o=s(this,V).pz)==null?void 0:o.sig)!=null?n:[]).map(([c,u])=>new X(c,u,e)))}rollForControlGroup(){var t,e;return Math.random()<((e=(t=s(this,V).pz)==null?void 0:t.control)!=null?e:0)}getTest(t){var e;return(e=s(this,V).test)==null?void 0:e[t]}computeSignals(t){let e=[];return s(this,$).forEach(r=>{r.computeSignals(t,e)}),e}computeAggregateDimensions(t){var e,r;return nt(t,(r=(e=s(this,V).pz)==null?void 0:e.agg)!=null?r:{})}getDimensionByKey(t){var r,o,n,c;let e=t.indexOf(ct);return e<=0?(o=(r=s(this,V).pz)==null?void 0:r.sig)==null?void 0:o[t]:(c=(n=s(this,V).pz)==null?void 0:n.enr)==null?void 0:c[t.substring(0,e)]}static getEnrichmentVectorKey(t,e){return`${t}${ct}${e}`}};V=new WeakMap,$=new WeakMap;a();var ut=(i,t)=>{var o;if(t.type!=="CK")return!1;let e=(o=i.state.cookies)==null?void 0:o[t.cookieName];return x(e,t.match)};a();a();function dt(i,t){var r;if(typeof i=="undefined"||i===null)return!1;let e=Number(i);if(isNaN(e))return!1;switch((r=t==null?void 0:t.op)!=null?r:"="){case"=":return e===t.e;case"!=":return e!==t.e;case">":return e>t.e;case"<":return e<t.e;default:return console.warn(`Unknown match type ${t.op} is false.`),!1}}var Z=R.getEnrichmentVectorKey("$pvc","v"),pt=(i,t,e)=>{var c,u;if(t.type!=="PVC")return!1;let r=!i.previousState||((c=i.state.url)==null?void 0:c.toString())!==((u=i.previousState.url)==null?void 0:u.toString()),n=(i.visitor.sessionScores[Z]||0)+1;if(dt(n,t.match)){let p=e.some(S=>S.type==="modscoreS"&&S.data.dimension===Z);return r&&!p&&e.push({type:"modscoreS",data:{dimension:Z,delta:1}}),!0}return!1};a();var mt=(i,t)=>{var r;if(t.type!=="QS")return!1;let e=(r=i.state.url)==null?void 0:r.searchParams.get(t.queryName);return x(e,t.match)};a();var lt=(i,t,e,r,o)=>{if(t.type!=="QK")return!1;if(typeof window=="undefined"&&r.dur==="t"&&i.scores[o]>0)return!0;let n=i.visitor.quirks[t.key];return x(n,t.match)};a();var ft=(i,t)=>{var e,r;return t.type!=="EVT"?!1:(r=(e=i.state.events)==null?void 0:e.some(o=>x(o.event,t.event)))!=null?r:!1};a();var gt=(i,t)=>{var e;return t.type!=="PV"?!1:x((e=i.state.url)==null?void 0:e.pathname,t.path)};a();var G,N=class{constructor(t){d(this,G,void 0);f(this,G,t)}evaluate(t,e,r,o,n){let c=!(e.op==="&"||!e.op);for(let u of e.clauses){let p;if(u.type==="G")p=this.evaluate(t,u,r,o,n);else{let S=s(this,G)[u.type];if(!S)throw new Error(`${u.type} signal criteria not registered`);p=S(t,u,r,o,n)}if(p===c)return c}return!c}};G=new WeakMap;a();function x(i,t){var n,c,u,p;let e=i,r=t==null?void 0:t.e;((n=t==null?void 0:t.cs)!=null?n:!1)||([e,r]=Mt(e,r));let o=(c=t==null?void 0:t.t)!=null?c:"=";if(o==="*")return i!==null&&typeof i!="undefined";if(o==="!*")return i===null||typeof i=="undefined";if(r===void 0)throw new Error(`Match expression is required for match type ${o}`);switch(o){case"=":return(e!=null?e:"")===r;case"!=":return(e!=null?e:"")!==r;case"~":return(u=(e!=null?e:"").includes(r))!=null?u:!1;case"!~":return!((p=e==null?void 0:e.includes(r))!=null?p:!0);case"//":return new RegExp(t.e,t.cs?"":"i").test(i!=null?i:"");case"!//":return!new RegExp(t.e,t.cs?"":"i").test(i!=null?i:"");default:throw new Error(`Unknown match type ${o}.`)}}function Mt(...i){return i.map(t=>t==null?void 0:t.toUpperCase())}a();var K=()=>({quirks:{},scores:{},sessionScores:{},tests:{},consent:!1,controlGroup:!1});a();a();import Ot from"mitt";import{dequal as Ut}from"dequal/lite";var It="__UNIFORM_DATA__",E,q,j=class{constructor({initialData:t}){d(this,E,void 0);d(this,q,Ot());this.events={on:s(this,q).on,off:s(this,q).off};t&&f(this,E,t)}get data(){return s(this,E)}updateData(t,e){return f(this,E,e),this.handleUpdateData(t,e)}async delete(t){f(this,E,void 0),await this.handleDelete(t)}signalAsyncDataUpdate(t){Ut(this.data,t)||(f(this,E,t),s(this,q).emit("dataUpdatedAsync",t))}getClientTransitionState(){if(typeof document=="undefined")return;let t=document.getElementById(It);return(t==null?void 0:t.textContent)?JSON.parse(t.textContent):void 0}};E=new WeakMap,q=new WeakMap;import{ntob as Rt,bton as qt}from"number-to-base64";var ht=typeof window=="undefined",O,U,Lt=class extends j{constructor({cookieAdapter:t,cookieName:e="ufvd"}){super({initialData:ht?zt(t.get(e)):void 0});d(this,O,void 0);d(this,U,void 0);f(this,O,e),f(this,U,t)}handleDelete(){return s(this,U).remove(s(this,O)),Promise.resolve()}async handleUpdateData(t,e){ht||(e.consent?s(this,U).set(s(this,O),At(e)):s(this,U).remove(s(this,O)))}};O=new WeakMap,U=new WeakMap;var St="~",yt="!",vt="-";function zt(i){if(!i)return;let t=i.split(St);if(t.length>3)return;let[e,r,o]=t;return{consent:!0,sessionScores:Dt(tt(r)),scores:Dt(tt(o)),tests:tt(e)}}function tt(i){return i.split(yt).map(e=>e.split(vt)).reduce((e,r)=>(r.length!==2||(e[r[0]]=r[1]),e),{})}function Dt(i){return Object.entries(i).reduce((t,[e,r])=>(t[e]=qt(r),t),{})}function At(i){return[et(i.tests),et(Ct(i.sessionScores)),et(Ct(i.scores))].join(St)}function Ct(i){return Object.entries(i).reduce((t,[e,r])=>(t[e]=Rt(r),t),{})}function et(i){return Object.entries(i).map(t=>t.join(vt)).join(yt)}a();var J,Nt,$t=class extends j{constructor({cookieAdapter:t,visitorIdCookieName:e="ufvi",...r}){super(r);d(this,J);r.initialData||h(this,J,Nt).call(this).catch(o=>{console.error(o)})}handleDelete(t){throw new Error("Method not implemented.")}async handleUpdateData(t){let e=await new Promise(r=>{setTimeout(()=>{r(void 0)},2e3)});e&&this.signalAsyncDataUpdate(e)}};J=new WeakSet,Nt=async function(){let t=await new Promise(e=>{setTimeout(()=>{e(void 0)},2e3)});t&&this.signalAsyncDataUpdate(t)};a();function Ae(i){let{gracePeriod:t=864e5,decayRate:e=1/30,decayCap:r=.95}=i!=null?i:{};return function({now:n,lastUpd:c,scores:u,sessionScores:p}){if(typeof c!="number")return!1;let M=n-c-t;if(M<=0)return!1;let Q=M/864e5,W=1-Math.min(r,Q*e);return W<=0?!1:(Vt(u,W),Vt(p,W),!0)}}function Vt(i,t){for(let e in i)i[e]*=t}a();import _t from"mitt";import{dequal as it}from"dequal/lite";a();var rt=class{constructor(){this.inMemoryFallback={};this.hasLocalStorageObject=typeof localStorage!="undefined"}get(t){let e=this.inMemoryFallback[t];if(!this.hasLocalStorageObject||e)return e;try{let r=localStorage.getItem(t);return r?JSON.parse(r):void 0}catch(r){return e}}set(t,e,r){if(this.inMemoryFallback[t]=e,!(!this.hasLocalStorageObject||!r))try{localStorage.setItem(t,JSON.stringify(e))}catch(o){console.warn(o)}}delete(t,e){e||delete this.inMemoryFallback[t];try{localStorage.removeItem(t)}catch(r){}}};a();import Gt from"rfdc";var jt=Gt();function xt(i,t,e){let r=t?jt(t):K();return i.forEach(o=>{var n,c;switch(o.type){case"consent":r.consent=o.data;break;case"setquirk":r.quirks[o.data.key]=o.data.value;break;case"settest":r.tests[o.data.test]=o.data.variant;break;case"modscore":if(e)break;let u=(n=r.scores[o.data.dimension])!=null?n:0;r.scores[o.data.dimension]=u+o.data.delta;break;case"modscoreS":if(e)break;let p=(c=r.sessionScores[o.data.dimension])!=null?c:0;r.sessionScores[o.data.dimension]=p+o.data.delta;break;case"identify":break;default:throw new Error("Unknown command")}}),r}var B="ufvisitor",v,I,z,y,D,w,k,L,Y,Ft,H,Qt,_,bt,F,kt,ot=class{constructor(t){d(this,D);d(this,k);d(this,Y);d(this,H);d(this,_);d(this,F);d(this,v,_t());d(this,I,new rt);d(this,z,void 0);d(this,y,void 0);this.events={on:s(this,v).on,off:s(this,v).off};if(f(this,y,t),s(this,D,w)||h(this,k,L).call(this,h(this,F,kt).call(this),!0),t.transitionStore){let e=t.transitionStore.getClientTransitionState();e&&e.quirks&&this.updateData(Object.entries(e.quirks).map(([o,n])=>({type:"setquirk",data:{key:o,value:n}}))),t.transitionStore.events.on("dataUpdatedAsync",o=>{h(this,k,L).call(this,{...s(this,D,w).visitorData,...o})});let r=t.transitionStore.data;r&&h(this,k,L).call(this,{...s(this,D,w).visitorData,...r},!0)}}get data(){let t=s(this,D,w);if(h(this,H,Qt).call(this,t)){let{sessionScores:e,...r}=t.visitorData;return h(this,k,L).call(this,{...r,sessionScores:{}}),s(this,v).emit("log",["info",120]),s(this,D,w).visitorData}return t.visitorData}async updateData(t){var r,o;if(t.length===0)return;s(this,v).emit("log",["debug",101,t]);let e=xt(t,this.data,(r=s(this,D,w))==null?void 0:r.visitorData.controlGroup);t.some(n=>n.type==="consent"&&!n.data)&&s(this,I).delete(B,!0),h(this,k,L).call(this,e),await((o=s(this,y).transitionStore)==null?void 0:o.updateData(t,s(this,D,w).visitorData))}async delete(t){var e;s(this,I).delete(B,!1),await((e=s(this,y).transitionStore)==null?void 0:e.delete(t)),s(this,v).emit("log",["info",103,t]),h(this,k,L).call(this,h(this,F,kt).call(this))}};v=new WeakMap,I=new WeakMap,z=new WeakMap,y=new WeakMap,D=new WeakSet,w=function(){return s(this,I).get(B)},k=new WeakSet,L=function(t,e=!1){var S,M;let r=s(this,D,w),o=Date.now();h(this,_,bt).call(this,t.scores),h(this,_,bt).call(this,t.sessionScores),(M=(S=s(this,y)).decay)==null||M.call(S,{now:o,lastUpd:r==null?void 0:r.updated,scores:t.scores,sessionScores:t.sessionScores});let n=!it(r==null?void 0:r.visitorData.scores,t.scores),c=!it(r==null?void 0:r.visitorData.sessionScores,t.sessionScores),u=!it(r==null?void 0:r.visitorData.quirks,t.quirks),p={updated:o,visitorData:t};h(this,Y,Ft).call(this),s(this,I).set(B,p,!!t.consent),s(this,v).emit("log",["debug",102,t]),e||((n||c)&&s(this,v).emit("scoresUpdated",t),u&&s(this,v).emit("quirksUpdated",t))},Y=new WeakSet,Ft=function(){typeof window=="undefined"||!s(this,y).visitLifespan||(s(this,z)&&window.clearTimeout(s(this,z)),f(this,z,window.setTimeout(()=>{this.data},s(this,y).visitLifespan+50)))},H=new WeakSet,Qt=function(t){let e=s(this,y).visitLifespan;return e?t.updated+e<Date.now():!1},_=new WeakSet,bt=function(t){if(!!s(this,y).manifest)for(let e in t){let r=t[e],o=s(this,y).manifest.getDimensionByKey(e);!o||r>o.cap&&(s(this,v).emit("log",["debug",110,{dim:e,score:r,cap:o.cap}]),t[e]=o.cap)}},F=new WeakSet,kt=function(){var t,e,r;return{...K(),consent:(t=s(this,y).defaultConsent)!=null?t:!1,controlGroup:(r=(e=s(this,y).manifest)==null?void 0:e.rollForControlGroup())!=null?r:!1}};a();import Jt from"mitt";a();a();function Tt({context:i,variations:t,take:e=1}){var u;let r=(u=i.storage.data.controlGroup)!=null?u:!1,o=[],n=!1,c=i.scores;for(let p of t){if(o.length===e)break;if(!p.pz){o.push(p);continue}!r&&Et(p.pz,c)&&(n=!0,o.push(p))}return{personalized:n,variations:o}}a();function Et(i,t){return!i.op||i.op==="&"?i.crit.every(e=>wt(e,t)):i.crit.some(e=>wt(e,t))}function wt(i,t){var c;let{op:e,l:r}=i,o=(c=t[r])!=null?c:0;if(e==="+")return Math.max(...Object.values(t))===o&&o>0;if(e==="-")return Math.min(...Object.values(t))===o&&o>0;let n=i.rDim?t[i.rDim]:i.r;if(n===void 0)return!1;if(e===">")return o>n;if(e==="<")return o<n;if(e==="=")return o===n;if(e==="!=")return o!==n;throw new Error(`Unknown op: ${e}`)}a();var Kt=i=>{let{values:t,total:e,missingDistribution:r}=i.reduce((o,n)=>(n.testDistribution?o.total+=n.testDistribution:++o.missingDistribution,o.values.push(n.testDistribution),o),{values:[],total:0,missingDistribution:0});if(e>100)throw new Error(`Total distribution ${e} is over the maximum 100.`);if(e<100){let n=(100-e)/r;t.forEach((c,u)=>{typeof c=="undefined"&&(t[u]=n)})}return t},st=({name:i,context:t,variations:e})=>{var n;let r,o=t.getTestVariantId(i);if(o===null)return{result:void 0};if(o&&(r=e.find(c=>c.id===o),r||t.log("warn",401,{test:i,variant:o})),!r){let c=Kt(e),u=Math.floor(Math.random()*100),p=0;r=e.find((S,M)=>{let Q=c[M];if(u>p&&u<=p+Q)return S;p+=Q}),r&&t.setTestVariantId(i,(n=r.id)!=null?n:"Unknown")}return{result:r}};var T,P,C,g,Bt=class{constructor(t){d(this,T,void 0);d(this,P,{});d(this,C,void 0);d(this,g,Jt());this.events={on:s(this,g).on,off:s(this,g).off};let{manifest:e,...r}=t;f(this,C,{}),f(this,T,new R({manifest:e,evaluator:new N({CK:ut,QS:mt,QK:lt,PVC:pt,EVT:ft,PV:gt})})),this.storage=new ot({manifest:s(this,T),...r}),this.storage.events.on("log",(...n)=>s(this,g).emit("log",...n));let o=n=>{var u;let c={...n.scores};for(let p in n.sessionScores)c[p]=((u=c[p])!=null?u:0)+n.sessionScores[p];c=s(this,T).computeAggregateDimensions(c),f(this,P,c),s(this,g).emit("scoresUpdated",c),s(this,g).emit("log",["info",3,c])};this.storage.events.on("scoresUpdated",o),o(this.storage.data),this.storage.events.on("quirksUpdated",n=>{let c=s(this,T).computeSignals({scores:s(this,P),state:s(this,C),previousState:s(this,C),visitor:this.storage.data});this.storage.updateData(c),s(this,g).emit("quirksUpdated",n.quirks),s(this,g).emit("log",["info",4,n.quirks])}),s(this,g).emit("log",["debug",1,{options:t,scores:s(this,P)}])}get scores(){return s(this,P)}async update(t){let e=[];s(this,g).emit("log",["info",2,t]),t.quirks&&(e.push(...Object.entries(t.quirks).map(([o,n])=>({type:"setquirk",data:{key:o,value:n}}))),t.quirks=void 0),t.enrichments&&(e.push(...t.enrichments.map(o=>({type:"modscore",data:{dimension:R.getEnrichmentVectorKey(o.cat,o.key),delta:o.str}}))),t.enrichments=void 0);let r=s(this,C);f(this,C,{...s(this,C),...t}),e.push(...s(this,T).computeSignals({state:s(this,C),previousState:r,visitor:this.storage.data,scores:s(this,P)})),await this.storage.updateData(e)}getTestVariantId(t){var r;let e=s(this,T).getTest(t);return e?(r=e.wv)!=null?r:this.storage.data.tests[t]:(s(this,g).emit("log",["warn",401,t]),null)}setTestVariantId(t,e){this.storage.updateData([{type:"settest",data:{test:t,variant:e}}])}log(...t){s(this,g).emit("log",t)}test(t){var r;let e=st({...t,context:this});return s(this,g).emit("testResult",{name:t.name,variantId:(r=e.result)==null?void 0:r.id,control:this.storage.data.controlGroup}),e}personalize(t){let e=Tt({...t,context:this});return t.name?s(this,g).emit("personalizationResult",{name:t.name,variantIds:e.variations.map(r=>{var o;return(o=r.id)!=null?o:"Unknown"}),control:this.storage.data.controlGroup}):this.log("warn",301),e}async forget(t){f(this,C,{}),await this.storage.delete(t)}};T=new WeakMap,P=new WeakMap,C=new WeakMap,g=new WeakMap;a();var Dr=([i,t,...e])=>{console[i](`\u{1F94B} [${i}] Uniform event ID ${t}
|
2
|
+
`,...e.map(r=>JSON.stringify(r,null,2)))};a();a();var Pt={1:({options:i,scores:t})=>["tracker","constructed",i,t],2:i=>["tracker","received data update",i],3:i=>["tracker","new score vector",i],4:i=>["tracker","updated quirks",i],101:i=>["storage","received update commands",i],102:i=>["storage","data was updated",i],103:i=>["storage",`data was deleted ${i?"from all devices":"from this device"}`],110:({dim:i,cap:t,score:e})=>["storage",`${i} score ${e} exceeded cap ${t}. Rounded down.`],120:()=>["storage","visitor data expired and was cleared"],301:()=>["placement","Missing `name` field on personalization. Analytics events will not be triggered."],401:i=>["testing",`${i} was unknown; it will not be run.`],402:({test:i,variant:t})=>["testing",`${i} no longer has visitor's variant ${t}; it will be removed.`],700:()=>["gtag","gtag is not defined, skipping analytics event emission. Ensure you have added the gtag script to your page."],701:()=>["gtag","enabled gtag event signal redirection"]};var br=([i,t,...e])=>{let r=Pt[t],o=`\u{1F94B} [${new Date().toLocaleTimeString()}][${i}]`;r||console[i](`${o} unknown message ID ${t} - ensure all Uniform packages are the same version`,...e);let[n,c,...u]=r(...e);console[i](`${o}[${n}] ${c} (Event ID: ${t})
|
3
|
+
`,...u.map(p=>JSON.stringify(p,null,2)))};a();var Yt=(u=>(u.ListStart="nesi-list-start",u.ListEnd="nesi-list-end",u.ListItem="nesi-list-item-html",u.ListItemSettings="nesi-list-item-settings",u.TestStart="nesi-test-start",u.TestEnd="nesi-test-end",u.Unknown="unknown",u))(Yt||{}),Tr="nesitag";export{Bt as Context,Lt as CookieTransitionDataStore,Tr as EdgeNodeTagName,$t as EdgeTransitionDataStore,N as GroupCriteriaEvaluator,R as ManifestInstance,It as SERVER_STATE_ID,Yt as ScriptType,j as TransitionDataStore,ot as VisitorDataStore,nt as computeAggregateDimensions,Dr as consoleLogDrain,ut as cookieEvaluator,Ae as createLinearDecay,br as debugConsoleLogDrain,K as emptyVisitorData,Et as evaluateVariantMatch,ft as eventEvaluator,x as isStringMatch,Z as pageViewCountDimension,pt as pageViewCountEvaluator,gt as pageVisitedEvaluator,Tt as personalizeVariations,mt as queryStringEvaluator,lt as quirkEvaluator,st as testVariations};
|
package/package.json
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
{
|
2
|
+
"name": "@uniformdev/context",
|
3
|
+
"version": "12.2.1-alpha.107+b30768d5",
|
4
|
+
"description": "Uniform Context core package",
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
6
|
+
"main": "./dist/index.js",
|
7
|
+
"module": "./dist/index.esm.js",
|
8
|
+
"exports": {
|
9
|
+
".": {
|
10
|
+
"import": {
|
11
|
+
"node": "./dist/index.mjs",
|
12
|
+
"default": "./dist/index.esm.js"
|
13
|
+
},
|
14
|
+
"require": "./dist/index.js"
|
15
|
+
},
|
16
|
+
"./cli": {
|
17
|
+
"import": "./dist/cli/cli.mjs",
|
18
|
+
"require": "./dist/cli/cli.js"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"types": "./dist/index.d.ts",
|
22
|
+
"typesVersions": {
|
23
|
+
"*": {
|
24
|
+
".": [
|
25
|
+
"./dist/index.d.ts"
|
26
|
+
],
|
27
|
+
"cli": [
|
28
|
+
"./dist/cli/cli.d.ts"
|
29
|
+
]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"sideEffects": false,
|
33
|
+
"scripts": {
|
34
|
+
"build": "tsup",
|
35
|
+
"dev": "tsup --watch",
|
36
|
+
"clean": "rimraf dist",
|
37
|
+
"test": "jest --maxWorkers=1",
|
38
|
+
"lint": "eslint \"src/**/*.{js,ts,tsx}\"",
|
39
|
+
"format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
|
40
|
+
"ci:verify": "run-p lint test",
|
41
|
+
"ci:build": "tsup --minify --clean",
|
42
|
+
"update-openapi": "node ./update-openapi.cjs",
|
43
|
+
"benchmark:build": "tsup src/storage/__benchmarks__/storage.benchmark.ts",
|
44
|
+
"benchmark:run": "node ./dist/storage.benchmark.js"
|
45
|
+
},
|
46
|
+
"devDependencies": {
|
47
|
+
"@types/jest": "27.0.3",
|
48
|
+
"@types/node": "16.11.12",
|
49
|
+
"@types/yargs": "17.0.8",
|
50
|
+
"@uniformdev/cli": "^12.2.1-alpha.107+b30768d5",
|
51
|
+
"benny": "^3.7.1",
|
52
|
+
"eslint": "8.4.1",
|
53
|
+
"eslint-plugin-react": "7.27.1",
|
54
|
+
"eslint-plugin-react-hooks": "4.3.0",
|
55
|
+
"jest": "27.4.4",
|
56
|
+
"npm-run-all": "4.1.5",
|
57
|
+
"rimraf": "3.0.2",
|
58
|
+
"ts-jest": "27.1.1",
|
59
|
+
"tsup": "5.11.1",
|
60
|
+
"yargs": "17.3.0"
|
61
|
+
},
|
62
|
+
"dependencies": {
|
63
|
+
"dequal": "^2.0.2",
|
64
|
+
"mitt": "^3.0.0",
|
65
|
+
"number-to-base64": "^1.0.5",
|
66
|
+
"rfdc": "^1.3.0"
|
67
|
+
},
|
68
|
+
"files": [
|
69
|
+
"/dist"
|
70
|
+
],
|
71
|
+
"gitHead": "b30768d5d58d4c75b390274042724d50c1ee1041"
|
72
|
+
}
|