Comparing version 4.3.0 to 4.3.1
@@ -1,2 +0,2 @@ | ||
var Regex=(()=>{var H=Object.defineProperty;var Ce=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Le=Object.prototype.hasOwnProperty;var _e=(e,t)=>{for(var n in t)H(e,n,{get:t[n],enumerable:!0})},be=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ie(t))!Le.call(e,o)&&o!==n&&H(e,o,{get:()=>t[o],enumerable:!(r=Ce(t,o))||r.enumerable});return e};var Oe=e=>be(H({},"__esModule",{value:!0}),e);var ze={};_e(ze,{pattern:()=>V,regex:()=>je,rewrite:()=>qe});var E=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function N(e,t,n,r){let o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1],s=0,a="";for(let u of e.matchAll(o)){let{0:c,groups:{$skip:p}}=u;if(!p&&(!r||r===E.DEFAULT==!s)){n instanceof Function?a+=n(u,{context:s?E.CHAR_CLASS:E.DEFAULT,negated:i[i.length-1]}):a+=n;continue}c[0]==="["?(s++,i.push(c[1]==="^")):c==="]"&&s&&(s--,i.pop()),a+=c}return a}function k(e,t,n,r){N(e,t,n,r)}function y(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;let o=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let i=0,s;for(;s=o.exec(e);){let{0:a,groups:{$skip:u}}=s;if(!u&&(!r||r===E.DEFAULT==!i))return s;a==="["?i++:a==="]"&&i&&i--,o.lastIndex==s.index&&o.lastIndex++}return null}function v(e,t,n){return!!y(e,t,0,n)}function W(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,o=0,i=1,s;for(;s=n.exec(e);){let[a]=s;if(a==="[")o++;else if(o)a==="]"&&o--;else if(a==="(")i++;else if(a===")"&&(i--,!i)){r=s.index;break}}return e.slice(t,r)}var $=class{#e;constructor(t){this.#e=t}toString(){return String(this.#e)}};function V(e,...t){if(Array.isArray(e?.raw))return new $(e.raw.flatMap((n,r)=>r<e.raw.length-1?[n,t[r]]:n).join(""));if(!t.length)return new $(e??"");throw new Error(`Unexpected arguments: ${JSON.stringify([e,...t])}`)}var f={DEFAULT:"R_DEFAULT",CHAR_CLASS:"R_CHAR_CLASS",GROUP_NAME:"R_GROUP_NAME",ENCLOSED_TOKEN:"R_ENCLOSED_TOKEN",INTERVAL_QUANTIFIER:"R_INTERVAL_QUANTIFIER",INVALID_INCOMPLETE_TOKEN:"R_INVALID_INCOMPLETE_TOKEN"},d={DEFAULT:"CC_DEFAULT",RANGE:"CC_RANGE",ENCLOSED_TOKEN:"CC_ENCLOSED_TOKEN",Q_TOKEN:"CC_Q_TOKEN",INVALID_INCOMPLETE_TOKEN:"CC_INVALID_INCOMPLETE_TOKEN"},x=(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),oe=(()=>{try{new RegExp("","v")}catch{return!1}return!0})(),b="&!#$%*+,.:;<=>?@^`~",C="$E$",Q=String.raw`\(\?<(?![=!])(?<captureName>[^>]+)>`,O=String.raw`\((?!\?)(?!(?<=\(\?\()DEFINE\))|${Q}`,D=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function B(e,t){return t===E.CHAR_CLASS?e.replace(new RegExp(String.raw`[()\[\]{}|\\/\-${b}]`,"g"),"\\$&"):e.replace(/[()\[\]{}|\\^$*+?.]/g,"\\$&")}function j(e){return e.replace(new RegExp(`^([${b}])(?!\\1)`),(t,n,r)=>`\\${t}${r+1===e.length?"":t}`)}function se(e){return e.replace(/^\^/,"\\^^")}function G(e,t){return N(e,String.raw`\\0(?!\d)`,"\\x00",t)}function ne(e,t,n){let r=0;for(let[o]of e.matchAll(new RegExp(`[${B(t+n,E.CHAR_CLASS)}]`,"g")))if(r+=o===t?1:-1,r<0)return n;return r>0?t:""}function ie(e,t,n){let r=e.replace(/\\./gsu,"");if(r.endsWith("\\"))return"\\";if(t===f.DEFAULT)return ne(r,"(",")");if(t===f.CHAR_CLASS&&!(n===d.ENCLOSED_TOKEN||n===d.Q_TOKEN))return ne(r,"[","]");if(t===f.ENCLOSED_TOKEN||t===f.INTERVAL_QUANTIFIER||n===d.ENCLOSED_TOKEN||n===d.Q_TOKEN){if(r.includes("}"))return"}"}else if(t===f.GROUP_NAME&&r.includes(">"))return">";return""}var re=new RegExp(String.raw` | ||
var Regex=(()=>{var B=Object.defineProperty;var Ce=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var _e=Object.prototype.hasOwnProperty;var be=(e,t)=>{for(var n in t)B(e,n,{get:t[n],enumerable:!0})},Oe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Le(t))!_e.call(e,s)&&s!==n&&B(e,s,{get:()=>t[s],enumerable:!(r=Ce(t,s))||r.enumerable});return e};var De=e=>Oe(B({},"__esModule",{value:!0}),e);var ze={};be(ze,{pattern:()=>Q,regex:()=>je,rewrite:()=>qe});var E=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function N(e,t,n,r){let s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1],o=0,i="";for(let u of e.matchAll(s)){let{0:c,groups:{$skip:p}}=u;if(!p&&(!r||r===E.DEFAULT==!o)){n instanceof Function?i+=n(u,{context:o?E.CHAR_CLASS:E.DEFAULT,negated:a[a.length-1]}):i+=n;continue}c[0]==="["?(o++,a.push(c[1]==="^")):c==="]"&&o&&(o--,a.pop()),i+=c}return i}function x(e,t,n,r){N(e,t,n,r)}function v(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;let s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let a=0,o;for(;o=s.exec(e);){let{0:i,groups:{$skip:u}}=o;if(!u&&(!r||r===E.DEFAULT==!a))return o;i==="["?a++:i==="]"&&a&&a--,s.lastIndex==o.index&&s.lastIndex++}return null}function V(e,t,n){return!!v(e,t,0,n)}function W(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,s=0,a=1,o;for(;o=n.exec(e);){let[i]=o;if(i==="[")s++;else if(s)i==="]"&&s--;else if(i==="(")a++;else if(i===")"&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var $=class{#e;constructor(t){this.#e=t}toString(){return String(this.#e)}};function Q(e,...t){if(Array.isArray(e?.raw))return new $(e.raw.flatMap((n,r)=>r<e.raw.length-1?[n,t[r]]:n).join(""));if(!t.length)return new $(e??"");throw new Error(`Unexpected arguments: ${JSON.stringify([e,...t])}`)}var f={DEFAULT:"R_DEFAULT",CHAR_CLASS:"R_CHAR_CLASS",GROUP_NAME:"R_GROUP_NAME",ENCLOSED_TOKEN:"R_ENCLOSED_TOKEN",INTERVAL_QUANTIFIER:"R_INTERVAL_QUANTIFIER",INVALID_INCOMPLETE_TOKEN:"R_INVALID_INCOMPLETE_TOKEN"},g={DEFAULT:"CC_DEFAULT",RANGE:"CC_RANGE",ENCLOSED_TOKEN:"CC_ENCLOSED_TOKEN",Q_TOKEN:"CC_Q_TOKEN",INVALID_INCOMPLETE_TOKEN:"CC_INVALID_INCOMPLETE_TOKEN"},G=(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),oe=(()=>{try{new RegExp("","v")}catch{return!1}return!0})(),b="&!#$%*+,.:;<=>?@^`~",I="$E$",j=String.raw`\(\?<(?![=!])(?<captureName>[^>]+)>`,O=String.raw`\((?!\?)(?!(?<=\(\?\()DEFINE\))|${j}`,D=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function z(e,t){return t===E.CHAR_CLASS?e.replace(new RegExp(String.raw`[()\[\]{}|\\/\-${b}]`,"g"),"\\$&"):e.replace(/[()\[\]{}|\\^$*+?.]/g,"\\$&")}function q(e){return e.replace(new RegExp(`^([${b}])(?!\\1)`),(t,n,r)=>`\\${t}${r+1===e.length?"":t}`)}function ie(e){return e.replace(/^\^/,"\\^^")}function M(e,t){return N(e,String.raw`\\0(?!\d)`,"\\x00",t)}function re(e,t,n){let r=0;for(let[s]of e.matchAll(new RegExp(`[${z(t+n,E.CHAR_CLASS)}]`,"g")))if(r+=s===t?1:-1,r<0)return n;return r>0?t:""}function ae(e,t,n){let r=e.replace(/\\./gsu,"");if(r.endsWith("\\"))return"\\";if(t===f.DEFAULT)return re(r,"(",")");if(t===f.CHAR_CLASS&&!(n===g.ENCLOSED_TOKEN||n===g.Q_TOKEN))return re(r,"[","]");if(t===f.ENCLOSED_TOKEN||t===f.INTERVAL_QUANTIFIER||n===g.ENCLOSED_TOKEN||n===g.Q_TOKEN){if(r.includes("}"))return"}"}else if(t===f.GROUP_NAME&&r.includes(">"))return">";return""}var se=new RegExp(String.raw` | ||
(?<groupN>\(\?<(?![=!])|\\[gk]<) | ||
@@ -14,5 +14,5 @@ | (?<enclosedT>\\[pPu]\{) | ||
| \\?. | ||
`.replace(/\s+/g,""),"gsu");function R(e,{regexContext:t=f.DEFAULT,charClassContext:n=d.DEFAULT,charClassDepth:r=0,lastPos:o=0}={}){re.lastIndex=o;let i;for(;i=re.exec(e);){let{0:s,groups:{groupN:a,enclosedT:u,qT:c,intervalQ:p,incompleteT:g}}=i;s==="["?(r++,t=f.CHAR_CLASS,n=d.DEFAULT):s==="]"&&t===f.CHAR_CLASS?(r&&r--,r||(t=f.DEFAULT),n=d.DEFAULT):t===f.CHAR_CLASS?g?n=d.INVALID_INCOMPLETE_TOKEN:s==="-"?n=d.RANGE:u?n=d.ENCLOSED_TOKEN:c?n=d.Q_TOKEN:(s==="}"&&(n===d.ENCLOSED_TOKEN||n===d.Q_TOKEN)||n===d.INVALID_INCOMPLETE_TOKEN||n===d.RANGE)&&(n=d.DEFAULT):g?t=f.INVALID_INCOMPLETE_TOKEN:a?t=f.GROUP_NAME:u?t=f.ENCLOSED_TOKEN:p?t=f.INTERVAL_QUANTIFIER:(s===">"&&t===f.GROUP_NAME||s==="}"&&(t===f.ENCLOSED_TOKEN||t===f.INTERVAL_QUANTIFIER)||t===f.INVALID_INCOMPLETE_TOKEN)&&(t=f.DEFAULT)}return{regexContext:t,charClassContext:n,charClassDepth:r,lastPos:e.length}}function U(e){let t=0;return k(e,O,()=>t++,E.DEFAULT),t}function ae(e,t){return N(e,String.raw`\\(?<num>[1-9]\d*)`,({groups:{num:n}})=>`\\${+n+t}`,E.DEFAULT)}var De=["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"].join("|"),Re=new RegExp(String.raw` | ||
`.replace(/\s+/g,""),"gsu");function R(e,{regexContext:t=f.DEFAULT,charClassContext:n=g.DEFAULT,charClassDepth:r=0,lastPos:s=0}={}){se.lastIndex=s;let a;for(;a=se.exec(e);){let{0:o,groups:{groupN:i,enclosedT:u,qT:c,intervalQ:p,incompleteT:m}}=a;o==="["?(r++,t=f.CHAR_CLASS,n=g.DEFAULT):o==="]"&&t===f.CHAR_CLASS?(r&&r--,r||(t=f.DEFAULT),n=g.DEFAULT):t===f.CHAR_CLASS?m?n=g.INVALID_INCOMPLETE_TOKEN:o==="-"?n=g.RANGE:u?n=g.ENCLOSED_TOKEN:c?n=g.Q_TOKEN:(o==="}"&&(n===g.ENCLOSED_TOKEN||n===g.Q_TOKEN)||n===g.INVALID_INCOMPLETE_TOKEN||n===g.RANGE)&&(n=g.DEFAULT):m?t=f.INVALID_INCOMPLETE_TOKEN:i?t=f.GROUP_NAME:u?t=f.ENCLOSED_TOKEN:p?t=f.INTERVAL_QUANTIFIER:(o===">"&&t===f.GROUP_NAME||o==="}"&&(t===f.ENCLOSED_TOKEN||t===f.INTERVAL_QUANTIFIER)||t===f.INVALID_INCOMPLETE_TOKEN)&&(t=f.DEFAULT)}return{regexContext:t,charClassContext:n,charClassDepth:r,lastPos:e.length}}function U(e){let t=0;return x(e,O,()=>t++,E.DEFAULT),t}function ue(e,t){return N(e,String.raw`\\(?<num>[1-9]\d*)`,({groups:{num:n}})=>`\\${+n+t}`,E.DEFAULT)}function F(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Re=["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"].join("|"),Ue=new RegExp(String.raw` | ||
\\(?: c[A-Za-z] | ||
| p\{(?<pStrProp>${De})\} | ||
| p\{(?<pStrProp>${Re})\} | ||
| [pP]\{[^\}]+\} | ||
@@ -27,3 +27,3 @@ | (?<qStrProp>q) | ||
| . | ||
`.replace(/\s+/g,""),"gsu");function z(e){let t=!1,n;for(let{0:r,groups:o}of e.matchAll(Re)){if(o.pStrProp||o.qStrProp||r==="["&&t)return!0;if(["-","--","&&"].includes(r))t=!1;else if(r!=="["&&r!=="]"){if(t||n==="]")return!0;t=!0}n=r}return!1}function ue(e,t,n,r){let o={raw:[]},i=[],s;return e.raw.forEach((a,u)=>{let c=n(a,{...s,lastPos:0},r);if(o.raw.push(c.transformed),s=c.runningContext,u<e.raw.length-1){let p=t[u];if(p instanceof $){let g=n(p,{...s,lastPos:0},r);i.push(V(g.transformed)),s=g.runningContext}else i.push(p)}}),{template:o,substitutions:i}}var Ue=new RegExp(String.raw` | ||
`.replace(/\s+/g,""),"gsu");function Z(e){let t=!1,n;for(let{0:r,groups:s}of e.matchAll(Ue)){if(s.pStrProp||s.qStrProp||r==="["&&t)return!0;if(["-","--","&&"].includes(r))t=!1;else if(r!=="["&&r!=="]"){if(t||n==="]")return!0;t=!0}n=r}return!1}function le(e,t,n,r){let s={raw:[]},a=[],o;return e.raw.forEach((i,u)=>{let c=n(i,{...o,lastPos:0},r);if(s.raw.push(c.transformed),o=c.runningContext,u<e.raw.length-1){let p=t[u];if(p instanceof $){let m=n(p,{...o,lastPos:0},r);a.push(Q(m.transformed)),o=m.runningContext}else a.push(p)}}),{template:s,substitutions:a}}var Fe=new RegExp(String.raw` | ||
${D} | ||
@@ -33,3 +33,3 @@ | \(\?< | ||
| \\?. | ||
`.replace(/\s+/g,""),"gsu");function le(e,t){e=String(e);let n="",r="";for(let{0:o,groups:{backrefNum:i}}of e.matchAll(Ue)){n+=o,t=R(n,t);let{regexContext:s}=t;if(s===f.DEFAULT)if(o==="(")r+="(?:";else{if(i)throw new Error(`Invalid decimal escape "${o}" with implicit flag n; replace with named backreference`);r+=o}else r+=o}return{transformed:r,runningContext:t}}var ce=/^\s$/,Fe=/^\\[\s#]$/,Z=/^[ \t]$/,Pe=/^\\[ \t]$/,ke=new RegExp(String.raw` | ||
`.replace(/\s+/g,""),"gsu");function ce(e,t){e=String(e);let n="",r="";for(let{0:s,groups:{backrefNum:a}}of e.matchAll(Fe)){n+=s,t=R(n,t);let{regexContext:o}=t;if(o===f.DEFAULT)if(s==="(")r+="(?:";else{if(a)throw new Error(`Invalid decimal escape "${s}" with implicit flag n; replace with named backreference`);r+=s}else r+=s}return{transformed:r,runningContext:t}}var fe=/^\s$/,Pe=/^\\[\s#]$/,J=/^[ \t]$/,ke=/^\\[ \t]$/,xe=new RegExp(String.raw` | ||
\\(?: [gk]< | ||
@@ -48,4 +48,4 @@ | [pPu]\{ | ||
| \\?. | ||
`.replace(/\s+/g,""),"gsu");function fe(e,t,n){e=String(e);let r=!1,o=!1,i=!1,s="",a="",u="",c="",p=!1,g=(l,{prefix:m=!0,postfix:A=!1}={})=>(l=(p&&m?"(?:)":"")+l+(A?"(?:)":""),p=!1,l);for(let{0:l,index:m}of e.matchAll(ke)){if(i){l===` | ||
`&&(i=!1,p=!0);continue}if(r){if(ce.test(l))continue;r=!1,p=!0}else if(o){if(Z.test(l))continue;o=!1}s+=l,t=R(s,t);let{regexContext:A,charClassContext:h}=t;if(l==="-"&&A===f.CHAR_CLASS&&c===d.RANGE&&(n.flags.includes("v")||n.unicodeSetsPlugin))throw new Error("Invalid unescaped hyphen as the end value for a range");if(A===f.DEFAULT&&/^(?:[?*+]|\?\?)$/.test(l)||A===f.INTERVAL_QUANTIFIER&&l==="{")a+=g(l,{prefix:!1,postfix:u==="("&&l==="?"});else if(A===f.DEFAULT)ce.test(l)?r=!0:l.startsWith("#")?i=!0:Fe.test(l)?a+=g(l[1],{prefix:!1}):a+=g(l);else if(A===f.CHAR_CLASS&&l!=="["&&l!=="[^")if(Z.test(l)&&(h===d.DEFAULT||h===d.RANGE||h===d.Q_TOKEN))o=!0;else{if(h===d.INVALID_INCOMPLETE_TOKEN)throw new Error(`Invalid incomplete token in character class: "${l}"`);if(Pe.test(l)&&(h===d.DEFAULT||h===d.Q_TOKEN))a+=g(l[1],{prefix:!1});else if(h===d.DEFAULT){let T=e[m+1]??"",S=G(l);(Z.test(T)||l==="^")&&(S=j(S)),a+=g(S)}else a+=g(l)}else a+=g(l);r||o||i||(u=l,c=h)}return{transformed:a,runningContext:t}}function pe(e){let t=String.raw`\(\?:\)`;e=N(e,`(?:${t}){2,}`,"(?:)",E.DEFAULT);let n=C.replace(/\$/g,"\\$");return e=N(e,String.raw`(?:${t}(?=[)|.[$\\]|\((?!DEFINE)|$)|(?<=[()|.\]^>]|\\[bBdDfnrsStvwW]|\(\?(?:[:=!]|<[=!])|^)${t}(?![?*+{]))(?!${n})`,"",E.DEFAULT),e}var Ee=new RegExp(String.raw`(?<noncapturingStart>${D})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function de(e,t){if(!/\(\?>/.test(e))return e;let n="(?>",r=`(?:(?=(${t.useEmulationGroups?C:""}`,o=[0],i=0,s=0,a=NaN,u;do{u=!1;let c=0,p=0,g=!1,l;for(Ee.lastIndex=Number.isNaN(a)?0:a+r.length;l=Ee.exec(e);){let{0:m,index:A,groups:{capturingStart:h,noncapturingStart:T}}=l;if(m==="[")c++;else if(c)m==="]"&&c--;else if(m===n&&!g)a=A,g=!0;else if(g&&T)p++;else if(h)g?p++:(i++,o.push(i+s));else if(m===")"&&g){if(!p){s++,e=`${e.slice(0,a)}${r}${e.slice(a+n.length,A)}))<$$${s+i}>)${e.slice(A+1)}`,u=!0;break}p--}}}while(u);return e=N(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:c,groups:{backrefNum:p,wrappedBackrefNum:g}})=>{if(p){let l=+p;if(l>o.length-1)throw new Error(`Backref "${c}" greater than number of captures`);return`\\${o[l]}`}return`\\${g}`},E.DEFAULT),e}var ge=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,xe=new RegExp(String.raw` | ||
`.replace(/\s+/g,""),"gsu");function pe(e,t,n){e=String(e);let r=!1,s=!1,a=!1,o="",i="",u="",c="",p=!1,m=(l,{prefix:d=!0,postfix:A=!1}={})=>(l=(p&&d?"(?:)":"")+l+(A?"(?:)":""),p=!1,l);for(let{0:l,index:d}of e.matchAll(xe)){if(a){l===` | ||
`&&(a=!1,p=!0);continue}if(r){if(fe.test(l))continue;r=!1,p=!0}else if(s){if(J.test(l))continue;s=!1}o+=l,t=R(o,t);let{regexContext:A,charClassContext:h}=t;if(l==="-"&&A===f.CHAR_CLASS&&c===g.RANGE&&(n.flags.includes("v")||n.unicodeSetsPlugin))throw new Error("Invalid unescaped hyphen as the end value for a range");if(A===f.DEFAULT&&/^(?:[?*+]|\?\?)$/.test(l)||A===f.INTERVAL_QUANTIFIER&&l==="{")i+=m(l,{prefix:!1,postfix:u==="("&&l==="?"});else if(A===f.DEFAULT)fe.test(l)?r=!0:l.startsWith("#")?a=!0:Pe.test(l)?i+=m(l[1],{prefix:!1}):i+=m(l);else if(A===f.CHAR_CLASS&&l!=="["&&l!=="[^")if(J.test(l)&&(h===g.DEFAULT||h===g.RANGE||h===g.Q_TOKEN))s=!0;else{if(h===g.INVALID_INCOMPLETE_TOKEN)throw new Error(`Invalid incomplete token in character class: "${l}"`);if(ke.test(l)&&(h===g.DEFAULT||h===g.Q_TOKEN))i+=m(l[1],{prefix:!1});else if(h===g.DEFAULT){let T=e[d+1]??"",S=M(l);(J.test(T)||l==="^")&&(S=q(S)),i+=m(S)}else i+=m(l)}else i+=m(l);r||s||a||(u=l,c=h)}return{transformed:i,runningContext:t}}function de(e){let t=String.raw`\(\?:\)`;e=N(e,`(?:${t}){2,}`,"(?:)",E.DEFAULT);let n=I.replace(/\$/g,"\\$");return e=N(e,String.raw`(?:${t}(?=[)|.[$\\]|\((?!DEFINE)|$)|(?<=[()|.\]^>]|\\[bBdDfnrsStvwW]|\(\?(?:[:=!]|<[=!])|^)${t}(?![?*+{]))(?!${n})`,"",E.DEFAULT),e}var Ee=new RegExp(String.raw`(?<noncapturingStart>${D})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function ge(e,t){if(!/\(\?>/.test(e))return e;let n="(?>",r=`(?:(?=(${t.useEmulationGroups?I:""}`,s=[0],a=0,o=0,i=NaN,u;do{u=!1;let c=0,p=0,m=!1,l;for(Ee.lastIndex=Number.isNaN(i)?0:i+r.length;l=Ee.exec(e);){let{0:d,index:A,groups:{capturingStart:h,noncapturingStart:T}}=l;if(d==="[")c++;else if(c)d==="]"&&c--;else if(d===n&&!m)i=A,m=!0;else if(m&&T)p++;else if(h)m?p++:(a++,s.push(a+o));else if(d===")"&&m){if(!p){o++,e=`${e.slice(0,i)}${r}${e.slice(i+n.length,A)}))<$$${o+a}>)${e.slice(A+1)}`,u=!0;break}p--}}}while(u);return e=N(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:c,groups:{backrefNum:p,wrappedBackrefNum:m}})=>{if(p){let l=+p;if(l>s.length-1)throw new Error(`Backref "${c}" greater than number of captures`);return`\\${s[l]}`}return`\\${m}`},E.DEFAULT),e}var me=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,X=new RegExp(String.raw` | ||
\\(?: \d+ | ||
@@ -63,5 +63,5 @@ | c[A-Za-z] | ||
))? | ||
| (?<q>${ge})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?) | ||
| (?<qBase>${me})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?) | ||
| \\?. | ||
`.replace(/\s+/g,""),"gsu");function me(e){if(!new RegExp(`${ge}\\+`).test(e))return e;let t=[],n=null,r=null,o="",i=0,s="";for(let{0:a,index:u,groups:{q:c,qMod:p,invalidQ:g}}of e.matchAll(xe)){if(a==="[")i||(r=u),i++;else if(a==="]")i?i--:r=null;else if(p==="+"&&o&&!o.startsWith("(")){if(g)throw new Error(`Invalid quantifier "${a}"`);if(/^\{\d+\}$/.test(c))s+=c;else if(o===")"||o==="]"){let l=o===")"?n:r;if(l===null)throw new Error(`Invalid unmatched "${o}"`);let m=e.slice(l,u);s=`${e.slice(0,l)}(?>${m}${c})`}else s=`${e.slice(0,s.length-o.length)}(?>${o}${c})`;continue}else a[0]==="("?t.push(u):a===")"&&(n=t.length?t.pop():null);o=a,s+=a}return s}function Ne(e,t){let n=Ae(e,{includeContents:!0}),r=Me(e,n,t.useEmulationGroups);return Ke(r,n)}var Ge=String.raw`\\g<(?<subroutineName>[^>&]+)>`,M=new RegExp(String.raw` | ||
`.replace(/\s+/g,""),"gsu");function he(e){if(!new RegExp(`${me}\\+`).test(e))return e;let t=[],n=null,r=null,s="",a=0,o;for(X.lastIndex=0;o=X.exec(e);){let{0:i,index:u,groups:{qBase:c,qMod:p,invalidQ:m}}=o;if(i==="[")a||(r=u),a++;else if(i==="]")a?a--:r=null;else if(p==="+"&&s&&!s.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${i}"`);let l=-1;if(/^\{\d+\}$/.test(c))e=F(e,u+c.length,p,"");else{if(s===")"||s==="]"){let d=s===")"?n:r;if(d===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,d)}(?>${e.slice(d,u)}${c})${e.slice(u+i.length)}`}else e=`${e.slice(0,u-s.length)}(?>${s}${c})${e.slice(u+i.length)}`;l+=4}X.lastIndex+=l}else i[0]==="("?t.push(u):i===")"&&(n=t.length?t.pop():null);s=i}return e}function Ae(e,t){let n=we(e,{includeContents:!0}),r=Me(e,n,t.useEmulationGroups);return Ke(r,n)}var Ge=String.raw`\\g<(?<subroutineName>[^>&]+)>`,K=new RegExp(String.raw` | ||
${Ge} | ||
@@ -72,3 +72,3 @@ | (?<capturingStart>${O}) | ||
| \\?. | ||
`.replace(/\s+/g,""),"gsu");function Me(e,t,n){if(!/\\g</.test(e))return e;let r=v(e,"\\\\(?:[1-9]|k<[^>]+>)",E.DEFAULT),o=r?`(${n?C:""}`:"(?:",i=new Map,s=[],a=[0],u=0,c=0,p=0,g=0,l=0,m=e,A;for(M.lastIndex=0;A=M.exec(m);){let{0:h,index:T,groups:{subroutineName:S,capturingStart:q,backrefNum:F,backrefName:K}}=A;if(h==="[")l++;else if(l)h==="]"&&l--;else if(S){if(!t.has(S))throw new Error(`Invalid named capture referenced by subroutine ${h}`);if(i.has(S))throw new Error(`Subroutine ${h} followed a recursive reference`);let w=t.get(S).contents,L=`${o}${w})`;r&&(p=0,c++),i.set(S,{unclosedGroupCount:ye(L)}),s.push(S),m=Y(m,T,h,L),M.lastIndex-=h.length-o.length}else if(q)i.size?(r&&(p++,c++),h!=="("&&(m=Y(m,T,h,o),M.lastIndex-=h.length-o.length)):r&&(a.push(X(a)+1+c-g),g=c,u++);else if((F||K)&&i.size){let w=F?+F:t.get(K)?.groupNum,L=!1;for(let I of s){let _=t.get(I);if(w>=_.groupNum&&w<=_.groupNum+_.numCaptures){L=!0;break}}if(L){let I=t.get(X(s)),_=u+c-p,P=`\\k<$$b${w}s${_}r${I.groupNum}c${I.numCaptures}>`;m=Y(m,T,h,P),M.lastIndex+=P.length-h.length}}else if(h===")"&&i.size){let w=i.get(X(s));w.unclosedGroupCount--,w.unclosedGroupCount||i.delete(s.pop())}}return r&&(m=N(m,String.raw`\\(?:(?<bNum>[1-9]\d*)|k<\$\$b(?<bNumSub>\d+)s(?<subNum>\d+)r(?<refNum>\d+)c(?<refCaps>\d+)>)`,({0:h,groups:{bNum:T,bNumSub:S,subNum:q,refNum:F,refCaps:K}})=>{if(T){let P=+T;if(P>a.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${a[P]}`}let w=+S,L=+q,I=+F,_=+K;return w<I||w>I+_?`\\${a[w]}`:`\\${L-I+w}`},E.DEFAULT)),m}var J=new RegExp(String.raw`${Q}|\(\?:\)|(?<invalid>\\?.)`,"gsu");function Ke(e,t){let n=y(e,String.raw`\(\?\(DEFINE\)`,0,E.DEFAULT);if(!n)return e;let r=he(e,n);if(r.afterPos<e.length)throw new Error("DEFINE group allowed only at the end of a regex");if(r.afterPos>e.length)throw new Error("DEFINE group is unclosed");let o;for(J.lastIndex=0;o=J.exec(r.contents);){let{captureName:i,invalid:s}=o.groups;if(i){let a=he(r.contents,o),u;if(!t.get(i).isUnique)u=i;else{let c=Ae(a.contents);for(let p of c.keys())if(!t.get(p).isUnique){u=p;break}}if(u)throw new Error(`Duplicate group name "${u}" within DEFINE`);J.lastIndex=a.afterPos}else if(s)throw new Error("DEFINE group includes unsupported syntax at top level")}return e.slice(0,n.index)}function ye(e){let t=0;return k(e,"\\(",()=>t++,E.DEFAULT),t}function ve(e,t){let n=0,r=0,o;for(;o=y(e,O,r,E.DEFAULT);){let{0:i,index:s,groups:{captureName:a}}=o;if(n++,a===t)break;r=s+i.length}return n}function he(e,t){let n=t.index+t[0].length,r=W(e,n),o=n+r.length+1;return{contents:r,afterPos:o}}function Ae(e,{includeContents:t}={}){let n=new Map;return k(e,Q,({0:r,index:o,groups:{captureName:i}})=>{if(n.has(i))n.get(i).isUnique=!1;else{let s={isUnique:!0};if(t){let a=W(e,o+r.length);Object.assign(s,{contents:a,groupNum:ve(e,i),numCaptures:U(a)})}n.set(i,s)}},E.DEFAULT),n}function X(e){return e[e.length-1]}function Y(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Ve="&!#%,:;<=>@`~",Qe=new RegExp(String.raw` | ||
`.replace(/\s+/g,""),"gsu");function Me(e,t,n){if(!/\\g</.test(e))return e;let r=V(e,"\\\\(?:[1-9]|k<[^>]+>)",E.DEFAULT),s=r?`(${n?I:""}`:"(?:",a=new Map,o=[],i=[0],u=0,c=0,p=0,m=0,l=0,d=e,A;for(K.lastIndex=0;A=K.exec(d);){let{0:h,index:T,groups:{subroutineName:S,capturingStart:H,backrefNum:P,backrefName:y}}=A;if(h==="[")l++;else if(l)h==="]"&&l--;else if(S){if(!t.has(S))throw new Error(`Invalid named capture referenced by subroutine ${h}`);if(a.has(S))throw new Error(`Subroutine ${h} followed a recursive reference`);let w=t.get(S).contents,L=`${s}${w})`;r&&(p=0,c++),a.set(S,{unclosedGroupCount:ye(L)}),o.push(S),d=F(d,T,h,L),K.lastIndex-=h.length-s.length}else if(H)a.size?(r&&(p++,c++),h!=="("&&(d=F(d,T,h,s),K.lastIndex-=h.length-s.length)):r&&(i.push(ee(i)+1+c-m),m=c,u++);else if((P||y)&&a.size){let w=P?+P:t.get(y)?.groupNum,L=!1;for(let C of o){let _=t.get(C);if(w>=_.groupNum&&w<=_.groupNum+_.numCaptures){L=!0;break}}if(L){let C=t.get(ee(o)),_=u+c-p,k=`\\k<$$b${w}s${_}r${C.groupNum}c${C.numCaptures}>`;d=F(d,T,h,k),K.lastIndex+=k.length-h.length}}else if(h===")"&&a.size){let w=a.get(ee(o));w.unclosedGroupCount--,w.unclosedGroupCount||a.delete(o.pop())}}return r&&(d=N(d,String.raw`\\(?:(?<bNum>[1-9]\d*)|k<\$\$b(?<bNumSub>\d+)s(?<subNum>\d+)r(?<refNum>\d+)c(?<refCaps>\d+)>)`,({0:h,groups:{bNum:T,bNumSub:S,subNum:H,refNum:P,refCaps:y}})=>{if(T){let k=+T;if(k>i.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${i[k]}`}let w=+S,L=+H,C=+P,_=+y;return w<C||w>C+_?`\\${i[w]}`:`\\${L-C+w}`},E.DEFAULT)),d}var Y=new RegExp(String.raw`${j}|\(\?:\)|(?<invalid>\\?.)`,"gsu");function Ke(e,t){let n=v(e,String.raw`\(\?\(DEFINE\)`,0,E.DEFAULT);if(!n)return e;let r=Ne(e,n);if(r.afterPos<e.length)throw new Error("DEFINE group allowed only at the end of a regex");if(r.afterPos>e.length)throw new Error("DEFINE group is unclosed");let s;for(Y.lastIndex=0;s=Y.exec(r.contents);){let{captureName:a,invalid:o}=s.groups;if(a){let i=Ne(r.contents,s),u;if(!t.get(a).isUnique)u=a;else{let c=we(i.contents);for(let p of c.keys())if(!t.get(p).isUnique){u=p;break}}if(u)throw new Error(`Duplicate group name "${u}" within DEFINE`);Y.lastIndex=i.afterPos}else if(o)throw new Error("DEFINE group includes unsupported syntax at top level")}return e.slice(0,n.index)}function ye(e){let t=0;return x(e,"\\(",()=>t++,E.DEFAULT),t}function ve(e,t){let n=0,r=0,s;for(;s=v(e,O,r,E.DEFAULT);){let{0:a,index:o,groups:{captureName:i}}=s;if(n++,i===t)break;r=o+a.length}return n}function Ne(e,t){let n=t.index+t[0].length,r=W(e,n),s=n+r.length+1;return{contents:r,afterPos:s}}function we(e,{includeContents:t}={}){let n=new Map;return x(e,j,({0:r,index:s,groups:{captureName:a}})=>{if(n.has(a))n.get(a).isUnique=!1;else{let o={isUnique:!0};if(t){let i=W(e,s+r.length);Object.assign(o,{contents:i,groupNum:ve(e,a),numCaptures:U(i)})}n.set(a,o)}},E.DEFAULT),n}function ee(e){return e[e.length-1]}var Ve="&!#%,:;<=>@`~",Qe=new RegExp(String.raw` | ||
\[\^?-? | ||
@@ -81,3 +81,3 @@ | --?\] | ||
| \\?. | ||
`.replace(/\s+/g,""),"gsu");function we(e){let t='Invalid unescaped "-" in character class',n=!1,r="";for(let{0:o,groups:{dp:i,vOnlyEscape:s}}of e.matchAll(Qe)){if(o[0]==="["){if(n)throw new Error("Invalid nested character class when flag v not supported; possibly from interpolation");if(o.endsWith("-"))throw new Error(t);n=!0}else if(o.endsWith("]")){if(o[0]==="-")throw new Error(t);n=!1}else if(n){if(o==="&&"||o==="--")throw new Error(`Invalid set operator "${o}" when flag v not supported`);if(i)throw new Error(`Invalid double punctuator "${o}", reserved by flag v`);if("(){}/|".includes(o))throw new Error(`Invalid unescaped "${o}" in character class`);if(s){r+=s;continue}}r+=o}return r}var je=(e,...t)=>{if(Array.isArray(e?.raw))return ee({},e,...t);if((typeof e=="string"||e===void 0)&&!t.length)return ee.bind(null,{flags:e??""});if({}.toString.call(e)==="[object Object]"&&!t.length)return ee.bind(null,e);throw new Error(`Unexpected arguments: ${JSON.stringify([e,...t])}`)},ee=(e,t,...n)=>{let r=Se(e),o=Te(t,n,r),i=0,s="",a;if(o.template.raw.forEach((u,c)=>{let p=!!(o.template.raw[c]||o.template.raw[c+1]);i+=U(u),s+=G(u,E.CHAR_CLASS),a=R(s,a);let{regexContext:g,charClassContext:l}=a;if(c<o.template.raw.length-1){let m=o.substitutions[c];s+=He(m,r.flags,g,l,p,i),m instanceof RegExp?i+=U(m.source):m instanceof $&&(i+=U(String(m)))}}),s=$e(s,r),r.subclass){let u=Be(s);return new te(u.expression,r.flags,{captureMap:u.captureMap})}return new RegExp(s,r.flags)};function qe(e="",t={}){let n=Se(t);if(n.subclass)throw new Error("Cannot use option subclass");return{expression:$e(Te({raw:[e]},[],n).template.raw[0],n),flags:n.flags}}function Se(e){let t={flags:"",subclass:!1,plugins:[],unicodeSetsPlugin:we,disable:{},force:{},...e};if(/[nuvx]/.test(t.flags))throw new Error("Implicit flags v/u/x/n cannot be explicitly added");let n=t.force.v||(t.disable.v?!1:oe);return t.flags+=n?"v":"u",n&&(t.unicodeSetsPlugin=null),t}function Te(e,t,n){let r=[];n.disable.x||r.push(fe),n.disable.n||r.push(le);for(let o of r)({template:e,substitutions:t}=ue(e,t,o,n));return{template:e,substitutions:t}}function $e(e,t){let{flags:n,plugins:r,unicodeSetsPlugin:o,disable:i,subclass:s}=t;return[...r,...i.subroutines?[]:[Ne],...i.atomic?[]:[me,de],...i.x?[]:[pe],...o?[o]:[]].forEach(a=>e=a(e,{flags:n,useEmulationGroups:s})),e}var te=class e extends RegExp{#e;constructor(t,n,r){super(t,n),r?this.#e=r.captureMap:t instanceof e&&(this.#e=t.#e)}exec(t){let n=RegExp.prototype.exec.call(this,t);if(!n||!this.#e)return n;let r=[...n];n.length=1;for(let o=1;o<r.length;o++)this.#e[o]&&n.push(r[o]);return n}};function He(e,t,n,r,o,i){if(e instanceof RegExp&&n!==f.DEFAULT)throw new Error("Cannot interpolate a RegExp at this position because the syntax context does not match");if(n===f.INVALID_INCOMPLETE_TOKEN||r===d.INVALID_INCOMPLETE_TOKEN)throw new Error("Interpolation preceded by invalid incomplete token");let s=e instanceof $,a="";if(!(e instanceof RegExp)){e=String(e),s||(a=B(e,n===f.CHAR_CLASS?E.CHAR_CLASS:E.DEFAULT));let u=ie(a||e,n,r);if(u)throw new Error(`Unescaped stray "${u}" in the interpolated value would have side effects outside it`)}if(n===f.ENCLOSED_TOKEN||n===f.INTERVAL_QUANTIFIER||n===f.GROUP_NAME||r===d.ENCLOSED_TOKEN||r===d.Q_TOKEN)return s?String(e):a;if(n===f.CHAR_CLASS){if(s){if(v(String(e),"^-|^&&|-$|&&$"))throw new Error("Cannot use range or set operator at boundary of interpolated pattern; move the operation into the pattern or the operator outside of it");let u=se(j(e));return z(e)?`[${u}]`:G(u)}return z(a)?`[${a}]`:a}if(e instanceof RegExp){let u=We(e,t),c=ae(u.value,i);return u.usedModifier?c:`(?:${c})`}return s?`(?:${e})`:o?`(?:${a})`:a}function We(e,t){let n={i:null,m:null,s:null},r="\\n\\r\\u2028\\u2029",o=e.source;if(e.ignoreCase!==t.includes("i"))if(x)n.i=e.ignoreCase;else throw new Error("Pattern modifiers not supported, so flag i on the outer and interpolated regex must match");if(e.dotAll!==t.includes("s")&&(x?n.s=e.dotAll:o=N(o,"\\.",e.dotAll?"[^]":`[^${r}]`,E.DEFAULT)),e.multiline!==t.includes("m")&&(x?n.m=e.multiline:(o=N(o,"\\^",e.multiline?`(?<=^|[${r}])`:"(?<![^])",E.DEFAULT),o=N(o,"\\$",e.multiline?`(?=$|[${r}])`:"(?![^])",E.DEFAULT))),x){let i=Object.keys(n),s=i.filter(u=>n[u]===!0).join(""),a=i.filter(u=>n[u]===!1).join("");if(a&&(s+=`-${a}`),s)return{value:`(?${s}:${o})`,usedModifier:!0}}return{value:o}}function Be(e){let t=C.replace(/\$/g,"\\$"),n=[!0];return e=N(e,`(?:${O})(?<mark>${t})?`,({0:r,groups:{mark:o}})=>o?(n.push(!1),r.slice(0,-C.length)):(n.push(!0),r),E.DEFAULT),{captureMap:n,expression:e}}return Oe(ze);})(); | ||
`.replace(/\s+/g,""),"gsu");function Se(e){let t='Invalid unescaped "-" in character class',n=!1,r="";for(let{0:s,groups:{dp:a,vOnlyEscape:o}}of e.matchAll(Qe)){if(s[0]==="["){if(n)throw new Error("Invalid nested character class when flag v not supported; possibly from interpolation");if(s.endsWith("-"))throw new Error(t);n=!0}else if(s.endsWith("]")){if(s[0]==="-")throw new Error(t);n=!1}else if(n){if(s==="&&"||s==="--")throw new Error(`Invalid set operator "${s}" when flag v not supported`);if(a)throw new Error(`Invalid double punctuator "${s}", reserved by flag v`);if("(){}/|".includes(s))throw new Error(`Invalid unescaped "${s}" in character class`);if(o){r+=o;continue}}r+=s}return r}var je=(e,...t)=>{if(Array.isArray(e?.raw))return te({},e,...t);if((typeof e=="string"||e===void 0)&&!t.length)return te.bind(null,{flags:e??""});if({}.toString.call(e)==="[object Object]"&&!t.length)return te.bind(null,e);throw new Error(`Unexpected arguments: ${JSON.stringify([e,...t])}`)},te=(e,t,...n)=>{let r=Te(e),s=$e(t,n,r),a=0,o="",i;if(s.template.raw.forEach((u,c)=>{let p=!!(s.template.raw[c]||s.template.raw[c+1]);a+=U(u),o+=M(u,E.CHAR_CLASS),i=R(o,i);let{regexContext:m,charClassContext:l}=i;if(c<s.template.raw.length-1){let d=s.substitutions[c];o+=He(d,r.flags,m,l,p,a),d instanceof RegExp?a+=U(d.source):d instanceof $&&(a+=U(String(d)))}}),o=Ie(o,r),r.subclass){let u=We(o);return new ne(u.expression,r.flags,{captureMap:u.captureMap})}return new RegExp(o,r.flags)};function qe(e="",t={}){let n=Te(t);if(n.subclass)throw new Error("Cannot use option subclass");return{expression:Ie($e({raw:[e]},[],n).template.raw[0],n),flags:n.flags}}function Te(e){let t={flags:"",subclass:!1,plugins:[],unicodeSetsPlugin:Se,disable:{},force:{},...e};if(/[nuvx]/.test(t.flags))throw new Error("Implicit flags v/u/x/n cannot be explicitly added");let n=t.force.v||(t.disable.v?!1:oe);return t.flags+=n?"v":"u",n&&(t.unicodeSetsPlugin=null),t}function $e(e,t,n){let r=[];n.disable.x||r.push(pe),n.disable.n||r.push(ce);for(let s of r)({template:e,substitutions:t}=le(e,t,s,n));return{template:e,substitutions:t}}function Ie(e,t){let{flags:n,plugins:r,unicodeSetsPlugin:s,disable:a,subclass:o}=t;return[...r,...a.subroutines?[]:[Ae],...a.atomic?[]:[he,ge],...a.x?[]:[de],...s?[s]:[]].forEach(i=>e=i(e,{flags:n,useEmulationGroups:o})),e}var ne=class e extends RegExp{#e;constructor(t,n,r){super(t,n),r?this.#e=r.captureMap:t instanceof e&&(this.#e=t.#e)}exec(t){let n=RegExp.prototype.exec.call(this,t);if(!n||!this.#e)return n;let r=[...n];n.length=1;for(let s=1;s<r.length;s++)this.#e[s]&&n.push(r[s]);return n}};function He(e,t,n,r,s,a){if(e instanceof RegExp&&n!==f.DEFAULT)throw new Error("Cannot interpolate a RegExp at this position because the syntax context does not match");if(n===f.INVALID_INCOMPLETE_TOKEN||r===g.INVALID_INCOMPLETE_TOKEN)throw new Error("Interpolation preceded by invalid incomplete token");let o=e instanceof $,i="";if(!(e instanceof RegExp)){e=String(e),o||(i=z(e,n===f.CHAR_CLASS?E.CHAR_CLASS:E.DEFAULT));let u=ae(i||e,n,r);if(u)throw new Error(`Unescaped stray "${u}" in the interpolated value would have side effects outside it`)}if(n===f.ENCLOSED_TOKEN||n===f.INTERVAL_QUANTIFIER||n===f.GROUP_NAME||r===g.ENCLOSED_TOKEN||r===g.Q_TOKEN)return o?String(e):i;if(n===f.CHAR_CLASS){if(o){if(V(String(e),"^-|^&&|-$|&&$"))throw new Error("Cannot use range or set operator at boundary of interpolated pattern; move the operation into the pattern or the operator outside of it");let u=ie(q(e));return Z(e)?`[${u}]`:M(u)}return Z(i)?`[${i}]`:i}if(e instanceof RegExp){let u=Be(e,t),c=ue(u.value,a);return u.usedModifier?c:`(?:${c})`}return o?`(?:${e})`:s?`(?:${i})`:i}function Be(e,t){let n={i:null,m:null,s:null},r="\\n\\r\\u2028\\u2029",s=e.source;if(e.ignoreCase!==t.includes("i"))if(G)n.i=e.ignoreCase;else throw new Error("Pattern modifiers not supported, so flag i on the outer and interpolated regex must match");if(e.dotAll!==t.includes("s")&&(G?n.s=e.dotAll:s=N(s,"\\.",e.dotAll?"[^]":`[^${r}]`,E.DEFAULT)),e.multiline!==t.includes("m")&&(G?n.m=e.multiline:(s=N(s,"\\^",e.multiline?`(?<=^|[${r}])`:"(?<![^])",E.DEFAULT),s=N(s,"\\$",e.multiline?`(?=$|[${r}])`:"(?![^])",E.DEFAULT))),G){let a=Object.keys(n),o=a.filter(u=>n[u]===!0).join(""),i=a.filter(u=>n[u]===!1).join("");if(i&&(o+=`-${i}`),o)return{value:`(?${o}:${s})`,usedModifier:!0}}return{value:s}}function We(e){let t=I.replace(/\$/g,"\\$"),n=[!0];return e=N(e,`(?:${O})(?<mark>${t})?`,({0:r,groups:{mark:s}})=>s?(n.push(!1),r.slice(0,-I.length)):(n.push(!0),r),E.DEFAULT),{captureMap:n,expression:e}}return De(ze);})(); | ||
//# sourceMappingURL=regex.min.js.map |
{ | ||
"name": "regex", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "Regex template tag with extended syntax, context-aware interpolation, and always-on best practices", | ||
@@ -5,0 +5,0 @@ "author": "Steven Levithan", |
@@ -121,3 +121,3 @@ <div align="center"> | ||
<script type="module"> | ||
import {regex, pattern} from 'https://cdn.jsdelivr.net/npm/regex@4.3.0/+esm'; | ||
import {regex, pattern} from 'https://cdn.jsdelivr.net/npm/regex@4.3.1/+esm'; | ||
// … | ||
@@ -131,3 +131,3 @@ </script> | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/regex@4.3.0/dist/regex.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/regex@4.3.1/dist/regex.min.js"></script> | ||
<script> | ||
@@ -134,0 +134,0 @@ const {regex, pattern} = Regex; |
@@ -14,2 +14,4 @@ /** | ||
`?+`, `*+`, `++`, `{N}+`, `{N,}+`, `{N,N}+`. | ||
This follows Java, PCRE, Perl, and Python. | ||
Possessive quantifiers in Oniguruma and Onigmo are only: `?+`, `*+`, `++`. | ||
@param {string} expression | ||
@@ -16,0 +18,0 @@ @returns {string} |
@@ -45,2 +45,10 @@ /** | ||
export function adjustNumberedBackrefs(expression: string, precedingCaptures: number): string; | ||
/** | ||
@param {string} str | ||
@param {number} pos | ||
@param {string} oldValue | ||
@param {string} newValue | ||
@returns {string} | ||
*/ | ||
export function spliceStr(str: string, pos: number, oldValue: string, newValue: string): string; | ||
export function containsCharClassUnion(charClassPattern: any): boolean; | ||
@@ -47,0 +55,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
446858
2825