@techinject/browser 0.1.0-alpha.1 → 0.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cdn/signalkit.mjs +1 -1
- package/dist/dashboard.d.ts +11 -1
- package/dist/dashboard.d.ts.map +1 -1
- package/dist/dashboard.js +63 -3
- package/dist/dashboard.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @techinject/browser
|
|
2
2
|
|
|
3
|
-
SignalKit browser
|
|
3
|
+
SignalKit browser SDK. MIT licensed; experimental alpha API.
|
|
4
4
|
|
|
5
5
|
Optional in-app connection status UI: import `mountConnectionsDashboard` from
|
|
6
6
|
`@techinject/browser/dashboard`, then call it with an existing DOM element and SDK
|
package/dist/cdn/signalkit.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function Le(e,t){return typeof t=="bigint"?t.toString():t}var me=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function je(e){return new me(e)}function Ne(e){return e==null}function Ue(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ne(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Fe(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function he(e){return Fe(e._zod.def)??e._zod.def.shape}function Be(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return ne(this,t,n),n},enumerable:!0,configurable:!0})}function Ke(e,t,r){t in e?ne(e,t,r):e[t]=r}function jt(e,t,r,n){let o=he(t);for(let i of r){let c=Object.getOwnPropertyDescriptor(o,i);c.enumerable&&(c.get?Be(e,i,()=>{let s=t._zod.def.shape[i];return n?n(s,i):s}):Ke(e,i,n?n(c.value,i):c.value))}}function Nt(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Be(e,r,()=>t[r]):Ke(e,r,n.value))}}function Ve(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}var _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function We(e){if(re(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(re(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function q(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function k(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ge(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var qe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Xe(e,t){if(!We(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=he(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return q(e,Ve(e._zod.def,{shape:Ut(e,t)}))}function Ut(e,t){let r={};return jt(r,e,Reflect.ownKeys(he(e))),Nt(r,t),r}function L(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function He(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function oe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function G(e){return typeof e=="string"?e:e?.message}function ge(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function F(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:G(e.inst?._zod.def?.error?.(e))??G(i?.(e))??G(t?.error?.(e))??G(r.customError?.(e))??G(r.localeError?.(e))??"Invalid input",s={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(s[u]=e[u]);return s.path??(s.path=[]),s.message=c,t?.reportInput&&(s.input=e.input),s}var Ft=/[\uD800-\uDBFF]/;function xe(e){let t=e.length;if(!Ft.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function ve(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Je(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Bt(e,r,n.value)}}function j(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function $e(e,t,r){return j(e,t,r,!1)}function Bt(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:j(this,t,r.bind(this))},set(n){j(this,t,n)}})}function Kt(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var de,D=!1,Vt={configurable:!0,get(){D=!0}};function X(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&de!==e._zod){de=void 0;return}de=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Vt);let o=D;D=!1;try{let i=r(this);return D?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),D=D||o,i}catch(i){throw delete this[t],D=D||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Ye(e,t,r,n){let o=Kt(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var Qe;var be={value:void 0,enumerable:!1},et="captureStackTrace"in Error?Error:null;function Wt(e){let t=et;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return et=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function b(e,t,r,n){let o={};function i(d){this.def=d,this.constr=h,this.traits=new Set}i.prototype=o;let c=r,s=c&&new WeakSet;function u(d,_){if(d._zod){if(d._zod.traits.has(e))return}else{be.value=new i(_);try{Object.defineProperty(d,"_zod",be)}finally{be.value=void 0}}if(d._zod.traits.add(e),t(d,_),s){let v=Object.getPrototypeOf(d),p=d._zod.constr.prototype,x=v;for(;x&&x!==p;)x=Object.getPrototypeOf(x);let f=x??v;s.has(f)||(s.add(f),Je(f,c))}let g=h.prototype;for(let v in g)Object.prototype.hasOwnProperty.call(g,v)&&(v in d||(d[v]=g[v].bind(d)))}let l=n?.Parent??Object;class a extends l{}Object.defineProperty(a,"name",{value:e});function h(d){let _=n?.Parent?Wt(a):this;u(_,d);let g=_._zod.deferred;if(g){for(let p of g)p();_._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;return v&&v(_),_}return Object.defineProperty(h,"init",{value:u}),Object.defineProperty(h,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(h,"name",{value:e}),h}var M=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(Qe=globalThis).__zod_globalConfig??(Qe.__zod_globalConfig={});var H=globalThis.__zod_globalConfig;function B(e){return e&&Object.assign(H,e),H}function Gt(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Le,2)),e.message}function qt(e){this._zod.message=e}var Xt={get:Gt,set:qt,enumerable:!0,configurable:!0},ze={value:void 0,enumerable:!1},tt=new WeakSet([Object.prototype,Error.prototype]),rt=(e,t)=>{e.name="$ZodError",ze.value=t,Object.defineProperty(e,"issues",ze),ze.value=void 0,Object.defineProperty(e,"message",Xt);let r=Object.getPrototypeOf(e);tt.has(r)||(tt.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},wr=b("$ZodError",rt),J=b("$ZodError",rt,void 0,{Parent:Error});var Jt=e=>{let t=(r,n,o,i)=>{let c=o?{...o,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise)throw new M;if(s.issues.length){let u=new(i?.Err??e)(s.issues.map(l=>F(l,c,B())));throw _e(u,i?.callee??t),u}return s.value};return t},we=Jt(J),Yt=e=>{let t=async(r,n,o,i)=>{let c=o?{...o,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(i?.Err??e)(s.issues.map(l=>F(l,c,B())));throw _e(u,i?.callee??t),u}return s.value};return t},Ze=Yt(J),Qt=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new M;return i.issues.length?nt(e,i.issues,o):{success:!0,data:i.value}},Pe=Qt(J);function nt(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>F(o,r,B()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var er=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?nt(e,i.issues,o):{success:!0,data:i.value}},ke=er(J);var ot=/^[\s\S]{0,}$/;var it=/^-?\d+(?:\.\d+)?$/;var O=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ct=e=>{let t=e.value;return!Ne(t)&&t.length!==void 0},ie={number:"number",bigint:"bigint",object:"date"},ut=b("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=ie[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ie[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ae=b("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=ie[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ie[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var at=b("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=qe[t.format];e._zod.check=c=>{let s=c.value;if(r){if(!Number.isInteger(s)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?c.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<o&&c.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&c.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var lt=b("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=ct),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?xe(o):i)<=t.maximum)return;let s=ve(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pt=b("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=ct),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?xe(o):i)>=t.minimum)return;let s=ve(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var ft=b("$ZodCheckStringFormat",(e,t)=>{var r,n;O.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),dt=b("$ZodCheckRegex",(e,t)=>{ft.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var ht={major:4,minor:6,patch:5};var U=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let c of i._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,u,l)=>{if(s.memo)return s;let a=L(s),h;for(let d of u){if(d._zod.def.when){if(He(s)||!d._zod.def.when(s))continue}else if(a)continue;let _=s.issues.length,g=d._zod.check(s);if(g instanceof Promise&&l?.async===!1)throw new M;if(h||g instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await g,s.issues.length!==_&&(ge(s.issues,_,e),a||(a=L(s,_)))});else{if(s.issues.length===_)continue;ge(s.issues,_,e),a||(a=L(s,_))}}return h?h.then(()=>s):s},c=(s,u,l)=>{if(L(s))return s.aborted=!0,s;let a=i(u,o,l);if(a instanceof Promise){if(l.async===!1)throw new M;return a.then(h=>e._zod.parse(h,l))}return e._zod.parse(a,l)};e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let a=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return a instanceof Promise?a.then(h=>c(h,s,u)):c(a,s,u)}let l=e._zod.parse(s,u);if(l instanceof Promise){if(u.async===!1)throw new M;return l.then(a=>i(a,o,u))}return i(l,o,u)}}},{get"~standard"(){return $e(this,"~standard",or(this))},set"~standard"(e){j(this,"~standard",e)}}),xt=(e,t)=>e.issues.length?{issues:e.issues.map(r=>F(r,t,B()))}:{value:e.value};async function nr(e,t){let r={async:!0};return xt(await e._zod.run({value:t,issues:[]},r),r)}function or(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return xt(n,r)}catch{}return nr(e,t)},vendor:"zod",version:1}}var vt=b("$ZodString",(e,t)=>{U.init(e,t),e._zod.pattern=t.pattern??ot,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}});var Ce=b("$ZodNumber",(e,t)=>{U.init(e,t),e._zod.pattern=it,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),$t=b("$ZodNumberFormat",(e,t)=>{at.init(e,t),Ce.init(e,t)});function _t(e,t,r){e.issues.length&&t.issues.push(...oe(r,e.issues)),t.value[r]=e.value}var bt=b("$ZodArray",(e,t)=>{U.init(e,t);let r=H.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let c=[],s=o?.abortEarly;for(let u=0;u<i.length;u++){let l=i[u],a=t.element._zod.run({value:l,issues:[]},o);if(a instanceof Promise)c.push(a.then(h=>_t(h,n,u)));else if(_t(a,n,u),s&&a.issues.length!==0&&L(a))break}return c.length?Promise.all(c).then(()=>n):n}});function se(e,t,r,n,o,i){let c=r in n,s=i==="optional";if(!(!c&&s&&o==="optional")){if(e.issues.length){if(o!==void 0&&s&&!c)return;t.issues.push(...oe(r,e.issues))}if(!c&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(c||o==="defaulted"&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}var ir=[];function sr(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:ir,o=n.length?[...t,...n]:t;for(let c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let i=Ge(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function cr(e,t,r,n,o,i,c){let s=[],u=o.keySet,l=o.catchall._zod,a=l.def.type,h=l.optin,d=l.optout,_=0;for(let g in t){if(c&&r.issues.length!==_){if(L(r,_))break;_=r.issues.length}if(u.has(g))continue;if(g==="__proto__"){a==="never"&&s.push(g);continue}if(a==="never"){s.push(g);continue}let v=l.run({value:t[g],issues:[]},n);v instanceof Promise?e.push(v.then(p=>se(p,r,g,t,h,d))):se(v,r,g,t,h,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var yt=b("$ZodObject",(e,t)=>{U.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let l=()=>{let a={...n};return Object.defineProperty(t,"shape",{value:a}),l.raw=a,a};l.raw=n,Object.defineProperty(t,"shape",{get:l})}let o=je(()=>sr(t));X(e,"propValues",l=>{let a=l.def.shape,h={};for(let d in a){let _=a[d]._zod;if(_.values){Object.prototype.hasOwnProperty.call(h,d)||ne(h,d,new Set);for(let g of _.values)h[d].add(g);_.optin!==void 0&&h[d].add(void 0)}}return h});let i=re,c=t.catchall,s,u=H.memoizer;u?.attach(e),e._zod.parse=(l,a)=>{s??(s=o.value);let h=l.value;if(!i(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value=u?u.alloc(e,l,{},a):{};let d=[],_=s.shape,g=a?.abortEarly,v=l.issues.length;for(let p of s.allKeys){if(g&&l.issues.length!==v){if(L(l,v))break;v=l.issues.length}if(p==="__proto__")continue;let x=_[p],f=x._zod.optin,m=x._zod.optout,y=x._zod.run({value:h[p],issues:[]},a);y instanceof Promise?d.push(y.then($=>se($,l,p,h,f,m))):se(y,l,p,h,f,m)}return c?cr(d,h,l,a,o.value,e,g===!0):d.length?Promise.all(d).then(()=>l):l}});function gt(e,t){return e.value=t.issues.length?void 0:t.value,e}var zt=b("$ZodOptional",(e,t)=>{U.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",X(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),X(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Ue(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>gt(r,i)):gt(r,o)}return t.innerType._zod.run(r,n)}});function wt(e){return e.checks&&(e.checks=[...e.checks]),e}function Zt(e,t){return new e(wt({type:"string",...k(t)}))}function Pt(e,t){return new e(wt({type:"number",checks:[],...k(t)}))}function kt(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(t)})}function ce(e,t){return new ut({check:"less_than",...k(t),value:e,inclusive:!0})}function At(e,t){return new Ae({check:"greater_than",...k(t),value:e,inclusive:!1})}function Ee(e,t){return new Ae({check:"greater_than",...k(t),value:e,inclusive:!0})}function Ie(e){return At(0,e)}function Se(e){return Ee(0,e)}function Y(e,t){return new lt({check:"max_length",...k(t),maximum:e})}function Q(e,t){return new pt({check:"min_length",...k(t),minimum:e})}function Me(e,t){return new dt({check:"string_format",format:"regex",...k(t),pattern:e})}var ee=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");U.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){j(this,"with",e)},parse(e,t){return we(this,e,t,{callee:this.parse})},parseAsync(e,t){return Ze(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Pe(this,e,t)},safeParseAsync(e,t){return ke(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0})},clone(e,t){return q(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),lr=b("ZodMiniString",(e,t)=>{vt.init(e,t),ee.init(e,t)});function ue(e){return Zt(lr,e)}var Ct=b("ZodMiniNumber",(e,t)=>{Ce.init(e,t),ee.init(e,t)});function Et(e){return Pt(Ct,e)}var pr=b("ZodMiniNumberFormat",(e,t)=>{$t.init(e,t),Ct.init(e,t)});function It(e){return kt(pr,e)}var fr=b("ZodMiniArray",(e,t)=>{bt.init(e,t),ee.init(e,t)});function St(e,t){return new fr({type:"array",element:e,...k(t)})}var dr=b("ZodMiniObject",(e,t)=>{yt.init(e,t),ee.init(e,t),Ye(e,"shape",r=>r._zod.def.shape,!1)});function ae(e,t){let r={type:"object",shape:e??{},...k(t)};return new dr(r)}function Mt(e,t){return Xe(e,t)}var mr=b("ZodMiniOptional",(e,t)=>{zt.init(e,t),ee.init(e,t)});function te(e){return new mr({type:"optional",innerType:e})}var hr=Object.freeze({analytics:!1,marketing:!1,observability:!1}),pe=ue().check(Q(1),Y(128)),Rt=Et().check(Se()),_r=ue().check(Me(/^[A-Z]{3}$/)),gr=ae({item_id:pe,item_name:te(pe),price:te(Rt),quantity:te(It().check(Ie(),ce(1e5))),item_category:te(pe)}),le=ae({currency:_r,value:Rt,items:St(gr).check(Q(1),Y(100))}),Ot={page_view:ae({page_path:ue().check(Q(1),Y(2048))}),product_view:le,add_to_cart:le,begin_checkout:le,purchase:Mt(le,{transaction_id:pe})};function Tt(e,t){let r=e;if(!r||typeof r!="object"||!Object.hasOwn(Ot,r.name)||!/^[\w.-]{1,128}$/.test(t))return;let n=r.timestamp??Date.now();if(!Number.isFinite(n)||n<0)return;let o=Ot[r.name].safeParse(r.properties);if(o.success){if(r.name==="page_view"){let i=o.data;if(!i.page_path.startsWith("/")||i.page_path.startsWith("//"))return;i.page_path=i.page_path.split(/[?#]/)[0]??"/"}return{name:r.name,eventId:t,timestamp:n,properties:o.data}}}function K(){return globalThis.crypto.randomUUID()}function E(e,t){try{return new URL(t??String(e),"http://signalkit.invalid").pathname.split("/").map(n=>{let o;try{o=decodeURIComponent(n)}catch{return":redacted"}return o.includes("@")||o.length>64?":redacted":n}).join("/").replace(/\/[0-9]+(?=\/|$)/g,"/:id").replace(/\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=\/|$)/gi,"/:id").slice(0,2048)}catch{return"/"}}function Oe(e){let t=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/.exec(e??"");if(!(!t||/^0+$/.test(t[1])||/^0+$/.test(t[2])))return{traceId:t[1],spanId:t[2],sampled:(Number.parseInt(t[3],16)&1)===1}}function Dt(e={}){let t=[...e.providers??[]];function r(p){return{analytics:p?.analytics===!0,marketing:p?.marketing===!0,observability:p?.observability===!0}}let n=r(e.consent),o=!1,i=t.map(p=>({name:p.name,category:p.category,consent:!1,disposed:!1,attempts:0,sent:0,failed:0,denied:0,dropped:0,invalid:0})),c=new Set,s=()=>{for(let p of c)try{p()}catch{}},u=new Set,l=new Map,a=Number.isFinite(e.timeoutMs)?Math.max(1,Math.min(e.timeoutMs,6e4)):5e3,h=Number.isFinite(e.maxPending)?Math.max(1,Math.min(Math.floor(e.maxPending),1e3)):100;function d(p){p.outcomes.forEach((x,f)=>{let m=i[f];m&&(m.attempts++,m[x.status]++,m.lastStatus=x.status,m.lastUpdated=Date.now())}),s();try{e.onDiagnostic?.(p)}catch{}return p}async function _(p,x){if(!n[p.category])return{provider:p.name,status:"denied",reason:"consent"};let f=new AbortController;l.set(f,p.category);let m;try{return await Promise.race([Promise.resolve().then(()=>{if(f.signal.aborted)throw new Error("aborted");return p.send(structuredClone(x),f.signal)}),new Promise((y,$)=>{f.signal.addEventListener("abort",()=>$(new Error("aborted")),{once:!0}),m=setTimeout(()=>{f.abort(),$(new Error("timeout"))},a)})]),{provider:p.name,status:f.signal.aborted?"dropped":"sent"}}catch{return{provider:p.name,status:f.signal.aborted?"dropped":"failed",reason:f.signal.aborted?"aborted_or_timeout":"provider_error"}}finally{m!==void 0&&clearTimeout(m),l.delete(f)}}function g(p){let x;try{x=p?.eventId}catch{}let f=typeof x=="string"&&/^[\w.-]{1,128}$/.test(x)?x:K(),m;try{m=x!==void 0&&x!==f?void 0:Tt(p,f)}catch{m=void 0}let y=m?o||u.size>=h?"dropped":void 0:"invalid";if(y)return Promise.resolve(d({eventId:f,outcomes:(t.length?t.map(z=>z.name):["core"]).map(z=>({provider:z,status:y,reason:y==="invalid"?"event_schema":"capacity_or_disposed"}))}));let $=Promise.all(t.map(z=>_(z,m))).then(z=>d({eventId:f,outcomes:z}));return u.add($),$.finally(()=>u.delete($)),$}function v(p){n=r(p);for(let x of i)x.consent=n[x.category];s();for(let[x,f]of l)n[f]||x.abort();for(let x of t)try{x.setConsent?.({...n})}catch{}}return v(n),{track:g,setConsent:v,getConsent:()=>({...n}),getConnections:()=>i.map(p=>({...p})),subscribeConnections(p){return c.add(p),()=>{c.delete(p)}},flush:async()=>{await Promise.all([...u])},dispose:()=>{o=!0;for(let p of i)p.disposed=!0;s(),u.size?Promise.all([...u]).then(()=>c.clear()):c.clear();for(let p of l.keys())p.abort();for(let p of t)try{p.dispose?.()}catch{}}}}var Z=()=>window;function Re(e,t){let r,n;return{load(o){return r||(r=new Promise((i,c)=>{if(typeof document>"u")return c(new Error("Browser provider requires a document"));n=document.createElement("script"),n.async=!0,n.src=e,t.nonce&&(n.nonce=t.nonce);let s=setTimeout(()=>l(new Error("Provider script timed out")),t.timeoutMs??4e3),u=()=>l(new Error("Provider script aborted"));function l(a){clearTimeout(s),o?.removeEventListener("abort",u),n&&(n.onload=null,n.onerror=null),a?(n?.remove(),r=void 0,c(a)):i()}if(n.onload=()=>l(),n.onerror=()=>l(new Error("Provider script blocked")),o?.aborted)return u();o?.addEventListener("abort",u,{once:!0}),document.head.appendChild(n)}),r)},dispose(){n?.remove(),n=void 0,r=void 0}}}function Te(e,t,r){if(!t.test(e))throw new Error(`Invalid ${r}`)}function xr(e){Te(e.measurementId,/^G-[A-Z0-9]+$/,"GA4 measurement ID");let t=Re(`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e.measurementId)}`,e),r=!1,n=()=>{let o=Z();o.dataLayer??=[],o.gtag??=function(...i){o.dataLayer?.push(i)},r||(o.gtag("consent","default",{analytics_storage:"denied",ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied"}),o.gtag("js",new Date),o.gtag("config",e.measurementId,{send_page_view:!1,page_location:location.origin+E(location.href),page_referrer:document.referrer?E(document.referrer):""}),r=!0)};return{name:"ga4",category:"analytics",async send(o,i){if(n(),await t.load(i),i?.aborted)throw new Error("Dispatch aborted");Z().gtag?.("consent","update",{analytics_storage:"granted"}),Z().gtag?.("event",o.name==="product_view"?"view_item":o.name,{...o.properties,page_location:location.origin+E(location.href),page_referrer:document.referrer?E(document.referrer):"",event_id:o.eventId,send_to:e.measurementId})},setConsent(o){r&&Z().gtag?.("consent","update",{analytics_storage:o.analytics?"granted":"denied"})},dispose(){r&&Z().gtag?.("consent","update",{analytics_storage:"denied"}),t.dispose()}}}var vr={page_view:"PageView",product_view:"ViewContent",add_to_cart:"AddToCart",begin_checkout:"InitiateCheckout",purchase:"Purchase"};function $r(e){Te(e.pixelId,/^\d+$/,"Meta pixel ID");let t=Re("https://connect.facebook.net/en_US/fbevents.js",e),r=!1,n=()=>{let o=Z();if(!o.fbq){let i=(...c)=>{i.callMethod?i.callMethod(...c):i.queue?.push(c)};i.queue=[],i.loaded=!0,i.version="2.0",i.push=i,o.fbq=i}r||(o.fbq("set","autoConfig",!1,e.pixelId),o.fbq("init",e.pixelId),r=!0)};return{name:"meta-pixel",category:"marketing",async send(o,i){if(n(),await t.load(i),i?.aborted)throw new Error("Dispatch aborted");let c=o.properties.items,s={...o.properties.currency?{currency:o.properties.currency}:{},...typeof o.properties.value=="number"?{value:o.properties.value}:{},...c?{content_type:"product",content_ids:c.map(u=>u.item_id),contents:c.map(u=>({id:u.item_id,quantity:u.quantity??1,item_price:u.price}))}:{}};Z().fbq?.("consent","grant"),Z().fbq?.("trackSingle",e.pixelId,vr[o.name],s,{eventID:o.eventId})},setConsent(o){r&&Z().fbq?.("consent",o.marketing?"grant":"revoke")},dispose(){r&&Z().fbq?.("consent","revoke"),t.dispose()}}}function br(e){Te(e.projectId,/^[a-z0-9]+$/i,"Clarity project ID");let t=Re(`https://www.clarity.ms/tag/${encodeURIComponent(e.projectId)}`,e),r=!1;return{name:"clarity",category:"analytics",async send(n,o){if(!r){let i=Z();if(!i.clarity){let c=[],s=(...u)=>{c.push(u)};Object.assign(s,{q:c}),i.clarity=s}r=!0}if(await t.load(o),o?.aborted)throw new Error("Dispatch aborted");Z().clarity?.("consentv2",{analytics_Storage:"granted",ad_Storage:"denied"}),n.name!=="page_view"&&Z().clarity?.("event",n.name)},setConsent(n){r&&Z().clarity?.("consentv2",{analytics_Storage:n.analytics?"granted":"denied",ad_Storage:"denied"})},dispose(){r&&Z().clarity?.("consentv2",{analytics_Storage:"denied",ad_Storage:"denied"}),t.dispose()}}}var fe;function Ds(e={}){let t=Dt(e),r=!1,n={},o=new Set,i=Number.isFinite(e.timeoutMs)?Math.max(1,Math.min(3e4,e.timeoutMs)):2e3;async function c(f){let m;try{await Promise.race([Promise.resolve(f()),new Promise(y=>{m=setTimeout(y,i)})])}catch{}finally{m!==void 0&&clearTimeout(m)}}let s="",u=[],l=f=>["googletagmanager.com","google-analytics.com","facebook.net","facebook.com","clarity.ms"].some(m=>f.hostname===m||f.hostname.endsWith("."+m))||(e.excludeUrls??[]).some(m=>f.href.startsWith(m)||f.pathname.startsWith(m)),a=(f,m)=>t.track({name:"page_view",...m?{eventId:m}:{},properties:{page_path:E(f??(typeof location>"u"?"/":location.href))}}),h=f=>{if(!t.getConsent().observability||!r||!e.observer||o.size>=32)return;let m=c(()=>e.observer.record(f)).finally(()=>{o.delete(m)});o.add(m)},d=()=>{if(!r)return;let f=location.pathname;f!==s&&(s=f,a())};function _(){if(r||typeof window>"u"||fe)return;fe=n,r=!0,d();for(let y of["pushState","replaceState"]){let $=history[y],z=function(...R){$.apply(this,R),d()};history[y]=z,u.push(()=>{history[y]===z&&(history[y]=$)})}window.addEventListener("popstate",d),u.push(()=>window.removeEventListener("popstate",d));let f=window.fetch;if(f){let y=async($,z)=>{if(!r)return f.call(window,$,z);let R=$ instanceof Request?$.url:String($),T;try{T=new URL(R,location.href)}catch{return f.call(window,$,z)}if(l(T)||!t.getConsent().observability)return f.call(window,$,z);let V=performance.now(),W=(z?.method??($ instanceof Request?$.method:"GET")).toUpperCase(),P=new Headers(z?.headers??($ instanceof Request?$.headers:void 0)),w=Oe(P.get("traceparent")),A=w?.traceId,I=w?.spanId;(e.traceOrigins??[]).includes(T.origin)&&!P.has("traceparent")&&(A=K().replaceAll("-","").slice(0,32),I=K().replaceAll("-","").slice(0,16),P.set("traceparent",`00-${A}-${I}-01`));let S={...A?{traceId:A}:{},...I?{spanId:I}:{}};try{let C=await f.call(window,$,{...z,headers:P});return h({kind:"request",route:E(T.href),method:W,status:C.status,durationMs:performance.now()-V,error:C.status>=400,...S}),C}catch(C){throw h({kind:"request",route:E(T.href),method:W,status:0,durationMs:performance.now()-V,error:!0,...S}),C}};window.fetch=y,u.push(()=>{window.fetch===y&&(window.fetch=f)})}let m=window.XMLHttpRequest?.prototype;if(m){let y=m.open,$=m.send,z=m.setRequestHeader,R=new WeakMap,T=function(P,w,A=!0,I,S){try{R.set(this,{url:new URL(String(w),location.href),method:P.toUpperCase(),trace:!1})}catch{R.delete(this)}return y.call(this,P,w,A,I,S)},V=function(P,w){let A=R.get(this);A&&P.toLowerCase()==="traceparent"&&(A.trace=!0,A.traceparent=w),z.call(this,P,w)},W=function(P){let w=R.get(this);if(!r)return $.call(this,P);if(!w||l(w.url)||!t.getConsent().observability)return $.call(this,P);let A=performance.now(),I=Oe(w.traceparent),S=I?.traceId,C=I?.spanId;(e.traceOrigins??[]).includes(w.url.origin)&&!w.trace&&(S=K().replaceAll("-","").slice(0,32),C=K().replaceAll("-","").slice(0,16),z.call(this,"traceparent",`00-${S}-${C}-01`));let De=()=>h({kind:"request",route:E(w.url.href),method:w.method,status:this.status,durationMs:performance.now()-A,error:this.status===0||this.status>=400,...S?{traceId:S}:{},...C?{spanId:C}:{}});this.addEventListener("loadend",De,{once:!0});try{return $.call(this,P)}catch(Lt){throw this.removeEventListener("loadend",De),Lt}};m.open=T,m.send=W,m.setRequestHeader=V,u.push(()=>{m.open===T&&(m.open=y),m.send===W&&(m.send=$),m.setRequestHeader===V&&(m.setRequestHeader=z)})}}function g(){fe===n&&(fe=void 0),r=!1,u.splice(0).reverse().forEach(f=>f())}let v=()=>{g();try{e.observer?.setConsent?.({analytics:!1,marketing:!1,observability:!1})}catch{}t.dispose();try{e.observer?.dispose?.()}catch{}},p=f=>{t.setConsent(f);try{e.observer?.setConsent?.(t.getConsent())}catch{}};try{e.observer?.setConsent?.(t.getConsent())}catch{}let x={...t,async flush(){await t.flush(),await Promise.all([...o]),e.observer?.flush&&await c(()=>e.observer.flush())},setConsent:p,page:a,start:_,stop:g,dispose:v};return e.autoTrack!==!1&&_(),x}function Ns(e,t){let r=e.ownerDocument,n=r.createElement("section");n.className="signalkit-connections",n.setAttribute("aria-label","SignalKit connections");let o=r.createElement("h2");o.textContent="Connections";let i=r.createElement("p");i.textContent="This SDK instance only. SDK send completion does not prove provider delivery or attribution. Counts reset when the instance restarts. Technical observers are not included.";let c=r.createElement("div");n.append(o,i,c),e.append(n);let s=()=>{c.replaceChildren();let l=t.getConnections();if(!l.length){let a=r.createElement("p");a.textContent="No event providers configured. Add providers to your SignalKit configuration.",c.append(a)}for(let a of l){let h=r.createElement("article"),d=r.createElement("h3");d.textContent=a.name;let _=r.createElement("p"),g={sent:"SDK send completed",denied:"Consent denied",failed:"Send failed",dropped:"Dropped (timeout, capacity or disposed)",invalid:"Invalid event"};_.textContent=a.disposed?"SDK disposed":a.consent?a.lastStatus?g[a.lastStatus]:"Configured \xB7 no outcomes yet":"Blocked by consent";let v=r.createElement("p");v.textContent=`${a.category} \xB7 ${a.attempts} outcomes \xB7 ${a.sent} completed \xB7 ${a.failed} failed \xB7 ${a.denied} denied \xB7 ${a.dropped} dropped \xB7 ${a.invalid} invalid`;let p=r.createElement("p");p.textContent=a.lastUpdated?`Last outcome: ${new Date(a.lastUpdated).toLocaleString()}`:"Waiting for a new event.",h.append(d,_,v,p),c.append(h)}};s();let u=t.subscribeConnections(s);return()=>{u(),n.remove()}}export{Ds as createBrowserSignals,br as createClarityProvider,xr as createGA4Provider,$r as createMetaPixelProvider,Ns as mountConnectionsDashboard};
|
|
1
|
+
function je(e,t){return typeof t=="bigint"?t.toString():t}var he=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Ne(e){return new he(e)}function Ue(e){return e==null}function Fe(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ne(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Be(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function ge(e){return Be(e._zod.def)??e._zod.def.shape}function Ke(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return ne(this,t,n),n},enumerable:!0,configurable:!0})}function Ve(e,t,r){t in e?ne(e,t,r):e[t]=r}function Ut(e,t,r,n){let o=ge(t);for(let i of r){let c=Object.getOwnPropertyDescriptor(o,i);c.enumerable&&(c.get?Ke(e,i,()=>{let s=t._zod.def.shape[i];return n?n(s,i):s}):Ve(e,i,n?n(c.value,i):c.value))}}function Ft(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?Ke(e,r,()=>t[r]):Ve(e,r,n.value))}}function We(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}var _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ge(e){if(re(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(re(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function q(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function P(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function qe(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Xe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function He(e,t){if(!Ge(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=ge(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return q(e,We(e._zod.def,{shape:Bt(e,t)}))}function Bt(e,t){let r={};return Ut(r,e,Reflect.ownKeys(ge(e))),Ft(r,t),r}function L(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Je(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function oe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function G(e){return typeof e=="string"?e:e?.message}function xe(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function ie(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function F(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:G(e.inst?._zod.def?.error?.(e))??G(i?.(e))??G(t?.error?.(e))??G(r.customError?.(e))??G(r.localeError?.(e))??"Invalid input",s={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(s[u]=e[u]);return s.path??(s.path=[]),s.message=c,t?.reportInput&&(s.input=e.input),s}var Kt=/[\uD800-\uDBFF]/;function ve(e){let t=e.length;if(!Kt.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function be(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ye(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Vt(e,r,n.value)}}function j(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function $e(e,t,r){return j(e,t,r,!1)}function Vt(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:j(this,t,r.bind(this))},set(n){j(this,t,n)}})}function Wt(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var me,D=!1,Gt={configurable:!0,get(){D=!0}};function X(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&me!==e._zod){me=void 0;return}me=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Gt);let o=D;D=!1;try{let i=r(this);return D?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),D=D||o,i}catch(i){throw delete this[t],D=D||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Qe(e,t,r,n){let o=Wt(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var et;var ye={value:void 0,enumerable:!1},tt="captureStackTrace"in Error?Error:null;function qt(e){let t=tt;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return tt=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function $(e,t,r,n){let o={};function i(m){this.def=m,this.constr=l,this.traits=new Set}i.prototype=o;let c=r,s=c&&new WeakSet;function u(m,_){if(m._zod){if(m._zod.traits.has(e))return}else{ye.value=new i(_);try{Object.defineProperty(m,"_zod",ye)}finally{ye.value=void 0}}if(m._zod.traits.add(e),t(m,_),s){let v=Object.getPrototypeOf(m),f=m._zod.constr.prototype,x=v;for(;x&&x!==f;)x=Object.getPrototypeOf(x);let d=x??v;s.has(d)||(s.add(d),Ye(d,c))}let g=l.prototype;for(let v in g)Object.prototype.hasOwnProperty.call(g,v)&&(v in m||(m[v]=g[v].bind(m)))}let a=n?.Parent??Object;class p extends a{}Object.defineProperty(p,"name",{value:e});function l(m){let _=n?.Parent?qt(p):this;u(_,m);let g=_._zod.deferred;if(g){for(let f of g)f();_._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;return v&&v(_),_}return Object.defineProperty(l,"init",{value:u}),Object.defineProperty(l,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}var M=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(et=globalThis).__zod_globalConfig??(et.__zod_globalConfig={});var H=globalThis.__zod_globalConfig;function B(e){return e&&Object.assign(H,e),H}function Xt(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,je,2)),e.message}function Ht(e){this._zod.message=e}var Jt={get:Xt,set:Ht,enumerable:!0,configurable:!0},we={value:void 0,enumerable:!1},rt=new WeakSet([Object.prototype,Error.prototype]),nt=(e,t)=>{e.name="$ZodError",we.value=t,Object.defineProperty(e,"issues",we),we.value=void 0,Object.defineProperty(e,"message",Jt);let r=Object.getPrototypeOf(e);rt.has(r)||(rt.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Cr=$("$ZodError",nt),J=$("$ZodError",nt,void 0,{Parent:Error});var Qt=e=>{let t=(r,n,o,i)=>{let c=o?{...o,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise)throw new M;if(s.issues.length){let u=new(i?.Err??e)(s.issues.map(a=>F(a,c,B())));throw _e(u,i?.callee??t),u}return s.value};return t},Ze=Qt(J),er=e=>{let t=async(r,n,o,i)=>{let c=o?{...o,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},c);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(i?.Err??e)(s.issues.map(a=>F(a,c,B())));throw _e(u,i?.callee??t),u}return s.value};return t},ke=er(J),tr=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new M;return i.issues.length?ot(e,i.issues,o):{success:!0,data:i.value}},Pe=tr(J);function ot(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>F(o,r,B()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var rr=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?ot(e,i.issues,o):{success:!0,data:i.value}},Ce=rr(J);var it=/^[\s\S]{0,}$/;var st=/^-?\d+(?:\.\d+)?$/;var O=$("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ut=e=>{let t=e.value;return!Ue(t)&&t.length!==void 0},se={number:"number",bigint:"bigint",object:"date"},at=$("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=se[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:se[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ae=$("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=se[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:se[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var lt=$("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Xe[t.format];e._zod.check=c=>{let s=c.value;if(r){if(!Number.isInteger(s)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?c.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<o&&c.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&c.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var pt=$("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=ut),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?ve(o):i)<=t.maximum)return;let s=be(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ft=$("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=ut),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?ve(o):i)>=t.minimum)return;let s=be(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var dt=$("$ZodCheckStringFormat",(e,t)=>{var r,n;O.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),mt=$("$ZodCheckRegex",(e,t)=>{dt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var gt={major:4,minor:6,patch:6};var U=$("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gt;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let c of i._zod.onattach)c(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,u,a)=>{if(s.memo)return s;let p=L(s),l;for(let m of u){if(m._zod.def.when){if(Je(s)||!m._zod.def.when(s))continue}else if(p)continue;let _=s.issues.length,g=m._zod.check(s);if(g instanceof Promise&&a?.async===!1)throw new M;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,s.issues.length!==_&&(ie(s.issues,_,e),p||(p=L(s,_)))});else{if(s.issues.length===_)continue;ie(s.issues,_,e),p||(p=L(s,_))}}return l?l.then(()=>s):s},c=(s,u,a)=>{if(L(s))return s.aborted=!0,s;let p=i(u,o,a);if(p instanceof Promise){if(a.async===!1)throw new M;return p.then(l=>e._zod.parse(l,a))}return e._zod.parse(p,a)};e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let p=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return p instanceof Promise?p.then(l=>c(l,s,u)):c(p,s,u)}let a=e._zod.parse(s,u);if(a instanceof Promise){if(u.async===!1)throw new M;return a.then(p=>i(p,o,u))}return i(a,o,u)}}},{get"~standard"(){return $e(this,"~standard",sr(this))},set"~standard"(e){j(this,"~standard",e)}}),vt=(e,t)=>e.issues.length?{issues:e.issues.map(r=>F(r,t,B()))}:{value:e.value};async function ir(e,t){let r={async:!0};return vt(await e._zod.run({value:t,issues:[]},r),r)}function sr(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return vt(n,r)}catch{}return ir(e,t)},vendor:"zod",version:1}}var bt=$("$ZodString",(e,t)=>{U.init(e,t),e._zod.pattern=t.pattern??it,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}});var Ee=$("$ZodNumber",(e,t)=>{U.init(e,t),e._zod.pattern=st,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),$t=$("$ZodNumberFormat",(e,t)=>{lt.init(e,t),Ee.init(e,t)});function cr(e,t){let r=xe(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,c)=>{let s=t(i.value);if(s>n&&!c?.skipChecks&&c?.direction!=="backward"){for(let[u,a]of xe(e._zod.def.checks))if(s>u&&a._zod.def.when(i)){let p=i.issues.length;return a._zod.check(i),i.issues[p].continue=!1,ie(i.issues,p,e),i}}return o(i,c)}}var ur=e=>Array.isArray(e)?e.length:-1;function _t(e,t,r){e.issues.length&&t.issues.push(...oe(r,e.issues)),t.value[r]=e.value}var yt=$("$ZodArray",(e,t)=>{U.init(e,t);let r=H.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let c=[],s=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],p=t.element._zod.run({value:a,issues:[]},o);if(p instanceof Promise)c.push(p.then(l=>_t(l,n,u)));else if(_t(p,n,u),s&&p.issues.length!==0&&L(p))break}return c.length?Promise.all(c).then(()=>n):n},cr(e,ur)});function ce(e,t,r,n,o,i){let c=r in n,s=i==="optional";if(!(!c&&s&&o==="optional")){if(e.issues.length){if(o!==void 0&&s&&!c)return;t.issues.push(...oe(r,e.issues))}if(!c&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(c||o==="defaulted"&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}var ar=[];function lr(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:ar,o=n.length?[...t,...n]:t;for(let c of o)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let i=qe(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function pr(e,t,r,n,o,i,c){let s=[],u=o.keySet,a=o.catchall._zod,p=a.def.type,l=a.optin,m=a.optout,_=0;for(let g in t){if(c&&r.issues.length!==_){if(L(r,_))break;_=r.issues.length}if(u.has(g))continue;if(g==="__proto__"){p==="never"&&s.push(g);continue}if(p==="never"){s.push(g);continue}let v=a.run({value:t[g],issues:[]},n);v instanceof Promise?e.push(v.then(f=>ce(f,r,g,t,l,m))):ce(v,r,g,t,l,m)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var zt=$("$ZodObject",(e,t)=>{U.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let p={...n};return Object.defineProperty(t,"shape",{value:p}),a.raw=p,p};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=Ne(()=>lr(t));X(e,"propValues",a=>{let p=a.def.shape,l={};for(let m in p){let _=p[m]._zod;if(_.values){Object.prototype.hasOwnProperty.call(l,m)||ne(l,m,new Set);for(let g of _.values)l[m].add(g);_.optin!==void 0&&l[m].add(void 0)}}return l});let i=re,c=t.catchall,s,u=H.memoizer;u?.attach(e),e._zod.parse=(a,p)=>{s??(s=o.value);let l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value=u?u.alloc(e,a,{},p):{};let m=[],_=s.shape,g=p?.abortEarly,v=a.issues.length;for(let f of s.allKeys){if(g&&a.issues.length!==v){if(L(a,v))break;v=a.issues.length}if(f==="__proto__")continue;let x=_[f],d=x._zod.optin,h=x._zod.optout,y=x._zod.run({value:l[f],issues:[]},p);y instanceof Promise?m.push(y.then(b=>ce(b,a,f,l,d,h))):ce(y,a,f,l,d,h)}return c?pr(m,l,a,p,o.value,e,g===!0):m.length?Promise.all(m).then(()=>a):a}});function xt(e,t){return e.value=t.issues.length?void 0:t.value,e}var wt=$("$ZodOptional",(e,t)=>{U.init(e,t),X(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",X(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),X(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Fe(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>xt(r,i)):xt(r,o)}return t.innerType._zod.run(r,n)}});function Zt(e){return e.checks&&(e.checks=[...e.checks]),e}function kt(e,t){return new e(Zt({type:"string",...P(t)}))}function Pt(e,t){return new e(Zt({type:"number",checks:[],...P(t)}))}function Ct(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...P(t)})}function ue(e,t){return new at({check:"less_than",...P(t),value:e,inclusive:!0})}function At(e,t){return new Ae({check:"greater_than",...P(t),value:e,inclusive:!1})}function Se(e,t){return new Ae({check:"greater_than",...P(t),value:e,inclusive:!0})}function Ie(e){return At(0,e)}function Me(e){return Se(0,e)}function Y(e,t){return new pt({check:"max_length",...P(t),maximum:e})}function Q(e,t){return new ft({check:"min_length",...P(t),minimum:e})}function Oe(e,t){return new mt({check:"string_format",format:"regex",...P(t),pattern:e})}var ee=$("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");U.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){j(this,"with",e)},parse(e,t){return Ze(this,e,t,{callee:this.parse})},parseAsync(e,t){return ke(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Pe(this,e,t)},safeParseAsync(e,t){return Ce(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0})},clone(e,t){return q(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),mr=$("ZodMiniString",(e,t)=>{bt.init(e,t),ee.init(e,t)});function ae(e){return kt(mr,e)}var Et=$("ZodMiniNumber",(e,t)=>{Ee.init(e,t),ee.init(e,t)});function St(e){return Pt(Et,e)}var hr=$("ZodMiniNumberFormat",(e,t)=>{$t.init(e,t),Et.init(e,t)});function It(e){return Ct(hr,e)}var gr=$("ZodMiniArray",(e,t)=>{yt.init(e,t),ee.init(e,t)});function Mt(e,t){return new gr({type:"array",element:e,...P(t)})}var _r=$("ZodMiniObject",(e,t)=>{zt.init(e,t),ee.init(e,t),Qe(e,"shape",r=>r._zod.def.shape,!1)});function le(e,t){let r={type:"object",shape:e??{},...P(t)};return new _r(r)}function Ot(e,t){return He(e,t)}var xr=$("ZodMiniOptional",(e,t)=>{wt.init(e,t),ee.init(e,t)});function te(e){return new xr({type:"optional",innerType:e})}var vr=Object.freeze({analytics:!1,marketing:!1,observability:!1}),fe=ae().check(Q(1),Y(128)),Tt=St().check(Me()),br=ae().check(Oe(/^[A-Z]{3}$/)),$r=le({item_id:fe,item_name:te(fe),price:te(Tt),quantity:te(It().check(Ie(),ue(1e5))),item_category:te(fe)}),pe=le({currency:br,value:Tt,items:Mt($r).check(Q(1),Y(100))}),Rt={page_view:le({page_path:ae().check(Q(1),Y(2048))}),product_view:pe,add_to_cart:pe,begin_checkout:pe,purchase:Ot(pe,{transaction_id:fe})};function Dt(e,t){let r=e;if(!r||typeof r!="object"||!Object.hasOwn(Rt,r.name)||!/^[\w.-]{1,128}$/.test(t))return;let n=r.timestamp??Date.now();if(!Number.isFinite(n)||n<0)return;let o=Rt[r.name].safeParse(r.properties);if(o.success){if(r.name==="page_view"){let i=o.data;if(!i.page_path.startsWith("/")||i.page_path.startsWith("//"))return;i.page_path=i.page_path.split(/[?#]/)[0]??"/"}return{name:r.name,eventId:t,timestamp:n,properties:o.data}}}function K(){return globalThis.crypto.randomUUID()}function E(e,t){try{return new URL(t??String(e),"http://signalkit.invalid").pathname.split("/").map(n=>{let o;try{o=decodeURIComponent(n)}catch{return":redacted"}return o.includes("@")||o.length>64?":redacted":n}).join("/").replace(/\/[0-9]+(?=\/|$)/g,"/:id").replace(/\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?=\/|$)/gi,"/:id").slice(0,2048)}catch{return"/"}}function Re(e){let t=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/.exec(e??"");if(!(!t||/^0+$/.test(t[1])||/^0+$/.test(t[2])))return{traceId:t[1],spanId:t[2],sampled:(Number.parseInt(t[3],16)&1)===1}}function Lt(e={}){let t=[...e.providers??[]];function r(f){return{analytics:f?.analytics===!0,marketing:f?.marketing===!0,observability:f?.observability===!0}}let n=r(e.consent),o=!1,i=t.map(f=>({name:f.name,category:f.category,consent:!1,disposed:!1,attempts:0,sent:0,failed:0,denied:0,dropped:0,invalid:0})),c=new Set,s=()=>{for(let f of c)try{f()}catch{}},u=new Set,a=new Map,p=Number.isFinite(e.timeoutMs)?Math.max(1,Math.min(e.timeoutMs,6e4)):5e3,l=Number.isFinite(e.maxPending)?Math.max(1,Math.min(Math.floor(e.maxPending),1e3)):100;function m(f){f.outcomes.forEach((x,d)=>{let h=i[d];h&&(h.attempts++,h[x.status]++,h.lastStatus=x.status,h.lastUpdated=Date.now())}),s();try{e.onDiagnostic?.(f)}catch{}return f}async function _(f,x){if(!n[f.category])return{provider:f.name,status:"denied",reason:"consent"};let d=new AbortController;a.set(d,f.category);let h;try{return await Promise.race([Promise.resolve().then(()=>{if(d.signal.aborted)throw new Error("aborted");return f.send(structuredClone(x),d.signal)}),new Promise((y,b)=>{d.signal.addEventListener("abort",()=>b(new Error("aborted")),{once:!0}),h=setTimeout(()=>{d.abort(),b(new Error("timeout"))},p)})]),{provider:f.name,status:d.signal.aborted?"dropped":"sent"}}catch{return{provider:f.name,status:d.signal.aborted?"dropped":"failed",reason:d.signal.aborted?"aborted_or_timeout":"provider_error"}}finally{h!==void 0&&clearTimeout(h),a.delete(d)}}function g(f){let x;try{x=f?.eventId}catch{}let d=typeof x=="string"&&/^[\w.-]{1,128}$/.test(x)?x:K(),h;try{h=x!==void 0&&x!==d?void 0:Dt(f,d)}catch{h=void 0}let y=h?o||u.size>=l?"dropped":void 0:"invalid";if(y)return Promise.resolve(m({eventId:d,outcomes:(t.length?t.map(z=>z.name):["core"]).map(z=>({provider:z,status:y,reason:y==="invalid"?"event_schema":"capacity_or_disposed"}))}));let b=Promise.all(t.map(z=>_(z,h))).then(z=>m({eventId:d,outcomes:z}));return u.add(b),b.finally(()=>u.delete(b)),b}function v(f){n=r(f);for(let x of i)x.consent=n[x.category];s();for(let[x,d]of a)n[d]||x.abort();for(let x of t)try{x.setConsent?.({...n})}catch{}}return v(n),{track:g,setConsent:v,getConsent:()=>({...n}),getConnections:()=>i.map(f=>({...f})),subscribeConnections(f){return c.add(f),()=>{c.delete(f)}},flush:async()=>{await Promise.all([...u])},dispose:()=>{o=!0;for(let f of i)f.disposed=!0;s(),u.size?Promise.all([...u]).then(()=>c.clear()):c.clear();for(let f of a.keys())f.abort();for(let f of t)try{f.dispose?.()}catch{}}}}var Z=()=>window;function Te(e,t){let r,n;return{load(o){return r||(r=new Promise((i,c)=>{if(typeof document>"u")return c(new Error("Browser provider requires a document"));n=document.createElement("script"),n.async=!0,n.src=e,t.nonce&&(n.nonce=t.nonce);let s=setTimeout(()=>a(new Error("Provider script timed out")),t.timeoutMs??4e3),u=()=>a(new Error("Provider script aborted"));function a(p){clearTimeout(s),o?.removeEventListener("abort",u),n&&(n.onload=null,n.onerror=null),p?(n?.remove(),r=void 0,c(p)):i()}if(n.onload=()=>a(),n.onerror=()=>a(new Error("Provider script blocked")),o?.aborted)return u();o?.addEventListener("abort",u,{once:!0}),document.head.appendChild(n)}),r)},dispose(){n?.remove(),n=void 0,r=void 0}}}function De(e,t,r){if(!t.test(e))throw new Error(`Invalid ${r}`)}function yr(e){De(e.measurementId,/^G-[A-Z0-9]+$/,"GA4 measurement ID");let t=Te(`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e.measurementId)}`,e),r=!1,n=()=>{let o=Z();o.dataLayer??=[],o.gtag??=function(...i){o.dataLayer?.push(i)},r||(o.gtag("consent","default",{analytics_storage:"denied",ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied"}),o.gtag("js",new Date),o.gtag("config",e.measurementId,{send_page_view:!1,page_location:location.origin+E(location.href),page_referrer:document.referrer?E(document.referrer):""}),r=!0)};return{name:"ga4",category:"analytics",async send(o,i){if(n(),await t.load(i),i?.aborted)throw new Error("Dispatch aborted");Z().gtag?.("consent","update",{analytics_storage:"granted"}),Z().gtag?.("event",o.name==="product_view"?"view_item":o.name,{...o.properties,page_location:location.origin+E(location.href),page_referrer:document.referrer?E(document.referrer):"",event_id:o.eventId,send_to:e.measurementId})},setConsent(o){r&&Z().gtag?.("consent","update",{analytics_storage:o.analytics?"granted":"denied"})},dispose(){r&&Z().gtag?.("consent","update",{analytics_storage:"denied"}),t.dispose()}}}var zr={page_view:"PageView",product_view:"ViewContent",add_to_cart:"AddToCart",begin_checkout:"InitiateCheckout",purchase:"Purchase"};function wr(e){De(e.pixelId,/^\d+$/,"Meta pixel ID");let t=Te("https://connect.facebook.net/en_US/fbevents.js",e),r=!1,n=()=>{let o=Z();if(!o.fbq){let i=(...c)=>{i.callMethod?i.callMethod(...c):i.queue?.push(c)};i.queue=[],i.loaded=!0,i.version="2.0",i.push=i,o.fbq=i}r||(o.fbq("set","autoConfig",!1,e.pixelId),o.fbq("init",e.pixelId),r=!0)};return{name:"meta-pixel",category:"marketing",async send(o,i){if(n(),await t.load(i),i?.aborted)throw new Error("Dispatch aborted");let c=o.properties.items,s={...o.properties.currency?{currency:o.properties.currency}:{},...typeof o.properties.value=="number"?{value:o.properties.value}:{},...c?{content_type:"product",content_ids:c.map(u=>u.item_id),contents:c.map(u=>({id:u.item_id,quantity:u.quantity??1,item_price:u.price}))}:{}};Z().fbq?.("consent","grant"),Z().fbq?.("trackSingle",e.pixelId,zr[o.name],s,{eventID:o.eventId})},setConsent(o){r&&Z().fbq?.("consent",o.marketing?"grant":"revoke")},dispose(){r&&Z().fbq?.("consent","revoke"),t.dispose()}}}function Zr(e){De(e.projectId,/^[a-z0-9]+$/i,"Clarity project ID");let t=Te(`https://www.clarity.ms/tag/${encodeURIComponent(e.projectId)}`,e),r=!1;return{name:"clarity",category:"analytics",async send(n,o){if(!r){let i=Z();if(!i.clarity){let c=[],s=(...u)=>{c.push(u)};Object.assign(s,{q:c}),i.clarity=s}r=!0}if(await t.load(o),o?.aborted)throw new Error("Dispatch aborted");Z().clarity?.("consentv2",{analytics_Storage:"granted",ad_Storage:"denied"}),n.name!=="page_view"&&Z().clarity?.("event",n.name)},setConsent(n){r&&Z().clarity?.("consentv2",{analytics_Storage:n.analytics?"granted":"denied",ad_Storage:"denied"})},dispose(){r&&Z().clarity?.("consentv2",{analytics_Storage:"denied",ad_Storage:"denied"}),t.dispose()}}}var de;function Us(e={}){let t=Lt(e),r=!1,n={},o=new Set,i=Number.isFinite(e.timeoutMs)?Math.max(1,Math.min(3e4,e.timeoutMs)):2e3;async function c(d){let h;try{await Promise.race([Promise.resolve(d()),new Promise(y=>{h=setTimeout(y,i)})])}catch{}finally{h!==void 0&&clearTimeout(h)}}let s="",u=[],a=d=>["googletagmanager.com","google-analytics.com","facebook.net","facebook.com","clarity.ms"].some(h=>d.hostname===h||d.hostname.endsWith("."+h))||(e.excludeUrls??[]).some(h=>d.href.startsWith(h)||d.pathname.startsWith(h)),p=(d,h)=>t.track({name:"page_view",...h?{eventId:h}:{},properties:{page_path:E(d??(typeof location>"u"?"/":location.href))}}),l=d=>{if(!t.getConsent().observability||!r||!e.observer||o.size>=32)return;let h=c(()=>e.observer.record(d)).finally(()=>{o.delete(h)});o.add(h)},m=()=>{if(!r)return;let d=location.pathname;d!==s&&(s=d,p())};function _(){if(r||typeof window>"u"||de)return;de=n,r=!0,m();for(let y of["pushState","replaceState"]){let b=history[y],z=function(...R){b.apply(this,R),m()};history[y]=z,u.push(()=>{history[y]===z&&(history[y]=b)})}window.addEventListener("popstate",m),u.push(()=>window.removeEventListener("popstate",m));let d=window.fetch;if(d){let y=async(b,z)=>{if(!r)return d.call(window,b,z);let R=b instanceof Request?b.url:String(b),T;try{T=new URL(R,location.href)}catch{return d.call(window,b,z)}if(a(T)||!t.getConsent().observability)return d.call(window,b,z);let V=performance.now(),W=(z?.method??(b instanceof Request?b.method:"GET")).toUpperCase(),k=new Headers(z?.headers??(b instanceof Request?b.headers:void 0)),w=Re(k.get("traceparent")),C=w?.traceId,S=w?.spanId;(e.traceOrigins??[]).includes(T.origin)&&!k.has("traceparent")&&(C=K().replaceAll("-","").slice(0,32),S=K().replaceAll("-","").slice(0,16),k.set("traceparent",`00-${C}-${S}-01`));let I={...C?{traceId:C}:{},...S?{spanId:S}:{}};try{let A=await d.call(window,b,{...z,headers:k});return l({kind:"request",route:E(T.href),method:W,status:A.status,durationMs:performance.now()-V,error:A.status>=400,...I}),A}catch(A){throw l({kind:"request",route:E(T.href),method:W,status:0,durationMs:performance.now()-V,error:!0,...I}),A}};window.fetch=y,u.push(()=>{window.fetch===y&&(window.fetch=d)})}let h=window.XMLHttpRequest?.prototype;if(h){let y=h.open,b=h.send,z=h.setRequestHeader,R=new WeakMap,T=function(k,w,C=!0,S,I){try{R.set(this,{url:new URL(String(w),location.href),method:k.toUpperCase(),trace:!1})}catch{R.delete(this)}return y.call(this,k,w,C,S,I)},V=function(k,w){let C=R.get(this);C&&k.toLowerCase()==="traceparent"&&(C.trace=!0,C.traceparent=w),z.call(this,k,w)},W=function(k){let w=R.get(this);if(!r)return b.call(this,k);if(!w||a(w.url)||!t.getConsent().observability)return b.call(this,k);let C=performance.now(),S=Re(w.traceparent),I=S?.traceId,A=S?.spanId;(e.traceOrigins??[]).includes(w.url.origin)&&!w.trace&&(I=K().replaceAll("-","").slice(0,32),A=K().replaceAll("-","").slice(0,16),z.call(this,"traceparent",`00-${I}-${A}-01`));let Le=()=>l({kind:"request",route:E(w.url.href),method:w.method,status:this.status,durationMs:performance.now()-C,error:this.status===0||this.status>=400,...I?{traceId:I}:{},...A?{spanId:A}:{}});this.addEventListener("loadend",Le,{once:!0});try{return b.call(this,k)}catch(Nt){throw this.removeEventListener("loadend",Le),Nt}};h.open=T,h.send=W,h.setRequestHeader=V,u.push(()=>{h.open===T&&(h.open=y),h.send===W&&(h.send=b),h.setRequestHeader===V&&(h.setRequestHeader=z)})}}function g(){de===n&&(de=void 0),r=!1,u.splice(0).reverse().forEach(d=>d())}let v=()=>{g();try{e.observer?.setConsent?.({analytics:!1,marketing:!1,observability:!1})}catch{}t.dispose();try{e.observer?.dispose?.()}catch{}},f=d=>{t.setConsent(d);try{e.observer?.setConsent?.(t.getConsent())}catch{}};try{e.observer?.setConsent?.(t.getConsent())}catch{}let x={...t,async flush(){await t.flush(),await Promise.all([...o]),e.observer?.flush&&await c(()=>e.observer.flush())},setConsent:f,page:p,start:_,stop:g,dispose:v};return e.autoTrack!==!1&&_(),x}var jt={sentry:{label:"Sentry",setup:"Connect a host-owned Sentry client for request failures and sanitized exception summaries."},grafana:{label:"Grafana",setup:"Set the full OTLP traces endpoint and authentication headers on the server. Local Tempo and Grafana Cloud use the same exporter."},signoz:{label:"SigNoz",setup:"Set the full OTLP traces endpoint and any required authentication headers on the server. Local and cloud deployments use the same exporter."},otlp:{label:"OpenTelemetry",setup:"Set the full OTLP traces endpoint and any required authentication headers on the server."}};function Ks(e,t,r={}){let n=e.ownerDocument,o=n.createElement("section");o.className="signalkit-connections",o.setAttribute("aria-label","SignalKit connections");let i=n.createElement("h2");i.textContent="Connections";let c=n.createElement("p");c.textContent="This SDK instance only. SDK send completion does not prove provider delivery or attribution. Counts reset when the instance restarts. Observability configuration is shown separately when supplied by the host.";let s=n.createElement("section");if(s.setAttribute("aria-label","Event provider connections"),o.append(i,c,s),r.observability){let p=n.createElement("section");p.setAttribute("aria-label","Observability connections");let l=n.createElement("h2");l.textContent="Observability";let m=n.createElement("p");m.textContent="Host-declared configuration only. No connection checks or delivery verification are performed. Server consent and policy remain host-owned.",p.append(l,m);let _=new Set;for(let g of r.observability.slice(0,4)){if(!g||!Object.hasOwn(jt,g.backend)||_.has(g.backend))continue;_.add(g.backend);let v=jt[g.backend],f=n.createElement("article"),x=n.createElement("h3");x.textContent=v.label;let d=n.createElement("p");d.textContent=g.configured!==!0?"Not configured":g.enabled===!1?"Configured \xB7 blocked by host policy \xB7 delivery unverified":"Configured \xB7 delivery unverified";let h=n.createElement("p");h.textContent=g.hosting==="local"?"Local deployment":g.hosting==="cloud"?"Cloud deployment":"Hosting selected by the host";let y=n.createElement("p");y.textContent=v.setup,f.append(x,d,h,y),p.append(f)}o.append(p)}e.append(o);let u=()=>{s.replaceChildren();let p=t.getConnections();if(!p.length){let l=n.createElement("p");l.textContent="No event providers configured. Add providers to your SignalKit configuration.",s.append(l)}for(let l of p){let m=n.createElement("article"),_=n.createElement("h3");_.textContent=l.name;let g=n.createElement("p"),v={sent:"SDK send completed",denied:"Consent denied",failed:"Send failed",dropped:"Dropped (timeout, capacity or disposed)",invalid:"Invalid event"};g.textContent=l.disposed?"SDK disposed":l.consent?l.lastStatus?v[l.lastStatus]:"Configured \xB7 no outcomes yet":"Blocked by consent";let f=n.createElement("p");f.textContent=`${l.category} \xB7 ${l.attempts} outcomes \xB7 ${l.sent} completed \xB7 ${l.failed} failed \xB7 ${l.denied} denied \xB7 ${l.dropped} dropped \xB7 ${l.invalid} invalid`;let x=n.createElement("p");x.textContent=l.lastUpdated?`Last outcome: ${new Date(l.lastUpdated).toLocaleString()}`:"Waiting for a new event.",m.append(_,g,f,x),s.append(m)}};u();let a=t.subscribeConnections(u);return()=>{a(),o.remove()}}export{Us as createBrowserSignals,Zr as createClarityProvider,yr as createGA4Provider,wr as createMetaPixelProvider,Ks as mountConnectionsDashboard};
|
package/dist/dashboard.d.ts
CHANGED
|
@@ -3,6 +3,16 @@ export type ConnectionSource = {
|
|
|
3
3
|
getConnections(): ConnectionStatus[];
|
|
4
4
|
subscribeConnections(listener: () => void): () => void;
|
|
5
5
|
};
|
|
6
|
+
export type ObservabilityConnection = {
|
|
7
|
+
backend: 'sentry' | 'grafana' | 'signoz' | 'otlp';
|
|
8
|
+
configured: boolean;
|
|
9
|
+
hosting?: 'local' | 'cloud';
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type ConnectionsDashboardOptions = {
|
|
13
|
+
/** Static host-declared metadata only; never pass endpoints, headers or SDK clients. */
|
|
14
|
+
observability?: readonly ObservabilityConnection[];
|
|
15
|
+
};
|
|
6
16
|
/** Mount in an authenticated host page. No network requests, payloads, or credentials. */
|
|
7
|
-
export declare function mountConnectionsDashboard(element: HTMLElement, source: ConnectionSource): () => void;
|
|
17
|
+
export declare function mountConnectionsDashboard(element: HTMLElement, source: ConnectionSource, options?: ConnectionsDashboardOptions): () => void;
|
|
8
18
|
//# sourceMappingURL=dashboard.d.ts.map
|
package/dist/dashboard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,IAAI,gBAAgB,EAAE,CAAC;IACrC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CACxD,CAAC;AAEF,0FAA0F;AAC1F,wBAAgB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,IAAI,gBAAgB,EAAE,CAAC;IACrC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG;IACxC,wFAAwF;IACxF,aAAa,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACpD,CAAC;AAwBF,0FAA0F;AAC1F,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,2BAAgC,cAsG1C"}
|
package/dist/dashboard.js
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
|
+
const observabilityCatalog = {
|
|
2
|
+
sentry: {
|
|
3
|
+
label: 'Sentry',
|
|
4
|
+
setup: 'Connect a host-owned Sentry client for request failures and sanitized exception summaries.',
|
|
5
|
+
},
|
|
6
|
+
grafana: {
|
|
7
|
+
label: 'Grafana',
|
|
8
|
+
setup: 'Set the full OTLP traces endpoint and authentication headers on the server. Local Tempo and Grafana Cloud use the same exporter.',
|
|
9
|
+
},
|
|
10
|
+
signoz: {
|
|
11
|
+
label: 'SigNoz',
|
|
12
|
+
setup: 'Set the full OTLP traces endpoint and any required authentication headers on the server. Local and cloud deployments use the same exporter.',
|
|
13
|
+
},
|
|
14
|
+
otlp: {
|
|
15
|
+
label: 'OpenTelemetry',
|
|
16
|
+
setup: 'Set the full OTLP traces endpoint and any required authentication headers on the server.',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
1
19
|
/** Mount in an authenticated host page. No network requests, payloads, or credentials. */
|
|
2
|
-
export function mountConnectionsDashboard(element, source) {
|
|
20
|
+
export function mountConnectionsDashboard(element, source, options = {}) {
|
|
3
21
|
const document = element.ownerDocument;
|
|
4
22
|
const root = document.createElement('section');
|
|
5
23
|
root.className = 'signalkit-connections';
|
|
@@ -8,9 +26,51 @@ export function mountConnectionsDashboard(element, source) {
|
|
|
8
26
|
heading.textContent = 'Connections';
|
|
9
27
|
const note = document.createElement('p');
|
|
10
28
|
note.textContent =
|
|
11
|
-
'This SDK instance only. SDK send completion does not prove provider delivery or attribution. Counts reset when the instance restarts.
|
|
12
|
-
const list = document.createElement('
|
|
29
|
+
'This SDK instance only. SDK send completion does not prove provider delivery or attribution. Counts reset when the instance restarts. Observability configuration is shown separately when supplied by the host.';
|
|
30
|
+
const list = document.createElement('section');
|
|
31
|
+
list.setAttribute('aria-label', 'Event provider connections');
|
|
13
32
|
root.append(heading, note, list);
|
|
33
|
+
if (options.observability) {
|
|
34
|
+
const section = document.createElement('section');
|
|
35
|
+
section.setAttribute('aria-label', 'Observability connections');
|
|
36
|
+
const title = document.createElement('h2');
|
|
37
|
+
title.textContent = 'Observability';
|
|
38
|
+
const explanation = document.createElement('p');
|
|
39
|
+
explanation.textContent =
|
|
40
|
+
'Host-declared configuration only. No connection checks or delivery verification are performed. Server consent and policy remain host-owned.';
|
|
41
|
+
section.append(title, explanation);
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
for (const connection of options.observability.slice(0, 4)) {
|
|
44
|
+
if (!connection ||
|
|
45
|
+
!Object.hasOwn(observabilityCatalog, connection.backend) ||
|
|
46
|
+
seen.has(connection.backend))
|
|
47
|
+
continue;
|
|
48
|
+
seen.add(connection.backend);
|
|
49
|
+
const backend = observabilityCatalog[connection.backend];
|
|
50
|
+
const card = document.createElement('article');
|
|
51
|
+
const name = document.createElement('h3');
|
|
52
|
+
name.textContent = backend.label;
|
|
53
|
+
const status = document.createElement('p');
|
|
54
|
+
status.textContent =
|
|
55
|
+
connection.configured !== true
|
|
56
|
+
? 'Not configured'
|
|
57
|
+
: connection.enabled === false
|
|
58
|
+
? 'Configured · blocked by host policy · delivery unverified'
|
|
59
|
+
: 'Configured · delivery unverified';
|
|
60
|
+
const hosting = document.createElement('p');
|
|
61
|
+
hosting.textContent =
|
|
62
|
+
connection.hosting === 'local'
|
|
63
|
+
? 'Local deployment'
|
|
64
|
+
: connection.hosting === 'cloud'
|
|
65
|
+
? 'Cloud deployment'
|
|
66
|
+
: 'Hosting selected by the host';
|
|
67
|
+
const setup = document.createElement('p');
|
|
68
|
+
setup.textContent = backend.setup;
|
|
69
|
+
card.append(name, status, hosting, setup);
|
|
70
|
+
section.append(card);
|
|
71
|
+
}
|
|
72
|
+
root.append(section);
|
|
73
|
+
}
|
|
14
74
|
element.append(root);
|
|
15
75
|
const render = () => {
|
|
16
76
|
list.replaceChildren();
|
package/dist/dashboard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techinject/browser",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@techinject/core": "0.1.0-alpha.
|
|
23
|
-
"@techinject/contracts": "0.1.0-alpha.
|
|
22
|
+
"@techinject/core": "0.1.0-alpha.3",
|
|
23
|
+
"@techinject/contracts": "0.1.0-alpha.3"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|