"use strict";var f=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(m,e)=>{for(var n in e)f(m,n,{get:e[n],enumerable:!0})},h=(m,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of x(e))!c.call(m,t)&&t!==n&&f(m,t,{get:()=>e[t],enumerable:!(r=g(e,t))||r.enumerable});return m};var s=m=>h(f({},"__esModule",{value:!0}),m);var w={};l(w,{NumberModule:()=>d});module.exports=s(w);var u=require("../../errors/faker-error"),o=require("../../internal/module-base");class d extends o.SimpleModuleBase{int(e={}){typeof e=="number"&&(e={max:e});const{min:n=0,max:r=Number.MAX_SAFE_INTEGER}=e,t=Math.ceil(n),a=Math.floor(r);if(t===a)return t;if(a<t)throw r>=n?new u.FakerError(`No integer value between ${n} and ${r} found.`):new u.FakerError(`Max ${r} should be greater than min ${n}.`);const i=this.faker._randomizer.next();return Math.floor(i*(a+1-t)+t)}float(e={}){typeof e=="number"&&(e={max:e});const{min:n=0,max:r=1,precision:t}=e;if(r===n)return n;if(r<n)throw new u.FakerError(`Max ${r} should be greater than min ${n}.`);if(t!==void 0){if(t<=0)throw new u.FakerError("Precision should be greater than 0.");const i=1/t;return this.int({min:n*i,max:r*i})/i}return this.faker._randomizer.next()*(r-n)+n}binary(e={}){typeof e=="number"&&(e={max:e});const{min:n=0,max:r=1}=e;return this.int({max:r,min:n}).toString(2)}octal(e={}){typeof e=="number"&&(e={max:e});const{min:n=0,max:r=7}=e;return this.int({max:r,min:n}).toString(8)}hex(e={}){typeof e=="number"&&(e={max:e});const{min:n=0,max:r=15}=e;return this.int({max:r,min:n}).toString(16)}bigInt(e={}){var b,i;(typeof e=="bigint"||typeof e=="number"||typeof e=="string"||typeof e=="boolean")&&(e={max:e});const n=BigInt((b=e.min)!=null?b:0),r=BigInt((i=e.max)!=null?i:n+BigInt(999999999999999));if(r===n)return n;if(r<n)throw new u.FakerError(`Max ${r} should be larger then min ${n}.`);const t=r-n,a=BigInt(this.faker.string.numeric({length:t.toString(10).length,allowLeadingZeros:!0}))%(t+BigInt(1));return n+a}}0&&(module.exports={NumberModule});
