import{__require as t}from"../is-number/index.mjs";
/*!
 * to-regex-range <https://github.com/micromatch/to-regex-range>
 *
 * Copyright (c) 2015-present, Jon Schlinkert.
 * Released under the MIT License.
 */var e,r;function n(){if(r)return e;r=1;const n=t(),u=(t,e,r)=>{if(!1===n(t))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===e||t===e)return String(t);if(!1===n(e))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...r};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let s=t+":"+e+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(u.cache.hasOwnProperty(s))return u.cache[s].result;let c=Math.min(t,e),l=Math.max(t,e);if(1===Math.abs(c-l)){let r=t+"|"+e;return a.capture?`(${r})`:!1===a.wrap?r:`(?:${r})`}let h=p(t)||p(e),f={min:t,max:e,a:c,b:l},g=[],d=[];if(h&&(f.isPadded=h,f.maxLen=String(f.max).length),c<0){d=i(l<0?Math.abs(l):1,Math.abs(c),f,a),c=f.a=0}return l>=0&&(g=i(c,l,f,a)),f.negatives=d,f.positives=g,f.result=function(t,e){let r=o(t,e,"-",!1)||[],n=o(e,t,"",!1)||[],u=o(t,e,"-?",!0)||[];return r.concat(u).concat(n).join("|")}(d,g),!0===a.capture?f.result=`(${f.result})`:!1!==a.wrap&&g.length+d.length>1&&(f.result=`(?:${f.result})`),u.cache[s]=f,f.result};function a(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=function(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}(t,e),u=n.length,a="",i=0;for(let t=0;t<u;t++){let[e,r]=n[t];e===r?a+=e:"0"!==e||"9"!==r?a+=g(e,r):i++}return i&&(a+=!0===r.shorthand?"\\d":"[0-9]"),{pattern:a,count:[i],digits:u}}function i(t,e,r,n){let u,i=function(t,e){let r=1,n=1,u=l(t,r),a=new Set([e]);for(;t<=u&&u<=e;)a.add(u),r+=1,u=l(t,r);for(u=h(e+1,n)-1;t<u&&u<=e;)a.add(u),n+=1,u=h(e+1,n)-1;return a=[...a],a.sort(s),a}(t,e),o=[],c=t;for(let t=0;t<i.length;t++){let e=i[t],s=a(String(c),String(e),n),l="";r.isPadded||!u||u.pattern!==s.pattern?(r.isPadded&&(l=d(e,r,n)),s.string=l+s.pattern+f(s.count),o.push(s),c=e+1,u=s):(u.count.length>1&&u.count.pop(),u.count.push(s.count[0]),u.string=u.pattern+f(u.count),c=e+1)}return o}function o(t,e,r,n,u){let a=[];for(let u of t){let{string:t}=u;n||c(e,"string",t)||a.push(r+t),n&&c(e,"string",t)&&a.push(r+t)}return a}function s(t,e){return t>e?1:e>t?-1:0}function c(t,e,r){return t.some(t=>t[e]===r)}function l(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function h(t,e){return t-t%Math.pow(10,e)}function f(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function g(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function p(t){return/^-?(0+)\d/.test(t)}function d(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),u=!1!==r.relaxZeros;switch(n){case 0:return"";case 1:return u?"0?":"0";case 2:return u?"0{0,2}":"00";default:return u?`0{0,${n}}`:`0{${n}}`}}return u.cache={},u.clearCache=()=>u.cache={},e=u}export{n as __require};