import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{k as t,t as n}from"./esm-Dg7vifPm.js";import{n as r,t as i}from"./gracefulDecodeURIComponent-DUAwlHZu.js";function a(e,t){return Object.keys(t).reduce(function(n,r){if(r.startsWith(e)){var i=r.substr(e.length);n[i]=t[r]}return n},{})}var o=e((()=>{}));function s(e,n){var r=document.createElement(`a`);r.href=n;var o=r.search.slice(1).split(`&`).reduce(function(e,t){var n=t.split(`=`),r=n[0],a=n[1];return e[r]=i(a),e},{}),s=[],c=o.ajs_uid,l=o.ajs_event,u=o.ajs_aid,d=t(e.options.useQueryString)?e.options.useQueryString:{},f=d.aid,p=f===void 0?/.+/:f,m=d.uid,h=m===void 0?/.+/:m;if(u){var g=Array.isArray(o.ajs_aid)?o.ajs_aid[0]:o.ajs_aid;p.test(g)&&e.setAnonymousId(g)}if(c){var _=Array.isArray(o.ajs_uid)?o.ajs_uid[0]:o.ajs_uid;if(h.test(_)){var v=a(`ajs_trait_`,o);s.push(e.identify(_,v))}}if(l){var y=Array.isArray(o.ajs_event)?o.ajs_event[0]:o.ajs_event,b=a(`ajs_prop_`,o);s.push(e.track(y,b))}return Promise.all(s)}e((()=>{o(),r(),n()}))();export{s as queryString};
//# sourceMappingURL=query-string-COLLE6Tc.js.map