"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[18],{138:function(n,t,e){var r=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.convertWeightsToThresholds=t.assignWeighted=t.sampleN=t.showCanary=t.assignUniform=t.uniformIndex=void 0;const i=r(e(117));function o(n,t){if(0===t)return 0;const e=BigInt(`0x${(0,i.default)(n).substr(0,15)}`);return Number(e%BigInt(t))}function u(n){const t={};let e=0,r=0;return[...new Set(n)].sort(((n,t)=>n-t)).forEach((i=>{const o=n.filter((n=>n>=i)).map((n=>n-r)),u=(1-e)*function(n){return Math.min(...n)/n.reduce(((n,t)=>n+t),0)*n.length}(o);r=i,e+=u,t[i]=e})),n.map((n=>Math.round(100*t[n])))}t.uniformIndex=o,t.assignUniform=function(n,t){return t[o(n,t.length)]},t.showCanary=function(n,t=0){return t>0&&o(n,100)0&&t.length>0;){const i=o(n,t.length),u=t.splice(i,1)[0];r.push(u),e--}return r},t.assignWeighted=function(n,t){const e=u(t.map((n=>n.weight))),r=o(n,100),i=[...t];for(;i.length>1;){const t=o(n,i.length),u=i.splice(t,1)[0],s=e.splice(t,1)[0];if(u&&r{n.exports=function(n,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var e,r="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(e=t.cmp,function(n){return function(t,r){var i={key:t,value:n[t]},o={key:r,value:n[r]};return e(i,o)}}),o=[];return function n(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var e,u;if(Array.isArray(t)){for(u="[",e=0;e