codsen-utils 1.8.0 → 1.10.0

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/CHANGELOG.md CHANGED
@@ -3,12 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.10.0 (2026-09-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - align object predicate contracts ([2268d1b](https://github.com/codsen/codsen/commit/2268d1b75188c2ec9c13b14ace4360f6836fd1bd))
11
+ - classify Unicode letters by code point ([e166119](https://github.com/codsen/codsen/commit/e166119a72e032ff4e3faffe6d35d766f8a011d0))
12
+ - copy no-op pullAll results ([d09cdf0](https://github.com/codsen/codsen/commit/d09cdf0965cf175d136a8f346d88afb1055c2767))
13
+ - harden glob inclusion matching ([ac901db](https://github.com/codsen/codsen/commit/ac901db39ef29003493a2c76beca9ee23aa5c7ad))
14
+ - parse leading-dot CLI numbers ([8372959](https://github.com/codsen/codsen/commit/8372959d53f80ed9ffe66797f9607b6cf58178bc))
15
+ - preserve deep clone runtime shapes ([a62c091](https://github.com/codsen/codsen/commit/a62c0912158f24238e73c674d8be9c2414748966))
16
+ - preserve null-prototype records ([f2ea76f](https://github.com/codsen/codsen/commit/f2ea76f830bb5d9a8239ff1f0e5c6aef0a32b5c5))
17
+ - preserve proto data keys ([6747b19](https://github.com/codsen/codsen/commit/6747b198c8af2444b75856734422e495d28c11e1))
18
+ - reject unusable regular expressions ([56b79d5](https://github.com/codsen/codsen/commit/56b79d53d4b8067e267aeec3b58328387ea36528))
19
+ - **util-nonempty:** harden shallow value checks ([6f1eda6](https://github.com/codsen/codsen/commit/6f1eda6108ec38d15d30d4b3cb24a8880fcb4656))
20
+
21
+ ### Features
22
+
23
+ - isolate diagnostic value formatting ([a7dc987](https://github.com/codsen/codsen/commit/a7dc987a57d3d39f175b942dd8244bdb896ada28))
24
+
25
+ ## 1.9.0 (2026-08-22)
26
+
27
+ ### Features
28
+
29
+ - **codsen-utils:** add reusable type and trim helpers ([d30a73f](https://github.com/codsen/codsen/commit/d30a73fe807afd129cd7b8e776fde1fc230628b9))
30
+
31
+ ### Performance Improvements
32
+
33
+ - optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
34
+
6
35
  ## 1.8.0 (2026-08-19)
7
36
 
8
37
  ### Bug Fixes
9
38
 
10
39
  - make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
11
- - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
40
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
41
  - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
42
  - treat a backslash run before * like a run before any other char ([5cc839a](https://github.com/codsen/codsen/commit/5cc839abc1ba3f19f6c4ee740e8514d9122588d6))
14
43
 
@@ -1,29 +1,27 @@
1
1
  /**
2
2
  * @name codsen-utils
3
3
  * @fileoverview Various utility functions
4
- * @version 1.8.0
4
+ * @version 1.10.0
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/codsen-utils/}
8
8
  */
9
9
 
10
- var $="1.8.0";function ne(){let e=[],n=0,t=!1;return{append(r){return t?!1:n+r.length>1999?(e.push("\u2026"),n+=1,t=!0,!1):(e.push(r),n+=r.length,!0)},result(){return e.join("")},stopped(){return t}}}function te(e){return`\\u${e.toString(16).padStart(4,"0")}`}function I(e,n){if(e.append('"')){for(let t=0;t<n.length&&!e.stopped();t+=1){let r=n.charCodeAt(t);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(te(r)):e.append(n[t])}e.append('"')}}function re(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function J(e,n){e.append("Symbol(");let t=String(n);t.length>8&&I(e,t.slice(7,-1)),e.append(")")}function _(e,n){typeof n=="symbol"?J(e,n):I(e,String(n))}function U(e,n=0){let t=ne(),r=n===4?4:0,s=new WeakSet,o=0;function i(c){r&&t.append(" ".repeat(c*r))}function l(c,d){c&&t.append(","),r&&(t.append(`
11
- `),i(d+1))}function f(c,d,p){r&&d&&(t.append(`
12
- `),i(p)),t.append(c)}function g(c,d){Object.prototype.hasOwnProperty.call(c,"value")?S(c.value,d):t.append(re(c))}function m(c,d){let p;try{p=Reflect.getOwnPropertyDescriptor(c,"length")}catch{t.append("[Uninspectable]");return}let x=p?.value;if(!Number.isSafeInteger(x)||x<0){t.append("[Uninspectable]");return}t.append("[");let b=!1;for(let k=0;k<x&&!t.stopped();k+=1){if(l(b,d),b=!0,o>=50){t.append("[MaxEntries]");break}o+=1;let R;try{R=Reflect.getOwnPropertyDescriptor(c,String(k))}catch{t.append("[Uninspectable]");continue}R?.enumerable?g(R,d+1):t.append("[Empty]")}f("]",b,d)}function M(c,d){let p;try{p=Reflect.ownKeys(c)}catch{t.append("[Uninspectable]");return}t.append("{");let x=!1;for(let b of p){if(t.stopped())break;if(o>=50){l(x,d),x=!0,I(t,"\u2026"),t.append(r?": ":":"),t.append("[MaxEntries]");break}o+=1;let k;try{k=Reflect.getOwnPropertyDescriptor(c,b)}catch{l(x,d),x=!0,_(t,b),t.append(r?": ":":"),t.append("[Uninspectable]");continue}k?.enumerable&&(l(x,d),x=!0,_(t,b),t.append(r?": ":":"),g(k,d+1))}f("}",x,d)}function h(c,d){if(s.has(c)){t.append("[Circular]");return}if(d>=5){t.append("[MaxDepth]");return}let p;try{p=Array.isArray(c)}catch{t.append("[Uninspectable]");return}s.add(c);try{p?m(c,d):M(c,d)}finally{s.delete(c)}}function S(c,d){c===null?t.append("null"):typeof c=="string"?I(t,c):typeof c=="number"?t.append(Object.is(c,-0)?"-0":String(c)):typeof c=="boolean"?t.append(c?"true":"false"):typeof c>"u"?t.append("undefined"):typeof c=="bigint"?t.append(`${c}n`):typeof c=="symbol"?J(t,c):typeof c=="function"?t.append("[Function]"):h(c,d)}try{return S(e,0),t.result()}catch{return"[Uninspectable]"}}var We=$,oe="\u2018",se="\u2019",ie="\u201C",ce="\u201D",Ne="\u2013",Ee="\u2014",Ue="\xA0",De="\u2026",Le="\u200A",Be="\u2009",Fe="\u2032",Ve="\u2033",$e="\\",_e="\uFFFD",Je="`",Ke="\xD7",He=[".",",",";","!","?"],G=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),j=Object.prototype.hasOwnProperty,P=class{hasRepeatedReferences=!1;clones=[];index;sources=[];get(n){if(this.index){let r=this.index.get(n);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(n);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(n,t){if(this.index){this.index.set(n,t);return}if(this.sources.push(n),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function Q(e,n){let t=n.get(e);if(t!==void 0)return t;let r=e.slice(0);return n.set(e,r),r}function le(e,n){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let o=Buffer.from(e);return n.set(e,o),o}let t=Q(e.buffer,n);if(e instanceof DataView){let o=new DataView(t,e.byteOffset,e.byteLength);return n.set(e,o),o}let r=e.constructor,s=new r(t,e.byteOffset,e.length);return n.set(e,s),s}function D(e,n,t,r){for(let s of t){let o=n[s];e[s]=typeof o!="object"||o===null?o:T(o,r)}}function T(e,n){if(typeof e!="object"||e===null)return e;let t=n.get(e);if(t!==void 0)return t;if(Array.isArray(e)){let o=e.length,i=new Array(o);n.set(e,i);let l=e,f=Object.keys(e);if(f.length===o&&(o===0||f[o-1]===`${o-1}`))for(let g=0;g<o;g++){let m=l[g];i[g]=typeof m!="object"||m===null?m:T(m,n)}else D(i,l,f,n);return i}let r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null){let o={};return n.set(e,o),D(o,e,Object.keys(e),n),o}if(e instanceof Date){let o=new Date(e.getTime());return n.set(e,o),o}if(ArrayBuffer.isView(e))return le(e,n);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Q(e,n);if(e instanceof Map){let o=new Map;n.set(e,o);for(let[i,l]of e)o.set(T(i,n),T(l,n));return o}if(e instanceof Set){let o=new Set;n.set(e,o);for(let i of e)o.add(T(i,n));return o}let s={};return n.set(e,s),D(s,e,Object.keys(e),n),s}function Ge(e){return T(e,new P)}function Qe(e){let n=new P,t=T(e,n);return{hasRepeatedReferences:n.hasRepeatedReferences,value:t}}function Xe(e){if(!w(e))return!1;let n=e.charCodeAt(0);return n>=48&&n<=57}function qe(e){return w(e)&&e.length===1&&G.has(e)}function ze(e){return w(e)&&G.has(e)}function Ze(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91||n>96&&n<123:e.toUpperCase()!==e.toLowerCase()}function Ye(e){if(!e||!w(e))return!1;let n=e.charCodeAt(0);return n>64&&n<91||n>96&&n<123}function ve(e){return w(e)&&(e==='"'||e==="'"||e===oe||e===se||e===ie||e===ce)}function en(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>96&&n<123:e===e.toLowerCase()&&e!==e.toUpperCase()}function nn(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91:e===e.toUpperCase()&&e!==e.toLowerCase()}function tn(e){if(!w(e)||!e)return!1;let n=e.charCodeAt(0);return n<128?n===32||n>8&&n<14:!e[0].trim()}var rn=e=>w(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function X(e){if(e==null||typeof e!="object")return!1;let n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function on(e="",n=0,t=0,r=""){return n<0&&(n+=e.length,n<0&&(n=0)),e.slice(0,n)+(r||"")+e.slice(n+t)}function w(e){return typeof e=="string"}function fe(e){return Number.isFinite(e)}function sn(e){return Number.isSafeInteger(e)&&e>=0}function cn(e){return typeof e=="boolean"}function ln(e){return e===null}function ae(e){return e instanceof RegExp}function fn(e,n){if(!w(e)||!w(n)||n.length===0)return[];let t=[],r=e.indexOf(n);for(;r!==-1;)t.push(r),r=e.indexOf(n,r+1);return t}function an(e=[],n=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!n||!Array.isArray(n)||!n.length)return e;if(e.length<128||n.length<5)return e.filter(r=>!n.includes(r));let t=new Set(n);return e.filter(r=>!t.has(r))}function un(e){return e!=null}function dn(e){return[...new Set(e)]}function ue(e){if(!(typeof e!="string"||!e)){if(e.includes(`\r
10
+ var Z="1.10.0";import{formatDiagnosticValue as B}from"codsen-format-diagnostic-value";var ue=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),L=ue.slice(1).split("_"),W=[],Y=127;for(let e=0;e<L.length;e+=2){let t=Y+1+Number.parseInt(L[e],36),n=t+Number.parseInt(L[e+1],36);W.push([t,n]),Y=n}function X(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=W.length-1;for(;t<=n;){let r=t+n>>1,o=W[r];if(e<o[0])n=r-1;else if(e>o[1])t=r+1;else return!0}return!1}var nt=Z,ae="\u2018",de="\u2019",ge="\u201C",pe="\u201D",rt="\u2013",_t="\u2014",ot="\xA0",st="\u2026",it="\u200A",ct="\u2009",lt="\u2032",ft="\u2033",ut="\\",at="\uFFFD",dt="`",gt="\xD7",pt=[".",",",";","!","?"],te=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),T=Object.prototype.hasOwnProperty,ne=Function.prototype.toString,he=ne.call(Object),P=class{hasRepeatedReferences=!1;clones=[];index;sources=[];get(t){if(this.index){let r=this.index.get(t);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let n=this.sources.indexOf(t);if(n!==-1)return this.hasRepeatedReferences=!0,this.clones[n]}set(t,n){if(this.index){this.index.set(t,n);return}if(this.sources.push(t),this.clones.push(n),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function re(e,t){let n=t.get(e);if(n!==void 0)return n;let r=e.slice(0);return t.set(e,r),r}function be(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let _=Buffer.from(e);return t.set(e,_),_}let n=re(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let _=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,_),_}let r=e.constructor,o=new r(n,e.byteOffset,e.length);return t.set(e,o),o}function _e(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function M(e,t,n,r){for(let o of n){let _=t[o],s=typeof _!="object"||_===null?_:j(_,r);o==="__proto__"?_e(e,o,s):e[o]=s}}function R(e,t,n,r){for(let o of n){let _=Object.getOwnPropertyDescriptor(t,o);if(_){if("value"in _){let s=_.value;_.value=typeof s!="object"||s===null?s:j(s,r)}Object.defineProperty(e,o,_)}}}var ye=Map.prototype.entries,me=Set.prototype.values,z=Object.prototype.toString,xe=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength")?.get,we=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags")?.get,ke=Object.getOwnPropertyDescriptor(RegExp.prototype,"global")?.get,oe=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get,Ce=RegExp.prototype.test,N;function Oe(e){if(e instanceof ArrayBuffer)return!0;try{return xe.call(e),!0}catch{return!1}}function Ae(e){try{return ye.call(e)}catch{return null}}function je(e){try{return me.call(e)}catch{return null}}function Se(e){try{return N||(N=Object.getOwnPropertyDescriptor(URL.prototype,"href")?.get),N.call(e)}catch{return null}}function j(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let i=e.length,l=new Array(i);t.set(e,l);let p=e,k=Object.keys(e);if(k.length===i&&(i===0||k[i-1]===`${i-1}`))for(let a=0;a<i;a++){let y=p[a];l[a]=typeof y!="object"||y===null?y:j(y,t)}else M(l,p,k,t);return l}let r=Object.getPrototypeOf(e);if(r===Object.prototype){let i={};return t.set(e,i),M(i,e,Object.keys(e),t),i}if(r===null){let i=Object.create(null);return t.set(e,i),M(i,e,Object.keys(e),t),i}if(Me(e)){let i=new Date(ie.call(e));return t.set(e,i),R(i,e,Object.keys(e),t),i}if(ArrayBuffer.isView(e))return be(e,t);if(Oe(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return re(e,t);let o=Ae(e);if(o){let i=new Map;t.set(e,i);for(let[l,p]of o)i.set(j(l,t),j(p,t));return R(i,e,Object.keys(e),t),i}let _=je(e);if(_){let i=new Set;t.set(e,i);for(let l of _)i.add(j(l,t));return R(i,e,Object.keys(e),t),i}if(se(e)&&e!==RegExp.prototype){let i=new RegExp(oe.call(e),we.call(e));return i.lastIndex=e.lastIndex,t.set(e,i),R(i,e,Object.keys(e),t),i}let s=Se(e);if(s!==null){let i=new URL(s);return t.set(e,i),R(i,e,Object.keys(e),t),i}if(e instanceof Error||z.call(e)==="[object Error]"){let i=Object.create(Object.getPrototypeOf(e));return t.set(e,i),R(i,e,Reflect.ownKeys(e),t),i}let c=Object.create(r);return t.set(e,c),M(c,e,Object.keys(e),t),c}function ht(e){return j(e,new P)}function bt(e){let t=new P,n=j(e,t);return{hasRepeatedReferences:t.hasRepeatedReferences,value:n}}function yt(e){if(!b(e))return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function mt(e){return b(e)&&e.length===1&&te.has(e)}function xt(e){return b(e)&&te.has(e)}function J(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function wt(e){if(!b(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:X(J(e))}function kt(e){if(!e||!b(e))return!1;let t=e.charCodeAt(0);return t>64&&t<91||t>96&&t<123}function Ct(e){return b(e)&&(e==='"'||e==="'"||e===ae||e===de||e===ge||e===pe)}function Ot(e){if(!b(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>96&&t<123:J(e)<0?!1:e===e.toLowerCase()&&e!==e.toUpperCase()}function At(e){if(!b(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91:J(e)<0?!1:e===e.toUpperCase()&&e!==e.toLowerCase()}function jt(e){if(!b(e)||!e)return!1;let t=e.charCodeAt(0);return t<128?t===32||t>8&&t<14:!e[0].trim()}var St=e=>b(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function Re(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");return!n||!("value"in n)||typeof n.value!="function"?!1:Object.getOwnPropertyDescriptor(n.value,"prototype")?.value===t&&ne.call(n.value)===he}function Rt(e="",t=0,n=0,r=""){return t<0&&(t+=e.length,t<0&&(t=0)),e.slice(0,t)+(r||"")+e.slice(t+n)}function b(e){return typeof e=="string"}function Pe(e){return Number.isFinite(e)}function Pt(e){return Number.isSafeInteger(e)&&e>=0}function Mt(e){return typeof e=="boolean"}function Tt(e){return e===null}function se(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):z.call(e)!=="[object RegExp]"?!1:(oe.call(e),!0)}catch{return!1}}var ie=Date.prototype.getTime;function Me(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||z.call(e)!=="[object Date]")return!1;try{return ie.call(e),!0}catch{return!1}}function It(e,t){if(!e||!t)return e;let n=!0;for(let c=t.length;c--;)if(t.charCodeAt(c)>127){n=!1;break}if(n){let c=0,i=e.length;if(t.length===1){let l=t.charCodeAt(0);for(;c<i&&e.charCodeAt(c)===l;)c++;for(;i>c&&e.charCodeAt(i-1)===l;)i--}else{for(;c<i&&t.includes(e[c]);)c++;for(;i>c&&t.includes(e[i-1]);)i--}return c===0&&i===e.length?e:e.slice(c,i)}let r=Array.from(e),o=new Set(t),_=0,s=r.length;for(;_<s&&o.has(r[_]);)_++;for(;s>_&&o.has(r[s-1]);)s--;return _===0&&s===r.length?e:r.slice(_,s).join("")}function Dt(e,t){if(!b(e)||!b(t)||t.length===0)return[];let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Et(e=[],t=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!t||!Array.isArray(t)||!t.length)return e.slice();if(e.length*t.length<400)return e.filter(r=>!t.includes(r));let n=new Set(t);return e.filter(r=>!n.has(r))}function Bt(e){return e!=null}function Lt(e){return[...new Set(e)]}function Te(e){if(!(typeof e!="string"||!e)){if(e.includes(`\r
13
11
  `))return`\r
14
12
  `;if(e.includes(`
15
13
  `))return`
16
- `;if(e.includes("\r"))return"\r"}}function pn(e,n,t=`
17
- `){if(t!==`
18
- `&&t!==`\r
19
- `&&t!=="\r")throw new Error(`codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as ${U(t)}`);return n==="crlf"?`\r
20
- `:n==="cr"?"\r":n==="lf"?`
21
- `:ue(e)||t}function gn(e,n){return X(e)&&w(n)&&j.call(e,n)}function hn(e,n){return e.localeCompare(n)}var bn=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],yn=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function mn(e,n){if(!Array.isArray(e)||!e.length||!w(n))return!1;for(let t of e){if(typeof t=="string"){if(n===t)return!0;continue}if(ae(t)){t.global&&(t.lastIndex=0);let r=t.test(n);if(t.global&&(t.lastIndex=0),r)return!0}}return!1}function xn(e=[],n=[]){if(!Array.isArray(e)||!Array.isArray(n)||!e.length||!n.length)return[];let t=[];if(e.length*n.length<64){for(let o of e)n.includes(o)&&!t.includes(o)&&t.push(o);return t}let r=new Set(n),s=new Set;for(let o of e)r.has(o)&&!s.has(o)&&(s.add(o),t.push(o));return t}var L=/^-?\d+(?:\.\d*)?(?:e[+-]?\d+)?$/i;function de(e){return e.replace(/-+([^-])/g,(n,t)=>t.toUpperCase())}function pe(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function ge(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function K(e,n){let t=Number.POSITIVE_INFINITY,r=e.split(`
22
- `);for(let o of r){let i=/^[ \t]*(?=\S)/.exec(o);i&&(t=Math.min(t,i[0].length))}let s=" ".repeat(n);return r.map(o=>o.trim()?s+o.slice(t):o).join(`
23
- `)}function he(e,n,t){let r="";return e&&(r=ge(e.replace(/\t+\n*$/,"")),r.includes(`
24
- `)&&(r=K(r,t)),r=`
25
- ${r}`),n&&(r=r?`${K(`
26
- ${n}
27
- `,t)}${r}`:`
28
- ${n}`),`${r}
29
- `}function be(e){let n=w(e.name)?e.name:"",{bin:t}=e;return w(t)?n.slice(n.startsWith("@")?n.indexOf("/")+1:0):t&&typeof t=="object"?Object.keys(t)[0]??n:n}function ye(e,n){let t=e?e.type:void 0;return n===void 0?t==="string"?"":t==="number"?void 0:!0:t==="boolean"?n==="true":t==="number"?Number(n):n}function kn(e="",n={}){let t=typeof process>"u"?void 0:process,r=n.pkg??{},s=n.argv??t?.argv.slice(2)??[],o=n.helpIndent??2,i=n.autoHelp??!0,l=n.autoVersion??!0,f=n.version??r.version??"No version found",g=j.call(n,"booleanDefault")?n.booleanDefault:!1,m=he(e,n.description??r.description,o);function M(a){console.log(m),t?.exit(fe(a)?a:2)}function h(){console.log(f),t?.exit(0)}let S=[],c=new Map;for(let[a,u]of Object.entries(n.flags??{})){let y={key:a,type:u.type,isMultiple:!!u.isMultiple,source:u};S.push(y),c.set(a,y),c.set(pe(a),y),u.shortFlag&&c.set(u.shortFlag,y)}let d=[],p={};function x(a,u){let y=c.get(a),C=y?y.key:de(a);if(y?.isMultiple){let A=p[C];Array.isArray(A)?A.push(u):p[C]=[u];return}p[C]=u}function b(a,u){x(a,ye(c.get(a),u))}function k(a,u){return u===void 0?!1:a?.type==="boolean"?u==="true"||u==="false":!(u.startsWith("-")&&u.length>1&&!L.test(u))}function R(a,u){let y=a.slice(1);for(let C=0;C<y.length;C++){let A=y[C],O=y.slice(C+1);if(O.startsWith("="))return b(A,O.slice(1)),u;if(L.test(O)||O&&/\W/.test(O[0]))return b(A,O),u;let E=c.get(A);if(O&&E?.type&&E.type!=="boolean")return b(A,O),u;if(O){b(A,void 0);continue}if(k(E,s[u+1]))return b(A,s[u+1]),u+1;b(A,void 0)}return u}for(let a=0;a<s.length;a++){let u=s[a];if(u==="--"){d.push(...s.slice(a+1));break}if(u.startsWith("--")){let y=u.slice(2),C=y.indexOf("=");if(C!==-1){b(y.slice(0,C),y.slice(C+1));continue}if(y.startsWith("no-")){x(y.slice(3),!1);continue}let A=c.get(y);if(k(A,s[a+1])){b(y,s[a+1]),a++;continue}b(y,void 0);continue}if(u.startsWith("-")&&u.length>1&&!L.test(u)){a=R(u,a);continue}d.push(u)}for(let a of S)j.call(p,a.key)||(j.call(a.source,"default")?p[a.key]=a.source.default:a.isMultiple?p[a.key]=[]:a.type==="boolean"&&g!==void 0&&(p[a.key]=g));!d.length&&s.length===1&&(l&&p.version===!0?h():i&&p.help===!0&&M(0));let V=be(r);return V&&t&&(t.title=V),{input:d,flags:p,pkg:r,help:m,showHelp:M,showVersion:h}}function wn(e,n=[]){if(!e)return e;if(!X(e))throw new Error(`codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ${U(e,4)} (typeof is "${typeof e}")`);let t={},r=new P;r.set(e,t);let s=Object.keys(e),o=s.length<128||n.length<5?void 0:new Set(n);for(let i of s)(o?o.has(i):n.includes(i))||(t[i]=T(e[i],r));return t}var me=256,xe=1024,ke=1,we=new Map,Ce=new Map;function F(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let n=String.fromCharCode(e).toUpperCase();if(n.length!==1)return e;let t=n.charCodeAt(0);return e>127&&t<128?e:t}function B(e,n,t,r,s,o){for(let i=0;i<s;i++){let l=e.charCodeAt(n+i),f=t.charCodeAt(r+i);if(o||(l>=97&&l<=122&&(l-=32),f>=97&&f<=122&&(f-=32)),l!==f)return!1}return!0}function q(e,n,t){let r=n.indexOf("\\");if(r===-1&&e===n)return!0;let s=n.indexOf("*");if(r===-1&&s===-1){if(t)return!1;for(let m=0;m<n.length;m++)if(n.charCodeAt(m)>127)return;return e.length===n.length&&B(e,0,n,0,n.length,!1)}if(r!==-1)return;let o=0,i=!1,l=-1;for(let m=0;m<n.length;m++){let M=n.charCodeAt(m);if(M>127)return;if(M===42){if(l=m,!i){if(o++,o>1)return;i=!0}}else i=!1}let f=l+1,g=n.length-f;return e.length<s+g?!1:B(e,0,n,0,s,t)&&B(e,e.length-g,n,f,g,t)}function Ae(e){let n=new Uint32Array(e.length),t=0;for(let r=1;r<e.length;r++){for(;t>0&&e[r]!==e[t];)t=n[t-1];e[r]===e[t]&&t++,n[r]=t}return n}function Se(e,n){let t=[[]],r=!0,s=!1,o=!1,i=0;for(let h=0;h<e.length;){let S=e.codePointAt(h);if(S!==92){if(S===42)s=!0,o||(t.push([]),o=!0);else{let k=n?S:F(S);t[t.length-1].push(k),r&&=k<=127,i++,o=!1}h+=S>65535?2:1;continue}let c=h+1;for(;e.charCodeAt(c)===92;)c++;let d=c-h,p=e.codePointAt(c),x,b=!1;p===42?(b=d%2===0,x=b?d/2:(d-1)/2):p===void 0||p===10||p===13||p===8232||p===8233?x=Math.ceil(d/2):x=Math.floor(d/2);for(let k=0;k<x;k++)t[t.length-1].push(92),i++;if(b){o=!1,h=c;continue}if(p!==void 0){let k=n?p:F(p);t[t.length-1].push(k),r&&=k<=127,i++,c+=p>65535?2:1}o=!1,h=c}let l=s&&t[0].length===0,f=s&&t[t.length-1].length===0,g=[];for(let h of t)h.length&&g.push({values:h});let m=l?0:1,M=g.length-(f?0:1);for(let h=m;h<M;h++)g[h].values.length>ke&&(g[h].failure=Ae(g[h].values));return{asciiOnly:r,endsWithWildcard:f,hasWildcard:s,minimumInputLength:i,segments:g,startsWithWildcard:l}}function z(e,n){let t=n?we:Ce,r=e.length<=xe;if(r){let o=t.get(e);if(o)return o}let s=Se(e,n);if(r){if(t.size>=me){let o=t.keys().next().value;o!==void 0&&t.delete(o)}t.set(e,s)}return s}function Z(e,n){if(n){let s=[];for(let o=0;o<e.length;){let i=e.codePointAt(o);s.push(i),o+=i>65535?2:1}return s}let t=new Uint32Array(e.length),r=0;for(let s=0;s<e.length;){let o=e.codePointAt(s);t[r]=F(o),r++,s+=o>65535?2:1}return r===t.length?t:t.subarray(0,r)}function W(e,n,t,r){for(let s=0;s<t.values.length;s++){let o=e.charCodeAt(n+s);if(!r&&o>=97&&o<=122&&(o-=32),o!==t.values[s])return!1}return!0}function Me(e,n,t,r,s){let o=r-n.values.length;if(o<t)return-1;if(!n.failure){for(let l=t;l<=o;l++)if(W(e,l,n,s))return l;return-1}let i=0;for(let l=t;l<r;l++){let f=e.charCodeAt(l);for(!s&&f>=97&&f<=122&&(f-=32);i>0&&f!==n.values[i];)i=n.failure[i-1];if(f===n.values[i]&&(i++,i===n.values.length))return l-i+1}return-1}function Y(e,n,t){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&W(e,0,n.segments[0],t);let r=0,s=n.segments.length,o=0,i=e.length;if(!n.startsWithWildcard){let l=n.segments[0];if(!W(e,0,l,t))return!1;o=l.values.length,r++}if(!n.endsWithWildcard){s--;let l=n.segments[s];if(i-=l.values.length,!W(e,i,l,t))return!1}for(let l=r;l<s;l++){let f=n.segments[l],g=Me(e,f,o,i,t);if(g===-1)return!1;o=g+f.values.length}return!0}function N(e,n,t){for(let r=0;r<t.values.length;r++)if(e[n+r]!==t.values[r])return!1;return!0}function Oe(e,n,t,r){let s=r-n.values.length;if(s<t)return-1;if(!n.failure){for(let i=t;i<=s;i++)if(N(e,i,n))return i;return-1}let o=0;for(let i=t;i<r;i++){for(;o>0&&e[i]!==n.values[o];)o=n.failure[o-1];if(e[i]===n.values[o]&&(o++,o===n.values.length))return i-o+1}return-1}function v(e,n){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&N(e,0,n.segments[0]);let t=0,r=n.segments.length,s=0,o=e.length;if(!n.startsWithWildcard){let i=n.segments[0];if(!N(e,0,i))return!1;s=i.values.length,t++}if(!n.endsWithWildcard){r--;let i=n.segments[r];if(o-=i.values.length,!N(e,o,i))return!1}for(let i=t;i<r;i++){let l=n.segments[i],f=Oe(e,l,s,o);if(f===-1)return!1;s=f+l.values.length}return!0}function Te(e,n,t){let r=q(e,n,t);if(r!==void 0)return r;let s=z(n,t);return s.asciiOnly?Y(e,s,t):v(Z(e,t),s)}function H(e,n,t,r){let s=q(e,n,t);if(s!==void 0)return s;let o=z(n,t);return o.asciiOnly?Y(e,o,t):(r.tokens??=Z(e,t),v(r.tokens,o))}function Cn(e,n,t){if(typeof n!="string"&&!n.length)return!1;let r=t===void 0?!1:t.caseSensitiveMatch===!0;if(typeof n=="string"){let l=n.charCodeAt(0)===33,f=l?n.slice(1):n,g=Te(e,f,r);return l?!g:g}let s={},o=!1,i=!1;for(let l of n){let f=l.charCodeAt(0)===33,g=f?l.slice(1):l;if(f){if(H(e,g,r,s))return!1}else o=!0,!i&&H(e,g,r,s)&&(i=!0)}return o?i:!0}export{$e as backslash,Je as backtick,kn as codsenCLI,hn as compareFn,Ge as deepClone,Qe as deepCloneWithMetadata,ue as detectEol,Ve as doublePrime,De as ellipsis,un as existy,fn as findAllIdx,U as formatDiagnosticValue,Le as hairspace,gn as hasOwnProp,mn as includes,yn as inlineTags,xn as intersection,cn as isBool,qe as isCurrencyChar,ze as isCurrencySymbol,sn as isInt,Ye as isLatinLetter,Ze as isLetter,en as isLowercaseLetter,ln as isNull,fe as isNum,Xe as isNumberChar,X as isPlainObject,ve as isQuote,ae as isRegExp,w as isStr,nn as isUppercaseLetter,tn as isWhitespaceChar,ie as leftDoubleQuote,oe as leftSingleQuote,Cn as match,Ke as multiplicationSign,wn as omit,an as pullAll,He as punctuationChars,Ee as rawMDash,Ne as rawNDash,Ue as rawNbsp,_e as rawReplacementMark,rn as removeTrailingSlash,pn as resolveEolSetting,ce as rightDoubleQuote,se as rightSingleQuote,Fe as singlePrime,on as stringSplice,Be as thinSpace,dn as uniq,We as version,bn as voidTags};
14
+ `;if(e.includes("\r"))return"\r"}}function Wt(e,t,n=`
15
+ `){if(n!==`
16
+ `&&n!==`\r
17
+ `&&n!=="\r")throw new Error(`codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as ${B(n)}`);return t==="crlf"?`\r
18
+ `:t==="cr"?"\r":t==="lf"?`
19
+ `:Te(e)||n}function Nt(e,t){return e!=null&&T.call(e,t)}function Vt(e,t){return e.localeCompare(t)}var Ft=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],$t=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function Ut(e,t){if(!Array.isArray(e)||!e.length||!b(t))return!1;for(let n of e){if(typeof n=="string"){if(t===n)return!0;continue}if(se(n)){let r=ke.call(n);r&&(n.lastIndex=0);let o=Ce.call(n,t);if(r&&(n.lastIndex=0),o)return!0}}return!1}function zt(e=[],t=[]){if(!Array.isArray(e)||!Array.isArray(t)||!e.length||!t.length)return[];let n=[];if(e.length*t.length<64){for(let _ of e)t.includes(_)&&!n.includes(_)&&n.push(_);return n}let r=new Set(t),o=new Set;for(let _ of e)r.has(_)&&!o.has(_)&&(o.add(_),n.push(_));return n}var V=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function Ie(e){return e.replace(/-+([^-])/g,(t,n)=>n.toUpperCase())}function De(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ee(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function v(e,t){let n=Number.POSITIVE_INFINITY,r=e.split(`
20
+ `);for(let _ of r){let s=/^[ \t]*(?=\S)/.exec(_);s&&(n=Math.min(n,s[0].length))}let o=" ".repeat(t);return r.map(_=>_.trim()?o+_.slice(n):_).join(`
21
+ `)}function Be(e,t,n){let r="";return e&&(r=Ee(e.replace(/\t+\n*$/,"")),r.includes(`
22
+ `)&&(r=v(r,n)),r=`
23
+ ${r}`),t&&(r=r?`${v(`
24
+ ${t}
25
+ `,n)}${r}`:`
26
+ ${t}`),`${r}
27
+ `}function Le(e){let t=b(e.name)?e.name:"",{bin:n}=e;return b(n)?t.slice(t.startsWith("@")?t.indexOf("/")+1:0):n&&typeof n=="object"?Object.keys(n)[0]??t:t}function We(e,t){let n=e?e.type:void 0;return t===void 0?n==="string"?"":n==="number"?void 0:!0:n==="boolean"?t==="true":n==="number"?Number(t):t}function Jt(e="",t={}){let n=typeof process>"u"?void 0:process,r=t.pkg??{},o=t.argv??n?.argv.slice(2)??[],_=t.helpIndent??2,s=t.autoHelp??!0,c=t.autoVersion??!0,i=t.version??r.version??"No version found",l=T.call(t,"booleanDefault")?t.booleanDefault:!1,p=Be(e,t.description??r.description,_);function k(f){console.log(p),n?.exit(Pe(f)?f:2)}function a(){console.log(i),n?.exit(0)}let y=[],h=new Map;for(let[f,u]of Object.entries(t.flags??{})){let g={key:f,type:u.type,isMultiple:!!u.isMultiple,source:u};y.push(g),h.set(f,g),h.set(De(f),g),u.shortFlag&&h.set(u.shortFlag,g)}let O=[],d={};function S(f,u){let g=h.get(f),x=g?g.key:Ie(f);if(g?.isMultiple){let w=d[x];Array.isArray(w)?w.push(u):d[x]=[u];return}d[x]=u}function m(f,u){S(f,We(h.get(f),u))}function C(f,u){return u===void 0?!1:f?.type==="boolean"?u==="true"||u==="false":!(u.startsWith("-")&&u.length>1&&!V.test(u))}function le(f,u){let g=f.slice(1);for(let x=0;x<g.length;x++){let w=g[x],A=g.slice(x+1);if(A.startsWith("="))return m(w,A.slice(1)),u;if(V.test(A)||A&&/\W/.test(A[0]))return m(w,A),u;let E=h.get(w);if(A&&E?.type&&E.type!=="boolean")return m(w,A),u;if(A){m(w,void 0);continue}if(C(E,o[u+1]))return m(w,o[u+1]),u+1;m(w,void 0)}return u}for(let f=0;f<o.length;f++){let u=o[f];if(u==="--"){O.push(...o.slice(f+1));break}if(u.startsWith("--")){let g=u.slice(2),x=g.indexOf("=");if(x!==-1){m(g.slice(0,x),g.slice(x+1));continue}if(g.startsWith("no-")){S(g.slice(3),!1);continue}let w=h.get(g);if(C(w,o[f+1])){m(g,o[f+1]),f++;continue}m(g,void 0);continue}if(u.startsWith("-")&&u.length>1&&!V.test(u)){f=le(u,f);continue}O.push(u)}for(let f of y)T.call(d,f.key)||(T.call(f.source,"default")?d[f.key]=f.source.default:f.isMultiple?d[f.key]=[]:f.type==="boolean"&&l!==void 0&&(d[f.key]=l));!O.length&&o.length===1&&(c&&d.version===!0?a():s&&d.help===!0&&k(0));let Q=Le(r);return Q&&n&&(n.title=Q),{input:O,flags:d,pkg:r,help:p,showHelp:k,showVersion:a}}function qt(e,t=[]){if(!e)return e;if(!Re(e))throw new Error(`codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ${B(e,4)} (typeof is "${typeof e}")`);let n=Object.getPrototypeOf(e)===null?Object.create(null):{},r=new P;r.set(e,n);let o=Object.keys(e),_=o.length*t.length<400?void 0:new Set(t);for(let s of o){if(_?_.has(s):t.includes(s))continue;let c=j(e[s],r);s==="__proto__"?_e(n,s,c):n[s]=c}return n}var Ne=256,Ve=1024,Fe=1,$e=new Map,Ue=new Map;function U(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let n=t.charCodeAt(0);return e>127&&n<128?e:n}function F(e,t,n,r,o,_){for(let s=0;s<o;s++){let c=e.charCodeAt(t+s),i=n.charCodeAt(r+s);if(_||(c>=97&&c<=122&&(c-=32),i>=97&&i<=122&&(i-=32)),c!==i)return!1}return!0}function ce(e,t,n){let r=t.indexOf("\\");if(r===-1&&e===t)return!0;let o=t.indexOf("*");if(r===-1&&o===-1){if(n)return!1;for(let p=0;p<t.length;p++)if(t.charCodeAt(p)>127)return;return e.length===t.length&&F(e,0,t,0,t.length,!1)}if(r!==-1)return;let _=0,s=!1,c=-1;for(let p=0;p<t.length;p++){let k=t.charCodeAt(p);if(k>127)return;if(k===42){if(c=p,!s){if(_++,_>1)return;s=!0}}else s=!1}let i=c+1,l=t.length-i;return e.length<o+l?!1:F(e,0,t,0,o,n)&&F(e,e.length-l,t,i,l,n)}function ze(e){let t=new Uint32Array(e.length),n=0;for(let r=1;r<e.length;r++){for(;n>0&&e[r]!==e[n];)n=t[n-1];e[r]===e[n]&&n++,t[r]=n}return t}function Je(e,t){let n=[[]],r=!0,o=!1,_=!1,s=0;for(let a=0;a<e.length;){let y=e.codePointAt(a);if(y!==92){if(y===42)o=!0,_||(n.push([]),_=!0);else{let C=t?y:U(y);n[n.length-1].push(C),r&&=C<=127,s++,_=!1}a+=y>65535?2:1;continue}let h=a+1;for(;e.charCodeAt(h)===92;)h++;let O=h-a,d=e.codePointAt(h),S,m=!1;d===42?(m=O%2===0,S=m?O/2:(O-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?S=Math.ceil(O/2):S=Math.floor(O/2);for(let C=0;C<S;C++)n[n.length-1].push(92),s++;if(m){_=!1,a=h;continue}if(d!==void 0){let C=t?d:U(d);n[n.length-1].push(C),r&&=C<=127,s++,h+=d>65535?2:1}_=!1,a=h}let c=o&&n[0].length===0,i=o&&n[n.length-1].length===0,l=[];for(let a of n)a.length&&l.push({values:a});let p=c?0:1,k=l.length-(i?0:1);for(let a=p;a<k;a++)l[a].values.length>Fe&&(l[a].failure=ze(l[a].values));return{asciiOnly:r,endsWithWildcard:i,hasWildcard:o,minimumInputLength:s,segments:l,startsWithWildcard:c}}function q(e,t){let n=t?$e:Ue,r=e.length<=Ve;if(r){let _=n.get(e);if(_)return _}let o=Je(e,t);if(r){if(n.size>=Ne){let _=n.keys().next().value;_!==void 0&&n.delete(_)}n.set(e,o)}return o}function H(e,t){if(t){let o=[];for(let _=0;_<e.length;){let s=e.codePointAt(_);o.push(s),_+=s>65535?2:1}return o}let n=new Uint32Array(e.length),r=0;for(let o=0;o<e.length;){let _=e.codePointAt(o);n[r]=U(_),r++,o+=_>65535?2:1}return r===n.length?n:n.subarray(0,r)}function I(e,t,n,r){for(let o=0;o<n.values.length;o++){let _=e.charCodeAt(t+o);if(!r&&_>=97&&_<=122&&(_-=32),_!==n.values[o])return!1}return!0}function qe(e,t,n,r,o){let _=r-t.values.length;if(_<n)return-1;if(!t.failure){for(let c=n;c<=_;c++)if(I(e,c,t,o))return c;return-1}let s=0;for(let c=n;c<r;c++){let i=e.charCodeAt(c);for(!o&&i>=97&&i<=122&&(i-=32);s>0&&i!==t.values[s];)s=t.failure[s-1];if(i===t.values[s]&&(s++,s===t.values.length))return c-s+1}return-1}function K(e,t,n){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&I(e,0,t.segments[0],n);let r=0,o=t.segments.length,_=0,s=e.length;if(!t.startsWithWildcard){let c=t.segments[0];if(!I(e,0,c,n))return!1;_=c.values.length,r++}if(!t.endsWithWildcard){o--;let c=t.segments[o];if(s-=c.values.length,!I(e,s,c,n))return!1}for(let c=r;c<o;c++){let i=t.segments[c],l=qe(e,i,_,s,n);if(l===-1)return!1;_=l+i.values.length}return!0}function D(e,t,n){for(let r=0;r<n.values.length;r++)if(e[t+r]!==n.values[r])return!1;return!0}function He(e,t,n,r){let o=r-t.values.length;if(o<n)return-1;if(!t.failure){for(let s=n;s<=o;s++)if(D(e,s,t))return s;return-1}let _=0;for(let s=n;s<r;s++){for(;_>0&&e[s]!==t.values[_];)_=t.failure[_-1];if(e[s]===t.values[_]&&(_++,_===t.values.length))return s-_+1}return-1}function G(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&D(e,0,t.segments[0]);let n=0,r=t.segments.length,o=0,_=e.length;if(!t.startsWithWildcard){let s=t.segments[0];if(!D(e,0,s))return!1;o=s.values.length,n++}if(!t.endsWithWildcard){r--;let s=t.segments[r];if(_-=s.values.length,!D(e,_,s))return!1}for(let s=n;s<r;s++){let c=t.segments[s],i=He(e,c,o,_);if(i===-1)return!1;o=i+c.values.length}return!0}function Ke(e,t,n){let r=ce(e,t,n);if(r!==void 0)return r;let o=q(t,n);return o.asciiOnly?K(e,o,n):G(H(e,n),o)}function ee(e,t,n,r){let o=ce(e,t,n);if(o!==void 0)return o;let _=q(t,n);return _.asciiOnly?K(e,_,n):(r.tokens??=H(e,n),G(r.tokens,_))}function Ge(e,t){let n=e.charCodeAt(0)===33,r=n?e.slice(1):e;return{compiled:r.length===0?void 0:q(r,t),negative:n}}function $(e,t,n,r){let o;return t.compiled?t.compiled.asciiOnly?o=K(e,t.compiled,n):(r.tokens??=H(e,n),o=G(r.tokens,t.compiled)):o=e.length===0,t.negative?!o:o}function Ht(e,t){let n=t?.caseSensitiveMatch===!0,r=typeof e=="string"?[e]:Array.from(new Set(e));if(r.length===0)return()=>!1;let o=r.map(_=>Ge(_,n));if(typeof e=="string"){let _=o[0];return s=>$(s,_,n,{})}return _=>{let s={},c=!1,i=!1;for(let l of o)if(l.negative){if(!$(_,l,n,s))return!1}else c=!0,!i&&$(_,l,n,s)&&(i=!0);return c?i:!0}}function Kt(e,t,n){if(typeof t!="string"&&!t.length)return!1;let r=n===void 0?!1:n.caseSensitiveMatch===!0;if(typeof t=="string"){let c=t.charCodeAt(0)===33,i=c?t.slice(1):t,l=Ke(e,i,r);return c?!l:l}let o={},_=!1,s=!1;for(let c of t){let i=c.charCodeAt(0)===33,l=i?c.slice(1):c;if(i){if(ee(e,l,r,o))return!1}else _=!0,!s&&ee(e,l,r,o)&&(s=!0)}return _?s:!0}export{ut as backslash,dt as backtick,Jt as codsenCLI,Vt as compareFn,Ht as createMatcher,ht as deepClone,bt as deepCloneWithMetadata,Te as detectEol,ft as doublePrime,st as ellipsis,Bt as existy,Dt as findAllIdx,B as formatDiagnosticValue,it as hairspace,Nt as hasOwnProp,Ut as includes,$t as inlineTags,zt as intersection,Mt as isBool,mt as isCurrencyChar,xt as isCurrencySymbol,Me as isDate,Pt as isInt,kt as isLatinLetter,wt as isLetter,Ot as isLowercaseLetter,Tt as isNull,Pe as isNum,yt as isNumberChar,Re as isPlainObject,Ct as isQuote,se as isRegExp,b as isStr,At as isUppercaseLetter,jt as isWhitespaceChar,ge as leftDoubleQuote,ae as leftSingleQuote,Kt as match,gt as multiplicationSign,qt as omit,Et as pullAll,pt as punctuationChars,_t as rawMDash,rt as rawNDash,ot as rawNbsp,at as rawReplacementMark,St as removeTrailingSlash,Wt as resolveEolSetting,pe as rightDoubleQuote,de as rightSingleQuote,lt as singlePrime,Rt as stringSplice,ct as thinSpace,It as trimChars,Lt as uniq,nt as version,Ft as voidTags};
@@ -1,10 +1,18 @@
1
1
  /**
2
2
  * @name codsen-utils
3
3
  * @fileoverview Various utility functions
4
- * @version 1.8.0
4
+ * @version 1.10.0
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/codsen-utils/}
8
8
  */
9
9
 
10
- "use strict";var codsenUtils=(()=>{var W=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var we=Object.prototype.hasOwnProperty;var Ce=(e,n,t)=>n in e?W(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Ae=(e,n)=>{for(var t in n)W(e,t,{get:n[t],enumerable:!0})},Me=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ke(n))!we.call(e,s)&&s!==t&&W(e,s,{get:()=>n[s],enumerable:!(r=xe(n,s))||r.enumerable});return e};var Se=e=>Me(W({},"__esModule",{value:!0}),e);var I=(e,n,t)=>Ce(e,typeof n!="symbol"?n+"":n,t);var Bn={};Ae(Bn,{backslash:()=>Fe,backtick:()=>$e,codsenCLI:()=>Sn,compareFn:()=>gn,deepClone:()=>He,deepCloneWithMetadata:()=>Ge,detectEol:()=>pe,doublePrime:()=>Be,ellipsis:()=>Ee,existy:()=>an,findAllIdx:()=>cn,formatDiagnosticValue:()=>E,hairspace:()=>Ue,hasOwnProp:()=>pn,includes:()=>yn,inlineTags:()=>bn,intersection:()=>mn,isBool:()=>sn,isCurrencyChar:()=>Xe,isCurrencySymbol:()=>qe,isInt:()=>on,isLatinLetter:()=>Ze,isLetter:()=>ze,isLowercaseLetter:()=>ve,isNull:()=>ln,isNum:()=>ue,isNumberChar:()=>Qe,isPlainObject:()=>J,isQuote:()=>Ye,isRegExp:()=>de,isStr:()=>w,isUppercaseLetter:()=>en,isWhitespaceChar:()=>nn,leftDoubleQuote:()=>le,leftSingleQuote:()=>se,match:()=>Ln,multiplicationSign:()=>_e,omit:()=>On,pullAll:()=>fn,punctuationChars:()=>Je,rawMDash:()=>We,rawNDash:()=>je,rawNbsp:()=>Ne,rawReplacementMark:()=>Ve,removeTrailingSlash:()=>tn,resolveEolSetting:()=>dn,rightDoubleQuote:()=>ce,rightSingleQuote:()=>ie,singlePrime:()=>Le,stringSplice:()=>rn,thinSpace:()=>De,uniq:()=>un,version:()=>Ie,voidTags:()=>hn});var ee="1.8.0";function Te(){let e=[],n=0,t=!1;return{append(r){return t?!1:n+r.length>1999?(e.push("\u2026"),n+=1,t=!0,!1):(e.push(r),n+=r.length,!0)},result(){return e.join("")},stopped(){return t}}}function Re(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function N(e,n){if(e.append('"')){for(let t=0;t<n.length&&!e.stopped();t+=1){let r=n.charCodeAt(t);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(Re(r)):e.append(n[t])}e.append('"')}}function Pe(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function te(e,n){e.append("Symbol(");let t=String(n);t.length>8&&N(e,t.slice(7,-1)),e.append(")")}function ne(e,n){typeof n=="symbol"?te(e,n):N(e,String(n))}function E(e,n=0){let t=Te(),r=n===4?4:0,s=new WeakSet,o=0;function i(l){r&&t.append(" ".repeat(l*r))}function c(l,p){l&&t.append(","),r&&(t.append("\n"),i(p+1))}function a(l,p,d){r&&p&&(t.append("\n"),i(d)),t.append(l)}function g(l,p){Object.prototype.hasOwnProperty.call(l,"value")?M(l.value,p):t.append(Pe(l))}function x(l,p){let d;try{d=Reflect.getOwnPropertyDescriptor(l,"length")}catch(y){t.append("[Uninspectable]");return}let k=d==null?void 0:d.value;if(!Number.isSafeInteger(k)||k<0){t.append("[Uninspectable]");return}t.append("[");let b=!1;for(let y=0;y<k&&!t.stopped();y+=1){if(c(b,p),b=!0,o>=50){t.append("[MaxEntries]");break}o+=1;let T;try{T=Reflect.getOwnPropertyDescriptor(l,String(y))}catch(B){t.append("[Uninspectable]");continue}T!=null&&T.enumerable?g(T,p+1):t.append("[Empty]")}a("]",b,p)}function S(l,p){let d;try{d=Reflect.ownKeys(l)}catch(b){t.append("[Uninspectable]");return}t.append("{");let k=!1;for(let b of d){if(t.stopped())break;if(o>=50){c(k,p),k=!0,N(t,"\u2026"),t.append(r?": ":":"),t.append("[MaxEntries]");break}o+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(l,b)}catch(T){c(k,p),k=!0,ne(t,b),t.append(r?": ":":"),t.append("[Uninspectable]");continue}y!=null&&y.enumerable&&(c(k,p),k=!0,ne(t,b),t.append(r?": ":":"),g(y,p+1))}a("}",k,p)}function m(l,p){if(s.has(l)){t.append("[Circular]");return}if(p>=5){t.append("[MaxDepth]");return}let d;try{d=Array.isArray(l)}catch(k){t.append("[Uninspectable]");return}s.add(l);try{d?x(l,p):S(l,p)}finally{s.delete(l)}}function M(l,p){l===null?t.append("null"):typeof l=="string"?N(t,l):typeof l=="number"?t.append(Object.is(l,-0)?"-0":String(l)):typeof l=="boolean"?t.append(l?"true":"false"):typeof l>"u"?t.append("undefined"):typeof l=="bigint"?t.append("".concat(l,"n")):typeof l=="symbol"?te(t,l):typeof l=="function"?t.append("[Function]"):m(l,p)}try{return M(e,0),t.result()}catch(l){return"[Uninspectable]"}}var Ie=ee,se="\u2018",ie="\u2019",le="\u201C",ce="\u201D",je="\u2013",We="\u2014",Ne="\xA0",Ee="\u2026",Ue="\u200A",De="\u2009",Le="\u2032",Be="\u2033",Fe="\\",Ve="\uFFFD",$e="`",_e="\xD7",Je=[".",",",";","!","?"],fe=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),U=Object.prototype.hasOwnProperty,j=class{constructor(){I(this,"hasRepeatedReferences",!1);I(this,"clones",[]);I(this,"index");I(this,"sources",[])}get(n){if(this.index){let r=this.index.get(n);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(n);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(n,t){if(this.index){this.index.set(n,t);return}if(this.sources.push(n),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function ae(e,n){let t=n.get(e);if(t!==void 0)return t;let r=e.slice(0);return n.set(e,r),r}function Ke(e,n){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let o=Buffer.from(e);return n.set(e,o),o}let t=ae(e.buffer,n);if(e instanceof DataView){let o=new DataView(t,e.byteOffset,e.byteLength);return n.set(e,o),o}let r=e.constructor,s=new r(t,e.byteOffset,e.length);return n.set(e,s),s}function F(e,n,t,r){for(let s of t){let o=n[s];e[s]=typeof o!="object"||o===null?o:R(o,r)}}function R(e,n){if(typeof e!="object"||e===null)return e;let t=n.get(e);if(t!==void 0)return t;if(Array.isArray(e)){let o=e.length,i=new Array(o);n.set(e,i);let c=e,a=Object.keys(e);if(a.length===o&&(o===0||a[o-1]==="".concat(o-1)))for(let g=0;g<o;g++){let x=c[g];i[g]=typeof x!="object"||x===null?x:R(x,n)}else F(i,c,a,n);return i}let r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null){let o={};return n.set(e,o),F(o,e,Object.keys(e),n),o}if(e instanceof Date){let o=new Date(e.getTime());return n.set(e,o),o}if(ArrayBuffer.isView(e))return Ke(e,n);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return ae(e,n);if(e instanceof Map){let o=new Map;n.set(e,o);for(let[i,c]of e)o.set(R(i,n),R(c,n));return o}if(e instanceof Set){let o=new Set;n.set(e,o);for(let i of e)o.add(R(i,n));return o}let s={};return n.set(e,s),F(s,e,Object.keys(e),n),s}function He(e){return R(e,new j)}function Ge(e){let n=new j,t=R(e,n);return{hasRepeatedReferences:n.hasRepeatedReferences,value:t}}function Qe(e){if(!w(e))return!1;let n=e.charCodeAt(0);return n>=48&&n<=57}function Xe(e){return w(e)&&e.length===1&&fe.has(e)}function qe(e){return w(e)&&fe.has(e)}function ze(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91||n>96&&n<123:e.toUpperCase()!==e.toLowerCase()}function Ze(e){if(!e||!w(e))return!1;let n=e.charCodeAt(0);return n>64&&n<91||n>96&&n<123}function Ye(e){return w(e)&&(e==='"'||e==="'"||e===se||e===ie||e===le||e===ce)}function ve(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>96&&n<123:e===e.toLowerCase()&&e!==e.toUpperCase()}function en(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91:e===e.toUpperCase()&&e!==e.toLowerCase()}function nn(e){if(!w(e)||!e)return!1;let n=e.charCodeAt(0);return n<128?n===32||n>8&&n<14:!e[0].trim()}var tn=e=>w(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function J(e){if(e==null||typeof e!="object")return!1;let n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function rn(e="",n=0,t=0,r=""){return n<0&&(n+=e.length,n<0&&(n=0)),e.slice(0,n)+(r||"")+e.slice(n+t)}function w(e){return typeof e=="string"}function ue(e){return Number.isFinite(e)}function on(e){return Number.isSafeInteger(e)&&e>=0}function sn(e){return typeof e=="boolean"}function ln(e){return e===null}function de(e){return e instanceof RegExp}function cn(e,n){if(!w(e)||!w(n)||n.length===0)return[];let t=[],r=e.indexOf(n);for(;r!==-1;)t.push(r),r=e.indexOf(n,r+1);return t}function fn(e=[],n=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!n||!Array.isArray(n)||!n.length)return e;if(e.length<128||n.length<5)return e.filter(r=>!n.includes(r));let t=new Set(n);return e.filter(r=>!t.has(r))}function an(e){return e!=null}function un(e){return[...new Set(e)]}function pe(e){if(!(typeof e!="string"||!e)){if(e.includes("\r\n"))return"\r\n";if(e.includes("\n"))return"\n";if(e.includes("\r"))return"\r"}}function dn(e,n,t="\n"){if(t!=="\n"&&t!=="\r\n"&&t!=="\r")throw new Error('codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as '.concat(E(t)));return n==="crlf"?"\r\n":n==="cr"?"\r":n==="lf"?"\n":pe(e)||t}function pn(e,n){return J(e)&&w(n)&&U.call(e,n)}function gn(e,n){return e.localeCompare(n)}var hn=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],bn=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function yn(e,n){if(!Array.isArray(e)||!e.length||!w(n))return!1;for(let t of e){if(typeof t=="string"){if(n===t)return!0;continue}if(de(t)){t.global&&(t.lastIndex=0);let r=t.test(n);if(t.global&&(t.lastIndex=0),r)return!0}}return!1}function mn(e=[],n=[]){if(!Array.isArray(e)||!Array.isArray(n)||!e.length||!n.length)return[];let t=[];if(e.length*n.length<64){for(let o of e)n.includes(o)&&!t.includes(o)&&t.push(o);return t}let r=new Set(n),s=new Set;for(let o of e)r.has(o)&&!s.has(o)&&(s.add(o),t.push(o));return t}var V=/^-?\d+(?:\.\d*)?(?:e[+-]?\d+)?$/i;function xn(e){return e.replace(/-+([^-])/g,(n,t)=>t.toUpperCase())}function kn(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function wn(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function re(e,n){let t=Number.POSITIVE_INFINITY,r=e.split("\n");for(let o of r){let i=/^[ \t]*(?=\S)/.exec(o);i&&(t=Math.min(t,i[0].length))}let s=" ".repeat(n);return r.map(o=>o.trim()?s+o.slice(t):o).join("\n")}function Cn(e,n,t){let r="";return e&&(r=wn(e.replace(/\t+\n*$/,"")),r.includes("\n")&&(r=re(r,t)),r="\n".concat(r)),n&&(r=r?"".concat(re("\n".concat(n,"\n"),t)).concat(r):"\n".concat(n)),"".concat(r,"\n")}function An(e){var r;let n=w(e.name)?e.name:"",{bin:t}=e;return w(t)?n.slice(n.startsWith("@")?n.indexOf("/")+1:0):t&&typeof t=="object"&&(r=Object.keys(t)[0])!=null?r:n}function Mn(e,n){let t=e?e.type:void 0;return n===void 0?t==="string"?"":t==="number"?void 0:!0:t==="boolean"?n==="true":t==="number"?Number(n):n}function Sn(e="",n={}){var K,H,G,Q,X,q,z,Z,Y,v;let t=typeof process>"u"?void 0:process,r=(K=n.pkg)!=null?K:{},s=(G=(H=n.argv)!=null?H:t==null?void 0:t.argv.slice(2))!=null?G:[],o=(Q=n.helpIndent)!=null?Q:2,i=(X=n.autoHelp)!=null?X:!0,c=(q=n.autoVersion)!=null?q:!0,a=(Z=(z=n.version)!=null?z:r.version)!=null?Z:"No version found",g=U.call(n,"booleanDefault")?n.booleanDefault:!1,x=Cn(e,(Y=n.description)!=null?Y:r.description,o);function S(f){console.log(x),t==null||t.exit(ue(f)?f:2)}function m(){console.log(a),t==null||t.exit(0)}let M=[],l=new Map;for(let[f,u]of Object.entries((v=n.flags)!=null?v:{})){let h={key:f,type:u.type,isMultiple:!!u.isMultiple,source:u};M.push(h),l.set(f,h),l.set(kn(f),h),u.shortFlag&&l.set(u.shortFlag,h)}let p=[],d={};function k(f,u){let h=l.get(f),C=h?h.key:xn(f);if(h!=null&&h.isMultiple){let A=d[C];Array.isArray(A)?A.push(u):d[C]=[u];return}d[C]=u}function b(f,u){k(f,Mn(l.get(f),u))}function y(f,u){return u===void 0?!1:(f==null?void 0:f.type)==="boolean"?u==="true"||u==="false":!(u.startsWith("-")&&u.length>1&&!V.test(u))}function T(f,u){let h=f.slice(1);for(let C=0;C<h.length;C++){let A=h[C],O=h.slice(C+1);if(O.startsWith("="))return b(A,O.slice(1)),u;if(V.test(O)||O&&/\W/.test(O[0]))return b(A,O),u;let P=l.get(A);if(O&&(P!=null&&P.type)&&P.type!=="boolean")return b(A,O),u;if(O){b(A,void 0);continue}if(y(P,s[u+1]))return b(A,s[u+1]),u+1;b(A,void 0)}return u}for(let f=0;f<s.length;f++){let u=s[f];if(u==="--"){p.push(...s.slice(f+1));break}if(u.startsWith("--")){let h=u.slice(2),C=h.indexOf("=");if(C!==-1){b(h.slice(0,C),h.slice(C+1));continue}if(h.startsWith("no-")){k(h.slice(3),!1);continue}let A=l.get(h);if(y(A,s[f+1])){b(h,s[f+1]),f++;continue}b(h,void 0);continue}if(u.startsWith("-")&&u.length>1&&!V.test(u)){f=T(u,f);continue}p.push(u)}for(let f of M)U.call(d,f.key)||(U.call(f.source,"default")?d[f.key]=f.source.default:f.isMultiple?d[f.key]=[]:f.type==="boolean"&&g!==void 0&&(d[f.key]=g));!p.length&&s.length===1&&(c&&d.version===!0?m():i&&d.help===!0&&S(0));let B=An(r);return B&&t&&(t.title=B),{input:p,flags:d,pkg:r,help:x,showHelp:S,showVersion:m}}function On(e,n=[]){if(!e)return e;if(!J(e))throw new Error("codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ".concat(E(e,4),' (typeof is "').concat(typeof e,'")'));let t={},r=new j;r.set(e,t);let s=Object.keys(e),o=s.length<128||n.length<5?void 0:new Set(n);for(let i of s)(o?o.has(i):n.includes(i))||(t[i]=R(e[i],r));return t}var Tn=256,Rn=1024,Pn=1,In=new Map,jn=new Map;function _(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let n=String.fromCharCode(e).toUpperCase();if(n.length!==1)return e;let t=n.charCodeAt(0);return e>127&&t<128?e:t}function $(e,n,t,r,s,o){for(let i=0;i<s;i++){let c=e.charCodeAt(n+i),a=t.charCodeAt(r+i);if(o||(c>=97&&c<=122&&(c-=32),a>=97&&a<=122&&(a-=32)),c!==a)return!1}return!0}function ge(e,n,t){let r=n.indexOf("\\");if(r===-1&&e===n)return!0;let s=n.indexOf("*");if(r===-1&&s===-1){if(t)return!1;for(let x=0;x<n.length;x++)if(n.charCodeAt(x)>127)return;return e.length===n.length&&$(e,0,n,0,n.length,!1)}if(r!==-1)return;let o=0,i=!1,c=-1;for(let x=0;x<n.length;x++){let S=n.charCodeAt(x);if(S>127)return;if(S===42){if(c=x,!i){if(o++,o>1)return;i=!0}}else i=!1}let a=c+1,g=n.length-a;return e.length<s+g?!1:$(e,0,n,0,s,t)&&$(e,e.length-g,n,a,g,t)}function Wn(e){let n=new Uint32Array(e.length),t=0;for(let r=1;r<e.length;r++){for(;t>0&&e[r]!==e[t];)t=n[t-1];e[r]===e[t]&&t++,n[r]=t}return n}function Nn(e,n){let t=[[]],r=!0,s=!1,o=!1,i=0;for(let m=0;m<e.length;){let M=e.codePointAt(m);if(M!==92){if(M===42)s=!0,o||(t.push([]),o=!0);else{let y=n?M:_(M);t[t.length-1].push(y),r&&(r=y<=127),i++,o=!1}m+=M>65535?2:1;continue}let l=m+1;for(;e.charCodeAt(l)===92;)l++;let p=l-m,d=e.codePointAt(l),k,b=!1;d===42?(b=p%2===0,k=b?p/2:(p-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?k=Math.ceil(p/2):k=Math.floor(p/2);for(let y=0;y<k;y++)t[t.length-1].push(92),i++;if(b){o=!1,m=l;continue}if(d!==void 0){let y=n?d:_(d);t[t.length-1].push(y),r&&(r=y<=127),i++,l+=d>65535?2:1}o=!1,m=l}let c=s&&t[0].length===0,a=s&&t[t.length-1].length===0,g=[];for(let m of t)m.length&&g.push({values:m});let x=c?0:1,S=g.length-(a?0:1);for(let m=x;m<S;m++)g[m].values.length>Pn&&(g[m].failure=Wn(g[m].values));return{asciiOnly:r,endsWithWildcard:a,hasWildcard:s,minimumInputLength:i,segments:g,startsWithWildcard:c}}function he(e,n){let t=n?In:jn,r=e.length<=Rn;if(r){let o=t.get(e);if(o)return o}let s=Nn(e,n);if(r){if(t.size>=Tn){let o=t.keys().next().value;o!==void 0&&t.delete(o)}t.set(e,s)}return s}function be(e,n){if(n){let s=[];for(let o=0;o<e.length;){let i=e.codePointAt(o);s.push(i),o+=i>65535?2:1}return s}let t=new Uint32Array(e.length),r=0;for(let s=0;s<e.length;){let o=e.codePointAt(s);t[r]=_(o),r++,s+=o>65535?2:1}return r===t.length?t:t.subarray(0,r)}function D(e,n,t,r){for(let s=0;s<t.values.length;s++){let o=e.charCodeAt(n+s);if(!r&&o>=97&&o<=122&&(o-=32),o!==t.values[s])return!1}return!0}function En(e,n,t,r,s){let o=r-n.values.length;if(o<t)return-1;if(!n.failure){for(let c=t;c<=o;c++)if(D(e,c,n,s))return c;return-1}let i=0;for(let c=t;c<r;c++){let a=e.charCodeAt(c);for(!s&&a>=97&&a<=122&&(a-=32);i>0&&a!==n.values[i];)i=n.failure[i-1];if(a===n.values[i]&&(i++,i===n.values.length))return c-i+1}return-1}function ye(e,n,t){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&D(e,0,n.segments[0],t);let r=0,s=n.segments.length,o=0,i=e.length;if(!n.startsWithWildcard){let c=n.segments[0];if(!D(e,0,c,t))return!1;o=c.values.length,r++}if(!n.endsWithWildcard){s--;let c=n.segments[s];if(i-=c.values.length,!D(e,i,c,t))return!1}for(let c=r;c<s;c++){let a=n.segments[c],g=En(e,a,o,i,t);if(g===-1)return!1;o=g+a.values.length}return!0}function L(e,n,t){for(let r=0;r<t.values.length;r++)if(e[n+r]!==t.values[r])return!1;return!0}function Un(e,n,t,r){let s=r-n.values.length;if(s<t)return-1;if(!n.failure){for(let i=t;i<=s;i++)if(L(e,i,n))return i;return-1}let o=0;for(let i=t;i<r;i++){for(;o>0&&e[i]!==n.values[o];)o=n.failure[o-1];if(e[i]===n.values[o]&&(o++,o===n.values.length))return i-o+1}return-1}function me(e,n){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&L(e,0,n.segments[0]);let t=0,r=n.segments.length,s=0,o=e.length;if(!n.startsWithWildcard){let i=n.segments[0];if(!L(e,0,i))return!1;s=i.values.length,t++}if(!n.endsWithWildcard){r--;let i=n.segments[r];if(o-=i.values.length,!L(e,o,i))return!1}for(let i=t;i<r;i++){let c=n.segments[i],a=Un(e,c,s,o);if(a===-1)return!1;s=a+c.values.length}return!0}function Dn(e,n,t){let r=ge(e,n,t);if(r!==void 0)return r;let s=he(n,t);return s.asciiOnly?ye(e,s,t):me(be(e,t),s)}function oe(e,n,t,r){var i;let s=ge(e,n,t);if(s!==void 0)return s;let o=he(n,t);return o.asciiOnly?ye(e,o,t):((i=r.tokens)!=null||(r.tokens=be(e,t)),me(r.tokens,o))}function Ln(e,n,t){if(typeof n!="string"&&!n.length)return!1;let r=t===void 0?!1:t.caseSensitiveMatch===!0;if(typeof n=="string"){let c=n.charCodeAt(0)===33,a=c?n.slice(1):n,g=Dn(e,a,r);return c?!g:g}let s={},o=!1,i=!1;for(let c of n){let a=c.charCodeAt(0)===33,g=a?c.slice(1):c;if(a){if(oe(e,g,r,s))return!1}else o=!0,!i&&oe(e,g,r,s)&&(i=!0)}return o?i:!0}return Se(Bn);})();
10
+ "use strict";var codsenUtils=(()=>{var D=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var Fe=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t)=>{for(var n in t)D(e,n,{get:t[n],enumerable:!0})},$e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ne(t))!Ve.call(e,o)&&o!==n&&D(e,o,{get:()=>t[o],enumerable:!(r=Le(t,o))||r.enumerable});return e};var ze=e=>$e(D({},"__esModule",{value:!0}),e);var T=(e,t,n)=>Fe(e,typeof t!="symbol"?t+"":t,n);var bn={};Ue(bn,{backslash:()=>_t,backtick:()=>st,codsenCLI:()=>tn,compareFn:()=>Jt,createMatcher:()=>gn,deepClone:()=>wt,deepCloneWithMetadata:()=>kt,detectEol:()=>We,doublePrime:()=>rt,ellipsis:()=>ve,existy:()=>Ft,findAllIdx:()=>Nt,formatDiagnosticValue:()=>I,hairspace:()=>et,hasOwnProp:()=>zt,includes:()=>Ht,inlineTags:()=>Gt,intersection:()=>Kt,isBool:()=>Wt,isCurrencyChar:()=>Ot,isCurrencySymbol:()=>At,isDate:()=>De,isInt:()=>Dt,isLatinLetter:()=>St,isLetter:()=>jt,isLowercaseLetter:()=>Pt,isNull:()=>Bt,isNum:()=>Ie,isNumberChar:()=>Ct,isPlainObject:()=>Te,isQuote:()=>Rt,isRegExp:()=>Z,isStr:()=>k,isUppercaseLetter:()=>Mt,isWhitespaceChar:()=>Tt,leftDoubleQuote:()=>Oe,leftSingleQuote:()=>ke,match:()=>hn,multiplicationSign:()=>it,omit:()=>nn,pullAll:()=>Vt,punctuationChars:()=>ct,rawMDash:()=>Ye,rawNDash:()=>Ze,rawNbsp:()=>Xe,rawReplacementMark:()=>ot,removeTrailingSlash:()=>It,resolveEolSetting:()=>$t,rightDoubleQuote:()=>Ae,rightSingleQuote:()=>Ce,singlePrime:()=>nt,stringSplice:()=>Et,thinSpace:()=>tt,trimChars:()=>Lt,uniq:()=>Ut,version:()=>Qe,voidTags:()=>qt});var fe="1.10.0";function qe(){let e=[],t=0,n=!1;return{append(r){return n?!1:t+r.length>1999?(e.push("\u2026"),t+=1,n=!0,!1):(e.push(r),t+=r.length,!0)},result(){return e.join("")},stopped(){return n}}}function Ge(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function W(e,t){if(e.append('"')){for(let n=0;n<t.length&&!e.stopped();n+=1){let r=t.charCodeAt(n);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(Ge(r)):e.append(t[n])}e.append('"')}}function He(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function de(e,t){e.append("Symbol(");let n=String(t);n.length>8&&W(e,n.slice(7,-1)),e.append(")")}function ue(e,t){typeof t=="symbol"?de(e,t):W(e,String(t))}function I(e,t=0){let n=qe(),r=t===4?4:0,o=new WeakSet,_=0;function s(l){r&&n.append(" ".repeat(l*r))}function c(l,p){l&&n.append(","),r&&(n.append("\n"),s(p+1))}function i(l,p,d){r&&p&&(n.append("\n"),s(d)),n.append(l)}function a(l,p){Object.prototype.hasOwnProperty.call(l,"value")?w(l.value,p):n.append(He(l))}function m(l,p){let d;try{d=Reflect.getOwnPropertyDescriptor(l,"length")}catch(y){n.append("[Uninspectable]");return}let x=d==null?void 0:d.value;if(!Number.isSafeInteger(x)||x<0){n.append("[Uninspectable]");return}n.append("[");let b=!1;for(let y=0;y<x&&!n.stopped();y+=1){if(c(b,p),b=!0,_>=50){n.append("[MaxEntries]");break}_+=1;let R;try{R=Reflect.getOwnPropertyDescriptor(l,String(y))}catch(F){n.append("[Uninspectable]");continue}R!=null&&R.enumerable?a(R,p+1):n.append("[Empty]")}i("]",b,p)}function C(l,p){let d;try{d=Reflect.ownKeys(l)}catch(b){n.append("[Uninspectable]");return}n.append("{");let x=!1;for(let b of d){if(n.stopped())break;if(_>=50){c(x,p),x=!0,W(n,"\u2026"),n.append(r?": ":":"),n.append("[MaxEntries]");break}_+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(l,b)}catch(R){c(x,p),x=!0,ue(n,b),n.append(r?": ":":"),n.append("[Uninspectable]");continue}y!=null&&y.enumerable&&(c(x,p),x=!0,ue(n,b),n.append(r?": ":":"),a(y,p+1))}i("}",x,p)}function g(l,p){if(o.has(l)){n.append("[Circular]");return}if(p>=5){n.append("[MaxDepth]");return}let d;try{d=Array.isArray(l)}catch(x){n.append("[Uninspectable]");return}o.add(l);try{d?m(l,p):C(l,p)}finally{o.delete(l)}}function w(l,p){l===null?n.append("null"):typeof l=="string"?W(n,l):typeof l=="number"?n.append(Object.is(l,-0)?"-0":String(l)):typeof l=="boolean"?n.append(l?"true":"false"):typeof l>"u"?n.append("undefined"):typeof l=="bigint"?n.append("".concat(l,"n")):typeof l=="symbol"?de(n,l):typeof l=="function"?n.append("[Function]"):g(l,p)}try{return w(e,0),n.result()}catch(l){return"[Uninspectable]"}}var Ke=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),U=Ke.slice(1).split("_"),$=[],pe=127;for(let e=0;e<U.length;e+=2){let t=pe+1+Number.parseInt(U[e],36),n=t+Number.parseInt(U[e+1],36);$.push([t,n]),pe=n}function ge(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=$.length-1;for(;t<=n;){let r=t+n>>1,o=$[r];if(e<o[0])n=r-1;else if(e>o[1])t=r+1;else return!0}return!1}var Qe=fe,ke="\u2018",Ce="\u2019",Oe="\u201C",Ae="\u201D",Ze="\u2013",Ye="\u2014",Xe="\xA0",ve="\u2026",et="\u200A",tt="\u2009",nt="\u2032",rt="\u2033",_t="\\",ot="\uFFFD",st="`",it="\xD7",ct=[".",",",";","!","?"],je=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),L=Object.prototype.hasOwnProperty,Se=Function.prototype.toString,lt=Se.call(Object),E=class{constructor(){T(this,"hasRepeatedReferences",!1);T(this,"clones",[]);T(this,"index");T(this,"sources",[])}get(t){if(this.index){let r=this.index.get(t);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let n=this.sources.indexOf(t);if(n!==-1)return this.hasRepeatedReferences=!0,this.clones[n]}set(t,n){if(this.index){this.index.set(t,n);return}if(this.sources.push(t),this.clones.push(n),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function Re(e,t){let n=t.get(e);if(n!==void 0)return n;let r=e.slice(0);return t.set(e,r),r}function at(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let _=Buffer.from(e);return t.set(e,_),_}let n=Re(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let _=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,_),_}let r=e.constructor,o=new r(n,e.byteOffset,e.length);return t.set(e,o),o}function Pe(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function B(e,t,n,r){for(let o of n){let _=t[o],s=typeof _!="object"||_===null?_:S(_,r);o==="__proto__"?Pe(e,o,s):e[o]=s}}function P(e,t,n,r){for(let o of n){let _=Object.getOwnPropertyDescriptor(t,o);if(_){if("value"in _){let s=_.value;_.value=typeof s!="object"||s===null?s:S(s,r)}Object.defineProperty(e,o,_)}}}var ft=Map.prototype.entries,ut=Set.prototype.values,K=Object.prototype.toString,ye,dt=(ye=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:ye.get,me,pt=(me=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:me.get,xe,gt=(xe=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:xe.get,we,Me=(we=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:we.get,ht=RegExp.prototype.test,z;function bt(e){if(e instanceof ArrayBuffer)return!0;try{return dt.call(e),!0}catch(t){return!1}}function yt(e){try{return ft.call(e)}catch(t){return null}}function mt(e){try{return ut.call(e)}catch(t){return null}}function xt(e){var t;try{return z||(z=(t=Object.getOwnPropertyDescriptor(URL.prototype,"href"))==null?void 0:t.get),z.call(e)}catch(n){return null}}function S(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let i=e.length,a=new Array(i);t.set(e,a);let m=e,C=Object.keys(e);if(C.length===i&&(i===0||C[i-1]==="".concat(i-1)))for(let g=0;g<i;g++){let w=m[g];a[g]=typeof w!="object"||w===null?w:S(w,t)}else B(a,m,C,t);return a}let r=Object.getPrototypeOf(e);if(r===Object.prototype){let i={};return t.set(e,i),B(i,e,Object.keys(e),t),i}if(r===null){let i=Object.create(null);return t.set(e,i),B(i,e,Object.keys(e),t),i}if(De(e)){let i=new Date(Ee.call(e));return t.set(e,i),P(i,e,Object.keys(e),t),i}if(ArrayBuffer.isView(e))return at(e,t);if(bt(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Re(e,t);let o=yt(e);if(o){let i=new Map;t.set(e,i);for(let[a,m]of o)i.set(S(a,t),S(m,t));return P(i,e,Object.keys(e),t),i}let _=mt(e);if(_){let i=new Set;t.set(e,i);for(let a of _)i.add(S(a,t));return P(i,e,Object.keys(e),t),i}if(Z(e)&&e!==RegExp.prototype){let i=new RegExp(Me.call(e),pt.call(e));return i.lastIndex=e.lastIndex,t.set(e,i),P(i,e,Object.keys(e),t),i}let s=xt(e);if(s!==null){let i=new URL(s);return t.set(e,i),P(i,e,Object.keys(e),t),i}if(e instanceof Error||K.call(e)==="[object Error]"){let i=Object.create(Object.getPrototypeOf(e));return t.set(e,i),P(i,e,Reflect.ownKeys(e),t),i}let c=Object.create(r);return t.set(e,c),B(c,e,Object.keys(e),t),c}function wt(e){return S(e,new E)}function kt(e){let t=new E,n=S(e,t);return{hasRepeatedReferences:t.hasRepeatedReferences,value:n}}function Ct(e){if(!k(e))return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function Ot(e){return k(e)&&e.length===1&&je.has(e)}function At(e){return k(e)&&je.has(e)}function Q(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function jt(e){if(!k(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:ge(Q(e))}function St(e){if(!e||!k(e))return!1;let t=e.charCodeAt(0);return t>64&&t<91||t>96&&t<123}function Rt(e){return k(e)&&(e==='"'||e==="'"||e===ke||e===Ce||e===Oe||e===Ae)}function Pt(e){if(!k(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>96&&t<123:Q(e)<0?!1:e===e.toLowerCase()&&e!==e.toUpperCase()}function Mt(e){if(!k(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91:Q(e)<0?!1:e===e.toUpperCase()&&e!==e.toLowerCase()}function Tt(e){if(!k(e)||!e)return!1;let t=e.charCodeAt(0);return t<128?t===32||t>8&&t<14:!e[0].trim()}var It=e=>k(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function Te(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");if(!n||!("value"in n)||typeof n.value!="function")return!1;let r=Object.getOwnPropertyDescriptor(n.value,"prototype");return(r==null?void 0:r.value)===t&&Se.call(n.value)===lt}function Et(e="",t=0,n=0,r=""){return t<0&&(t+=e.length,t<0&&(t=0)),e.slice(0,t)+(r||"")+e.slice(t+n)}function k(e){return typeof e=="string"}function Ie(e){return Number.isFinite(e)}function Dt(e){return Number.isSafeInteger(e)&&e>=0}function Wt(e){return typeof e=="boolean"}function Bt(e){return e===null}function Z(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):K.call(e)!=="[object RegExp]"?!1:(Me.call(e),!0)}catch(t){return!1}}var Ee=Date.prototype.getTime;function De(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||K.call(e)!=="[object Date]")return!1;try{return Ee.call(e),!0}catch(t){return!1}}function Lt(e,t){if(!e||!t)return e;let n=!0;for(let c=t.length;c--;)if(t.charCodeAt(c)>127){n=!1;break}if(n){let c=0,i=e.length;if(t.length===1){let a=t.charCodeAt(0);for(;c<i&&e.charCodeAt(c)===a;)c++;for(;i>c&&e.charCodeAt(i-1)===a;)i--}else{for(;c<i&&t.includes(e[c]);)c++;for(;i>c&&t.includes(e[i-1]);)i--}return c===0&&i===e.length?e:e.slice(c,i)}let r=Array.from(e),o=new Set(t),_=0,s=r.length;for(;_<s&&o.has(r[_]);)_++;for(;s>_&&o.has(r[s-1]);)s--;return _===0&&s===r.length?e:r.slice(_,s).join("")}function Nt(e,t){if(!k(e)||!k(t)||t.length===0)return[];let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Vt(e=[],t=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!t||!Array.isArray(t)||!t.length)return e.slice();if(e.length*t.length<400)return e.filter(r=>!t.includes(r));let n=new Set(t);return e.filter(r=>!n.has(r))}function Ft(e){return e!=null}function Ut(e){return[...new Set(e)]}function We(e){if(!(typeof e!="string"||!e)){if(e.includes("\r\n"))return"\r\n";if(e.includes("\n"))return"\n";if(e.includes("\r"))return"\r"}}function $t(e,t,n="\n"){if(n!=="\n"&&n!=="\r\n"&&n!=="\r")throw new Error('codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as '.concat(I(n)));return t==="crlf"?"\r\n":t==="cr"?"\r":t==="lf"?"\n":We(e)||n}function zt(e,t){return e!=null&&L.call(e,t)}function Jt(e,t){return e.localeCompare(t)}var qt=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Gt=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function Ht(e,t){if(!Array.isArray(e)||!e.length||!k(t))return!1;for(let n of e){if(typeof n=="string"){if(t===n)return!0;continue}if(Z(n)){let r=gt.call(n);r&&(n.lastIndex=0);let o=ht.call(n,t);if(r&&(n.lastIndex=0),o)return!0}}return!1}function Kt(e=[],t=[]){if(!Array.isArray(e)||!Array.isArray(t)||!e.length||!t.length)return[];let n=[];if(e.length*t.length<64){for(let _ of e)t.includes(_)&&!n.includes(_)&&n.push(_);return n}let r=new Set(t),o=new Set;for(let _ of e)r.has(_)&&!o.has(_)&&(o.add(_),n.push(_));return n}var J=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function Qt(e){return e.replace(/-+([^-])/g,(t,n)=>n.toUpperCase())}function Zt(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function Yt(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function he(e,t){let n=Number.POSITIVE_INFINITY,r=e.split("\n");for(let _ of r){let s=/^[ \t]*(?=\S)/.exec(_);s&&(n=Math.min(n,s[0].length))}let o=" ".repeat(t);return r.map(_=>_.trim()?o+_.slice(n):_).join("\n")}function Xt(e,t,n){let r="";return e&&(r=Yt(e.replace(/\t+\n*$/,"")),r.includes("\n")&&(r=he(r,n)),r="\n".concat(r)),t&&(r=r?"".concat(he("\n".concat(t,"\n"),n)).concat(r):"\n".concat(t)),"".concat(r,"\n")}function vt(e){var r;let t=k(e.name)?e.name:"",{bin:n}=e;return k(n)?t.slice(t.startsWith("@")?t.indexOf("/")+1:0):n&&typeof n=="object"&&(r=Object.keys(n)[0])!=null?r:t}function en(e,t){let n=e?e.type:void 0;return t===void 0?n==="string"?"":n==="number"?void 0:!0:n==="boolean"?t==="true":n==="number"?Number(t):t}function tn(e="",t={}){var te,ne,re,_e,oe,se,ie,ce,le,ae;let n=typeof process>"u"?void 0:process,r=(te=t.pkg)!=null?te:{},o=(re=(ne=t.argv)!=null?ne:n==null?void 0:n.argv.slice(2))!=null?re:[],_=(_e=t.helpIndent)!=null?_e:2,s=(oe=t.autoHelp)!=null?oe:!0,c=(se=t.autoVersion)!=null?se:!0,i=(ce=(ie=t.version)!=null?ie:r.version)!=null?ce:"No version found",a=L.call(t,"booleanDefault")?t.booleanDefault:!1,m=Xt(e,(le=t.description)!=null?le:r.description,_);function C(f){console.log(m),n==null||n.exit(Ie(f)?f:2)}function g(){console.log(i),n==null||n.exit(0)}let w=[],l=new Map;for(let[f,u]of Object.entries((ae=t.flags)!=null?ae:{})){let h={key:f,type:u.type,isMultiple:!!u.isMultiple,source:u};w.push(h),l.set(f,h),l.set(Zt(f),h),u.shortFlag&&l.set(u.shortFlag,h)}let p=[],d={};function x(f,u){let h=l.get(f),O=h?h.key:Qt(f);if(h!=null&&h.isMultiple){let A=d[O];Array.isArray(A)?A.push(u):d[O]=[u];return}d[O]=u}function b(f,u){x(f,en(l.get(f),u))}function y(f,u){return u===void 0?!1:(f==null?void 0:f.type)==="boolean"?u==="true"||u==="false":!(u.startsWith("-")&&u.length>1&&!J.test(u))}function R(f,u){let h=f.slice(1);for(let O=0;O<h.length;O++){let A=h[O],j=h.slice(O+1);if(j.startsWith("="))return b(A,j.slice(1)),u;if(J.test(j)||j&&/\W/.test(j[0]))return b(A,j),u;let M=l.get(A);if(j&&(M!=null&&M.type)&&M.type!=="boolean")return b(A,j),u;if(j){b(A,void 0);continue}if(y(M,o[u+1]))return b(A,o[u+1]),u+1;b(A,void 0)}return u}for(let f=0;f<o.length;f++){let u=o[f];if(u==="--"){p.push(...o.slice(f+1));break}if(u.startsWith("--")){let h=u.slice(2),O=h.indexOf("=");if(O!==-1){b(h.slice(0,O),h.slice(O+1));continue}if(h.startsWith("no-")){x(h.slice(3),!1);continue}let A=l.get(h);if(y(A,o[f+1])){b(h,o[f+1]),f++;continue}b(h,void 0);continue}if(u.startsWith("-")&&u.length>1&&!J.test(u)){f=R(u,f);continue}p.push(u)}for(let f of w)L.call(d,f.key)||(L.call(f.source,"default")?d[f.key]=f.source.default:f.isMultiple?d[f.key]=[]:f.type==="boolean"&&a!==void 0&&(d[f.key]=a));!p.length&&o.length===1&&(c&&d.version===!0?g():s&&d.help===!0&&C(0));let F=vt(r);return F&&n&&(n.title=F),{input:p,flags:d,pkg:r,help:m,showHelp:C,showVersion:g}}function nn(e,t=[]){if(!e)return e;if(!Te(e))throw new Error("codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ".concat(I(e,4),' (typeof is "').concat(typeof e,'")'));let n=Object.getPrototypeOf(e)===null?Object.create(null):{},r=new E;r.set(e,n);let o=Object.keys(e),_=o.length*t.length<400?void 0:new Set(t);for(let s of o){if(_?_.has(s):t.includes(s))continue;let c=S(e[s],r);s==="__proto__"?Pe(n,s,c):n[s]=c}return n}var rn=256,_n=1024,on=1,sn=new Map,cn=new Map;function H(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let n=t.charCodeAt(0);return e>127&&n<128?e:n}function q(e,t,n,r,o,_){for(let s=0;s<o;s++){let c=e.charCodeAt(t+s),i=n.charCodeAt(r+s);if(_||(c>=97&&c<=122&&(c-=32),i>=97&&i<=122&&(i-=32)),c!==i)return!1}return!0}function Be(e,t,n){let r=t.indexOf("\\");if(r===-1&&e===t)return!0;let o=t.indexOf("*");if(r===-1&&o===-1){if(n)return!1;for(let m=0;m<t.length;m++)if(t.charCodeAt(m)>127)return;return e.length===t.length&&q(e,0,t,0,t.length,!1)}if(r!==-1)return;let _=0,s=!1,c=-1;for(let m=0;m<t.length;m++){let C=t.charCodeAt(m);if(C>127)return;if(C===42){if(c=m,!s){if(_++,_>1)return;s=!0}}else s=!1}let i=c+1,a=t.length-i;return e.length<o+a?!1:q(e,0,t,0,o,n)&&q(e,e.length-a,t,i,a,n)}function ln(e){let t=new Uint32Array(e.length),n=0;for(let r=1;r<e.length;r++){for(;n>0&&e[r]!==e[n];)n=t[n-1];e[r]===e[n]&&n++,t[r]=n}return t}function an(e,t){let n=[[]],r=!0,o=!1,_=!1,s=0;for(let g=0;g<e.length;){let w=e.codePointAt(g);if(w!==92){if(w===42)o=!0,_||(n.push([]),_=!0);else{let y=t?w:H(w);n[n.length-1].push(y),r&&(r=y<=127),s++,_=!1}g+=w>65535?2:1;continue}let l=g+1;for(;e.charCodeAt(l)===92;)l++;let p=l-g,d=e.codePointAt(l),x,b=!1;d===42?(b=p%2===0,x=b?p/2:(p-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?x=Math.ceil(p/2):x=Math.floor(p/2);for(let y=0;y<x;y++)n[n.length-1].push(92),s++;if(b){_=!1,g=l;continue}if(d!==void 0){let y=t?d:H(d);n[n.length-1].push(y),r&&(r=y<=127),s++,l+=d>65535?2:1}_=!1,g=l}let c=o&&n[0].length===0,i=o&&n[n.length-1].length===0,a=[];for(let g of n)g.length&&a.push({values:g});let m=c?0:1,C=a.length-(i?0:1);for(let g=m;g<C;g++)a[g].values.length>on&&(a[g].failure=ln(a[g].values));return{asciiOnly:r,endsWithWildcard:i,hasWildcard:o,minimumInputLength:s,segments:a,startsWithWildcard:c}}function Y(e,t){let n=t?sn:cn,r=e.length<=_n;if(r){let _=n.get(e);if(_)return _}let o=an(e,t);if(r){if(n.size>=rn){let _=n.keys().next().value;_!==void 0&&n.delete(_)}n.set(e,o)}return o}function X(e,t){if(t){let o=[];for(let _=0;_<e.length;){let s=e.codePointAt(_);o.push(s),_+=s>65535?2:1}return o}let n=new Uint32Array(e.length),r=0;for(let o=0;o<e.length;){let _=e.codePointAt(o);n[r]=H(_),r++,o+=_>65535?2:1}return r===n.length?n:n.subarray(0,r)}function N(e,t,n,r){for(let o=0;o<n.values.length;o++){let _=e.charCodeAt(t+o);if(!r&&_>=97&&_<=122&&(_-=32),_!==n.values[o])return!1}return!0}function fn(e,t,n,r,o){let _=r-t.values.length;if(_<n)return-1;if(!t.failure){for(let c=n;c<=_;c++)if(N(e,c,t,o))return c;return-1}let s=0;for(let c=n;c<r;c++){let i=e.charCodeAt(c);for(!o&&i>=97&&i<=122&&(i-=32);s>0&&i!==t.values[s];)s=t.failure[s-1];if(i===t.values[s]&&(s++,s===t.values.length))return c-s+1}return-1}function v(e,t,n){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&N(e,0,t.segments[0],n);let r=0,o=t.segments.length,_=0,s=e.length;if(!t.startsWithWildcard){let c=t.segments[0];if(!N(e,0,c,n))return!1;_=c.values.length,r++}if(!t.endsWithWildcard){o--;let c=t.segments[o];if(s-=c.values.length,!N(e,s,c,n))return!1}for(let c=r;c<o;c++){let i=t.segments[c],a=fn(e,i,_,s,n);if(a===-1)return!1;_=a+i.values.length}return!0}function V(e,t,n){for(let r=0;r<n.values.length;r++)if(e[t+r]!==n.values[r])return!1;return!0}function un(e,t,n,r){let o=r-t.values.length;if(o<n)return-1;if(!t.failure){for(let s=n;s<=o;s++)if(V(e,s,t))return s;return-1}let _=0;for(let s=n;s<r;s++){for(;_>0&&e[s]!==t.values[_];)_=t.failure[_-1];if(e[s]===t.values[_]&&(_++,_===t.values.length))return s-_+1}return-1}function ee(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&V(e,0,t.segments[0]);let n=0,r=t.segments.length,o=0,_=e.length;if(!t.startsWithWildcard){let s=t.segments[0];if(!V(e,0,s))return!1;o=s.values.length,n++}if(!t.endsWithWildcard){r--;let s=t.segments[r];if(_-=s.values.length,!V(e,_,s))return!1}for(let s=n;s<r;s++){let c=t.segments[s],i=un(e,c,o,_);if(i===-1)return!1;o=i+c.values.length}return!0}function dn(e,t,n){let r=Be(e,t,n);if(r!==void 0)return r;let o=Y(t,n);return o.asciiOnly?v(e,o,n):ee(X(e,n),o)}function be(e,t,n,r){var s;let o=Be(e,t,n);if(o!==void 0)return o;let _=Y(t,n);return _.asciiOnly?v(e,_,n):((s=r.tokens)!=null||(r.tokens=X(e,n)),ee(r.tokens,_))}function pn(e,t){let n=e.charCodeAt(0)===33,r=n?e.slice(1):e;return{compiled:r.length===0?void 0:Y(r,t),negative:n}}function G(e,t,n,r){var _;let o;return t.compiled?t.compiled.asciiOnly?o=v(e,t.compiled,n):((_=r.tokens)!=null||(r.tokens=X(e,n)),o=ee(r.tokens,t.compiled)):o=e.length===0,t.negative?!o:o}function gn(e,t){let n=(t==null?void 0:t.caseSensitiveMatch)===!0,r=typeof e=="string"?[e]:Array.from(new Set(e));if(r.length===0)return()=>!1;let o=r.map(_=>pn(_,n));if(typeof e=="string"){let _=o[0];return s=>G(s,_,n,{})}return _=>{let s={},c=!1,i=!1;for(let a of o)if(a.negative){if(!G(_,a,n,s))return!1}else c=!0,!i&&G(_,a,n,s)&&(i=!0);return c?i:!0}}function hn(e,t,n){if(typeof t!="string"&&!t.length)return!1;let r=n===void 0?!1:n.caseSensitiveMatch===!0;if(typeof t=="string"){let c=t.charCodeAt(0)===33,i=c?t.slice(1):t,a=dn(e,i,r);return c?!a:a}let o={},_=!1,s=!1;for(let c of t){let i=c.charCodeAt(0)===33,a=i?c.slice(1):c;if(i){if(be(e,a,r,o))return!1}else _=!0,!s&&be(e,a,r,o)&&(s=!0)}return _?s:!0}return ze(bn);})();
11
+ /**
12
+ * @name codsen-format-diagnostic-value
13
+ * @fileoverview Safely format untrusted JavaScript values for diagnostics
14
+ * @version 1.1.0
15
+ * @author Roy Revelt
16
+ * @license MIT
17
+ * {@link https://codsen.com/os/codsen-format-diagnostic-value/}
18
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codsen-utils",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "Various utility functions",
5
5
  "keywords": ["codsen", "utility", "helpers"],
6
6
  "homepage": "https://codsen.com/os/codsen-utils",
@@ -57,6 +57,9 @@
57
57
  "extras": [""]
58
58
  }
59
59
  },
60
+ "dependencies": {
61
+ "codsen-format-diagnostic-value": "^1.1.0"
62
+ },
60
63
  "engines": {
61
64
  "node": ">=18.20.8"
62
65
  },
package/types/index.d.ts CHANGED
@@ -1,16 +1,4 @@
1
- /**
2
- * Safely formats untrusted input for an error message.
3
- *
4
- * The result is JSON-like rather than JSON: values which JSON cannot express
5
- * use explicit diagnostic tokens. Object accessors are described without
6
- * running them, circular references are marked, and reflection failures are
7
- * contained. Output is capped at 2,000 UTF-16 code units, five object levels,
8
- * and 50 array items or object properties across the whole value.
9
- */
10
- declare function formatDiagnosticValue(
11
- value: unknown,
12
- indentation?: 0 | 4,
13
- ): string;
1
+ export { formatDiagnosticValue } from "codsen-format-diagnostic-value";
14
2
 
15
3
  declare const version: string;
16
4
  declare const leftSingleQuote = "\u2018";
@@ -39,33 +27,49 @@ interface JSONObject {
39
27
  [key: string]: JSONValue;
40
28
  }
41
29
  type Obj = JSONObject;
30
+ type PlainObject = Record<PropertyKey, unknown>;
42
31
  type EolChar = "\n" | "\r" | "\r\n";
43
32
  type EolSetting = "lf" | "crlf" | "cr";
44
- /** Clone nested data without retaining object or collection references. */
33
+ /**
34
+ * Clone nested data without retaining object or collection references.
35
+ *
36
+ * Functions and primitive values, including symbols, retain their identities.
37
+ * Arrays, plain and null-prototype records, dates, maps, sets, binary buffers
38
+ * and views, regular expressions, errors, URLs, and ordinary class instances
39
+ * retain their usable runtime shape. The built-in cases also accept
40
+ * cross-realm values; SharedArrayBuffer support depends on the current realm
41
+ * exposing its constructor. Enumerable accessors on records and arrays are
42
+ * read once and become data properties on the clone. Class behavior must rely
43
+ * on cloneable own state rather than private or other hidden internal slots.
44
+ * Cycles and repeated references remain cycles and repeated references within
45
+ * the cloned graph.
46
+ */
45
47
  declare function deepClone<T>(value: T): T;
46
48
  interface DeepCloneResult<T> {
47
49
  hasRepeatedReferences: boolean;
48
50
  value: T;
49
51
  }
50
- /** Clone nested data and report whether its source graph reused an object. */
52
+ /**
53
+ * Clone nested data under {@link deepClone}'s value contract and report whether
54
+ * its source graph reused an object.
55
+ */
51
56
  declare function deepCloneWithMetadata<T>(value: T): DeepCloneResult<T>;
52
57
  declare function isNumberChar(value: unknown): boolean;
53
58
  declare function isCurrencyChar(value: unknown): boolean;
54
59
  declare function isCurrencySymbol(value: unknown): boolean;
60
+ /** Return whether the input is exactly one Unicode Letter code point. */
55
61
  declare function isLetter(value: unknown): boolean;
56
62
  declare function isLatinLetter(value: unknown): boolean;
57
63
  declare function isQuote(value: unknown): boolean;
64
+ /** Return whether the input is exactly one lowercase Unicode code point. */
58
65
  declare function isLowercaseLetter(value: unknown): boolean;
66
+ /** Return whether the input is exactly one uppercase Unicode code point. */
59
67
  declare function isUppercaseLetter(value: unknown): boolean;
60
68
  declare function isWhitespaceChar(value: unknown): boolean;
61
69
  declare const removeTrailingSlash: <T>(value: T) => string | T;
62
- /**
63
- * Tells, is given input a plain object (an object literal,
64
- * a container object Object.create(null) or created by new Object())
65
- * @param value unknown
66
- * @returns boolean
67
- */
68
- declare function isPlainObject(value: unknown): value is JSONObject;
70
+ /** Return whether a value is an object literal, a value created by
71
+ * `new Object()`, or a direct null-prototype record, including across realms. */
72
+ declare function isPlainObject(value: unknown): value is PlainObject;
69
73
  /**
70
74
  * @param str input string
71
75
  * @param index starting index
@@ -85,7 +89,12 @@ declare function isNum(something: unknown): something is number;
85
89
  declare function isInt(something: unknown): something is number;
86
90
  declare function isBool(something: unknown): something is boolean;
87
91
  declare function isNull(something: unknown): something is null;
88
- declare function isRegExp(something: any): something is RegExp;
92
+ declare function isRegExp(something: unknown): something is RegExp;
93
+ declare function isDate(something: unknown): something is Date;
94
+ /**
95
+ * Trims the supplied Unicode characters from both ends of a string.
96
+ */
97
+ declare function trimChars(input: string, chars: string): string;
89
98
  /**
90
99
  * Gives array of indexes of all found substring occurrences
91
100
  * @param string source string
@@ -115,7 +124,8 @@ declare function resolveEolSetting(
115
124
  eolSetting: EolSetting | unknown,
116
125
  defaultEolChar?: EolChar,
117
126
  ): EolChar;
118
- declare function hasOwnProp(obj: unknown, prop: string): boolean;
127
+ /** Safely check an own string, number, or symbol property. */
128
+ declare function hasOwnProp(obj: unknown, prop: PropertyKey): boolean;
119
129
  /**
120
130
  * Related to @typescript-eslint/require-array-sort-compare lint error
121
131
  */
@@ -207,6 +217,22 @@ interface MatchOptions {
207
217
  /** Match letter case exactly. Off by default. */
208
218
  caseSensitiveMatch?: boolean;
209
219
  }
220
+ /**
221
+ * Prepare one or more wildcard patterns once and return a reusable matcher.
222
+ *
223
+ * The returned function has the same whole-string, wildcard, escaping,
224
+ * negation, and case-folding behavior as {@link match}. The returned closure
225
+ * retains its prepared state even when the bounded process-wide cache evicts a
226
+ * pattern or declines to cache a long one.
227
+ *
228
+ * @param patterns one pattern or an array of cohesive allow/deny patterns
229
+ * @param options matching options
230
+ * @returns a function that tests one input string against the prepared patterns
231
+ */
232
+ declare function createMatcher(
233
+ patterns: string | readonly string[],
234
+ options?: MatchOptions,
235
+ ): (input: string) => boolean;
210
236
  /**
211
237
  * Match a whole string against one or more wildcard patterns.
212
238
  *
@@ -239,6 +265,7 @@ export {
239
265
  backtick,
240
266
  codsenCLI,
241
267
  compareFn,
268
+ createMatcher,
242
269
  deepClone,
243
270
  deepCloneWithMetadata,
244
271
  detectEol,
@@ -246,7 +273,6 @@ export {
246
273
  ellipsis,
247
274
  existy,
248
275
  findAllIdx,
249
- formatDiagnosticValue,
250
276
  hairspace,
251
277
  hasOwnProp,
252
278
  includes,
@@ -255,6 +281,7 @@ export {
255
281
  isBool,
256
282
  isCurrencyChar,
257
283
  isCurrencySymbol,
284
+ isDate,
258
285
  isInt,
259
286
  isLatinLetter,
260
287
  isLetter,
@@ -286,6 +313,7 @@ export {
286
313
  singlePrime,
287
314
  stringSplice,
288
315
  thinSpace,
316
+ trimChars,
289
317
  uniq,
290
318
  version,
291
319
  voidTags,
@@ -305,4 +333,5 @@ export type {
305
333
  JsonObject,
306
334
  MatchOptions,
307
335
  Obj,
336
+ PlainObject,
308
337
  };