{"release_id":"01a1998d-9802-0000-b0f7-33a23307f4ed","chunk_id":"01a1998d-9818-7e33-bf50-632397946143","file":"BDP6GjLk.mjs","mappings":"kYAiBO,SAASA,EAASC,EAAiBC,EAAiC,CAC1E,MAAMC,EAAIC,GAAWH,EAAUC,EAAK,QAAUA,EAAK,IAAI,EACjDG,EAAOJ,GAAWC,EAAK,OAAS,QAAU,QAC1CI,EAAQD,IAAS,QAAU,EAAIF,EAAIA,EACnCI,EAAI,KAAK,MAAM,EAAID,CAAK,EAC9B,MAAO,CAAE,IAAK,KAAK,MAAMH,EAAI,GAAI,EAAI,GAAI,MAAOG,EAAQ,GAAKC,GAAKC,EAAaD,EAAI,KAAM,KAAAF,CAAA,CAC1F,CAGO,MAAMI,EAAY,CAACC,EAAkBC,IAC1CA,EAAUA,EAAUD,GAAa,EAAI,KAAK,IAE/BE,EAAiBH,EAC7BI,EAAS,YAAY,OACrBA,EAAS,mBAAmB,MAC7B,EAGO,SAASC,EAASC,EAA4B,CACpD,OAAOA,IAAU,QACd,CAAE,OAAQF,EAAS,YAAa,MAAOA,EAAS,kBAAA,EAChD,CAAE,OAAQA,EAAS,cAAe,MAAOA,EAAS,oBAAA,CACtD,CAGO,MAAMG,EAAe,CAAC,EAAG,IAAK,EAAG,IAAK,EAAG,CAAC","names":["standing","valueCm","stat","p","normalCdf","side","share","n","RARITY_CAP","volumeCm3","lengthCm","girthCm","AVERAGE_VOLUME","BJU_2015","statsFor","state","ASKED_INCHES"],"sources":["../../../../../../src/lib/tools/size-calc.ts"],"sourcesContent":["import { BJU_2015, normalCdf, type MeasurementStat } from '$lib/data/size-stats';\nimport { RARITY_CAP } from './size-chart';\n\n/**\n * The calculator's numbers (RAT-574): where a length and a girth sit among\n * Veale et al. 2015's 15,521 men, how rare that is, and the volume they make.\n * Everything in cm.\n */\n\nexport interface Standing {\n\t/** share of men below, 0–100, one decimal */\n\tpct: number;\n\t/** 1 in N men is above (or below, under the average); null past 1 in 10,000 */\n\toneIn: number | null;\n\tside: 'above' | 'below';\n}\n\nexport function standing(valueCm: number, stat: MeasurementStat): Standing {\n\tconst p = normalCdf((valueCm - stat.meanCm) / stat.sdCm);\n\tconst side = valueCm >= stat.meanCm ? 'above' : 'below';\n\tconst share = side === 'above' ? 1 - p : p;\n\tconst n = Math.round(1 / share);\n\treturn { pct: Math.round(p * 1000) / 10, oneIn: share > 0 && n <= RARITY_CAP ? n : null, side };\n}\n\n/** Volume as a cylinder: girth² × length / 4π. A model, not a measurement. */\nexport const volumeCm3 = (lengthCm: number, girthCm: number) =>\n\t(girthCm * girthCm * lengthCm) / (4 * Math.PI);\n\nexport const AVERAGE_VOLUME = volumeCm3(\n\tBJU_2015.erectLength.meanCm,\n\tBJU_2015.erectCircumference.meanCm\n);\n\n/** The stats a state is measured against. */\nexport function statsFor(state: 'erect' | 'flaccid') {\n\treturn state === 'erect'\n\t\t? { length: BJU_2015.erectLength, girth: BJU_2015.erectCircumference }\n\t\t: { length: BJU_2015.flaccidLength, girth: BJU_2015.flaccidCircumference };\n}\n\n/** \"Is 5 / 5.5 / … inches big?\" — the sizes people ask about by name. */\nexport const ASKED_INCHES = [5, 5.5, 6, 6.5, 7, 8];\n"],"version":3}