PageSourceSearch

https://openstory.so/assets/logger-CGBZgzx8.js

js openstory.so collected 2026-10-09 22:55:51 UTC 52,326 bytes, 19 lines download raw bytes

1import{n as e}from"./rolldown-runtime-hePW80VL.js";import"./errors-DF0pzPR8.js";function t(e){return typeof e==`function`?e:n(e)}function n(e){if(e==null)return()=>!1;if(e===`fatal`)return e=>e.level===`fatal`;if(e===`error`)return e=>e.level===`fatal`||e.level===`error`;if(e===`warning`)return e=>e.level===`fatal`||e.level===`error`||e.level===`warning`;if(e===`info`)return e=>e.level===`fatal`||e.level===`error`||e.level===`warning`||e.level===`info`;if(e===`debug`)return e=>e.level===`fatal`||e.level===`error`||e.level===`warning`||e.level===`info`||e.level===`debug`;if(e===`trace`)return()=>!0;throw TypeError(`Invalid log level: ${e}.`)}var r=[`trace`,`debug`,`info`,`warning`,`error`,`fatal`];function i(){return[...r]}function a(e,t){let n=r.indexOf(e);if(n<0)throw TypeError(`Invalid log level: ${JSON.stringify(e)}.`);let i=r.indexOf(t);if(i<0)throw TypeError(`Invalid log level: ${JSON.stringify(t)}.`);return n-i}var o=Symbol.for(`logtape.scopedConfig`),s={filters:[],lowestLevel:`trace`,parentSinks:`inherit`,sinks:[]},c=[];function l(e){let t=e?.getStore()?.[o];return f(t)?p(t):void 0}function u(e,t,n){return h(e,t,n).kind!==`none`}function d(e,t,n,r){let i=h(e,t.category,t.level);if(i.kind!==`none`&&_(e,t.category,t)){if(i.kind===`one`){n?.has(i.sink)||r(i.sink,n);return}for(let e of i.sinks)n?.has(e)||r(e,n)}}function f(e){return typeof e==`object`&&!!e&&`nodes`in e}function p(e){let t=e;for(;t?.disposed;)t=t.parent;return t}function m(e){return JSON.stringify(e)}function h(e,t,n){let r=`${m(t)}:${n}`,i=e.dispatchCache.get(r);return i??(i=g(e,t,t.length,n),e.dispatchCache.set(r,i)),i}function g(e,t,n,r){let i=t.slice(0,n),o=e.nodes.get(m(i))??s;if(o.lowestLevel===null||a(r,o.lowestLevel)<0)return{kind:`none`};let c=n>0&&o.parentSinks===`inherit`?g(e,t,n-1,r):{kind:`none`},l,u,d=e=>{u==null?l==null?l=e:u=[l,e]:u.push(e)};if(c.kind===`one`)d(c.sink);else if(c.kind===`many`)for(let e of c.sinks)d(e);for(let e of o.sinks)d(e);return u==null?l==null?{kind:`none`}:{kind:`one`,sink:l}:{kind:`many`,sinks:u}}function _(e,t,n){let r=m(t),i=e.filterCache.get(r);return i??(i=v(e,t),e.filterCache.set(r,i)),i.every(e=>e(n))}function v(e,t){for(let n=t.length;n>=0;n--){let r=e.nodes.get(m(t.slice(0,n)));if(!(r==null||r.filters.length<1))return r.filters}return c}var ee=Symbol.for(`logtape.lazy`),y=Symbol.for(`LogTape.throttlingSummaryRecord`),te=Symbol.for(`LogTape.sinkSnapshotPolicy.immediate`),b=new WeakSet,x=new WeakSet;function S(e){return typeof e==`object`&&!!e&&ee in e&&e[ee]===!0}function C(e){let t={};for(let n in e){let r=e[n];t[n]=S(r)?r.getter():r}let n=e,r=t;if(Object.prototype.propertyIsEnumerable.call(e,y)){let e=n[y];r[y]=S(e)?e.getter():e}return t}function w(e){return e instanceof Promise||Object.prototype.toString.call(e)===`[object Promise]`&&typeof e.then==`function`}function T(e,t,n,r){if(typeof r!=`function`){let i=r??{};e.log(t,n,i);return}if(!e.isEnabledFor(t))return Promise.resolve();let i=r();if(w(i))return Promise.resolve(i).then(r=>{e.log(t,n,r)});e.log(t,n,i)}function E(e){if(x.has(e))return e;let t=C(e.properties);if(b.has(e))return{category:e.category,level:e.level,get message(){return e.message},rawMessage:e.rawMessage,timestamp:e.timestamp,properties:t};let n=Object.getOwnPropertyDescriptors(e);return n.properties={value:t,enumerable:!0,configurable:!0},Object.defineProperties({},n)}function D(e){return typeof e!=`object`||!e?!1:Object.keys(e).length>0||Object.prototype.propertyIsEnumerable.call(e,y)}function O(e){return e[te]!==!0}function k(e=[]){return M.getLogger(e)}var A=Symbol.for(`logtape.rootLogger`);function j(e){return e.length>=2&&e[0]===`logtape`&&e[1]===`meta`}var M=class e{parent;children;category;sinks;filters;contextLocalStorage;#e=`inherit`;#t=`trace`;#n={};static getLogger(t=[]){let n=A in globalThis?globalThis[A]??null:null;return n??(n=new e(null,[]),globalThis[A]=n),typeof t==`string`?n.getChild(t):t.length===0?n:n.getChild(t)}static getNearestExistingLogger(t){let n=e.getLogger();for(let r of t){let t=n.children[r],i=t instanceof e?t:t?.deref();if(i==null)break;n=i}return n}constructor(e,t){this.parent=e,this.children={},this.category=t,this.sinks=[],this.filters=[]}get parentSinks(){return this.#e}set parentSinks(e){this.#e!==e&&(this.#e=e)}get lowestLevel(){return this.#t}set lowestLevel(e){this.#t!==e&&(this.#t=e)}getChild(t){let n=typeof t==`string`?t:t[0],r=this.children[n],i=r instanceof e?r:r?.deref();return i??(i=new e(this,[...this.category,n]),this.children[n]=`WeakRef`in globalThis?new WeakRef(i):i),typeof t==`string`||t.length===1?i:i.getChild(t.slice(1))}reset(){for(;this.sinks.length>0;)this.sinks.shift();for(this.parentSinks=`inherit`;this.filters.length>0;)this.filters.shift();this.lowestLevel=`trace`}
1resetDescendants(){for(let t of Object.values(this.children))(t instanceof e?t:t.deref())?.resetDescendants();this.reset()}with(e){return new ne(this,{...e})}filter(e){for(let t of this.filters)if(!t(e))return!1;return this.filters.length<1?this.parent?.filter(e)??!0:!0}*getSinks(e){let t=this.getSinkDispatchPlan(e);switch(t.kind){case`none`:return;case`one`:yield t.sink;return;case`many`:yield*t.sinks;return}}getSinkDispatchPlan(e){let t=this.#n[e];if(t!=null&&this.isSinkDispatchPlanFresh(e,t))return t;let n=this.parent!=null&&this.parentSinks===`inherit`?this.parent.getSinkDispatchPlan(e):void 0,r=this.createSinkDispatchPlan(e,n);return this.#n[e]=r,r}isSinkDispatchPlanFresh(e,t){if(t.lowestLevel!==this.lowestLevel||t.parentSinks!==this.parentSinks||t.localSinks.length!==this.sinks.length)return!1;for(let e=0;e<t.localSinks.length;e++)if(t.localSinks[e]!==this.sinks[e])return!1;let n=this.parent!=null&&this.parentSinks===`inherit`?this.parent.getSinkDispatchPlan(e):void 0;return t.parentPlan===n}createSinkDispatchPlan(e,t){let n={localSinks:[...this.sinks],parentSinks:this.parentSinks,lowestLevel:this.lowestLevel,parentPlan:t};if(n.lowestLevel===null||a(e,n.lowestLevel)<0)return{...n,kind:`none`};let r,i,o=e=>{i==null?r==null?r=e:i=[r,e]:i.push(e)};t!=null&&(t.kind===`one`?r=t.sink:t.kind===`many`&&(i=[...t.sinks]));for(let e of n.localSinks)o(e);return i==null?r==null?{...n,kind:`none`}:{...n,kind:`one`,sink:r}:{...n,kind:`many`,sinks:i}}isEnabledFor(t){let n=j(this.category)?[]:de(),r=l(e.getLogger().contextLocalStorage);return r==null?this.getDispatcher(n).isEnabledForResolved(t):u(r,n.length>0?[...n,...this.category]:this.category,t)}isCertainlyDropped(t){let n=j(this.category)?[]:de(),r=l(e.getLogger().contextLocalStorage);if(r!=null)return!u(r,n.length>0?[...n,...this.category]:this.category,t);let i=this.getDispatcher(n);return i.lowestLevel===null||a(t,i.lowestLevel)<0||!i.hasEffectiveFilters()&&!i.isEnabledForResolved(t)}getDispatcher(t){return t.length>0?e.getNearestExistingLogger([...t,...this.category]):this}hasEffectiveFilters(){return this.filters.length>0?!0:this.parent?.hasEffectiveFilters()??!1}isEnabledForResolved(e){return this.lowestLevel===null||a(e,this.lowestLevel)<0?!1:this.sinks.length>0||this.parent!=null&&this.parentSinks===`inherit`&&this.parent.isEnabledForResolved(e)}emit(t,n){let r=`category`in t?t.category:this.category,i=j(r)?[]:de(),a=i.length>0?[...i,...r]:r;if(i.length<1&&Object.prototype.hasOwnProperty.call(t,`category`)){this.emitResolved(t,n);return}let o=Object.getOwnPropertyDescriptors(t);o.category={value:a,enumerable:!0,configurable:!0};let s=Object.defineProperties({},o);(i.length>0?e.getNearestExistingLogger(a):this).emitResolved(s,n)}emitResolved(t,n){let r=l(e.getLogger().contextLocalStorage);if(r!=null){let e,i=!1;d(r,t,n,(n,r)=>{try{if(O(n))try{e??=E(t)}catch{i=!0,e=t}n(e??t)}catch(e){let i=new Set(r);i.add(n),N.log(`fatal`,`Failed to emit a log record to sink {sink}: {error}`,{sink:n,error:e,record:t},i)}i&&(e=t)});return}if(this.lowestLevel===null||a(t.level,this.lowestLevel)<0||!this.filter(t))return;let i=this.getSinkDispatchPlan(t.level);if(i.kind===`none`)return;let o,s=!1;if(i.kind===`one`){let e=i.sink;if(n?.has(e))return;try{if(O(e))try{o=E(t)}catch{s=!0,o=t}e(o??t)}catch(r){let i=new Set(n);i.add(e),N.log(`fatal`,`Failed to emit a log record to sink {sink}: {error}`,{sink:e,error:r,record:t},i)}return}for(let e of i.sinks)if(!n?.has(e))try{if(o==null&&!s&&O(e))try{o=E(t)}catch{s=!0,o=t}e(o??t)}catch(r){let i=new Set(n);i.add(e),N.log(`fatal`,`Failed to emit a log record to sink {sink}: {error}`,{sink:e,error:r,record:t},i)}}log(e,t,n,r){if(this.isCertainlyDropped(e))return;let i=fe();if(typeof n!=`function`&&i==null&&!t.includes(`{`)&&!D(n)){let n={category:this.category,level:e,message:[t],rawMessage:t,timestamp:Date.now(),properties:{}};x.add(n),this.emit(n,r);return}let a,o,s=typeof n==`function`?{category:this.category,level:e,timestamp:Date.now(),get message(){return o??=ce(t,this.properties),o},rawMessage:t,get properties(){return a??=C({...i??{},...n()}),a}}:{category:this.category,level:e,timestamp:Date.now(),get message(){return o??=ce(t,this.properties),o},rawMessage:t,get properties(){return a??=C({...i??{},...n}),a}};
1b.add(s),this.emit(s,r)}logLazily(e,t,n={}){if(this.isCertainlyDropped(e))return;let r=fe(),i,a;function o(){if((a==null||i==null)&&(a=t((e,...t)=>(i=e,le(e,t))),i==null))throw TypeError(`No log record was made.`);return[a,i]}this.emit({category:this.category,level:e,get message(){return o()[0]},get rawMessage(){return o()[1]},timestamp:Date.now(),properties:{...r??{},...n}})}logTemplate(e,t,n,r={}){if(this.isCertainlyDropped(e))return;let i=fe();this.emit({category:this.category,level:e,message:le(t,n),rawMessage:t,timestamp:Date.now(),properties:{...i??{},...r}})}trace(e,...t){if(typeof e==`string`)return T(this,`trace`,e,t[0]);typeof e==`function`?this.logLazily(`trace`,e):Array.isArray(e)?this.logTemplate(`trace`,e,t):this.log(`trace`,`{*}`,e)}debug(e,...t){if(typeof e==`string`)return T(this,`debug`,e,t[0]);typeof e==`function`?this.logLazily(`debug`,e):Array.isArray(e)?this.logTemplate(`debug`,e,t):this.log(`debug`,`{*}`,e)}info(e,...t){if(typeof e==`string`)return T(this,`info`,e,t[0]);typeof e==`function`?this.logLazily(`info`,e):Array.isArray(e)?this.logTemplate(`info`,e,t):this.log(`info`,`{*}`,e)}logError(e,t,n){if(typeof n!=`function`){this.log(e,`{error.message}`,{...n,error:t});return}if(!this.isEnabledFor(e))return Promise.resolve();let r=n();if(r instanceof Promise)return r.then(n=>{this.log(e,`{error.message}`,{...n,error:t})});this.log(e,`{error.message}`,{...r,error:t})}warn(e,...t){if(e instanceof Error)return this.logError(`warning`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`warning`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`warning`,e,t[0]);else typeof e==`function`?this.logLazily(`warning`,e):Array.isArray(e)?this.logTemplate(`warning`,e,t):this.log(`warning`,`{*}`,e)}warning(e,...t){if(e instanceof Error)return this.logError(`warning`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`warning`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`warning`,e,t[0]);else typeof e==`function`?this.logLazily(`warning`,e):Array.isArray(e)?this.logTemplate(`warning`,e,t):this.log(`warning`,`{*}`,e)}error(e,...t){if(e instanceof Error)return this.logError(`error`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`error`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`error`,e,t[0]);else typeof e==`function`?this.logLazily(`error`,e):Array.isArray(e)?this.logTemplate(`error`,e,t):this.log(`error`,`{*}`,e)}fatal(e,...t){if(e instanceof Error)return this.logError(`fatal`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`fatal`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`fatal`,e,t[0]);else typeof e==`function`?this.logLazily(`fatal`,e):Array.isArray(e)?this.logTemplate(`fatal`,e,t):this.log(`fatal`,`{*}`,e)}},ne=class e{logger;properties;constructor(e,t){this.logger=e,this.properties=t}get category(){return this.logger.category}get parent(){return this.logger.parent}getChild(e){return this.logger.getChild(e).with(this.properties)}with(t){return new e(this.logger,{...this.properties,...t})}log(e,t,n,r){if(this.logger.isCertainlyDropped(e))return;let i=this.properties;this.logger.log(e,t,typeof n==`function`?()=>C({...i,...n()}):()=>C({...i,...n}),r)}logLazily(e,t){this.logger.isCertainlyDropped(e)||this.logger.logLazily(e,t,C(this.properties))}logTemplate(e,t,n){this.logger.isCertainlyDropped(e)||this.logger.logTemplate(e,t,n,C(this.properties))}emit(e){let t={...e,properties:C({...this.properties,...e.properties})};this.logger.emit(t)}isEnabledFor(e){return this.logger.isEnabledFor(e)}trace(e,...t){if(typeof e==`string`)return T(this,`trace`,e,t[0]);typeof e==`function`?this.logLazily(`trace`,e):Array.isArray(e)?this.logTemplate(`trace`,e,t):this.log(`trace`,`{*}`,e)}debug(e,...t){if(typeof e==`string`)return T(this,`debug`,e,t[0]);typeof e==`function`?this.logLazily(`debug`,e):Array.isArray(e)?this.logTemplate(`debug`,e,t):this.log(`debug`,`{*}`,e)}info(e,...t){if(typeof e==`string`)return T(this,`info`,e,t[0]);typeof e==`function`?this.logLazily(`info`,e):Array.isArray(e)?this.logTemplate(`info`,e,t):this.log(`info`,`{*}`,e)}
1logError(e,t,n){if(typeof n!=`function`){this.log(e,`{error.message}`,{...n,error:t});return}if(!this.isEnabledFor(e))return Promise.resolve();let r=n();if(r instanceof Promise)return r.then(n=>{this.log(e,`{error.message}`,{...n,error:t})});this.log(e,`{error.message}`,{...r,error:t})}warn(e,...t){if(e instanceof Error)return this.logError(`warning`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`warning`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`warning`,e,t[0]);else typeof e==`function`?this.logLazily(`warning`,e):Array.isArray(e)?this.logTemplate(`warning`,e,t):this.log(`warning`,`{*}`,e)}warning(e,...t){if(e instanceof Error)return this.logError(`warning`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`warning`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`warning`,e,t[0]);else typeof e==`function`?this.logLazily(`warning`,e):Array.isArray(e)?this.logTemplate(`warning`,e,t):this.log(`warning`,`{*}`,e)}error(e,...t){if(e instanceof Error)return this.logError(`error`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`error`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`error`,e,t[0]);else typeof e==`function`?this.logLazily(`error`,e):Array.isArray(e)?this.logTemplate(`error`,e,t):this.log(`error`,`{*}`,e)}fatal(e,...t){if(e instanceof Error)return this.logError(`fatal`,e,t[0]);if(typeof e==`string`&&t[0]instanceof Error)this.log(`fatal`,e,{error:t[0]});else if(typeof e==`string`)return T(this,`fatal`,e,t[0]);else typeof e==`function`?this.logLazily(`fatal`,e):Array.isArray(e)?this.logTemplate(`fatal`,e,t):this.log(`fatal`,`{*}`,e)}},N=M.getLogger([`logtape`,`meta`]);function re(e){return e.includes(`.`)||e.includes(`[`)||e.includes(`?.`)}function ie(e,t){if(t!==`__proto__`&&t!==`prototype`&&t!==`constructor`&&(typeof e==`object`||typeof e==`function`)&&e!==null)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function ae(e,t){let n=e.length,r=t;if(r>=n)return null;let i;if(e[r]===`[`){if(r++,r>=n)return null;if(e[r]===`"`||e[r]===`'`){let t=e[r];r++;let a=``;for(;r<n&&e[r]!==t;)if(e[r]===`\\`){if(r++,r<n){let t=e[r];switch(t){case`n`:a+=`
2`;break;case`t`:a+=`	`;break;case`r`:a+=`\r`;break;case`b`:a+=`\b`;break;case`f`:a+=`\f`;break;case`v`:a+=`\v`;break;case`0`:a+=`\0`;break;case`\\`:a+=`\\`;break;case`"`:a+=`"`;break;case`'`:a+=`'`;break;case`u`:if(r+4<n){let n=e.slice(r+1,r+5),i=Number.parseInt(n,16);Number.isNaN(i)?a+=t:(a+=String.fromCharCode(i),r+=4)}else a+=t;break;default:a+=t}r++}}else a+=e[r],r++;if(r>=n)return null;i=a,r++}else{let t=r;for(;r<n&&e[r]!==`]`&&e[r]!==`'`&&e[r]!==`"`;)r++;if(r>=n)return null;let a=e.slice(t,r);if(a.length===0)return null;let o=Number(a);i=Number.isNaN(o)?a:o}for(;r<n&&e[r]!==`]`;)r++;r<n&&r++}else{let t=r;for(;r<n&&e[r]!==`.`&&e[r]!==`[`&&e[r]!==`?`&&e[r]!==`]`;)r++;if(i=e.slice(t,r),i.length===0)return null}return r<n&&e[r]===`.`&&r++,{segment:i,nextIndex:r}}function oe(e,t){if(typeof t==`string`)return ie(e,t);if(Array.isArray(e)&&t>=0&&t<e.length)return e[t]}function se(e,t){if(e==null||t.length===0||t.endsWith(`.`))return;let n=e,r=0,i=t.length;for(;r<i;){if(t.slice(r,r+2)===`?.`){if(r+=2,n==null)return}else if(n==null)return;let e=ae(t,r);if(e===null)return;let{segment:i,nextIndex:a}=e;if(r=a,n=oe(n,i),n===void 0)return}return n}function ce(e,t){let n=e.length;if(n===0)return[``];if(!e.includes(`{`))return[e];let r=[],i=0;for(let a=0;a<n;a++){let o=e[a];if(o===`{`){if((a+1<n?e[a+1]:``)===`{`){a++;continue}let o=e.indexOf(`}`,a+1);if(o===-1)continue;let s=e.slice(i,a);r.push(s.replace(/{{/g,`{`).replace(/}}/g,`}`));let c=e.slice(a+1,o),l,u=c.trim();u===`*`?l=c in t?t[c]:`*`in t?t[`*`]:t:(l=c===u||c in t?t[c]:t[u],l===void 0&&re(u)&&(l=se(t,u))),r.push(l),a=o,i=a+1}else o===`}`&&a+1<n&&e[a+1]===`}`&&a++}let a=e.slice(i);return r.push(a.replace(/{{/g,`{`).replace(/}}/g,`}`)),r}function le(e,t){let n=[];for(let r=0;r<e.length;r++)n.push(e[r]),r<t.length&&n.push(t[r]);return n}var ue=Symbol.for(`logtape.categoryPrefix`);function de(){let e=M.getLogger().contextLocalStorage?.getStore();if(e==null)return[];let t=e[ue];return Array.isArray(t)?t:[]}function fe(){let e=M.getLogger().contextLocalStorage?.getStore();if(e==null)return;let t=Object.keys(e);if(t.length<1)return;let n={};for(let r of t)n[r]=e[r];return n}function pe(e){return e===10?`\\n`:e===13?`\\r`:e===27?`\\x1b`:`\\x${e.toString(16).padStart(2,`0`)}`}function me(e,t){return e===9?!1:e===10||e===13?t:e<32||e===127||e>=128&&e<=159}var he=/^\x1b\[([0-9;:]*)m/,ge=`\x1B[0m`;function P(e,t={}){let n=t.sgr!==`escape`,r=t.newlines===`escape`,i=!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);
2if(n===27||me(n,r)){i=!0;break}}if(!i)return e;let a=``,o=0,s=!1;for(;o<e.length;){let t=e.charCodeAt(o);if(t===27){if(n){let t=he.exec(e.slice(o));if(t!=null){a+=t[0],s=!_e(t[1]),o+=t[0].length;continue}}a+=pe(27),o++}else me(t,r)?(a+=pe(t),o++):(a+=e[o],o++)}return s?a+ge:a}function _e(e){return/^0*$/.test(e.replace(/[;:]/g,``))}function ve(e){if(e===!1)return null;let t=e??{};return e=>P(e,t)}function ye(e){let t=[],n=[];return function(r,i){let a=e===void 0?i:e.call(this,r,i);if(typeof a!=`object`||!a)return a;for(;n.length>0&&n[n.length-1]!==this;)n.pop(),t.pop();for(let e=0;e<n.length;e++)if(n[e]===a||t[e]===i)return`[Circular]`;return t.push(i),n.push(a),a}}function F(e,t,n){try{return JSON.stringify(e,t,n)}catch{return JSON.stringify(e,ye(t),n)}}var be=e({inspect:()=>xe});function xe(e,t){return F(e,void 0,t?.compact===!0?void 0:2)??`undefined`}var Se={trace:`TRC`,debug:`DBG`,info:`INF`,warning:`WRN`,error:`ERR`,fatal:`FTL`},Ce=typeof document<`u`||typeof navigator<`u`&&navigator.product===`ReactNative`?e=>F(e):`Deno`in globalThis&&`inspect`in globalThis.Deno&&typeof globalThis.Deno.inspect==`function`?(e,t)=>globalThis.Deno.inspect(e,{strAbbreviateSize:1/0,iterableLimit:1/0,...t}):be!=null&&`inspect`in be&&typeof xe==`function`?(e,t)=>xe(e,{maxArrayLength:1/0,maxStringLength:1/0,...t}):e=>F(e),we=(e,t)=>String(Ce(e,t)),Te=new TextEncoder;function Ee(e,t,n){let r=e.length,i=n==null?e=>e:e=>n(e);if(r===1)return i(e[0]);if(r<=6){let n=``;for(let a=0;a<r;a++)n+=a%2==0?i(e[a]):t(e[a]);return n}let a=Array(r);for(let n=0;n<r;n++)a[n]=n%2==0?i(e[n]):t(e[n]);return a.join(``)}function I(e){return e<10?`0${e}`:`${e}`}function De(e){return e<10?`00${e}`:e<100?`0${e}`:`${e}`}var Oe=/^([+-])(0\d|1\d|2[0-3]):([0-5]\d)$/;function ke(e,t){let n=e<0?`-`:`+`,r=Math.abs(e),i=I(Math.floor(r/60)),a=I(r%60);return!t&&a===`00`?`${n}${i}`:`${n}${i}:${a}`}function Ae(e,t){let n=e.formatToParts(new Date(t)),r=``,i=``,a=``,o=``,s=``,c=``;for(let e of n)e.type===`year`?r=e.value:e.type===`month`?i=e.value:e.type===`day`?a=e.value:e.type===`hour`?o=e.value:e.type===`minute`?s=e.value:e.type===`second`&&(c=e.value);return{year:r,month:i,day:a,hour:o,minute:s,second:c}}function je(e,t){let n=new Date(e),r=De(n.getUTCMilliseconds());if(t.kind===`utc`)return{year:`${n.getUTCFullYear()}`,month:I(n.getUTCMonth()+1),day:I(n.getUTCDate()),hour:I(n.getUTCHours()),minute:I(n.getUTCMinutes()),second:I(n.getUTCSeconds()),ms:r,offsetMinutes:0};if(t.kind===`local`)return{year:`${n.getFullYear()}`,month:I(n.getMonth()+1),day:I(n.getDate()),hour:I(n.getHours()),minute:I(n.getMinutes()),second:I(n.getSeconds()),ms:r,offsetMinutes:-n.getTimezoneOffset()};if(t.kind===`offset`){let n=new Date(e+t.minutes*6e4);return{year:`${n.getUTCFullYear()}`,month:I(n.getUTCMonth()+1),day:I(n.getUTCDate()),hour:I(n.getUTCHours()),minute:I(n.getUTCMinutes()),second:I(n.getUTCSeconds()),ms:r,offsetMinutes:t.minutes}}let i=Ae(t.formatter,e),a=Date.UTC(Number(i.year),Number(i.month)-1,Number(i.day),Number(i.hour),Number(i.minute),Number(i.second),n.getUTCMilliseconds()),o=Math.round((a-e)/6e4);return{...i,ms:r,offsetMinutes:o}}function Me(e){if(e===void 0)return{kind:`utc`};if(e===null)return{kind:`local`};let t=Oe.exec(e);if(t!=null){let e=t[1]===`-`?-1:1,n=Number(t[2]),r=Number(t[3]);return{kind:`offset`,minutes:e*(n*60+r)}}if(typeof Intl>`u`||typeof Intl.DateTimeFormat!=`function`)throw TypeError(`Invalid timeZone option: ${JSON.stringify(e)}. This environment does not support IANA time zones.`);try{return{kind:`iana`,formatter:new Intl.DateTimeFormat(`en-CA`,{timeZone:e,hour12:!1,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}}catch{throw TypeError(`Invalid timeZone option: ${JSON.stringify(e)}. Expected an IANA time zone name (e.g., "Asia/Seoul") or a fixed UTC offset string (e.g., "+09:00").`)}}function L(e,t){return e===`none`?()=>null:e===`rfc3339`&&t.kind===`utc`?e=>new Date(e).toISOString():n=>{let r=je(n,t),i=`${r.year}-${r.month}-${r.day}`,a=`${r.hour}:${r.minute}:${r.second}.${r.ms}`,o=ke(r.offsetMinutes,!0),s=ke(r.offsetMinutes,!1);return e===`date-time-timezone`?`${i} ${a} ${o}`:e===`date-time-tz`?`${i} ${a} ${s}`:e===`date-time`?`${i} ${a}`:e===`time-timezone`?`${a} ${o}`:e===`time-tz`?`${a} ${s}`:e===`time`?a:e===`date`?i:`${i}T${a}${o}`}}var R={ABBR:Se,abbr:{trace:`trc`,debug:`dbg`,info:`inf`,warning:`wrn`,error:`err`,fatal:`ftl`},FULL:{trace:`TRACE`,debug:`DEBUG`,info:`INFO`,warning:`WARNING`,error:`ERROR`,fatal:`FATAL`},full:{trace:`trace`,debug:`debug`,info:`info`,warning:`warning`,error:`error`,fatal:`fatal`},L:{trace:`T`,debug:`D`,info:`I`,warning:`W`,error:`E`,fatal:`F`},l:{trace:`t`,debug:`d`,info:`i`,warning:`w`,error:`e`,fatal:`f`}};function Ne(e){return e===`crlf`?`\r
3`:`
4`}var Pe=/[\u007f-\u009f]/g;function Fe(e){return e.replace(Pe,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}function z(e,t){if(!(t instanceof Error))return t;let n={name:t.name,message:t.message};typeof t.stack==`string`&&(n.stack=t.stack);let r=t.cause;r!==void 0&&(n.cause=r),typeof AggregateError<`u`&&t instanceof AggregateError&&(n.errors=t.errors);for(let e of Object.keys(t))e in n||(n[e]=t[e]);return n}function Ie(e){let t=e.length;if(t===1)return e[0];if(t===3)return e[0]+F(e[1])+e[2];let n=e[0];for(let r=1;r<t;r++)n+=r&1?F(e[r]):e[r];return n}function Le(e,t){if(t!=null&&(typeof t==`object`||typeof t==`function`||typeof t==`bigint`)){let n=t.toJSON;typeof n==`function`&&(t=n.call(t,e))}return JSON.stringify(z(e,t),ye(z))}function Re(e,t){let n=e.level===`warning`?`WARN`:e.level.toUpperCase(),r=Le(`message`,Ie(e.message)),i=Le(`properties`,e.properties),a=`{"@timestamp":${JSON.stringify(new Date(e.timestamp).toISOString())},"level":${JSON.stringify(n)}`;return r!==void 0&&(a+=`,"message":${r}`),a+=`,"logger":${JSON.stringify(e.category.join(`.`))}`,i!==void 0&&(a+=`,"properties":${i}`),Fe(`${a}}`)+t}function ze(e={}){let t=(()=>{let t=e.timestamp,n=Me(e.timeZone);return t==null?L(`date-time-timezone`,n):t===`disabled`?L(`none`,n):typeof t==`string`&&(t===`date-time-timezone`||t===`date-time-tz`||t===`date-time`||t===`time-timezone`||t===`time-tz`||t===`time`||t===`date`||t===`rfc3339`||t===`none`)?L(t,n):t})(),n=e.category??`·`,r=ve(e.sanitize),i=ve(e.sanitize!==!1&&{...e.sanitize,sgr:`escape`}),a=e.value?t=>e.value(t,we):we,o=(()=>{let t=e.level;return t==null||t===`ABBR`?e=>R.ABBR[e]:t===`abbr`?e=>R.abbr[e]:t===`FULL`?e=>R.FULL[e]:t===`full`?e=>R.full[e]:t===`L`?e=>R.L[e]:t===`l`?e=>R.l[e]:t})(),s=Ne(e.lineEnding),c=e.format??(({timestamp:e,level:t,category:n,message:r})=>`${e?`${e} `:``}[${t}] ${n}: ${r}`);return e=>{let l=Ee(e.message,a,r),u=t(e.timestamp),d=o(e.level),f=i==null?e.category:e.category.map(i),p={timestamp:u,level:d,category:typeof n==`function`?n(f):f.join(n),message:l,record:e};return`${c(p)}${s}`}}ze();var Be=`\x1B[0m`,Ve={black:`\x1B[30m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,white:`\x1B[37m`},He={bold:`\x1B[1m`,dim:`\x1B[2m`,italic:`\x1B[3m`,underline:`\x1B[4m`,strikethrough:`\x1B[9m`},Ue={trace:null,debug:`blue`,info:`green`,warning:`yellow`,error:`red`,fatal:`magenta`};function We(e={}){let t=e.format,n=e.timestampStyle===void 0?`dim`:e.timestampStyle,r=e.timestampColor??null,i=`${n==null?``:He[n]}${r==null?``:Ve[r]}`,a=n==null&&r==null?``:Be,o=e.levelStyle===void 0?`bold`:e.levelStyle,s=e.levelColors??Ue,c=e.categoryStyle===void 0?`dim`:e.categoryStyle,l=e.categoryColor??null,u=`${c==null?``:He[c]}${l==null?``:Ve[l]}`,d=c==null&&l==null?``:Be;return ze({timestamp:`date-time-tz`,value(e,t){return t(e,{colors:!0})},...e,format({timestamp:e,level:n,category:r,message:c,record:l}){let f=s[l.level];return e=e==null?null:`${i}${e}${a}`,n=`${o==null?``:He[o]}${f==null?``:Ve[f]}${n}${o==null&&f==null?``:Be}`,t==null?`${e==null?``:`${e} `}${n} ${u}${r}:${d} ${c}`:t({timestamp:e,level:n,category:`${u}${r}${d}`,message:c,record:l})}})}We();function Ge(e={}){let t=Ne(e.lineEnding);if(!e.categorySeparator&&!e.message&&!e.properties)return e=>Re(e,t);let n=e.message===`template`,r=e.properties??`nest:properties`,i;if(typeof e.categorySeparator==`function`)i=e.categorySeparator;else{let t=e.categorySeparator??`.`;i=e=>e.join(t)}let a;if(r===`flatten`)a=e=>e;else if(r.startsWith(`prepend:`)){let e=r.substring(8);if(e===``)throw TypeError(`Invalid properties option: ${JSON.stringify(r)}. It must be of the form "prepend:<prefix>" where <prefix> is a non-empty string.`);a=t=>{let n={};for(let r in t)n[`${e}${r}`]=t[r];return n}}else if(r.startsWith(`nest:`)){let e=r.substring(5);a=t=>({[e]:t})}else throw TypeError(`Invalid properties option: ${JSON.stringify(r)}. It must be "flatten", "prepend:<prefix>", or "nest:<key>".`);let o;return o=n?e=>{if(typeof e.rawMessage==`string`)return e.rawMessage;let t=``;for(let n=0;n<e.rawMessage.length;n++)n>0&&(t+=`{}`),t+=e.rawMessage[n];return t}:e=>{let t=e.message.length;if(t===1)return e.message[0];let n=``;for(let r=0;r<t;
4r++)n+=r%2<1?e.message[r]:F(e.message[r]);return n},e=>Fe(JSON.stringify({"@timestamp":new Date(e.timestamp).toISOString(),level:e.level===`warning`?`WARN`:e.level.toUpperCase(),message:o(e),logger:i(e.category),...a(e.properties)},ye(z)))+t}Ge();function Ke(e,t){return t?typeof e.rawMessage==`string`?e.rawMessage:e.rawMessage.join(`{}`):Ee(e.message,Ze)}function qe(e){if(e===``)return null;let t=!1;for(let n of e)if(Ye(n,n.codePointAt(0))){t=!0;break}if(!t)return e;let n=``;for(let t of e)Ye(t,t.codePointAt(0))?n+=Xe(t):n+=t;return n}function Je(e){return e===127||e>=128&&e<=159}function Ye(e,t){return t<=32||Je(t)||t===65533||e===`=`||e===`"`||e===`%`}function Xe(e){let t=``;for(let n of Te.encode(e))t+=`%${n.toString(16).toUpperCase().padStart(2,`0`)}`;return t}function Ze(e){if(typeof e==`string`)return e;if(e===null)return`null`;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`||e===void 0||typeof e==`symbol`||typeof e==`function`)return String(e);try{let t=JSON.stringify(e,z);if(typeof t==`string`)return Qe(t)}catch{}return we(e,{colors:!1})}function Qe(e){return e.startsWith(`"`)&&e.endsWith(`"`)?JSON.parse(e):e}function $e(e,t){let n=e===``||t&&et(e);for(let t of e)if(tt(t,t.codePointAt(0))){n=!0;break}if(!n)return e;let r=``;for(let t of e){let e=t.codePointAt(0);r+=nt(t,e)}return`"${r}"`}function et(e){return e===`null`||e===`undefined`||e===`true`||e===`false`}function tt(e,t){return t<=32||Je(t)||t===65533||e===`=`||e===`"`||e===`\\`}function nt(e,t){switch(e){case`	`:return`\\t`;case`
5`:return`\\n`;case`\r`:return`\\r`;case`"`:return`\\"`;case`\\`:return`\\\\`;default:return t<=31||Je(t)?`\\u${t.toString(16).padStart(4,`0`)}`:e}}function rt(e){return $e(Ze(e),typeof e==`string`)}function B(e,t,n){let r=qe(t);r!=null&&e.push(`${r}=${rt(n)}`)}function it(e={}){let t=Ne(e.lineEnding),n=L(`rfc3339`,Me(e.timeZone)),r=e.message===`template`,i=e.properties??`flatten`,a;if(typeof e.categorySeparator==`function`)a=e.categorySeparator;else{let t=e.categorySeparator??`.`;a=e=>e.join(t)}let o=``;if(i===`flatten`)o=``;else if(i.startsWith(`prepend:`)){if(o=i.substring(8),o===``)throw TypeError(`Invalid properties option: `+JSON.stringify(i)+`. It must be of the form "prepend:<prefix>" where <prefix> is a non-empty string.`)}else throw TypeError(`Invalid properties option: ${JSON.stringify(i)}. It must be "flatten" or "prepend:<prefix>".`);return e=>{let i=[];B(i,`time`,n(e.timestamp)),B(i,`level`,e.level),B(i,`logger`,a(e.category)),B(i,`msg`,Ke(e,r));for(let t in e.properties)Object.prototype.hasOwnProperty.call(e.properties,t)&&B(i,`${o}${t}`,e.properties[t]);return`${i.join(` `)}${t}`}}it();var at={trace:`background-color: gray; color: white;`,debug:`background-color: gray; color: white;`,info:`background-color: white; color: black;`,warning:`background-color: orange; color: black;`,error:`background-color: red; color: white;`,fatal:`background-color: maroon; color: white;`};function ot(e){let t=``,n=[];for(let r=0;r<e.message.length;r++)r%2==0?t+=P(e.message[r]):(t+=`%o`,n.push(e.message[r]));let r=new Date(e.timestamp);return[`%c${`${r.getUTCHours().toString().padStart(2,`0`)}:${r.getUTCMinutes().toString().padStart(2,`0`)}:${r.getUTCSeconds().toString().padStart(2,`0`)}.${r.getUTCMilliseconds().toString().padStart(3,`0`)}`} %c${Se[e.level]}%c %c${e.category.map(e=>P(e,{sgr:`escape`})).join(`·`)} %c${t}`,`color: gray;`,at[e.level],`background-color: default;`,`color: gray;`,`color: default;`,...n]}function V(e={}){let t=e.formatter??ot,n={trace:`debug`,debug:`debug`,info:`info`,warning:`warn`,error:`error`,fatal:`error`,...e.levelMap??{}},r=e.console??globalThis.console,i=e=>{let i=t(e),a=n[e.level];if(a===void 0)throw TypeError(`Invalid log level: ${e.level}.`);if(typeof i==`string`){let e=i.replace(/\r?\n$/,``);r[a](e)}else r[a](...i)};if(!e.nonBlocking)return i;let a=e.nonBlocking===!0?{}:e.nonBlocking,o=a.bufferSize??100,s=a.flushInterval??100,c=[],l=null,u=null,d=!1,f=!1,p=o*2;function m(){if(c.length===0)return;let e=c.splice(0);for(let t of e)try{i(t)}catch{}}function h(){f||(f=!0,u=setTimeout(()=>{u=null,f=!1,m()},0))}function g(){l!==null||d||(l=setInterval(()=>{m()},s))}let _=e=>{d||(c.length>=p&&c.shift(),c.push(e),c.length>=o?h():l===null&&g())};return _[Symbol.dispose]=()=>{d=!0,l!==null&&(clearInterval(l),l=null),u!==null&&(clearTimeout(u),u=null,f=!1),m()},_}var st=null,ct=0,lt=!1,ut=new Set,dt=new Set,ft=new Set,pt=new Set,H=new Set,U;function mt(e){let t=Array.isArray(e.category)?e.category:[e.category];return t.length===0||t.length===1&&t[0]===`logtape`||t.length===2&&t[0]===`logtape`&&t[1]===`meta`}function ht(e){U?.(),U=void 0;let t=e?yt:bt;if(typeof globalThis.EdgeRuntime!=`string`&&`process`in globalThis&&!(`Deno`in globalThis)){let e=globalThis.process,n=e?.on;if(typeof n==`function`){n.call(e,`exit`,t),U=()=>{let n=e?.off??e?.removeListener;typeof n==`function`&&n.call(e,`exit`,t)};return}}let n=globalThis.addEventListener;if(typeof n!=`function`)return;let r=globalThis.removeEventListener;`Deno`in globalThis?(n.call(globalThis,`unload`,t),typeof r==`function`&&(U=()=>{r.call(globalThis,`unload`,t)})):(n.call(globalThis,`pagehide`,t),typeof r==`function`&&(U=()=>{r.call(globalThis,`pagehide`,t)}))}function gt(e){xt(`configureSync()`,()=>{if(st!=null&&!e.reset)throw new G(`Already configured; if you want to reset, turn on the reset flag.`);if(pt.size>0||H.size>0)throw new G(`Previously configured async disposables are still active. Use configure() instead or explicitly dispose them using dispose().`);bt(),vt();try{_t(e,!1)}catch(e){throw e instanceof G&&(bt(),vt()),e}}
5)}function _t(e,n){st=e;let r=!1,i=new Set;for(let n of e.loggers){mt(n)&&(r=!0);let a=Array.isArray(n.category)?JSON.stringify(n.category):JSON.stringify([n.category]);if(i.has(a))throw new G(`Duplicate logger configuration for category: ${a}. Each category can only be configured once.`);i.add(a);let o=M.getLogger(n.category);for(let t of n.sinks??[]){let n=e.sinks[t];if(!n)throw new G(`Sink not found: ${t}.`);o.sinks.push(n)}o.parentSinks=n.parentSinks??`inherit`,n.lowestLevel!==void 0&&(o.lowestLevel=n.lowestLevel);for(let r of n.filters??[]){let n=e.filters?.[r];if(n===void 0)throw new G(`Filter not found: ${r}.`);o.filters.push(t(n))}ut.add(o)}M.getLogger().contextLocalStorage=e.contextLocalStorage;for(let t of Object.values(e.sinks)){if(Symbol.asyncDispose in t){if(n)H.add(t);else throw new G(`Async disposables cannot be used with configureSync().`)}Symbol.dispose in t&&ft.add(t)}for(let t of Object.values(e.filters??{}))if(t!=null&&typeof t!=`string`){if(Symbol.asyncDispose in t){if(n)pt.add(t);else throw new G(`Async disposables cannot be used with configureSync().`);H.delete(t)}Symbol.dispose in t&&(dt.add(t),ft.delete(t))}ht(n);let a=M.getLogger([`logtape`,`meta`]);r||a.sinks.push(V()),a.info(`LogTape loggers are configured.  Note that LogTape itself uses the meta logger, which has category {metaLoggerCategory}.  The meta logger is used to log internal diagnostics such as sink exceptions.  It's recommended to configure the meta logger with a separate sink so that you can easily notice if logging itself fails or is misconfigured.  To turn off this message, configure the meta logger with higher log levels than {dismissLevel}.  See also <https://logtape.org/manual/categories#meta-logger>.`,{metaLoggerCategory:[`logtape`,`meta`],dismissLevel:`info`})}function vt(){U?.(),U=void 0;let e=M.getLogger([]);e.resetDescendants(),delete e.contextLocalStorage,ut.clear(),st=null}async function yt(){let e=[];try{wt()}catch(t){e.push(t)}try{await Dt()}catch(t){e.push(t)}try{Tt()}catch(t){e.push(t)}try{await Ot()}catch(t){e.push(t)}W(e)}function bt(){let e=[];try{wt()}catch(t){e.push(t)}try{Tt()}catch(t){e.push(t)}W(e)}function xt(e,t){St(e),lt=!0;try{return t()}finally{lt=!1}}function St(e){if(lt)throw new G(`${e} cannot be called while LogTape is being reconfigured.`);Ct(e)}function Ct(e){if(ct>0)throw new G(`${e} cannot be called while a scoped configuration is active. Use nested withConfig() instead.`)}function wt(){Et(dt)}function Tt(){Et(ft)}function Et(e){let t=[];try{for(let n of e)try{n[Symbol.dispose]()}catch(e){t.push(e)}finally{e.delete(n)}}finally{e.clear()}W(t)}async function Dt(){await kt(pt)}async function Ot(){await kt(H)}async function kt(e){let t=[];try{for(let n of e)try{t.push(Promise.resolve(n[Symbol.asyncDispose]()))}catch(e){t.push(Promise.reject(e))}finally{e.delete(n)}}finally{e.clear()}await At(t)}async function At(e){W((await Promise.allSettled(e)).filter(e=>e.status===`rejected`).map(e=>e.reason))}function W(e){if(!(e.length<1))throw e.length===1?e[0]:AggregateError(e,`Multiple errors occurred while disposing LogTape resources.`)}var G=class extends Error{constructor(e){super(e),this.name=`ConfigError`}};function jt(){try{return typeof Deno<`u`&&Deno.stdout.isTerminal?Deno.stdout.isTerminal():typeof process<`u`&&process.stdout?!!process.stdout.isTTY:!1}catch{return!1}}function Mt(){try{if(typeof Deno<`u`&&Deno.consoleSize)return Deno.consoleSize()?.columns||null;if(typeof process<`u`&&process.stdout)return process.stdout.columns||null;let e=typeof Deno<`u`?Deno.env.get(`COLUMNS`):{}.COLUMNS;if(e){let t=parseInt(e,10);return isNaN(t)?null:t}return null}catch{return null}}function Nt(e=80){return jt()&&Mt()||e}function Pt(e,t,n=`.`,r=`middle`){if(!r||t<=0)return e.join(n);let i=e.join(n);if(i.length<=t)return i;if(t<5)return`…`;if(r===`end`||e.length<=2)return i.substring(0,t-1)+`…`;let a=e[0],o=e[e.length-1];return a.length+1+o.length>t?i.substring(0,t-1)+`…`:`${a}…${o}`}var Ft=/\x1b\[[0-9;]*m/g;function It(e){return e.replace(Ft,``)}function K(e){let t=It(e);if(t.length===0)return 0;let n=0,r=0;for(;r<t.length;){let e=t.codePointAt(r);if(e===void 0){r++;continue}let i=Lt(e);i>=0&&(n+=i),r+=e>65535?2:1}return n}function Lt(e){return e<32||e>=127&&e<160?-1:Vt(e)?0:Ht(e)?2:1}var Rt=[[768,879],[1155,1161],[1425,1469],[1473,1474],[1476,1477],[1552,1562],[1611,1631],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1840,1866],[1958,1968],[2027,2035],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2273],[2275,2306],[2369,2376],[2385,2391],[2402,2403],[2497,2500],[2530,2531],[2561,2562],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2753,2757],[2759,2760],[2786,2787],[2810,2815],[2881,2884],[2901,2902],[2914,2915],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3426,3427],[3538,3540],[3636,3642],[3655,3662],[3764,3772],[3784,3789],[3864,3865],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4229,4230],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6089,6099],[6155,6157],[6277,6278],[6432,6434],[6439,6440],[6457,6459],[6679,6680],[6744,6750],[6757,6764],[6771,6780],[6832,6846],[6912,6915],[6966,6970],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7144,7145],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[65024,65039],[65056,65071]],zt=new Set([1471,1479,1648,1809,2045,2362,23
564,2381,2433,2492,2509,2558,2620,2641,2677,2748,2765,2817,2876,2879,2893,2946,3008,3021,3072,3076,3201,3260,3263,3270,3393,3396,3405,3457,3530,3542,3633,3761,3893,3895,3897,4038,4226,4237,4253,6086,6109,6313,6450,6683,6742,6752,6754,6783,6964,6972,6978,7142,7149,7405,7412,65279]);function Bt(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=Math.floor((n+r)/2),[a,o]=t[i];if(e>=a&&e<=o)return!0;e<a?r=i-1:n=i+1}return!1}function Vt(e){return zt.has(e)||Bt(e,Rt)}function Ht(e){return e>=4352&&e<=4447||e>=8986&&e<=8987||e>=9001&&e<=9002||e>=9193&&e<=9196||e===9200||e===9203||e>=9725&&e<=9726||e>=9748&&e<=9749||e>=9800&&e<=9811||e===9855||e===9875||e===9888||e===9889||e===9898||e===9899||e>=9917&&e<=9918||e>=9924&&e<=9925||e===9934||e===9940||e>=9962&&e<=9962||e>=9970&&e<=9971||e===9973||e===9978||e===9981||e>=9989&&e<=9989||e>=9994&&e<=9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e>=11035&&e<=11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=40959||e>=43360&&e<=43391||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=94176&&e<=94180||e>=94192&&e<=94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e>=110589&&e<=110590||e>=110592&&e<=110882||e>=110928&&e<=110930||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e>=127374&&e<=127374||e>=127377&&e<=127386||e>=127462&&e<=127487||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=127568&&e<=127569||e>=127584&&e<=127589||e>=127744&&e<=128727||e>=128736&&e<=128748||e>=128752&&e<=128764||e>=128768&&e<=128883||e>=128896&&e<=128984||e>=128992&&e<=129003||e>=129008&&e<=129008||e>=129024&&e<=129035||e>=129040&&e<=129095||e>=129104&&e<=129113||e>=129120&&e<=129159||e>=129168&&e<=129197||e>=129200&&e<=129201||e>=129280&&e<=129619||e>=129632&&e<=129645||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function Ut(e,t,n){if(t<=0||K(e)<=t&&!e.includes(`
6`))return e;let r=` `.repeat(Math.max(0,n));if(e.includes(`
7`)){let n=e.split(`
8`),i=[];for(let e=0;e<n.length;e++){let a=n[e];if(K(a)<=t)e===0?i.push(a):i.push(r+a);else{let n=Wt(a,t,r);if(e===0)i.push(n);else{let e=n.split(`
9`);for(let t=0;t<e.length;t++)t===0?i.push(r+e[t]):i.push(e[t])}}}return i.join(`
10`)}return Wt(e,t,r)}function Wt(e,t,n){let r=[],i=``,a=0,o=0;for(;o<e.length;){if(e[o]===`\x1B`&&e[o+1]===`[`){let t=o+2;for(;t<e.length&&e[t]!==`m`;)t++;if(t<e.length){t++,i+=e.slice(o,t),o=t;continue}}let s=e[o];if(a>=t&&s!==` `){let e=i.lastIndexOf(` `);e>0?(r.push(i.slice(0,e)),i=n+i.slice(e+1)+s,a=K(i)):(r.push(i),i=n+s,a=K(i))}else i+=s,a=K(i);o++}return i.trim()&&r.push(i),r.filter(e=>e.trim().length>0).join(`
11`)}function Gt(e){let t=[],n=[];return function(r,i){let a=e===void 0?i:e.call(this,r,i);if(typeof a!=`object`||!a)return a;for(;n.length>0&&n[n.length-1]!==this;)n.pop(),t.pop();for(let e=0;e<n.length;e++)if(n[e]===a||t[e]===i)return`[Circular]`;return t.push(i),n.push(a),a}}function Kt(e,t,n){try{return JSON.stringify(e,t,n)}catch{return JSON.stringify(e,Gt(t),n)}}function qt(e,t){return Kt(e,void 0,t?.compact===!0?void 0:2)??`undefined`}var q=`\x1B[0m`,Jt=`\x1B[2m`,J={trace:`rgb(167,139,250)`,debug:`rgb(96,165,250)`,info:`rgb(52,211,153)`,warning:`rgb(251,191,36)`,error:`rgb(248,113,113)`,fatal:`rgb(220,38,38)`,category:`rgb(100,116,139)`,message:`rgb(148,163,184)`,timestamp:`rgb(100,116,139)`},Yt={reset:q,bold:`\x1B[1m`,dim:Jt,italic:`\x1B[3m`,underline:`\x1B[4m`,strikethrough:`\x1B[9m`},Xt={black:`\x1B[30m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,white:`\x1B[37m`},Zt=/^rgb\((\d+),(\d+),(\d+)\)$/,Qt=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,$t=/^([+-])(0\d|1\d|2[0-3]):([0-5]\d)$/;function Y(e){if(e===null)return``;if(e in Xt)return Xt[e];let t=e.match(Zt);if(t){let[,e,n,r]=t;return`\x1b[38;2;${e};${n};${r}m`}let n=e.match(Qt);if(n){let e=n[1];return e.length===3&&(e=e.split(``).map(e=>e+e).join(``)),`\x1b[38;2;${parseInt(e.substr(0,2),16)};${parseInt(e.substr(2,2),16)};${parseInt(e.substr(4,2),16)}m`}return``}function X(e){return e===null?``:Array.isArray(e)?e.map(e=>Yt[e]||``).join(``):Yt[e]||``}function en(e){let t=[];for(let[n,r]of e)t.push({prefix:n,color:r});return t.sort((e,t)=>
11t.prefix.length-e.prefix.length)}function tn(e,t){for(let n of t)if(nn(e,n.prefix))return n.color;return null}function nn(e,t){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function Z(e){return e<10?`0${e}`:`${e}`}function rn(e){return e<10?`00${e}`:e<100?`0${e}`:`${e}`}function an(e,t){let n=e<0?`-`:`+`,r=Math.abs(e),i=Z(Math.floor(r/60)),a=Z(r%60);return!t&&a===`00`?`${n}${i}`:`${n}${i}:${a}`}function on(e){if(e===void 0)return{kind:`utc`};if(e===null)return{kind:`local`};let t=$t.exec(e);if(t!=null){let e=t[1]===`-`?-1:1,n=Number(t[2]),r=Number(t[3]);return{kind:`offset`,minutes:e*(n*60+r)}}if(typeof Intl>`u`||typeof Intl.DateTimeFormat!=`function`)throw TypeError(`Invalid timeZone option: ${JSON.stringify(e)}. This environment does not support IANA time zones.`);try{return{kind:`iana`,formatter:new Intl.DateTimeFormat(`en-CA`,{timeZone:e,hour12:!1,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}}catch{throw TypeError(`Invalid timeZone option: ${JSON.stringify(e)}. Expected an IANA time zone name (e.g., "Asia/Seoul") or a fixed UTC offset string (e.g., "+09:00").`)}}function sn(e,t){let n=e.formatToParts(new Date(t)),r=``,i=``,a=``,o=``,s=``,c=``;for(let e of n)e.type===`year`?r=e.value:e.type===`month`?i=e.value:e.type===`day`?a=e.value:e.type===`hour`?o=e.value:e.type===`minute`?s=e.value:e.type===`second`&&(c=e.value);return{year:r,month:i,day:a,hour:o,minute:s,second:c}}function cn(e,t){let n=new Date(e),r=rn(n.getUTCMilliseconds());if(t.kind===`utc`)return{year:`${n.getUTCFullYear()}`,month:Z(n.getUTCMonth()+1),day:Z(n.getUTCDate()),hour:Z(n.getUTCHours()),minute:Z(n.getUTCMinutes()),second:Z(n.getUTCSeconds()),ms:r,offsetMinutes:0};if(t.kind===`local`)return{year:`${n.getFullYear()}`,month:Z(n.getMonth()+1),day:Z(n.getDate()),hour:Z(n.getHours()),minute:Z(n.getMinutes()),second:Z(n.getSeconds()),ms:r,offsetMinutes:-n.getTimezoneOffset()};if(t.kind===`offset`){let n=new Date(e+t.minutes*6e4);return{year:`${n.getUTCFullYear()}`,month:Z(n.getUTCMonth()+1),day:Z(n.getUTCDate()),hour:Z(n.getUTCHours()),minute:Z(n.getUTCMinutes()),second:Z(n.getUTCSeconds()),ms:r,offsetMinutes:t.minutes}}let i=sn(t.formatter,e),a=Date.UTC(Number(i.year),Number(i.month)-1,Number(i.day),Number(i.hour),Number(i.minute),Number(i.second),n.getUTCMilliseconds()),o=Math.round((a-e)/6e4);return{...i,ms:r,offsetMinutes:o}}var ln={trace:`🔍`,debug:`🐛`,info:`✨`,warning:`⚡`,error:`❌`,fatal:`💀`};function un(e){let t=Object.entries(e),n=Math.max(...t.map(([,e])=>K(e)));return Object.fromEntries(t.map(([e,t])=>[e,t+` `.repeat(n-K(t))]))}function dn(e={}){let{timestamp:t=`none`,timeZone:n,timestampColor:r=`rgb(100,116,139)`,timestampStyle:a=`dim`,level:o=`full`,levelColors:s={},levelStyle:c=`underline`,icons:l=!0,categorySeparator:u=`·`,categoryColor:d=`rgb(100,116,139)`,categoryColorMap:f=new Map,categoryStyle:p=[`dim`,`italic`],categoryWidth:m=20,categoryTruncate:h=`middle`,messageColor:g=`rgb(148,163,184)`,messageStyle:_=`dim`,colors:v=!0,align:ee=!0,inspectOptions:y={},properties:te=!1,wordWrap:b=!0,sanitize:x={}}=e,S=x===!1?null:e=>P(e,x),C=x===!1?null:e=>P(e,{...x,sgr:`escape`}),w={...y,compact:y.compact??!0,depth:y.depth??1/0},T=un(l===!1?{trace:``,debug:``,info:``,warning:``,error:``,fatal:``}:l===!0?ln:{...ln,...l}),E={trace:J.trace,debug:J.debug,info:J.info,warning:J.warning,error:J.error,fatal:J.fatal,...s},D={ABBR:{trace:`TRC`,debug:`DBG`,info:`INF`,warning:`WRN`,error:`ERR`,fatal:`FTL`},L:{trace:`T`,debug:`D`,info:`I`,warning:`W`,error:`E`,fatal:`F`},abbr:{trace:`trc`,debug:`dbg`,info:`inf`,warning:`wrn`,error:`err`,fatal:`ftl`},l:{trace:`t`,debug:`d`,info:`i`,warning:`w`,error:`e`,fatal:`f`}},O=e=>typeof o==`function`?o(e):o===`FULL`?e.toUpperCase():o===`full`?e:D[o]?.[e]??e,k=on(n),A=null;A=t===`none`||t===`disabled`?null:typeof t==`function`?t:e=>{if(t===`rfc3339`&&k.kind===`utc`)return new Date(e).toISOString();let n=cn(e,k),r=`${n.year}-${n.month}-${n.day}`,i=`${n.hour}:${n.minute}:${n.second}.${n.ms}`,a=an(n.offsetMinutes,!0),o=an(n.offsetMinutes,!1);return t===`date-time-timezone`?`${r} ${i} ${a}`:t===`date-time-tz`?`${r} ${i} ${o}`:t===`date-time`?`${r} ${i}`:t===`time-timezone`?`${i} ${a}`:t===`time-tz`?`${i} ${o}`:t===`time`?i:t===`date`?r:`${r}T${i}${a}`};let j=b!==!1,M;M=typeof b==`number`?b:b===!0?Nt(80):80;let ne=en(f),N=[...i()],re=Math.max(...N.map(e=>O(e).length));return e=>{let t=T[e.level]||``,n=O(e.level),i=Pt(C==null?e.category:e.category.map(C),m,u,h),o=``,s=v?Y(g):``,l=v?
11X(_):``,f=v?`${l}${s}`:``;for(let t=0;t<e.message.length;t++)if(t%2==0){let n=e.message[t];o+=S==null?n:S(n)}else{let n=e.message[t],r=qt(n,{colors:v,...w});if(r.includes(`
12`)){let e=r.split(`
13`).map((e,t)=>t===0?v&&(s||l)?`${q}${e}${f}`:e:v&&(s||l)?`${e}${f}`:e);o+=e.join(`
14`)}else o+=v&&(s||l)?`${q}${r}${f}`:r}let y=v?tn(e.category,ne)||d:null,b=t,x=n,D=i,k=o,N=``;if(v){let t=Y(E[e.level]);x=`${X(c)}${t}${n}${q}`;let r=Y(y);D=`${X(p)}${r}${i}${q}`,k=`${f}${o}${q}`}if(A){let t=A(e.timestamp);if(t!==null){if(v){let e=Y(r);N=`${X(a)}${e}${t}${q}  `}else N=`${t}  `}}if(ee){let t=v?Y(E[e.level]).length+X(c).length+4:0,n=v?Y(y).length+X(p).length+4:0,r=x.padEnd(re+t),i=D.padEnd(m+n),a=`${N}${b} ${r} ${i} ${k}`,s=K(It(`${N}${b} ${r} ${i} `));return(j||o.includes(`
15`))&&(a=Ut(a,j?M:1/0,s)),te&&(a+=fn(e,s,j?M:1/0,v,w)),a+`
16`}{let t=`${N}${b} ${x} ${D} ${k}`,n=K(It(`${N}${b} ${x} ${D} `));return(j||o.includes(`
17`))&&(t=Ut(t,j?M:1/0,n)),te&&(t+=fn(e,n,j?M:1/0,v,w)),t+`
18`}}}function fn(e,t,n,r,i){let a=``;for(let o in e.properties){let s=e.properties[o],c=Math.max(0,t-K(o)-2);a+=`
19`+Ut(`${` `.repeat(c)}${r?Jt:``}${o}:${r?q:``} ${qt(s,{colors:r,...i})}`,n,t)}return a}dn();var pn=`[truncated]`,mn=20,hn=1e3;function gn(e,t,n=new Map){let r={maxDepth:_n(e.maxDepth,mn),maxProperties:_n(e.maxProperties,hn)},i=new Set;return{limits:r,visited:n,exceededLimits:i,reportLimitExceeded(e){i.add(e),t(e,r)}}}function _n(e,t){return e==null||!Number.isFinite(e)||e<0?t:Math.floor(e)}var vn=k([`logtape`,`meta`]),yn=!1;function bn(e){return e instanceof Error||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Promise||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||ArrayBuffer.isView(e)}function xn(e,t,n={}){for(let{pattern:e}of t)if(!e.global)throw TypeError(`Pattern ${e} does not have the global flag set.`);function r(e){for(let n of t)e=(n.replacement,e.replaceAll(n.pattern,n.replacement));return e}function i(e,t,n){if(typeof e==`object`&&e&&t.visited.has(e))return t.visited.get(e);if(typeof e==`string`)return r(e);if(Array.isArray(e)){let r=[],a=Math.min(e.length,t.limits.maxProperties);r.length=a,t.visited.set(e,r),e.length>t.limits.maxProperties&&Q(t,`maxProperties`);for(let o=0;o<a;o++){if(!(o in e))continue;let a=e[o];Cn(a)&&n+1>t.limits.maxDepth?(Q(t,`maxDepth`),r[o]=pn):r[o]=i(a,t,n+1)}return r}if(typeof e==`object`&&e){if(bn(e))return e;let r={};t.visited.set(e,r);let a=Object.keys(e);a.length>t.limits.maxProperties&&Q(t,`maxProperties`);for(let o of a.slice(0,t.limits.maxProperties)){let a=e[o];Cn(a)&&n+1>t.limits.maxDepth?(Q(t,`maxDepth`),r[o]=pn):r[o]=i(a,t,n+1)}return r}return e}return t=>{let a=e(t);if(typeof a==`string`)return r(a);let o=wn(n);return a.length>o.limits.maxProperties&&Q(o,`maxProperties`),a.slice(0,o.limits.maxProperties).map(e=>i(e,o,0))}}function Sn(e,t){if(!(yn||typeof vn.warn!=`function`))try{yn=!0,vn.warn(`Redaction traversal exceeded {limit}; replacing or omitting remaining data to keep logging bounded.`,{limit:e,...t})}catch{}finally{yn=!1}}function Cn(e){return typeof e==`object`&&!!e&&!bn(e)}function wn(e){return gn(e,Sn)}function Q(e,t){e.exceededLimits.has(t)||e.reportLimitExceeded(t)}var $=`[REDACTED]`,Tn=[{pattern:/\b(sk|pk|fal|key|token|secret|password|bearer)[-_]?[a-zA-Z0-9\-_.]{16,}\b/gi,replacement:$},{pattern:/\b(postgres|mysql|redis|https?):\/\/[^\s"']+@[^\s"']+/gi,replacement:$},{pattern:/\b[A-Za-z0-9+_-]{64,}={0,2}\b/g,replacement:$},{pattern:/\bAKIA[A-Z0-9]{16}\b/g,replacement:$},{pattern:/\b[A-Za-z0-9_-]{40}\b(?=.*(?:token|key|secret))/gi,replacement:$}],En=()=>typeof window<`u`,Dn=()=>!1,On=!1;function kn(){if(On)return;On=!0;let e=Dn(),t=En(),n=e?`debug`:`info`,r=t?jn(e):An(e);gt({sinks:r,loggers:[{category:[`openstory`],sinks:Object.keys(r),lowestLevel:n},{category:[`logtape`,`meta`],sinks:Object.keys(r),lowestLevel:`error`}]})}function An(e){return{console:V({formatter:xn(e?dn({timestamp:`time`,wordWrap:!1,properties:!1}):Ge(),Tn)})}}function jn(e){return e?{console:V({formatter:ot})}:{posthog:Nn,console:V({formatter:ot,levelMap:{trace:`debug`,debug:`debug`,info:`log`,warning:`warn`,error:`error`,fatal:`error`}})}}function Mn(){if(typeof window>`u`)return;let e=window.posthog;return e&&typeof e.captureLog==`function`?e:void 0}var Nn=e=>{let t=Mn();t?.captureLog&&t.captureLog({severity:e.level,body:Fn(Pn(e.message)),attributes:{category:e.category.join(`.`),timestamp:e.timestamp,...In(e.properties)}})};function Pn(e){return e.map(e=>typeof e==`string`?e:(()=>{try{return JSON.stringify(e)}catch{return String(e)}})()).join(``)}function Fn(e){let t=e;for(let{pattern:e,replacement:n}of Tn)t=t.replaceAll(e,typeof n==`string`?n:$);return t}function In(e){let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`string`?Fn(r):r;return t}export{k as n,kn as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.