'use strict';
import { first } from './collections/single-funcs.js';

var __defProp=Object['defineProperty'],__name=(_0x3b9893,_0x16394f)=>__defProp(_0x3b9893,'name',{'value':_0x16394f,'configurable':!![]});function getRandomFromCollection(_0x29e69c){return _0x29e69c[Math['floor'](getSecureRandom()*_0x29e69c['length'])];}__name(getRandomFromCollection,'getRandomFromCollection');function getRandomFromCollectionByWeight(_0xabf77c){let _0x3c0842=-0x1939+-0x17a2+0x30db;for(const _0x3481bd of _0xabf77c){_0x3481bd['weight']=_0x3481bd['weight']??-0x601+-0x3*0xa4a+0x1d8*0x14,_0x3c0842+=_0x3481bd['weight'],_0x3481bd['weight']=_0x3c0842;}const _0xcdeff=getSecureRandom()*_0x3c0842;return _0xabf77c['find'](_0x427b5d=>_0x427b5d['weight']>_0xcdeff)['id'];}__name(getRandomFromCollectionByWeight,'getRandomFromCollectionByWeight');function getSecureRandom(){const _0x18493a=new Uint32Array(0x5d1*0x6+0xc61+-0x2f46);return crypto['getRandomValues'](_0x18493a),first(Array['from'](_0x18493a))/(-0xaacde123*-0x1+-0x9a47d*0x1a07+-0x1502a5047*-0x1+(0xb38*0x2+-0x1101+-0x56e));}__name(getSecureRandom,'getSecureRandom');

export { getRandomFromCollection, getRandomFromCollectionByWeight };
