@bicharts/shape-core 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DMLWYEQ2.mjs → chunk-35Z7JCND.mjs} +1 -1
- package/dist/chunk-BIC73LQV.mjs +4 -0
- package/dist/{chunk-OZEOA6ZE.mjs → chunk-C5I73OM2.mjs} +1 -1
- package/dist/chunk-ILHBRGIO.mjs +2 -0
- package/dist/chunk-PFCJESUQ.mjs +2 -0
- package/dist/{chunk-E6SVTFAW.mjs → chunk-TPVDJHU6.mjs} +1 -1
- package/dist/chunk-ZFTP4NSP.mjs +2 -0
- package/dist/geoDetector.mjs +1 -1
- package/dist/geoPoint.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/indexedText.mjs +1 -1
- package/dist/ingest.mjs +1 -1
- package/dist/ordinalDetector.mjs +1 -1
- package/dist/testing.mjs +1 -1
- package/dist/types/aggregation.d.ts +6 -1
- package/dist/types/geoCountryNames.d.ts +2 -2
- package/dist/types/geoDetector.d.ts +1 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/ingest.d.ts +3 -1
- package/dist/types/languages.d.ts +66 -0
- package/dist/types/nameReader.d.ts +76 -0
- package/dist/types/numberText.d.ts +14 -0
- package/dist/types/sampleMask.d.ts +6 -0
- package/dist/types/util.d.ts +7 -5
- package/dist/types/wire.d.ts +14 -10
- package/dist/util.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-ANY34FNP.mjs +0 -4
- package/dist/chunk-FUTSF2X5.mjs +0 -2
- package/dist/chunk-IJXTU62R.mjs +0 -2
- package/dist/chunk-TDTXRIHS.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a as h}from"./chunk-FUTSF2X5.mjs";var b=[{name:"likert7_agreement",minMatches:5,canonical:["strongly disagree","disagree","slightly disagree","neutral","slightly agree","agree","strongly agree"]},{name:"likert5_agreement",minMatches:3,canonical:["strongly disagree","disagree","neutral","agree","strongly agree"]},{name:"likert3_agreement",minMatches:2,canonical:["disagree","neutral","agree"]},{name:"likert5_satisfaction",minMatches:3,canonical:["very dissatisfied","dissatisfied","neutral","satisfied","very satisfied"]},{name:"likert3_satisfaction",minMatches:2,canonical:["dissatisfied","neutral","satisfied"]},{name:"likert5_quality",minMatches:3,canonical:["poor","fair","good","very good","excellent"]},{name:"likert3_quality",minMatches:2,canonical:["poor","fair","good"]},{name:"frequency5",minMatches:3,canonical:["never","rarely","sometimes","often","always"]},{name:"intensity5",minMatches:3,canonical:["not at all","slightly","moderately","very","extremely"]},{name:"importance5",minMatches:3,canonical:["not important","slightly important","moderately important","very important","extremely important"]},{name:"severity_low_critical",minMatches:3,canonical:["low","medium","high","critical"]},{name:"severity_low_urgent",minMatches:3,canonical:["low","medium","high","urgent"]},{name:"severity_none_critical",minMatches:3,canonical:["none","mild","moderate","severe","critical"]},{name:"priority_p4_p1",minMatches:3,canonical:["p4","p3","p2","p1","p0"]},{name:"severity_trivial_blocker",minMatches:3,canonical:["trivial","minor","major","critical","blocker"]},{name:"severity_minor_severe",minMatches:3,canonical:["minor","moderate","major","severe"]},{name:"magnitude5_medium",minMatches:3,canonical:["very low","low","medium","high","very high"]},{name:"magnitude5_moderate",minMatches:3,canonical:["very low","low","moderate","high","very high"]},{name:"speed5",minMatches:3,canonical:["very slow","slow","moderate","fast","very fast"]},{name:"temperature6",minMatches:3,canonical:["freezing","cold","cool","mild","warm","hot"]},{name:"experience6",minMatches:3,canonical:["novice","beginner","intermediate","advanced","expert","master"]},{name:"tier_metal",minMatches:3,canonical:["bronze","silver","gold","platinum","diamond"]},{name:"tshirt_letter_sizes",minMatches:4,canonical:["xxs","xs","s","m","l","xl","xxl","xxxl"]},{name:"tshirt_word_sizes",minMatches:3,canonical:["extra small","small","medium","large","extra large"]},{name:"nps_bands",minMatches:2,canonical:["detractor","passive","promoter"]},{name:"likelihood5",minMatches:3,canonical:["very unlikely","unlikely","neutral","likely","very likely"]},{name:"education",minMatches:3,canonical:["none","primary","secondary","bachelors","masters","doctoral"]},{name:"grades_a_to_f",minMatches:3,canonical:["a","b","c","d","f"]},{name:"grades_a_to_f_plusminus",minMatches:4,canonical:["a+","a","a-","b+","b","b-","c+","c","c-","d+","d","d-","f"]}],v={seldom:"rarely",infrequently:"rarely","hardly ever":"rarely",occasionally:"sometimes",periodically:"sometimes","now and then":"sometimes",frequently:"often",frequent:"often",regularly:"often",commonly:"often",usually:"often",constantly:"always","every time":"always","all the time":"always",consistently:"always",continually:"always",bad:"poor",weak:"poor",subpar:"poor",mediocre:"fair",passable:"fair","so so":"fair",decent:"good",solid:"good",outstanding:"excellent",superb:"excellent",exceptional:"excellent",stellar:"excellent",unsatisfied:"dissatisfied",unhappy:"dissatisfied",displeased:"dissatisfied",happy:"satisfied",content:"satisfied",pleased:"satisfied",delighted:"very satisfied","highly satisfied":"very satisfied","extremely satisfied":"very satisfied","highly dissatisfied":"very dissatisfied","extremely dissatisfied":"very dissatisfied",neither:"neutral",undecided:"neutral","no opinion":"neutral","neither agree nor disagree":"neutral","completely agree":"strongly agree","totally agree":"strongly agree","completely disagree":"strongly disagree","totally disagree":"strongly disagree","highly unlikely":"very unlikely","extremely unlikely":"very unlikely","highly likely":"very likely","extremely likely":"very likely","almost certain":"very likely",bachelor:"bachelors","bachelor's":"bachelors",undergraduate:"bachelors","bachelor degree":"bachelors","master's":"masters",graduate:"masters","master degree":"masters",doctorate:"doctoral",phd:"doctoral"},x=(()=>{let n=new Set;for(let t of b)for(let r of t.canonical)n.add(d(r));return n})(),q=(()=>{let n=new Map;for(let[t,r]of Object.entries(v)){let e=d(t);x.has(e)||n.has(e)||n.set(e,d(r))}return n})();function y(n){return q.get(n)??n}var D=new Set(["hour","hr","day","dow","dom","weekday","week","wk","woy","month","mth","quarter","qtr","year","yr","semester","trimester","decade","period","fiscal","fy","rank","level","lvl","tier","grade","band","decile","percentile","quartile","quintile","score","rating","stars","step","stage","phase","round","wave","episode","chapter","age","cohort","generation","seniority","position","sequence","seq","priority"]);function K(n){if(!n)return!1;for(let t of h(n))if(D.has(t))return!0;return!1}function d(n){return n.toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}function g(n){let t=new Map;for(let[r,e]of n)for(let a of r)t.set(d(a),e);return t}var _=[{name:"weekday_mon_sun",minMatches:4,dict:g([[["monday","mon"],0],[["tuesday","tue","tues"],1],[["wednesday","wed","weds"],2],[["thursday","thu","thur","thurs","thr"],3],[["friday","fri"],4],[["saturday","sat"],5],[["sunday","sun"],6]])},{name:"month_jan_dec",minMatches:4,dict:g([[["january","jan"],0],[["february","feb"],1],[["march","mar"],2],[["april","apr"],3],[["may"],4],[["june","jun"],5],[["july","jul"],6],[["august","aug"],7],[["september","sep","sept"],8],[["october","oct"],9],[["november","nov"],10],[["december","dec"],11]])},{name:"quarter_q1_q4",minMatches:3,dict:g([[["q1","qtr 1","qtr1","quarter 1","q 1"],0],[["q2","qtr 2","qtr2","quarter 2","q 2"],1],[["q3","qtr 3","qtr3","quarter 3","q 3"],2],[["q4","qtr 4","qtr4","quarter 4","q 4"],3]])}],p={};function C(n){let t=n||"";if(!t)return{weekday:new Map,month:new Map};let r=p[t];if(r)return r;let e=new Map,a=new Map,i=(s,l,m)=>{let u=d(l);u&&s.set(u,m);let c=d(l.replace(/\./g,""));c&&c!==u&&s.set(c,m)};try{let s=new Intl.DateTimeFormat(t,{weekday:"long"}),l=new Intl.DateTimeFormat(t,{weekday:"short"});for(let c=0;c<7;++c){let f=new Date(Date.UTC(2024,0,1+c));i(e,s.format(f),c),i(e,l.format(f),c)}let m=new Intl.DateTimeFormat(t,{month:"long"}),u=new Intl.DateTimeFormat(t,{month:"short"});for(let c=0;c<12;++c){let f=new Date(Date.UTC(2020,c,15));i(a,m.format(f),c),i(a,u.format(f),c)}}catch{}let o={weekday:e,month:a};return p[t]=o,o}function M(n,t){if(t.size===0)return n;let r=new Map(n);for(let[e,a]of t)r.has(e)||r.set(e,a);return r}function N(n,t){let r=C(t);for(let e of _){let a=e.name==="weekday_mon_sun"?M(e.dict,r.weekday):e.name==="month_jan_dec"?M(e.dict,r.month):e.dict,i=!0,o=new Map;for(let[l,m]of n){let u=a.get(l);if(u===void 0){i=!1;break}o.has(u)||o.set(u,m)}if(!i||o.size<e.minMatches)continue;let s=[...o.entries()].sort((l,m)=>l[0]-m[0]).map(l=>l[1]);return{pattern:e.name,orderedDomain:s}}return null}function w(n){let t=new Map;for(let r of n){if(r==null)continue;let e=String(r);if(e.length===0)continue;let a=d(e);t.has(a)||t.set(a,e)}return t}var S=15,R=10,O=(()=>{let n=["xxs","xs","s","sm","small","m","med","medium","l","lg","large","xl","xlarge","xxl","xxxl","2xl","3xl","4xl","y","n","yes","no","t","f","true","false","na","n/a","n a","none","null","unknown","other","all","both","low","medium","med","high","very low","very high","minimal","critical","urgent"],t=new Set(n.map(d));for(let r of _)for(let e of r.dict.keys())t.add(e);return t})();function A(n){let t=n.trim();return t.length===0||t.length>R||(t.match(/\p{L}/gu)||[]).length>1?!1:/\p{Nd}/u.test(t)}function E(n){let t=n.trim();return t.length===1&&/[\p{L}\p{Nd}]/u.test(t)}function V(n){if(!n||n.length===0)return null;let t=new Set,r=[];for(let e of n){if(e==null)continue;let a=String(e);if(t.has(a))continue;let i=d(a);if(!(i===""||O.has(i)||A(a)||E(a))||(t.add(a),r.push(a),r.length>S))return null}return r.length>0?r:null}var I=/^(\p{L}{0,3}) ?([0-9]+)\s*[-–—:.)]\s*(.+)$/u;function T(n){let t=null,r=new Set,e=[];for(let a of n.values()){let i=I.exec(a.trim());if(!i)return null;let o=i[1].toLowerCase();if(t===null)t=o;else if(o!==t)return null;let s=Number(i[2]);if(r.has(s)||d(i[3])==="")return null;r.add(s),e.push({code:s,original:a,label:i[3]})}return e}function L(n,t){let r=k(w(n.map(s=>s.label)),t);if(r===null)return;if(r.orderedDomain.length!==n.length)return null;let e=new Map;for(let s of n)e.set(s.label,s);let a=r.orderedDomain.map(s=>e.get(s));if(a.some(s=>s===void 0))return null;let i=!0,o=!0;for(let s=1;s<a.length;++s)a[s].code<=a[s-1].code&&(i=!1),a[s].code>=a[s-1].code&&(o=!1);return!i&&!o?null:{pattern:r.pattern,orderedDomain:a.map(s=>s.original)}}function Y(n,t){if(!n||n.length<2)return null;let r=w(n);if(r.size<2)return null;let e=T(r);if(e!==null){let i=L(e,t);if(i!==void 0)return i}let a=k(r,t);return a!==null?a:e!==null?P(r):null}var F=/^([0-9]+)\s*(?:\.|\)|-)\s*([^\s\d].*)$/u,j=3,z=20;function P(n){if(n.size<j||n.size>z)return null;let t=new Set,r=[];for(let e of n.values()){let a=F.exec(e.trim());if(!a||d(a[2])==="")return null;let i=Number(a[1]);if(t.has(i))return null;t.add(i),r.push({n:i,original:e})}return r.sort((e,a)=>e.n-a.n),{pattern:"numeric_rank_prefix",orderedDomain:r.map(e=>e.original)}}function k(n,t){let r=new Map;for(let[a,i]of n){let o=y(a);r.has(o)||r.set(o,i)}let e=null;for(let a of b){let i=[];for(let m of a.canonical){let u=r.get(m);u!==void 0&&i.push(u)}if(i.length<a.minMatches)continue;let o=new Set(a.canonical),s=!0;for(let m of n.keys())if(!o.has(y(m))){s=!1;break}if(!s)continue;let l;e===null||i.length>e.matched||i.length===e.matched&&a.canonical.length<e.pattern.canonical.length?l=!0:l=!1,l&&(e={pattern:a,matched:i.length,orderedDomain:i})}return e?{pattern:e.pattern.name,orderedDomain:e.orderedDomain}:N(n,t)}export{K as a,V as b,Y as c};
|
|
2
|
+
import{f as h}from"./chunk-ILHBRGIO.mjs";var b=[{name:"likert7_agreement",minMatches:5,canonical:["strongly disagree","disagree","slightly disagree","neutral","slightly agree","agree","strongly agree"]},{name:"likert5_agreement",minMatches:3,canonical:["strongly disagree","disagree","neutral","agree","strongly agree"]},{name:"likert3_agreement",minMatches:2,canonical:["disagree","neutral","agree"]},{name:"likert5_satisfaction",minMatches:3,canonical:["very dissatisfied","dissatisfied","neutral","satisfied","very satisfied"]},{name:"likert3_satisfaction",minMatches:2,canonical:["dissatisfied","neutral","satisfied"]},{name:"likert5_quality",minMatches:3,canonical:["poor","fair","good","very good","excellent"]},{name:"likert3_quality",minMatches:2,canonical:["poor","fair","good"]},{name:"frequency5",minMatches:3,canonical:["never","rarely","sometimes","often","always"]},{name:"intensity5",minMatches:3,canonical:["not at all","slightly","moderately","very","extremely"]},{name:"importance5",minMatches:3,canonical:["not important","slightly important","moderately important","very important","extremely important"]},{name:"severity_low_critical",minMatches:3,canonical:["low","medium","high","critical"]},{name:"severity_low_urgent",minMatches:3,canonical:["low","medium","high","urgent"]},{name:"severity_none_critical",minMatches:3,canonical:["none","mild","moderate","severe","critical"]},{name:"priority_p4_p1",minMatches:3,canonical:["p4","p3","p2","p1","p0"]},{name:"severity_trivial_blocker",minMatches:3,canonical:["trivial","minor","major","critical","blocker"]},{name:"severity_minor_severe",minMatches:3,canonical:["minor","moderate","major","severe"]},{name:"magnitude5_medium",minMatches:3,canonical:["very low","low","medium","high","very high"]},{name:"magnitude5_moderate",minMatches:3,canonical:["very low","low","moderate","high","very high"]},{name:"speed5",minMatches:3,canonical:["very slow","slow","moderate","fast","very fast"]},{name:"temperature6",minMatches:3,canonical:["freezing","cold","cool","mild","warm","hot"]},{name:"experience6",minMatches:3,canonical:["novice","beginner","intermediate","advanced","expert","master"]},{name:"tier_metal",minMatches:3,canonical:["bronze","silver","gold","platinum","diamond"]},{name:"tshirt_letter_sizes",minMatches:4,canonical:["xxs","xs","s","m","l","xl","xxl","xxxl"]},{name:"tshirt_word_sizes",minMatches:3,canonical:["extra small","small","medium","large","extra large"]},{name:"nps_bands",minMatches:2,canonical:["detractor","passive","promoter"]},{name:"likelihood5",minMatches:3,canonical:["very unlikely","unlikely","neutral","likely","very likely"]},{name:"education",minMatches:3,canonical:["none","primary","secondary","bachelors","masters","doctoral"]},{name:"grades_a_to_f",minMatches:3,canonical:["a","b","c","d","f"]},{name:"grades_a_to_f_plusminus",minMatches:4,canonical:["a+","a","a-","b+","b","b-","c+","c","c-","d+","d","d-","f"]}],v={seldom:"rarely",infrequently:"rarely","hardly ever":"rarely",occasionally:"sometimes",periodically:"sometimes","now and then":"sometimes",frequently:"often",frequent:"often",regularly:"often",commonly:"often",usually:"often",constantly:"always","every time":"always","all the time":"always",consistently:"always",continually:"always",bad:"poor",weak:"poor",subpar:"poor",mediocre:"fair",passable:"fair","so so":"fair",decent:"good",solid:"good",outstanding:"excellent",superb:"excellent",exceptional:"excellent",stellar:"excellent",unsatisfied:"dissatisfied",unhappy:"dissatisfied",displeased:"dissatisfied",happy:"satisfied",content:"satisfied",pleased:"satisfied",delighted:"very satisfied","highly satisfied":"very satisfied","extremely satisfied":"very satisfied","highly dissatisfied":"very dissatisfied","extremely dissatisfied":"very dissatisfied",neither:"neutral",undecided:"neutral","no opinion":"neutral","neither agree nor disagree":"neutral","completely agree":"strongly agree","totally agree":"strongly agree","completely disagree":"strongly disagree","totally disagree":"strongly disagree","highly unlikely":"very unlikely","extremely unlikely":"very unlikely","highly likely":"very likely","extremely likely":"very likely","almost certain":"very likely",bachelor:"bachelors","bachelor's":"bachelors",undergraduate:"bachelors","bachelor degree":"bachelors","master's":"masters",graduate:"masters","master degree":"masters",doctorate:"doctoral",phd:"doctoral"},x=(()=>{let n=new Set;for(let t of b)for(let r of t.canonical)n.add(d(r));return n})(),q=(()=>{let n=new Map;for(let[t,r]of Object.entries(v)){let e=d(t);x.has(e)||n.has(e)||n.set(e,d(r))}return n})();function y(n){return q.get(n)??n}var D=new Set(["hour","hr","day","dow","dom","weekday","week","wk","woy","month","mth","quarter","qtr","year","yr","semester","trimester","decade","period","fiscal","fy","rank","level","lvl","tier","grade","band","decile","percentile","quartile","quintile","score","rating","stars","step","stage","phase","round","wave","episode","chapter","age","cohort","generation","seniority","position","sequence","seq","priority"]);function K(n){if(!n)return!1;for(let t of h(n))if(D.has(t))return!0;return!1}function d(n){return n.toLowerCase().replace(/[-_]+/g," ").replace(/\s+/g," ").trim()}function g(n){let t=new Map;for(let[r,e]of n)for(let a of r)t.set(d(a),e);return t}var _=[{name:"weekday_mon_sun",minMatches:4,dict:g([[["monday","mon"],0],[["tuesday","tue","tues"],1],[["wednesday","wed","weds"],2],[["thursday","thu","thur","thurs","thr"],3],[["friday","fri"],4],[["saturday","sat"],5],[["sunday","sun"],6]])},{name:"month_jan_dec",minMatches:4,dict:g([[["january","jan"],0],[["february","feb"],1],[["march","mar"],2],[["april","apr"],3],[["may"],4],[["june","jun"],5],[["july","jul"],6],[["august","aug"],7],[["september","sep","sept"],8],[["october","oct"],9],[["november","nov"],10],[["december","dec"],11]])},{name:"quarter_q1_q4",minMatches:3,dict:g([[["q1","qtr 1","qtr1","quarter 1","q 1"],0],[["q2","qtr 2","qtr2","quarter 2","q 2"],1],[["q3","qtr 3","qtr3","quarter 3","q 3"],2],[["q4","qtr 4","qtr4","quarter 4","q 4"],3]])}],p={};function C(n){let t=n||"";if(!t)return{weekday:new Map,month:new Map};let r=p[t];if(r)return r;let e=new Map,a=new Map,i=(s,l,m)=>{let u=d(l);u&&s.set(u,m);let c=d(l.replace(/\./g,""));c&&c!==u&&s.set(c,m)};try{let s=new Intl.DateTimeFormat(t,{weekday:"long"}),l=new Intl.DateTimeFormat(t,{weekday:"short"});for(let c=0;c<7;++c){let f=new Date(Date.UTC(2024,0,1+c));i(e,s.format(f),c),i(e,l.format(f),c)}let m=new Intl.DateTimeFormat(t,{month:"long"}),u=new Intl.DateTimeFormat(t,{month:"short"});for(let c=0;c<12;++c){let f=new Date(Date.UTC(2020,c,15));i(a,m.format(f),c),i(a,u.format(f),c)}}catch{}let o={weekday:e,month:a};return p[t]=o,o}function M(n,t){if(t.size===0)return n;let r=new Map(n);for(let[e,a]of t)r.has(e)||r.set(e,a);return r}function N(n,t){let r=C(t);for(let e of _){let a=e.name==="weekday_mon_sun"?M(e.dict,r.weekday):e.name==="month_jan_dec"?M(e.dict,r.month):e.dict,i=!0,o=new Map;for(let[l,m]of n){let u=a.get(l);if(u===void 0){i=!1;break}o.has(u)||o.set(u,m)}if(!i||o.size<e.minMatches)continue;let s=[...o.entries()].sort((l,m)=>l[0]-m[0]).map(l=>l[1]);return{pattern:e.name,orderedDomain:s}}return null}function w(n){let t=new Map;for(let r of n){if(r==null)continue;let e=String(r);if(e.length===0)continue;let a=d(e);t.has(a)||t.set(a,e)}return t}var S=15,R=10,O=(()=>{let n=["xxs","xs","s","sm","small","m","med","medium","l","lg","large","xl","xlarge","xxl","xxxl","2xl","3xl","4xl","y","n","yes","no","t","f","true","false","na","n/a","n a","none","null","unknown","other","all","both","low","medium","med","high","very low","very high","minimal","critical","urgent"],t=new Set(n.map(d));for(let r of _)for(let e of r.dict.keys())t.add(e);return t})();function A(n){let t=n.trim();return t.length===0||t.length>R||(t.match(/\p{L}/gu)||[]).length>1?!1:/\p{Nd}/u.test(t)}function E(n){let t=n.trim();return t.length===1&&/[\p{L}\p{Nd}]/u.test(t)}function V(n){if(!n||n.length===0)return null;let t=new Set,r=[];for(let e of n){if(e==null)continue;let a=String(e);if(t.has(a))continue;let i=d(a);if(!(i===""||O.has(i)||A(a)||E(a))||(t.add(a),r.push(a),r.length>S))return null}return r.length>0?r:null}var I=/^(\p{L}{0,3}) ?([0-9]+)\s*[-–—:.)]\s*(.+)$/u;function T(n){let t=null,r=new Set,e=[];for(let a of n.values()){let i=I.exec(a.trim());if(!i)return null;let o=i[1].toLowerCase();if(t===null)t=o;else if(o!==t)return null;let s=Number(i[2]);if(r.has(s)||d(i[3])==="")return null;r.add(s),e.push({code:s,original:a,label:i[3]})}return e}function L(n,t){let r=k(w(n.map(s=>s.label)),t);if(r===null)return;if(r.orderedDomain.length!==n.length)return null;let e=new Map;for(let s of n)e.set(s.label,s);let a=r.orderedDomain.map(s=>e.get(s));if(a.some(s=>s===void 0))return null;let i=!0,o=!0;for(let s=1;s<a.length;++s)a[s].code<=a[s-1].code&&(i=!1),a[s].code>=a[s-1].code&&(o=!1);return!i&&!o?null:{pattern:r.pattern,orderedDomain:a.map(s=>s.original)}}function Y(n,t){if(!n||n.length<2)return null;let r=w(n);if(r.size<2)return null;let e=T(r);if(e!==null){let i=L(e,t);if(i!==void 0)return i}let a=k(r,t);return a!==null?a:e!==null?P(r):null}var F=/^([0-9]+)\s*(?:\.|\)|-)\s*([^\s\d].*)$/u,j=3,z=20;function P(n){if(n.size<j||n.size>z)return null;let t=new Set,r=[];for(let e of n.values()){let a=F.exec(e.trim());if(!a||d(a[2])==="")return null;let i=Number(a[1]);if(t.has(i))return null;t.add(i),r.push({n:i,original:e})}return r.sort((e,a)=>e.n-a.n),{pattern:"numeric_rank_prefix",orderedDomain:r.map(e=>e.original)}}function k(n,t){let r=new Map;for(let[a,i]of n){let o=y(a);r.has(o)||r.set(o,i)}let e=null;for(let a of b){let i=[];for(let m of a.canonical){let u=r.get(m);u!==void 0&&i.push(u)}if(i.length<a.minMatches)continue;let o=new Set(a.canonical),s=!0;for(let m of n.keys())if(!o.has(y(m))){s=!1;break}if(!s)continue;let l;e===null||i.length>e.matched||i.length===e.matched&&a.canonical.length<e.pattern.canonical.length?l=!0:l=!1,l&&(e={pattern:a,matched:i.length,orderedDomain:i})}return e?{pattern:e.pattern.name,orderedDomain:e.orderedDomain}:N(n,t)}export{K as a,V as b,Y as c};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
+
import{r as c}from"./chunk-ILHBRGIO.mjs";import{gzip as h}from"pako";var w=e=>h(e);function P(e){return x(w(JSON.stringify(e))).replace(/\//g,".")}function x(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function T(e){if(typeof e!="string"||e==="")throw new TypeError("keyedSigner needs the host's signing key");return{sign:t=>String(c(t+e))}}function W(e,t){let n=t.sign(e);if(typeof n!="string"||n.trim()==="")throw new TypeError("the host's signer returned a blank signature");return n}function u(e,t){if(e==null||typeof e!="object")return;let n=e,r=n[t];return r??n[t.charAt(0).toUpperCase()+t.slice(1)]}function m(e){return String(e??"").toLowerCase().includes("ndjson")}function C(e){let t=null;try{t=e.headers?.get?.("content-type")??null}catch{t=null}return{status:typeof e.status=="number"?e.status:0,contentType:t,body:e.body??null,text:()=>e.text()}}function S(e,t,n){let r=e.trim();if(!r)return{result:null,typed:!1,parsed:!1};let i;try{i=JSON.parse(r)}catch{return{result:null,typed:!1,parsed:!1}}return f(i,t,n)}function f(e,t,n){if(!e||typeof e!="object"||Array.isArray(e))return{result:null,typed:!1,parsed:!0};let r=u(e,"type");if(r!=null){if(r==="progress"){let s=String(u(e,"stage")??"").trim();return s&&t?.(s),{result:null,typed:!0,parsed:!0}}if(r==="result"){let s=u(e,"result");return{result:s&&typeof s=="object"?s:null,typed:!0,parsed:!0}}return{result:null,typed:!0,parsed:!0}}return n?{result:u(e,"code")!==void 0||u(e,"errorMessage")!==void 0?e:null,typed:!1,parsed:!0}:{result:e,typed:!1,parsed:!0}}var a=class{constructor(t){this.onStage=t}onStage;result=null;anyParsed=!1;take(t){let n=S(t,this.onStage,!0);n.parsed&&(this.anyParsed=!0),n.result&&(n.typed||this.result===null)&&(this.result=n.result)}};function d(){return new Error("the generate response ended without a result")}async function R(e,t){let n=e.body;if(!n||typeof n.getReader!="function")return p(await e.text(),t,null);let r=n.getReader(),i=new TextDecoder,s=new a(t),o="";try{for(;;){let{done:y,value:g}=await r.read();if(y)break;o+=i.decode(g,{stream:!0});let l;for(;(l=o.indexOf(`
|
|
3
|
+
`))>=0;)s.take(o.slice(0,l)),o=o.slice(l+1)}}finally{try{r.releaseLock?.()}catch{}}if(o+=i.decode(),s.take(o),!s.result)throw d();return s.result}function p(e,t,n){let r=new a(t);for(let i of e.split(`
|
|
4
|
+
`))r.take(i);if(r.result)return r.result;throw!r.anyParsed&&n?n:d()}async function b(e,t){let n=await e.text(),r;try{r=JSON.parse(n)}catch(s){return p(n,t,s)}if(!r||typeof r!="object"||Array.isArray(r))throw new SyntaxError("the generate response was JSON but not a result object");let i=f(r,t,!1);if(i.result)return i.result;throw d()}async function N(e,t){return m(e.contentType)?R(e,t):b(e,t)}export{w as a,P as b,T as c,W as d,u as e,m as f,C as g,N as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a as Q,c as tt,d as nt,e as et,f as W,g as st,h as ot,i as it,p as L,v as V}from"./chunk-
|
|
2
|
+
import{a as Q,c as tt,d as nt,e as et,f as W,g as st,h as ot,i as it,p as L,v as V}from"./chunk-TPVDJHU6.mjs";import{f as q}from"./chunk-ILHBRGIO.mjs";var St="006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191193194195196197198199200201202203204205206207208209210211212214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310312313314315316317318319320321322323324325326327328329330331333334335336337338339341342344346347349350351352354355356357358359360361362363364365366367368369370371372373374376377378379380381382383384385386387388389390391392393394395396397398400401402403404405406407408409410411412413414415416417418420421422423424425426427430431432433434435436437438439440441442443444445446447448449450451452453454455456457458460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508510511512513514515516520521522523524525526527528530531532534535537538539540541542543544545546547548549550551553554556557558559560561562563564565566567570571572573574575576577580581582583584585586587588590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620622623624625626627628629630631633634635636637638639640641644645646647648650651652653654655656657658660661662664665666667668669670671672673674675676677678679680681683684685686687688689690691692693700701703704705706707708710711712713714716717718719720721722723724725726727728729730731734735736737738739740741743744745746747748749750751752753754755756757758759760761762763764765766767768769770772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816820821822823824825826827828829830831832833834835836837838840841843844845846847850851852853855856857859860863864865870871873874875877878879880881882883884890891893894895897898900902903904905906907908910911912913914915916917918919920921922923924925926927928930931932933934935936937939940941943944945946947948949950951952953954955956957958959960961967968969970971972973974975976977978979980981982983984985986988989990991992993994995996997998999",w=new Set(St.match(/.{3}/g)??[]);var at=[["AL","Alabama"],["AK","Alaska"],["AZ","Arizona"],["AR","Arkansas"],["CA","California"],["CO","Colorado"],["CT","Connecticut"],["DE","Delaware"],["FL","Florida"],["GA","Georgia"],["HI","Hawaii"],["ID","Idaho"],["IL","Illinois"],["IN","Indiana"],["IA","Iowa"],["KS","Kansas"],["KY","Kentucky"],["LA","Louisiana"],["ME","Maine"],["MD","Maryland"],["MA","Massachusetts"],["MI","Michigan"],["MN","Minnesota"],["MS","Mississippi"],["MO","Missouri"],["MT","Montana"],["NE","Nebraska"],["NV","Nevada"],["NH","New Hampshire"],["NJ","New Jersey"],["NM","New Mexico"],["NY","New York"],["NC","North Carolina"],["ND","North Dakota"],["OH","Ohio"],["OK","Oklahoma"],["OR","Oregon"],["PA","Pennsylvania"],["RI","Rhode Island"],["SC","South Carolina"],["SD","South Dakota"],["TN","Tennessee"],["TX","Texas"],["UT","Utah"],["VT","Vermont"],["VA","Virginia"],["WA","Washington"],["WV","West Virginia"],["WI","Wisconsin"],["WY","Wyoming"],["DC","District of Columbia"],["PR","Puerto Rico"],["GU","Guam"],["VI","U.S. Virgin Islands"],["AS","American Samoa"],["MP","Northern Mariana Islands"]],ct=new Set(at.map(n=>n[0])),yt={"Ala.":"AL","Alab.":"AL","Ariz.":"AZ","Ark.":"AR","Calif.":"CA","Cal.":"CA","Colo.":"CO","Col.":"CO","Conn.":"CT","Del.":"DE","Fla.":"FL","Flor.":"FL","Ga.":"GA","Ill.":"IL","Ind.":"IN","Kan.":"KS","Kans.":"KS","Ky.":"KY","La.":"LA","Md.":"MD","Mass.":"MA","Mich.":"MI","Minn.":"MN","Miss.":"MS","Mo.":"MO","Mont.":"MT","Neb.":"NE","Nebr.":"NE","Nev.":"NV","N.H.":"NH","N.J.":"NJ","N.M.":"NM","N.Mex.":"NM","N. Mex.":"NM","N.Y.":"NY","N.C.":"NC","N.D.":"ND","N.Dak.":"ND","N. Dak.":"ND","Okla.":"OK","Ore.":"OR","Oreg.":"OR","Pa.":"PA","Penn.":"PA","Penna.":"PA","R.I.":"RI","S.C.":"SC","S.D.":"SD","S.Dak.":"SD","S. Dak.":"SD","Tenn.":"TN","Tex.":"TX","Vt.":"VT","Va.":"VA","Wash.":"WA","W.Va.":"WV","W. Va.":"WV","Wis.":"WI","Wisc.":"WI","Wyo.":"WY","D.C.":"DC","Wash. D.C.":"DC","Wash., D.C.":"DC","P.R.":"PR","V.I.":"VI"},ut=(()=>{let n=new Map;for(let[s,i]of at)n.set(g(i),s);n.set(g("Washington DC"),"DC"),n.set(g("Washington D.C."),"DC"),n.set(g("US Virgin Islands"),"VI");for(let[s,i]of Object.entries(yt)){let r=g(s);r&&!n.has(r)&&n.set(r,i)}return n})(),lt=new Set(["01","02","04","05","06","08","09","10","11","12","13","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","44","45","46","47","48","49","50","51","53","54","55","56","60","66","69","72","78"]);function ft(n){return n.trim().toUpperCase()}function g(n){return Q(n)}var H=new Set(["country","countries","nation","nationality","iso","geo"]),U=new Set(["state","province","st"]),rt=new Set(["zip","zipcode","postal","postcode","plz"]),gt=new Set(["county","fips","borough","parish"]),ht=new Set(["city","cities","town","municipality","metro","location","place"]);function y(n,s){if(!n)return!1;for(let i of q(n))if(s.has(i))return!0;return!1}var Nt=95,At=5,Ct=6e4;function kt(n,s,i){if(!n||n.length===0)return null;let r=[],M=new Set;for(let t of n){if(t==null)continue;let e=String(t).trim();if(e.length===0||ot(g(e)))continue;let o=e.toLowerCase();if(!M.has(o)&&(M.add(o),r.push(e),r.length>Ct))return null}let h=r.length;if(h<2)return null;let N=r.map(ft),I=r.map(g),O=et(),d=0,p=0,m=0,T=0,D=0,l=0,_=0,x=0,Y=0,K=0,F=0,P=0,Z=t=>(L(t)??"").slice(0,3),$=0,J=0,E=0,X=y(s,rt);for(let t=0;t<h;++t){let e=N[t],o=I[t],u=r[t],S=tt.has(e),C=ct.has(e);nt.has(e)&&d++,S&&p++,C&&m++,S&&C&&$++;let G=O.has(o),R=ut.has(o);G&&T++,R&&D++,G&&R&&J++,W(u)&&K++,C&&R&&E++,/^\d{5}(-\d{4})?$/.test(u)||X&&/^\d{3,4}$/.test(u)?(l++,w.has(Z(u))&&P++):/^\d{4}$/.test(u)&&F++,/^\d{5}$/.test(u)&<.has(u.slice(0,2))&&_++,V(o)&&x++,V(o,"world")&&Y++}if(!X&&l>0){l+=F;for(let t of r)/^\d{4}$/.test(t)&&w.has(Z(t))&&P++}let B=t=>t/h*100,A=[],c=(t,e,o,u=!1)=>{let S=B(e),C=t==="city-name"||t==="city-name-world";S<(C?it:Nt)||e<2||u&&e<At&&!y(s,t==="country-name"?H:C?ht:U)||A.push({kind:t,matched:e,spec:o,pct:S})};c("country-iso3",d,6),c("country-name",T,5,!0),c("us-state-name",D,5,!0),c("us-zip5",l,4),c("us-county-fips",_,4),c("country-iso2",p,3),c("us-state-code",m,3);let dt=A.length;c("city-name",x,2,!0),A.length===dt&&c("city-name-world",Y,2,!0);let pt=m-E,mt=D-E;pt>0&&mt>0&&c("us-state-name",m+D-E,5,!0);let b=Math.max(d,p,T);if(K>b){let t=d===b?"country-iso3":T===b?"country-name":"country-iso2";c(t,K,t==="country-iso3"?6:t==="country-name"?5:3,t==="country-name")}if(A.length===0)return null;A.sort((t,e)=>e.pct-t.pct||e.spec-t.spec);let a=A[0],z=!1,v={"country-iso2":"us-state-code","us-state-code":"country-iso2","us-zip5":"us-county-fips","us-county-fips":"us-zip5","country-name":"us-state-name","us-state-name":"country-name"}[a.kind],k=A[1],j=v&&k&&k.kind===v&&Math.abs(a.pct-k.pct)<=15;if(a.kind==="country-iso2"||a.kind==="us-state-code"){let t=a.matched>0?$/a.matched:0,e=y(s,H),o=y(s,U);if(j||t>=.5){if(e&&!o)return f("country-iso2",p,!1);if(o&&!e)return f("us-state-code",m,!1);z=!0}}else if(a.kind==="us-zip5"||a.kind==="us-county-fips"){let t=_===l&&l===h,e=y(s,rt),o=y(s,gt);return o&&!e?f("us-county-fips",_,!1):e&&!o?f("us-zip5",l,!1):t?f("us-zip5",l,!0):f("us-zip5",l,!1)}else if(j&&(a.kind==="country-name"||a.kind==="us-state-name")){let t=a.matched>0?J/a.matched:0,e=y(s,H),o=y(s,U);if(e&&!o)return f("country-name",T,!1);if(o&&!e)return f("us-state-name",D,!1);t>=.5&&(z=!0)}return f(a.kind,a.matched,z);function f(t,e,o){let S={geoKind:t,geoMatchPct:Math.round(B(t==="us-zip5"?P:e)*10)/10};return o&&(S.geoAmbiguous=!0),S}}function Mt(n,s){if(n==null)return null;let i=String(n).trim();if(i.length===0)return null;switch(s){case"country-iso3":case"country-iso2":case"country-name":return W(i);case"us-state-code":case"us-state-name":{let r=ft(i);return ct.has(r)?r:ut.get(g(i))??null}case"us-zip5":return L(i);case"us-county-fips":return/^\d{5}$/.test(i)&<.has(i.slice(0,2))?i:null;default:return null}}function Gt(n){switch(n){case"country-iso3":case"country-iso2":case"country-name":case"us-state-code":case"us-state-name":case"us-zip5":case"us-county-fips":return!0;default:return!1}}function It(n,s){return s==="us-zip5"?w.has(n.slice(0,3)):!0}function Wt(n,s){let i=new Array(n.length),r=new Set,M=[],h=0;for(let N=0;N<n.length;++N){let I=Mt(n[N],s),O=I!==null&&It(I,s)?I:null;if(i[N]=O,O!==null)h++;else{let d=n[N];if(d!=null){let p=String(d).trim();if(p.length>0){let m=p.toLowerCase();r.has(m)||(r.add(m),M.push(p))}}}}return{iso:i,unmatched:M,matchedRows:h,totalRows:n.length}}export{rt as a,y as b,kt as c,Mt as d,Gt as e,Wt as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
+
var a=(n,t,e,r={})=>({code:n,name:t,script:e,dir:"ltr",intl:n,aliases:[],wordBreaks:!0,compounds:!1,gluedPrefixes:[],foldSensitive:!1,...r}),g=Object.freeze([a("en","English","Latn"),a("nl","Dutch","Latn",{compounds:!0}),a("de","German","Latn",{compounds:!0}),a("fr","French","Latn"),a("es","Spanish","Latn"),a("pt","Portuguese","Latn"),a("it","Italian","Latn"),a("pl","Polish","Latn"),a("cs","Czech","Latn"),a("sk","Slovak","Latn"),a("sv","Swedish","Latn",{compounds:!0}),a("da","Danish","Latn",{compounds:!0}),a("nb","Norwegian Bokmal","Latn",{compounds:!0,aliases:["no"]}),a("fi","Finnish","Latn",{compounds:!0}),a("hu","Hungarian","Latn",{compounds:!0}),a("tr","Turkish","Latn"),a("ro","Romanian","Latn"),a("hr","Croatian","Latn"),a("id","Indonesian","Latn",{aliases:["in"]}),a("vi","Vietnamese","Latn",{foldSensitive:!0}),a("ru","Russian","Cyrl"),a("uk","Ukrainian","Cyrl"),a("el","Greek","Grek"),a("zh","Chinese (Simplified)","Hani",{intl:"zh-Hans",wordBreaks:!1}),a("ja","Japanese","Jpan",{wordBreaks:!1}),a("ko","Korean","Hang"),a("ar","Arabic","Arab",{dir:"rtl",gluedPrefixes:["\u0627\u0644","\u0648\u0627\u0644","\u0628\u0627\u0644","\u0641\u0627\u0644","\u0643\u0627\u0644","\u0644\u0644","\u0648","\u0641","\u0628","\u0643","\u0644"]}),a("he","Hebrew","Hebr",{dir:"rtl",aliases:["iw"],gluedPrefixes:["\u05D4","\u05D5","\u05D1","\u05DC","\u05DE","\u05E9","\u05DB","\u05D5\u05D4","\u05E9\u05D4","\u05DE\u05D4","\u05D5\u05D1","\u05D5\u05DC","\u05D5\u05DE","\u05D1\u05D4","\u05DC\u05D4"]}),a("hi","Hindi","Deva"),a("th","Thai","Thai",{wordBreaks:!1})]),Y=Object.freeze(g.map(n=>n.code)),c=new Map(g.map(n=>[n.code,n])),h=new Map(g.flatMap(n=>n.aliases.map(t=>[t,n]))),m={nn:"nb"};function p(n){let t=String(n??"").trim().toLowerCase();return c.get(t)??h.get(t)}function S(n){try{let t=Intl.getCanonicalLocales(n);return t.length?t[0]:null}catch{return null}}function L(n){let t=n.split("-"),e=t.find((o,i)=>i>0&&o.length===4);if(e)return e.toLowerCase()==="hant";try{let o=Intl.Locale;if(typeof o=="function"){let i=new o(n).maximize();if(i&&typeof i.script=="string")return i.script==="Hant"}}catch{}let r=t.find((o,i)=>i>0&&o.length===2);return!!r&&["TW","HK","MO"].includes(r.toUpperCase())}function x(n){try{return Intl.NumberFormat.supportedLocalesOf([n]).length>0}catch{return!1}}function V(n){let t=c.get("en"),e=String(n??"").trim().replace(/_/g,"-"),r=e?S(e):null;if(!r)return{code:"en",language:t,tier:1,intl:"en"};let o=r.split("-")[0].toLowerCase(),i=c.get(o)??h.get(o);if(i){let l=i.code==="zh"&&L(r)?2:1;return{code:i.code,language:i,tier:l,intl:r}}let u=m[o],s=u?c.get(u):t;return{code:s.code,language:s,tier:2,intl:x(r)?r:s.intl}}var C={\u0142:"l",\u0141:"L",\u0131:"i",\u00F8:"o",\u00D8:"O",\u0111:"d",\u0110:"D",\u00F0:"d",\u00D0:"D"},T=[1632,1776,2406,3664,65296],y=/[\u0300-\u036F]/g;function N(n){let t=C[n];if(t)return t;let e=n.codePointAt(0);for(let o of T)if(e>=o&&e<=o+9)return String.fromCharCode(48+e-o);if(e>=65313&&e<=65338||e>=65345&&e<=65370)return String.fromCharCode(e-65248);let r=n.normalize("NFD").replace(y,"");return r.length===1?r:n}function f(n){if(!n)return n??"";let t="";for(let e of n)t+=N(e);return t}var D=/([\p{Ll}\p{Nd}])(\p{Lu})/gu,R=/[_\-./]+/g,E=/[^\p{L}\p{M}\p{N}\x00-\x7F]/gu;function d(n){return n?String(n).normalize("NFC").replace(D,"$1 $2").replace(R," ").replace(E," ").toLowerCase().split(/\s+/).filter(t=>t.length>0):[]}function b(n){let t=d(n),e=d(f(String(n??"").normalize("NFC")));return{words:t,folded:e.length===t.length?e:t.map(f)}}var M=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\u30FC]/u,_=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\u30FC]+/gu;function A(n){return!!n&&M.test(n)}function I(n){return n?String(n).normalize("NFC").match(_)??[]:[]}var w=3;function O(n,t,e=w){return!n||!t||n.length<=t.length||!n.endsWith(t)?!1:Array.from(n.slice(0,n.length-t.length)).length>=e}var U=2;function k(n,t){let e=p(t);if(!n||!e||e.gluedPrefixes.length===0)return[];let r=[];for(let o of[...e.gluedPrefixes].sort((i,u)=>u.length-i.length))if(n.length>o.length&&n.startsWith(o)){let i=n.slice(o.length);Array.from(i).length>=U&&!r.includes(i)&&r.push(i)}return r}var H=2;function K(n,t,e){if(!n||!t)return null;let r=p(e);if(!r)return null;let o=t.normalize("NFC").toLowerCase();if(A(o))return Array.from(o).length<H?null:I(n).some(l=>l.includes(o))?"substring":null;let i=b(n),u=r.foldSensitive?i.words:i.folded,s=r.foldSensitive?o:f(t.normalize("NFC")).toLowerCase();return u.includes(s)?"word":r.compounds&&u.some(l=>O(l,s))?"suffix":r.gluedPrefixes.length&&u.some(l=>k(l,r.code).includes(s))?"prefix":null}function J(n){return n!=null?n.toString():""}function Z(n,t){if(!n.length)return NaN;if(n.length===1)return n[0];let e=(n.length-1)*t,r=Math.floor(e),o=Math.ceil(e);return r===o?n[r]:n[r]+(n[o]-n[r])*(e-r)}function X(n){if(!n)return 0;let t=0xcbf29ce484222325n,e=0x100000001b3n,r=t;for(let o=0;o<n.length;o++)r^=BigInt(n.charCodeAt(o)),r=r*e&0xFFFFFFFFFFFFFFFFn;return Number(r&0x1FFFFFFFFFFFFFn)}function q(){let n=typeof globalThis<"u"?globalThis:{};if(n.crypto&&typeof n.crypto.getRandomValues=="function"){let t=new Uint32Array(1);return n.crypto.getRandomValues(t),t[0]/4294967296}return Math.floor(Date.now()%4294967295)/4294967296}function Q(n){return!!n&&n.isRefusal===!0}var nn=30;function en(n){let t=Date.parse(n);if(isNaN(t))return null;let e=new Date(t);if(z.test(n)||v.test(n.trim())||B.test(n))return e;let r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),o=e.getFullYear();return o>=0&&o<100&&r.setUTCFullYear(o),r}function F(n){return!(n instanceof Date)||isNaN(n.getTime())?null:n.getUTCHours()===0&&n.getUTCMinutes()===0&&n.getUTCSeconds()===0&&n.getUTCMilliseconds()===0?"utc":n.getHours()===0&&n.getMinutes()===0&&n.getSeconds()===0&&n.getMilliseconds()===0?"local":null}function tn(n){let t=F(n);if(!t)return null;let e=n;if(t==="utc")return e.toISOString().slice(0,10);let r=o=>(o<10?"0":"")+o;return`${e.getFullYear()}-${r(e.getMonth()+1)}-${r(e.getDate())}`}function P(n){let t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())),e=n.getFullYear();return e>=0&&e<100&&t.setUTCFullYear(e),t}function G(n,t){let e=[];for(let r of n){if(!r||!/date|time/i.test(String(r.dataType??"")))continue;let o=0,i=!0;for(let u of t){let s=u?u[r.name]:void 0;if(s==null||s==="")continue;if(!(s instanceof Date)){i=!1;break}let l=F(s);if(l===null){i=!1;break}l==="local"&&o++}i&&o>0&&e.push(r.name)}return e}function rn(n,t){let e=G(n,t);return e.length===0?{rows:t,columns:e}:{rows:t.map(o=>{if(!o)return o;let i={...o};for(let u of e){let s=i[u];s instanceof Date&&F(s)==="local"&&(i[u]=P(s))}return i}),columns:e}}var z=/^\s*\d{4}(-\d{2}(-\d{2})?)?\s*$/,v=/(?:Z|[+-]\d{2}:?\d{2})$/i,B=/\b(?:GMT|UTC)\b/i;export{g as a,Y as b,p as c,V as d,f as e,d as f,b as g,A as h,I as i,w as j,O as k,U as l,k as m,H as n,K as o,J as p,Z as q,X as r,q as s,Q as t,nn as u,en as v,F as w,tn as x,P as y,G as z,rn as A};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
+
import{a as Se}from"./chunk-QEH7WTLB.mjs";import{a as Ae,b as Ce}from"./chunk-2LR73DNS.mjs";import{c as _e}from"./chunk-C5I73OM2.mjs";import{b as be,f as ye}from"./chunk-TPVDJHU6.mjs";import{a as ge,b as pe,c as he}from"./chunk-35Z7JCND.mjs";import{e as le,f as j,p as ce,q as z,r as me,s as de,v as ie,x as fe}from"./chunk-ILHBRGIO.mjs";var Xe=[[24.4,49.4,-125,-66.9],[51.2,71.5,-168,-129.9],[18.9,22.3,-160.3,-154.8]],Qe=[7,72,-172,-52];function Me(n,e,t){return n>=t[0]&&n<=t[1]&&e>=t[2]&&e<=t[3]}var H=n=>Math.round(n*10)/10;function Re(n,e=3){let t=[],i=[],r=0,s=0;for(let l of n){let u=l?.lat,c=l?.lon;if(typeof u!="number"||typeof c!="number"||!isFinite(u)||!isFinite(c)||u<-90||u>90||c<-180||c>180)continue;t.push(u),i.push(c);let p=l?.country?String(l.country).trim().toUpperCase():"",f=p?ee(p):null;f?((p==="US"||p==="USA")&&r++,f==="north-america"&&s++):(Xe.some(v=>Me(u,c,v))&&r++,Me(u,c,Qe)&&s++)}let o=t.length;return o<e?null:(t.sort((l,u)=>l-u),i.sort((l,u)=>l-u),{pctUsa:H(r/o*100),pctNa:H(s/o*100),latP5:H(z(t,.05)),latP95:H(z(t,.95)),lonP5:H(z(i,.05)),lonP95:H(z(i,.95)),n:o})}var xe={"north-america":"AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI","south-america":"AR BO BR CL CO EC FK GF GY PE PY SR UY VE",europe:"AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA",africa:"AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW",asia:"AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE",oceania:"AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS",antarctica:"AQ BV GS HM TF"},X=(()=>{let n=new Map;for(let e of Object.keys(xe))for(let t of xe[e].split(/\s+/))t&&n.set(t,e);return n})();function qe(n){for(let[e,t]of n){let i=X.get(e);i&&!X.has(t)&&X.set(t,i)}}qe(be);function ee(n){if(!n)return null;let e=String(n).trim().toUpperCase();if(!e)return null;let t=X.get(e);if(t)return t;let i=ye(String(n));return i?X.get(i)??null:null}function an(n,e=2){return se(n.map(t=>[t,1]),e)}function se(n,e=2){let t=new Map,i=0;for(let[o,l]of n){let u=ee(o);if(!u)continue;let c=typeof l=="number"&&isFinite(l)&&l>0?l:1;t.set(u,(t.get(u)??0)+c),i+=c}if(i<e||!t.size)return null;let r="europe",s=-1;for(let o of Array.from(t.keys()).sort()){let l=t.get(o);l>s&&(r=o,s=l)}return{dominantGeoRegion:r,dominantGeoRegionPct:H(s/i*100),regionCount:t.size,n:i}}import Ye from"papaparse";var Je=[["Lu",/^\p{Lu}$/u],["Ll",/^\p{Ll}$/u],["Lt",/^\p{Lt}$/u],["Lm",/^\p{Lm}$/u],["Lo",/^\p{Lo}$/u],["Mn",/^\p{Mn}$/u],["Mc",/^\p{Mc}$/u],["Nd",/^\p{Nd}$/u]];function te(n){for(let[e,t]of Je)if(t.test(n))return e;return null}var et=[{id:"ascii",test:/^[A-Za-z]$/,ranges:[[65,90],[97,122]]},{id:"latin",test:/^[\u00C0-\u017F]$/u,ranges:[[192,383]]},{id:"cyrillic",test:/^[\u0400-\u045F\u0490-\u0491]$/u,ranges:[[1024,1119],[1168,1169]]},{id:"greek",test:/^[\u0386-\u03CE]$/u,ranges:[[902,974]]},{id:"han",test:/^[\u4E00-\u9FFF]$/u,ranges:[[19968,40959]]},{id:"hiragana",test:/^\p{Script=Hiragana}$/u,ranges:[[12353,12447]]},{id:"katakana",test:/^\p{Script=Katakana}$/u,ranges:[[12448,12543]]},{id:"hangul",test:/^[\uAC00-\uD7A3]$/u,ranges:[[44032,55203]]},{id:"arabic",test:/^[\u0620-\u0652\u0671-\u06D3]$/u,ranges:[[1568,1618],[1649,1747]]},{id:"hebrew",test:/^[\u05B0-\u05EA]$/u,ranges:[[1456,1514]]},{id:"devanagari",test:/^\p{Script=Devanagari}$/u,ranges:[[2304,2431]]},{id:"thai",test:/^\p{Script=Thai}$/u,ranges:[[3585,3662]]}],ne=new Map;function Ne(n,e,t,i){let r=ne.get(n);if(r)return r;let s=[];for(let[o,l]of e)for(let u=o;u<=l;u++){let c=String.fromCodePoint(u);te(c)===t&&(i&&!i.test(c)||s.push(c))}return ne.set(n,s),s}function tt(n){let t=n.codePointAt(0);for(let o=0;o<9&&te(String.fromCodePoint(t-1))==="Nd";o++)t--;let i="nd:"+t.toString(16),r=ne.get(i);if(r)return r;let s=[];for(let o=t;o<t+10;o++){let l=String.fromCodePoint(o);te(l)==="Nd"&&s.push(l)}return ne.set(i,s),s}function nt(n,e){if(e==="Nd")return tt(n);for(let r of et)if(r.test.test(n))return Ne(r.id+":"+e,r.ranges,e,r.id==="ascii"?null:r.test);let i=n.codePointAt(0)&-128;return Ne("block:"+i.toString(16)+":"+e,[[i,i+127]],e,null)}function it(n,e,t,i){let r=n.filter(s=>!e.has(s));return r.length===0&&(r=n.filter(s=>s!==t)),r.length===0?t:r[Math.min(r.length-1,Math.floor(i()*r.length))]}var st=/^[\p{L}\p{M}\p{Nd}]$/u,Te=/^[\p{L}\p{Nd}]$/u;function ve(n,e){if(!n)return n??"";let t=new Set(Array.from(n)),i=p=>{let f=te(p);return!f||!st.test(p)?p:it(nt(p,f),t,p,e)},r=p=>{let f=[];for(let v of p)f.push(i(v)),Te.test(v)&&e()<.2&&f.push(i(v));if(f.length>6){let v=Math.floor(e()*Math.min(3,f.length-6));for(let w=0;w<v;w++)for(let N=0;N<5;N++){let P=Math.floor(e()*f.length);if(Te.test(f[P])){f.splice(P,1);break}}}return f.join("")};if(!(n.includes("@")&&n.includes(".")))return r(n);let[o,l=""]=n.split("@"),u=l.endsWith(".com"),c=u?l.slice(0,-4):l;return`${r(o)}@${r(c)}${u?".com":""}`}var rt=["rate","ratio","pct","percent","percentage","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","z[_-]?score","average","avg","mean","median","stddev","variance","gpa","percentile","quantile","efficiency","accuracy","probability","multiplier","coefficient","correlation","occupancy","age","bmi","temperature","density","pressure","humidity","ph","velocity","speed","elevation","altitude","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps","temperatuur","temperatur","temperatura","teplota","lampotila","homerseklet","sicaklik","pression","presion","pressao","pressione","druck","tryck","tlak","paine","nyomas","presiune","humidite","humedad","umidade","umidita","feuchtigkeit","vochtigheid","kosteus","vlhkost","vitesse","velocidad","velocidade","velocita","geschwindigkeit","snelheid","hastighet","hastighed","rychlost","nopeus","sebesseg","brzina","predkosc","densite","densidad","densidade","densita","dichte","dichtheid","hustota","tiheys","gustoca","moyenne","mediane","promedio","mediana","gemiddelde","durchschnitt","mittelwert","genomsnitt","gennemsnit","gjennomsnitt","keskiarvo","atlag","ortalama","prosjek","srednia","prumer","priemer","medie","taux","tasa","taxa","tasso","verhaltnis","verhouding","aandeel","anteil","andel","osuus","podil","udzial","udio","pourcentage","porcentaje","percentual","prozent","procent","prosentti","szazalek","yuzde","participacion","participacao","pondere","omjer","arany","oran","rata","leeftijd","edad","idade","wiek","eletkor","varsta","puntuacion","pontuacao","punteggio","betyg","ocena","indice","indeks","wskaznik","puan"],ot=["pct","percent","percentage","rate","ratio","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","gpa","percentile","quantile","bmi","density","pressure","humidity","velocity","efficiency","occupancy","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps"],at=["latitude","longitude"],ut=["latitude","longitude"];function K(n){return le(n)}var re=["somme de","suma de","soma de","summe von","som van","somma di","summa av","sum av","sum af","soucet z","suma z","totaal van","total de","toplam","osszeg","nombre de","recuento de","contagem de","anzahl von","aantal van","conteggio di","antal av","lukumaara","pocet z"],we=["moyenne de","promedio de","media de","media di","durchschnitt von","gemiddelde van","medelvarde av","genomsnitt av","gennemsnit af","keskiarvo","atlag","ortalama","prumer z","srednia z","medie de","minimum de","minimo de","minimo di","minimum von","maximum de","maximo de","massimo di","maximum von"];function lt(n){return[...n].sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")}var Ie=new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:"+lt(re)+")\\s+)","i"),ct=/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g,mt=new RegExp("\\b("+rt.join("|")+")\\b|("+ot.join("|")+")$","i"),dt=new RegExp("\\b("+at.join("|")+")\\b|("+ut.join("|")+")$","i");function Le(n){if(!n)return"";let e=String(n),t=Ie.exec(K(e));return(t?e.slice(t[0].length):e).trim()}function ft(n){return!!n&&Ie.test(K(String(n)))}var gt=["count (distinct)","count distinct","distinct count","standard deviation","average","variance","median","product","stddev","std dev","count","sum","avg","min","minimum","max","maximum","var"],Ee=new RegExp("^\\s*("+[...gt].sort((n,e)=>e.length-n.length).map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")+")\\s+of\\s+","i");function De(n){if(n==null)return"";let e=String(n),t=Ee.exec(e);if(!t)return e;let i=l=>l.toLowerCase().replace(/\s+/g," ").trim(),r=i(t[1]),s=e.slice(t[0].length),o=0;for(;o<8;){let l=Ee.exec(s);if(!l||i(l[1])!==r)break;let u=s.slice(l[0].length);if(u.trim()==="")break;s=u,o++}return o===0?e:e.slice(0,t[0].length)+s}function oe(n,e){if(!n||!e)return!1;let t=String(n);for(let i of e){let r=i?.hostName;if(r&&r!==i?.name&&t.includes(r))return!0}return!1}var Oe={Sum:["Sum of "],Avg:["Average of "],Average:["Average of "],Count:["Count of "],CountNonNull:["Count of "],Min:["Min of ","First ","Earliest "],Max:["Max of ","Last ","Latest "],Median:["Median of "],StandardDeviation:["Standard deviation of "],Variance:["Variance of "]},pt=new RegExp("^("+Object.keys(Oe).join("|")+")\\((.+)\\)$");function Pe(n){if(!n)return[];let e=pt.exec(String(n).trim());if(!e)return[];let t=Oe[e[1]],i=e[2],r=[];for(let s=i.indexOf(".");s>=0;s=i.indexOf(".",s+1)){if(s===0)continue;let o=i.slice(s+1);if(o.trim()!=="")for(let l of t){let u=l+o;r.includes(u)||r.push(u)}}return r}function ht(n){let e=Le(n);return e.length===0?"":e.replace(ct," ")}function ke(n,e){if(!e)return!1;let t=Le(e);return n.test(K(ht(e)))||n.test(K(t))||n.test(K(j(t).join(" ")))}function Fe(n){return ke(dt,n)}function bt(n){return ke(mt,n)||Fe(n)}var Ge=/int|double|decimal|single|float|number|currency|money/i;function yt(n){let e=String(n?.valueNature??"").trim().toLowerCase();return e==="categorical"?"Categorical":e==="ordinal"?"Ordinal":e==="continuous"||n?.isMeasure===!0||Ge.test(String(n?.dataType??""))?"Continuous":"Categorical"}function _t(n){return n?.isMeasure===!0||Ge.test(String(n?.dataType??""))}function We(n){let e=n??{},t=yt(e);if(t!=="Continuous")return{nature:t,additivity:"unknown",basis:"role",suppressed:!1};if(Fe(e.name))return{nature:t,additivity:"positional",basis:"name",suppressed:!0};let i=String(e.additivity??"").trim().toLowerCase();if(!(i==="additive"&&ft(e.name))){if(i==="additive")return{nature:t,additivity:"additive",basis:"measured",suppressed:!1};if(i==="part_of_whole")return{nature:t,additivity:"part_of_whole",basis:"measured",suppressed:!1};if(i==="intensive_rate")return{nature:t,additivity:"intensive_rate",basis:"measured",suppressed:!1}}return e.discourageAggregationAcrossGroups===!0?{nature:t,additivity:"intensive_rate",basis:"host-flag",suppressed:!1}:bt(e.name)?{nature:t,additivity:"intensive_rate",basis:"name",suppressed:!1}:{nature:t,additivity:"additive",basis:"default",suppressed:!1}}function Be(n){let e=We(n),t=n??{};if(e.nature==="Categorical")return["first","distinctcount","count"];if(e.nature==="Ordinal")return _t(t)?["median","average","min","max","first","distinctcount","count"]:["first","distinctcount","count"];switch(e.additivity){case"positional":return["min","max","count","distinctcount","first"];case"intensive_rate":return["average","median","min","max","count","distinctcount","first"];default:return["sum","average","median","min","max","count","distinctcount","first"]}}function dn(n){return Be(n)[0]}function fn(n,e){return Be(n).indexOf(e)>=0}function gn(n,e){if(e!=="sum"&&e!=="count")return!1;if(e==="count")return!0;let t=We(n);return t.additivity==="additive"||t.additivity==="part_of_whole"||t.additivity==="unknown"}var St=/^[A-Za-z_$][A-Za-z0-9_$]*$/,At=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ct=new RegExp([String.raw`\bisMeasure\b`,String.raw`\bdataType\b`,String.raw`\bcolumns\s*\[\s*-?\d`,String.raw`\.iloc\s*\[[^\]]*,`,String.raw`\.iat\s*\[`,String.raw`\bselect_dtypes\b`,String.raw`\b_get_numeric_data\b`,String.raw`\bis_numeric_dtype\b`,String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`,String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`,String.raw`\bdf\.dtypes\b`,String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`,String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));function Q(n,e){if(!n||!e)return!1;let t=At(e);return new RegExp("['\"`]"+t+"['\"`]").test(n)?!0:St.test(e)&&new RegExp("\\."+t+"(?![A-Za-z0-9_$])").test(n)}function Mt(n){return!!n&&Ct.test(n)}function hn(n,e,t){return n?Mt(n)?[...e]:[...t,...e].some(i=>Q(n,i))?e.filter(i=>Q(n,i)):[...e]:[]}var yn=5,_n=6;var xt=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,Rt=/^(\d{4})[-/](\d{1,2})$/,Nt=/^(\d{4})[-\s]?Q([1-4])$/i,Tt=/^Q([1-4])[-\s](\d{4})$/i,vt=/^(\d{4})$/,Et=/^(\d{4})(0[1-9]|1[0-2])$/,wt=/^(\d{4})(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])$/;function U(n,e,t,i=0,r=0,s=0){if(!(n>=1&&e>=1&&e<=12&&t>=1&&t<=31))return null;let o=Date.UTC(n,e-1,t,i,r,s);if(!Number.isFinite(o))return null;let l=u=>u<10?"0"+u:String(u);return{ms:o,y:n,m:e,d:t,iso:`${n}-${l(e)}-${l(t)}`}}function It(n,e){let t=[],i="";for(let u=0;u<e.length;u++){if(e[u]!=="%"){i+=e[u].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");continue}switch(e[++u]){case"Y":t.push("Y"),i+="(\\d{4})";break;case"m":t.push("m"),i+="(\\d{1,2})";break;case"d":t.push("d"),i+="(\\d{1,2})";break;case"H":case"M":case"S":i+="\\d{1,2}";break;case"%":i+="%";break;default:return null}}let r=new RegExp("^"+i+"$").exec(n);if(!r)return null;let s=0,o=1,l=1;return t.forEach((u,c)=>{let p=+r[c+1];u==="Y"?s=p:u==="m"?o=p:l=p}),s?U(s,o,l):null}function Lt(n,e){let t=(n??"").trim();if(t==="")return null;if(e){let r=It(t,e);return r||null}let i=xt.exec(t);if(i)return U(+i[1],+i[2],+i[3],+(i[4]??0),+(i[5]??0),+(i[6]??0));if(i=Nt.exec(t),i)return U(+i[1],(+i[2]-1)*3+1,1);if(i=Tt.exec(t),i)return U(+i[2],(+i[1]-1)*3+1,1);if(i=Rt.exec(t),i&&+i[2]>=1&&+i[2]<=12)return U(+i[1],+i[2],1);if(i=wt.exec(t),i)return U(+i[1],+i[2],+i[3]);if(i=Et.exec(t),i)return U(+i[1],+i[2],1);if(i=vt.exec(t),i){let r=+i[1];return r>=1900&&r<=2100?U(r,1,1):null}return null}function Ve(n){let e=new Date(n).getUTCDay();return e>=1&&e<=5}function ze(n,e){if(e<=n)return 0;let t=Math.round((e-n)/864e5),i=Math.floor(t/7),r=i*5,s=n+i*7*864e5;for(;s<e;)Ve(s)&&r++,s+=864e5;return r}function Dt(n){if(n.length===0)return 0;let e=[...n].sort((i,r)=>i-r),t=e.length>>1;return e.length%2?e[t]:(e[t-1]+e[t])/2}function Ot(n){return n>0?n<.95?"hour":n<=1.05?"day":n>=6.5&&n<=7.5?"week":n>=27&&n<=31.5?"month":n>=88&&n<=93?"quarter":n>=362&&n<=368?"year":"irregular":"irregular"}function $e(n,e,t,i){switch(t){case"year":return e.y-n.y;case"quarter":return e.y*4+Math.floor((e.m-1)/3)-(n.y*4+Math.floor((n.m-1)/3));case"month":return e.y*12+e.m-(n.y*12+n.m);case"week":return Math.round((e.ms-n.ms)/(7*864e5));case"weekday":return ze(n.ms,e.ms);case"day":return Math.round((e.ms-n.ms)/864e5);default:return i>0?Math.round((e.ms-n.ms)/i):0}}function Ue(n,e){let t=e?.gapFactor??5,i=0,r=0,s=new Map;for(let g of n){if(g==null||g==="")continue;i++;let F=Lt(String(g),e?.pattern);F&&(r++,s.set(F.ms,F))}let o=[...s.values()].sort((g,F)=>g.ms-F.ms);if(o.length<3||i>0&&r/i<.8)return null;let l=o[o.length-1].ms-o[0].ms;if(l<=0)return null;let u=[];for(let g=1;g<o.length;g++)u.push(o[g].ms-o[g-1].ms);let c=Dt(u);if(!(c>0))return null;let p=Ot(c/864e5);p==="day"&&l>=7*864e5&&o.every(g=>Ve(g.ms))&&ze(o[0].ms,o[o.length-1].ms)+1>o.length*.5&&(p="weekday");let f=p==="irregular"?o.length:$e(o[0],o[o.length-1],p,c)+1,v=1,w=1,N=[],P=o[0],_=1;for(let g=1;g<o.length;g++){let F=$e(o[g-1],o[g],p,c);F>v&&(v=F),p!=="irregular"&&F>t?(w++,N.push({from:P.iso,to:o[g-1].iso,points:_}),P=o[g],_=1):_++}N.push({from:P.iso,to:o[o.length-1].iso,points:_});let E={grain:p,points:o.length,expectedPoints:Math.max(f,o.length),coveragePct:Math.round(o.length/Math.max(f,o.length)*1e3)/10,runs:w,largestGapUnits:v,gapFactor:t};return e?.includeBounds&&N.length<=6&&(E.runBounds=N),E}var Pt=12,kt=100,Ft=.3,Gt=.9,Wt=120,Bt=1900,$t=2100,Vt=0,zt=20,Ut=new Set(["id","ids","uuid","guid","key","zip","zipcode","postal","postalcode","ssn","code","codes","sku","isbn","msisdn","imei"]);function Yt(n){if(!n)return!1;let e=j(n);return e.length===0?!1:Ut.has(e[e.length-1])}var Ht=new Set(["year","yr","fy"]),Kt=n=>j(n).some(e=>Ht.has(e)),Zt=/^(?:(?:19|20)\d{2}(?:[-/ ]?(?:q[1-4]|w(?:0?[1-9]|[1-4]\d|5[0-3])|(?:0?[1-9]|1[0-2])))?|q[1-4][-/ ](?:19|20)\d{2}|(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*[-/ ]?(?:19|20)?\d{2})$/i;function ae(n){if(!Number.isInteger(n)||n<190001||n>210012)return!1;let e=n%100;return e>=1&&e<=12}function ue(n){if(!Number.isInteger(n)||n<19000101||n>21001231)return!1;let e=Math.floor(n/100)%100,t=n%100;return e>=1&&e<=12&&t>=1&&t<=31}var jt=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,Xt=/^(\d{4})([\/.])(\d{1,2})\2(\d{1,2})$/,Qt=/^(\d{1,2})([\/.\-])(\d{1,2})\2(\d{4})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function qt(n){let e=(n||"").toLowerCase();return e==="en-us"||e==="en"||e.startsWith("en-us-")||e==="en-ph"||e==="en-bz"}function Ze(n,e){let t=0,i=0,r=0,s=0,o=0,l="",u=0,c="",p=0,f=0,v=0,w=0,N=!1;for(let V of n){if(V==null)continue;let W=String(V).trim();if(W==="")continue;t++;let k;if(k=jt.exec(W)){let B=+k[2],$=+k[3];B>=1&&B<=12&&$>=1&&$<=31&&(i++,k[4]!==void 0&&r++,k[6]!==void 0&&s++)}else if(k=Xt.exec(W)){let B=+k[3],$=+k[4];B>=1&&B<=12&&$>=1&&$<=31&&(l&&l!==k[2]&&(N=!0),l=k[2],o++)}else if(k=Qt.exec(W)){let B=+k[1],$=+k[3];B>=1&&B<=31&&$>=1&&$<=31&&(B<=12||$<=12)&&(c&&c!==k[2]&&(N=!0),c=k[2],u++,B>12&&v++,$>12&&w++,k[5]!==void 0&&p++,k[7]!==void 0&&f++)}if(t>=200)break}if(t<2||(i+o+u)/t<.8||(i>0?1:0)+(o>0?1:0)+(u>0?1:0)!==1||N)return null;if(i>0)return r===i?{pattern:s===i?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M",orderFrom:"iso"}:{pattern:"%Y-%m-%d",orderFrom:"iso"};if(o>0)return{pattern:`%Y${l}%m${l}%d`,orderFrom:"iso"};if(v>0&&w>0)return null;let E,g;v>0?(E=!0,g="values"):w>0?(E=!1,g="values"):(E=!qt(e),g="locale");let F=E?`%d${c}%m${c}%Y`:`%m${c}%d${c}%Y`;return p===u?{pattern:F+(f===u?" %H:%M:%S":" %H:%M"),orderFrom:g}:{pattern:F,orderFrom:g}}function Jt(n,e){if(!e||!/\b(?:19|20)\d{2}\b/.test(n))return!1;let t=n.replace(/\b(?:19|20)\d{2}\b/g,"").replace(/[-/.,]/g," ").trim();if(!t)return!1;let i=Ae(t);return i.length>0&&e[i]!==void 0}function en(n){let{dataType:e,name:t,isMeasure:i,distinctCount:r}=n;if(e==="DateTime")return!0;if(i)return!1;if(e==="Integer"||e==="Decimal"){let s=n.minNum,o=n.maxNum;if(!(s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&Number.isInteger(s)&&Number.isInteger(o)&&o>=s))return!1;let u=s>=1900&&o<=2100;if(u&&r>=2&&Kt(t)||u&&r>=3&&r===o-s+1)return!0;let c=ae(s)&&ae(o),p=ue(s)&&ue(o);if(c||p){if(!n.sampleValues)return!0;let f=0,v=0;for(let w of n.sampleValues){if(w==null||w==="")continue;f++;let N=Number(String(w).trim());if(Number.isFinite(N)&&(c?ae(N):ue(N))&&v++,f>=60)break}if(f>=2&&v===f)return!0}return!1}if(n.sampleValues){let s=n.locale?Ce(n.locale):null,o=0,l=0,u=[];for(let c of n.sampleValues){if(c==null||c==="")continue;o++;let p=String(c).trim();if(u.push(p),(Zt.test(p)||Jt(p,s))&&l++,o>=60)break}if(o>=2&&l/o>=.8||Ze(u,n.locale)!==null)return!0}return!1}function tn(n){let e=K((n||"").trim().toLowerCase());return e.startsWith("sum ")||e.startsWith("total ")?"sum":e.startsWith("average ")||e.startsWith("avg. ")?"avg":e.startsWith("count ")||e.startsWith("distinct count ")||e.startsWith("count (distinct) ")?"count":e.startsWith("min ")||e.startsWith("minimum ")?"min":e.startsWith("max ")||e.startsWith("maximum ")?"max":we.some(t=>e.startsWith(t+" "))?/^(minimum|minimo)\b/.test(e)?"min":/^(maximum|maximo|massimo)\b/.test(e)?"max":"avg":re.some(t=>e.startsWith(t+" ")||e===t)?/^(nombre|recuento|contagem|anzahl|aantal|conteggio|antal|lukumaara|pocet)\b/.test(e)?"count":"sum":null}function nn(n){let{rows:e,measureColIdx:t,measureName:i,candidateDims:r,minNum:s,maxNum:o,discourageAgg:l}=n,u=100,c=.01,p="";for(let v of r){if(v.distinct<2||v.distinct>u)continue;let w=r.filter(g=>g.idx!==v.idx).map(g=>g.idx),N=new Map;for(let g of e){let F=g[t];if(typeof F!="number"||!Number.isFinite(F))continue;let V=w.length?w.map(k=>String(g[k])).join(p):"",W=N.get(V);W||(W={sum:0,cset:new Set},N.set(V,W)),W.sum+=F,W.cset.add(String(g[v.idx]))}let P=0,_=0,E=0;for(let g of N.values())g.cset.size<2||(E++,Math.abs(g.sum-100)<=100*c?P++:Math.abs(g.sum-1)<=1*c&&_++);if(E>=2&&(P/E>=.9||_/E>=.9))return{additivity:"part_of_whole",partOfWholeDim:v.name}}if(l)return{additivity:"intensive_rate"};let f=tn(i);return f==="avg"||f==="min"||f==="max"?{additivity:"intensive_rate"}:f==="count"?{additivity:"additive"}:f==="sum"?{additivity:"unknown"}:s!=null&&o!=null&&Number.isFinite(s)&&Number.isFinite(o)&&s>=0&&o<=1.0001&&o>0?{additivity:"intensive_rate"}:{additivity:"unknown"}}function He(n){let{dataType:e,isMeasure:t,name:i,distinct:r,nonblank:s,prec:o,maxval:l,minval:u}=n,c=l-u+1,p=c>0?r/c:1,f=s>0?r/s:0,v=e==="Decimal"||o>0;return Yt(i)?"Categorical":p>=Gt&&(ge(i)&&r<=Wt||u>=Bt&&l<=$t||u>=Vt&&l<=zt)?"Ordinal":t||r>Pt&&(v||r>=kt||f>=Ft)?"Continuous":"Categorical"}function sn(n){let e=null;for(let t=0;t<n.length;t++){let i=n[t];if(typeof i!="string"||i.length===0)continue;let r=i.trim();r.length!==i.length&&(e||(e=n.slice()),e[t]=r)}return e||n}var Ke=class{_computedStatsForLevel=null;_cols=[];_rows=[];_origIndices=[];_rowHashes=new Set;_hostQueryNames=[];_englishAliases=new Map;dedupRows=!0;emitLegacyAggAliases=!1;STR(e){return e==null?"":e instanceof Date?this.wholeDayIso(e)??(isNaN(e.getTime())?"":e.toISOString()):e.toString()}getPrecision(e){if(!isFinite(e))return 0;let i=e.toString().split(".")[1];return i?i.length:0}getColumns(){return this._cols}wholeDayIso(e){return fe(e)}hasTimeComponent(e){return!(e instanceof Date)||isNaN(e.getTime())?!1:this.wholeDayIso(e)===null}getColumnsWithStats(e,t){if(this._computedStatsForLevel==e)return this._cols;let i=0,r=parseInt(e),s=[];for(let a of this._cols){let d=new Map,I=[],M=0,m=0,C=0,R=null,x=null,A=null,O=!1,D=!0,y=!0,S=null,T=!1;for(let h of this._rows){let b=h[i],L=this.STR(b);if(L!=""){if(M+=L.length,d.set(L,(d.get(L)||0)+1),m++,a.dataType=="Integer"||a.dataType=="Decimal"||a.dataType=="DateTime")if((R===null||b<R)&&(R=b),(x===null||b>x)&&(x=b),a.dataType=="Integer"||a.dataType=="Decimal"){if(A===null?A=b:A+=b,a.dataType=="Decimal"){let G=this.getPrecision(b);G>C&&(C=G)}I.push(b)}else O=O||this.hasTimeComponent(b);T&&(b<S?D=!1:b>S&&(y=!1)),S=b,T=!0}}if(m>=3&&(D&&!y?a.sortedDirection="asc":y&&!D?a.sortedDirection="desc":a.sortedDirection="none"),m>0&&d.size>0&&!a.isMeasure){let h=0,b=Number.MAX_SAFE_INTEGER;for(let L of d.values())L>h&&(h=L),L<b&&(b=L);if(a.modalShare=h/m,a.minGroupCount=b===Number.MAX_SAFE_INTEGER?null:b,d.size===2){let L=[...d.keys()].map(J=>ce(J).trim().toLowerCase()).sort(),q=[["false","true"],["no","yes"],["n","y"],["0","1"],["f","t"]].some(J=>L[0]===J[0]&&L[1]===J[1]),Z=/^(is|has)[_a-z0-9]|(?:default|churn|fraud|approv|convert|active|cancel|delinquen|flag|paid|win|pass|fail)/i.test(a.name);(q||Z)&&(a.isBinaryFlag=!0)}}if(a.dataType=="DateTime"&&(a.dateWithTime=O),a.isTemporal=en({dataType:a.dataType,name:a.name,isMeasure:a.isMeasure,distinctCount:d.size,minNum:typeof R=="number"?R:null,maxNum:typeof x=="number"?x:null,sampleValues:d.keys(),locale:t}),a.isTemporal&&a.dataType==="String"&&!a.isMeasure){let h=Ze(d.keys(),t);h&&(a.temporalTextPattern=h.pattern)}if(a.isTemporal&&!a.isMeasure){let h=Ue(d.keys(),{includeBounds:r>=20,pattern:a.temporalTextPattern});h&&(a.temporalCadence=h)}this.updateColumnStats10(r,a,m,d,C,x,R),this.updateColumnStats20(r,I,m,A,a,M,O,R,x,C,d,t),!a.isMeasure&&(a.dataType==="Integer"||a.dataType==="Decimal")&&He({dataType:a.dataType,isMeasure:!1,name:a.name,distinct:d.size,nonblank:m,prec:C,maxval:typeof x=="number"?x:0,minval:typeof R=="number"?R:0})==="Continuous"&&(a.isMeasure=!0,a.geoKind=void 0,a.geoMatchPct=void 0,a.geoAmbiguous=void 0,a.dominantGeoRegion=void 0,a.dominantGeoRegionPct=void 0,a.geoRegionCount=void 0),s[i]=a.isMeasure||d.size>2e3?null:new Set(d.keys()),i++}let o=[];this._cols.forEach((a,d)=>{a.isMeasure||o.push({idx:d,distinct:a.distinctCount??0,name:a.name})}),this._cols.forEach((a,d)=>{if(!a.isMeasure)return;let I=typeof a.lowValue=="number"?a.lowValue:null,M=typeof a.highValue=="number"?a.highValue:null,m=nn({rows:this._rows,measureColIdx:d,measureName:a.name,candidateDims:o,minNum:I,maxNum:M,discourageAgg:!!a.discourageAggregationAcrossGroups});a.additivity=m.additivity,m.partOfWholeDim&&(a.partOfWholeDim=m.partOfWholeDim)});let l=50,u=4,c=o.filter(a=>a.distinct>=2&&a.distinct<=l);this._cols.forEach((a,d)=>{if(!a.isMeasure)return;let I=[];for(let y of this._rows){let S=y[d];if(S==null||S==="")continue;let T=typeof S=="number"?S:parseFloat(S);isNaN(T)||I.push(T)}if(I.length===0)return;let M=[...I].sort((y,S)=>y-S);if(M[0]===M[M.length-1])a.relativeDispersion=0;else if(M.length>=u){let y=z(M,.5),S=z(M,.1),T=z(M,.9);a.relativeDispersion=Math.abs(y)>1e-9?Math.round((T-S)/Math.abs(y)*1e3)/1e3:void 0}else a.relativeDispersion=void 0;let m=[];for(let y of c){let S=new Set;for(let T of this._rows){let h=T[d];h==null||h===""||S.add(this.STR(T[y.idx])+"")}m.push({otherColumn:y.name,nonBlankGroupCount:S.size})}m.length>0&&(a.nonBlankGroups=m);let C=0;for(let y of I)C+=y;C/=I.length;let R=0;for(let y of I)R+=(y-C)*(y-C);if(R<=1e-12)return;let x=[],A=[],O=y=>{if(y.length<4)return NaN;let S=[...y].sort((h,b)=>h-b),T=h=>S[Math.min(S.length-1,Math.max(0,Math.floor(h*(S.length-1))))];return T(.75)-T(.25)},D=O(I);for(let y of c){let S=new Map;for(let b of this._rows){let L=b[d];if(L==null||L==="")continue;let G=typeof L=="number"?L:parseFloat(L);if(isNaN(G))continue;let q=this.STR(b[y.idx])+"",Z=S.get(q);Z?(Z.s+=G,Z.n++,Z.vals.push(G)):S.set(q,{s:G,n:1,vals:[G]})}let T=0;for(let b of S.values()){let L=b.s/b.n;T+=b.n*(L-C)*(L-C)}x.push({otherColumn:y.name,eta2:Math.round(T/R*1e4)/1e4});let h=[];for(let b of S.values()){let L=O(b.vals);isNaN(L)||h.push(L)}if(h.length>=2&&isFinite(D)&&D>1e-9){let b=(Math.max(...h)-Math.min(...h))/D;A.push({otherColumn:y.name,spreadRatio:Math.round(b*1e4)/1e4})}}x.length>0&&(a.groupDiscrimination=x),A.length>0&&(a.spreadDiscrimination=A)});let p=.97,f=.8,v=8,w=5,N=this._cols.map((a,d)=>({c:a,i:d})).filter(a=>a.c.isMeasure);for(let a=0;a<N.length;a++)for(let d=a+1;d<N.length;d++){let I=N[a].i,M=N[d].i,m=0,C=0,R=0,x=0,A=0,O=0;for(let T of this._rows){let h=T[I],b=T[M];if(h==null||h===""||b===null||b===void 0||b==="")continue;let L=typeof h=="number"?h:parseFloat(h),G=typeof b=="number"?b:parseFloat(b);isNaN(L)||isNaN(G)||(m++,C+=L,R+=G,x+=L*L,A+=G*G,O+=L*G)}if(m<w)continue;let D=m*x-C*C,y=m*A-R*R;if(D<=1e-12||y<=1e-12)continue;let S=(m*O-C*R)/Math.sqrt(D*y);if(Math.abs(S)>=p){let T=N[a].c,h=N[d].c;T.collinearWithMeasures||(T.collinearWithMeasures=[]),h.collinearWithMeasures||(h.collinearWithMeasures=[]),T.collinearWithMeasures.push(h.name),h.collinearWithMeasures.push(T.name)}else if(Math.abs(S)>=f){let T=N[a].c,h=N[d].c,b=Math.round(S*1e3)/1e3;T.correlatedWithMeasures||(T.correlatedWithMeasures=[]),h.correlatedWithMeasures||(h.correlatedWithMeasures=[]),T.correlatedWithMeasures.push({otherColumn:h.name,r:b}),h.correlatedWithMeasures.push({otherColumn:T.name,r:b})}}for(let{c:a}of N)a.correlatedWithMeasures&&(a.correlatedWithMeasures.sort((d,I)=>Math.abs(I.r)-Math.abs(d.r)||(d.otherColumn<I.otherColumn?-1:1)),a.correlatedWithMeasures.length=Math.min(a.correlatedWithMeasures.length,v));for(let a=0;a<this._cols.length;a++){let d=s[a];if(!d||d.size===0)continue;let I=[];for(let M=0;M<this._cols.length;M++){if(M===a)continue;let m=s[M];if(!m||m.size===0)continue;let C=0;for(let x of d)m.has(x)&&C++;let R=Math.round(C/d.size*100);R>0&&I.push({otherColumn:this._cols[M].name,percentShared:R})}I.length>0&&(this._cols[a].sharedValueRatioWithOthers=I)}let P=50,_=[];for(let a=0;a<this._cols.length;a++){let d=s[a];d&&d.size>=2&&d.size<=P&&_.push(a)}if(_.length>=2){let a=new Map,d=(M,m)=>M+":"+m;for(let M=0;M<_.length;M++)for(let m=M+1;m<_.length;m++)a.set(d(_[M],_[m]),new Map);for(let M of this._rows)for(let m=0;m<_.length;m++){let C=this.STR(M[_[m]])+"";for(let R=m+1;R<_.length;R++){let x=""+this.STR(M[_[R]]),A=a.get(d(_[m],_[R])),O=C+""+x;A.set(O,(A.get(O)??0)+1)}}let I=new Map;for(let M=0;M<_.length;M++)for(let m=M+1;m<_.length;m++){let C=_[M],R=_[m],x=s[C].size,A=s[R].size,O=a.get(d(C,R)),D=O.size,y=0;for(let b of O.values())(y===0||b<y)&&(y=b);let S=Math.round(D/(x*A)*100),T=D===x,h=D===A;if((this._cols[C].categoricalPairStats||=[]).push({otherColumn:this._cols[R].name,fillPct:S,determinesOther:T,minCellCount:y,distinctCombinations:D}),(this._cols[R].categoricalPairStats||=[]).push({otherColumn:this._cols[C].name,fillPct:S,determinesOther:h,minCellCount:y,distinctCombinations:D}),T&&x>A){let b=I.get(C);(!b||A<b.card)&&I.set(C,{name:this._cols[R].name,card:A,ratio:A/x})}if(h&&A>x){let b=I.get(R);(!b||x<b.card)&&I.set(R,{name:this._cols[C].name,card:x,ratio:x/A})}}for(let[M,m]of I)this._cols[M].primaryParentColumn=m.name,this._cols[M].nestingRatio=Math.round(m.ratio*100)/100}let E=6,g=this._rows.length;for(let a=0;a<this._cols.length;a++){let d=this._cols[a];if(d.isMeasure||d.primaryParentColumn)continue;let I=d.distinctCount??0;if(I<=P||g>0&&I>=g)continue;let M=[];for(let m=0;m<this._cols.length;m++){if(m===a)continue;let C=this._cols[m];if(C.isMeasure)continue;let R=C.distinctCount??0;R<2||R>=I||M.push(m)}M.sort((m,C)=>(this._cols[m].distinctCount??0)-(this._cols[C].distinctCount??0));for(let m of M.slice(0,E)){let C=new Map,R=!0;for(let A of this._rows){let O=this.STR(A[a])+"",D=this.STR(A[m])+"",y=C.get(O);if(y===void 0)C.set(O,D);else if(y!==D){R=!1;break}}if(!R)continue;let x=this._cols[m].distinctCount??0;d.primaryParentColumn=this._cols[m].name,d.nestingRatio=Math.round(x/I*100)/100;break}}let F=.01,V=.05,W=.95,k=8,B=8,$=6,je=500,Y=[];for(let a=0;a<this._cols.length&&Y.length<B;a++){let d=this._cols[a].dataType;(d==="Double"||d==="Integer"||d==="Decimal")&&Y.push(a)}if(Y.length>=3&&this._rows.length>=k){let a=Math.min(this._rows.length,je),d=Y.map(x=>{let A=[];for(let y=0;y<a;y++){let S=this._rows[y][x],T=typeof S=="number"?S:parseFloat(String(S).replace(/,/g,""));if(S==null||S===""||!isFinite(T))return null;A.push(T)}let O=A[0],D=!1;for(let y of A)if(y!==O){D=!0;break}return D?A:null}),I=Y.map((x,A)=>A).filter(x=>d[x]!==null),M=x=>{let A=x.slice().sort((D,y)=>D-y),O=A.length>>1;return A.length%2?A[O]:(A[O-1]+A[O])/2},m=null,C=[],R=x=>{if(C.length>=3){let A=C.map(S=>d[S]),O=A[0].length,D=new Array(O);for(let S=0;S<O;S++){let T=0;for(let h of A)T+=h[S];D[S]=T}let y=M(D);if(y>0){let S=0;for(let h of D)Math.abs(h-y)<=y*F&&S++;let T=S/O;if(T>=W){let h=1;for(let b of A){let L=M(b)/y;L<h&&(h=L)}h>=V&&(!m||C.length>m.cols.length)&&(m={cols:C.slice(),total:y,matched:T})}}}if(!(C.length>=$))for(let A=x;A<I.length;A++)C.push(I[A]),R(A+1),C.pop()};if(R(0),m){let x=m,O={columns:x.cols.map(D=>this._cols[Y[D]].name),total:Math.round(x.total*1e3)/1e3,matchedPct:Math.round(x.matched*100)/100};for(let D of x.cols)this._cols[Y[D]].constantSumGroup=O}}return this._computedStatsForLevel=e,this._cols}updateColumnStats20(e,t,i,r,s,o,l,u,c,p,f,v){if(e>=20){let w=[...t].sort((_,E)=>_-E),N=Math.floor(w.length/2);if(i>0&&r!=null?s.avgValue=s.dataType=="Integer"?Math.round(r/i):r/i:s.avgValue=null,i>0&&(s.avgLength=o/i),this._rows.length>0){let _=E=>{let g=E instanceof Date?E:typeof E=="string"?ie(E)??new Date(E):new Date(E),F=this.wholeDayIso(g);return F?F+"T00:00:00.000Z":isNaN(g.getTime())?E:g.toISOString().slice(0,10)+"T00:00:00.000Z"};s.dataType!="DateTime"||l||!u?s.lowValue=u:s.lowValue=_(u),s.dataType!="DateTime"||l||!c?s.highValue=c:s.highValue=_(c),s.medianValue=w.length===0?null:w.length%2===0?s.dataType=="Integer"?Math.round((w[N-1]+w[N])/2):(w[N-1]+w[N])/2:w[N],s.numericPrecision=p}if(w.length>0){let _=s.avgValue??0,E=w.length,g=0,F=0;for(let W of w){let k=W-_;g+=k*k,F+=k*k*k}let V=g/E;s.skewness=V===0?0:F/E/Math.pow(Math.sqrt(V),3),s.stdDev=Math.sqrt(V)}r!==null&&(s.sum=r);let P=Array.from(f.entries()).sort((_,E)=>E[1]-_[1]);if(s.topCategories=P.slice(0,10).map(_=>_[1]),!s.isMeasure&&P.length>0){if(s.dataType==="String"){let _=P.map(g=>g[0]);s.formatSignature=Se(_);let E=/^(UUID|EMAIL_LIKE|URL_LIKE|PHONE_LIKE|NUMERIC_ID|HEX_ID|OPAQUE_ID_ALPHANUMERIC|DATE_STR|BOOLEAN)$/;s.formatSignature&&!E.test(s.formatSignature)&&(s.avgLength===void 0||s.avgLength>=3)&&(s.isFreeText=!0)}else s.topCategoryValues=P.slice(0,5).map(_=>_[0]);if(e>=20){let _=P.map(g=>g[0]),E=he(_,v);if(E!==null)s.ordinalPattern=E.pattern,s.orderedDomain=E.orderedDomain;else if(s.dataType==="String"){let g=pe(_);g!==null&&(s.safeDistinctValues=g)}}}if(w.length>=8&&(s.dataType==="Integer"||s.dataType==="Decimal")){let _=E=>w[Math.floor((w.length-1)*E)];s.quantiles={p05:_(.05),p25:_(.25),p75:_(.75),p95:_(.95)}}}if(!s.isMeasure&&f.size>0){let w=Array.from(f.entries()).sort((P,_)=>_[1]-P[1]),N=_e(w.map(P=>P[0]),s.name,v);if(N!==null&&(s.geoKind=N.geoKind,s.geoMatchPct=N.geoMatchPct,N.geoAmbiguous&&(s.geoAmbiguous=!0),N.geoKind.indexOf("country")===0)){let P=se(w);P&&(s.dominantGeoRegion=P.dominantGeoRegion,s.dominantGeoRegionPct=P.dominantGeoRegionPct,s.geoRegionCount=P.regionCount)}}}updateColumnStats10(e,t,i,r,s,o,l){e>=10&&(t.blankCount=this._rows.length-i,t.distinctCount=r.size+(t.blankCount!=0?1:0),t.valueNature="Categorical",i>0&&(t.dataType==="Integer"||t.dataType==="Decimal"?t.valueNature=He({dataType:t.dataType,isMeasure:!!t.isMeasure,name:t.name,distinct:r.size,nonblank:i,prec:s,maxval:o,minval:l}):t.dataType==="DateTime"&&(t.valueNature=t.dateWithTime?"Continuous":"Ordinal")))}getRowCount(){return this._rows.length}getLeafCardinality(){if(this._leafCardinality!==null)return this._leafCardinality;let e=[];if(this._cols.forEach((i,r)=>{i.isMeasure||e.push(r)}),e.length===0)return this._leafCardinality=this._rows.length,this._leafCardinality;let t=new Set;for(let i of this._rows)t.add(JSON.stringify(e.map(r=>i[r])));return this._leafCardinality=t.size,this._leafCardinality}_leafCardinality=null;getGeoExtent(){if(this._geoExtentComputed)return this._geoExtent;this._geoExtentComputed=!0,this._geoExtent=null;let e=o=>String(o||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z]+/),t=-1,i=-1,r=-1;if(this._cols.forEach((o,l)=>{let u=e(o.name),c=o.dataType==="Integer"||o.dataType==="Decimal";c&&t<0&&u.some(p=>p==="lat"||p==="latitude")?t=l:c&&i<0&&u.some(p=>p==="lon"||p==="lng"||p==="long"||p==="longitude")&&(i=l),r<0&&!o.isMeasure&&typeof o.geoKind=="string"&&o.geoKind.indexOf("country")===0&&(r=l)}),t<0||i<0)return null;let s=[];for(let o of this._rows){let l=o[t],u=o[i],c=l==null||l===""?null:Number(l),p=u==null||u===""?null:Number(u);s.push({lat:c,lon:p,country:r>=0&&ee(this.STR(o[r]))?this.STR(o[r]):null})}return this._geoExtent=Re(s),this._geoExtent}_geoExtent=null;_geoExtentComputed=!1;obfuscateString(e){return ve(e,de)}toObjectArray(){let e=this.liveEnglishAliases();return this._rows.map(t=>{let i={};this._cols.forEach((r,s)=>{i[r.name]=t[s],this.emitLegacyAggAliases&&r.hostName&&r.hostName!==r.name&&!Object.prototype.hasOwnProperty.call(i,r.hostName)&&(i[r.hostName]=t[s])});for(let[r,s]of e)Object.prototype.hasOwnProperty.call(i,s.alias)||(i[s.alias]=t[r]);return i})}async getCSVAsync(e){let t=[],i=e?25:1e7,r=e?4e3:1e7,s=new Map;for(let l of this._rows){let u={};for(let c=0;c<this._cols.length;c++){let p=this._cols[c],f=l[c];if(this.STR(f)!=""){if(e&&p.dataType=="String")if(s.has(f))f=s.get(f);else{let v=this.obfuscateString(f);s.set(f,v),f=v}else if(p.dataType=="DateTime"&&!p.dateWithTime){let v=f instanceof Date?f:typeof f=="string"?ie(f)??new Date(f):new Date(f);f=(this.wholeDayIso(v)??v.toISOString().slice(0,10))+"T00:00:00.000Z"}r-=this.STR(f).length}else f=null;u[c]=f,--r}if(t.push(u),--i,i<=0||r<=0)break}return await Ye.unparse(t,{header:!1})}getCSVHeaderLine(){let e=this.liveEnglishAliases();return Ye.unparse([this._cols.map((t,i)=>{if(this.emitLegacyAggAliases&&t.hostName)return this.STR(t.hostName);let r=e.get(i);return this.STR(r&&r.headerName?r.alias:t.name)})])}setHostQueryNames(e){this._hostQueryNames=(e??[]).map(t=>t==null?null:this.STR(t)),this._englishAliases=new Map}aliasesForCode(e){let t=oe(e,this._cols)?this.legacyAliases():[];for(let i of this.englishAliasesFor(e).values())t.push({name:i.name,alias:i.alias,reason:"english-implicit-agg"});return t}armAliasesForCode(e){return this.emitLegacyAggAliases=oe(e,this._cols),this._englishAliases=this.englishAliasesFor(e),this.getArmedAliases()}getArmedAliases(){let e=this.emitLegacyAggAliases?this.legacyAliases():[];for(let t of this.liveEnglishAliases().values())e.push({name:t.name,alias:t.alias,reason:"english-implicit-agg"});return e}legacyAliases(){let e=[];for(let t of this._cols)t&&t.hostName&&t.hostName!==t.name&&e.push({name:this.STR(t.name),alias:this.STR(t.hostName),reason:"doubled-agg-prefix"});return e}englishAliasesFor(e){let t=new Map;if(!e||this._hostQueryNames.length===0||!this._cols||this._cols.length===0)return t;let i=String(e),r=new Set;for(let o of this._cols)o&&(r.add(this.STR(o.name)),o.hostName&&r.add(this.STR(o.hostName)));let s=new Map;for(let o=0;o<this._cols.length;o++){if(!this._cols[o])continue;let l=Pe(this._hostQueryNames[o]).filter(u=>!r.has(u)&&Q(i,u));l.length===1&&s.set(l[0],[...s.get(l[0])??[],o])}for(let[o,l]of s){if(l.length!==1)continue;let u=this.STR(this._cols[l[0]].name);t.set(l[0],{name:u,alias:o,headerName:!Q(i,u)})}return t}liveEnglishAliases(){let e=new Map;for(let[t,i]of this._englishAliases){let r=this._cols?this._cols[t]:null;r&&this.STR(r.name)===i.name&&e.set(t,i)}return e}addRow(e,t){if(this.dedupRows){let i="";for(let s of e)i+=this.STR(s)+"~";let r=me(i);if(this._rowHashes.has(r))return!1;this._rowHashes.add(r)}return this._rows.push(sn(e)),this._origIndices.push(t??-1),!0}getOriginalRowIndex(e){return e<0||e>=this._origIndices.length?-1:this._origIndices[e]}reset(){this._cols=[],this._rows=[],this._origIndices=[],this._rowHashes=new Set,this._leafCardinality=null,this._hostQueryNames=[],this._englishAliases=new Map}setColumns(e){if(this._cols=e,!e||e.length===0)return;let t=new Set(e.map(i=>this.STR(i?.name)));for(let i of e){if(!i)continue;let r=this.STR(i.name),s=De(r);!s||s===r||t.has(s)||(t.delete(r),t.add(s),i.hostName=r,i.name=s)}}};export{Re as a,qe as b,ee as c,an as d,rt as e,ot as f,at as g,ut as h,Le as i,ft as j,De as k,oe as l,Pe as m,Fe as n,bt as o,We as p,Be as q,dn as r,fn as s,gn as t,Q as u,Mt as v,hn as w,yn as x,_n as y,Lt as z,Ue as A,Yt as B,Ze as C,en as D,tn as E,nn as F,He as G,sn as H,Ke as I};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a as w}from"./chunk-5MRZID36.mjs";var H="AB|CA|Alberta|-113.75|52.18,AK|US|Alaska|-148.32|61.29,AL|US|Alabama|-86.73|33.08,AR|US|Arkansas|-92.85|35.29,AZ|US|Arizona|-111.99|33.32,BC|CA|British Columbia|-122.73|49.27,CA|US|California|-119.21|35.2,CO|US|Colorado|-105|39.63,CT|US|Connecticut|-73.01|41.42,DC|US|District of Columbia|-77.04|38.9,DE|US|Delaware|-75.59|39.57,FL|US|Florida|-81.29|27.53,GA|US|Georgia|-84.02|33.43,HI|US|Hawaii|-157.73|21.26,IA|US|Iowa|-92.79|41.88,ID|US|Idaho|-115.65|44.2,IL|US|Illinois|-88.05|41.67,IN|US|Indiana|-86.27|40.23,KS|US|Kansas|-96|38.59,KY|US|Kentucky|-84.91|38.13,LA|US|Louisiana|-91.28|30.57,MA|US|Massachusetts|-71.28|42.32,MB|CA|Manitoba|-97.3|49.88,MD|US|Maryland|-76.79|39.18,ME|US|Maine|-70.01|43.92,MI|US|Michigan|-83.69|42.56,MN|US|Minnesota|-93.26|44.98,MO|US|Missouri|-92.66|38.73,MS|US|Mississippi|-89.62|32.36,MT|US|Montana|-111.07|46.37,MX01|MX|Aguascalientes|-102.29|21.91,MX02|MX|Baja California|-116.5|32.46,MX03|MX|Baja California Sur|-110.12|23.52,MX04|MX|Campeche|-91.08|19.25,MX05|MX|Chiapas|-92.77|16.28,MX06|MX|Chihuahua|-106.27|30.1,MX07|MX|Coahuila|-101.88|26.32,MX08|MX|Colima|-103.94|19.15,MX09|MX|Mexico City|-99.13|19.41,MX10|MX|Durango|-104.24|24.64,MX11|MX|Guanajuato|-101.37|20.87,MX12|MX|Guerrero|-99.83|17.31,MX13|MX|Hidalgo|-98.81|20.13,MX14|MX|Jalisco|-103.39|20.64,MX15|MX|M\xE9xico|-99.14|19.51,MX16|MX|Michoac\xE1n|-101.68|19.49,MX17|MX|Morelos|-99.15|18.88,MX18|MX|Nayarit|-104.89|21.5,MX19|MX|Nuevo Le\xF3n|-100.26|25.69,MX20|MX|Oaxaca|-96.23|17.05,MX21|MX|Puebla|-98.12|19.07,MX22|MX|Quer\xE9taro|-100.35|20.57,MX23|MX|Quintana Roo|-87.09|20.7,MX24|MX|San Luis Potos\xED|-100.7|22.22,MX25|MX|Sinaloa|-107.49|24.63,MX26|MX|Sonora|-111.05|29.37,MX27|MX|Tabasco|-92.98|17.99,MX28|MX|Tamaulipas|-98.33|24.92,MX29|MX|Tlaxcala|-98.19|19.31,MX30|MX|Veracruz|-96.31|19.2,MX31|MX|Yucat\xE1n|-89.52|20.94,MX32|MX|Zacatecas|-102.7|22.93,NB|CA|New Brunswick|-65.73|45.83,NC|US|North Carolina|-79.61|35.57,ND|US|North Dakota|-98.8|47.31,NE|US|Nebraska|-96.42|41.07,NH|US|New Hampshire|-71.37|43,NJ|US|New Jersey|-74.34|40.51,NL|CA|Newfoundland and Labrador|-52.77|47.55,NM|US|New Mexico|-106.28|34.69,NS|CA|Nova Scotia|-63.11|44.86,NV|US|Nevada|-115.95|36.72,NY|US|New York|-74.13|40.89,OH|US|Ohio|-82.75|40.53,OK|US|Oklahoma|-97.01|35.66,ON|CA|Ontario|-79.27|43.94,OR|US|Oregon|-122.75|44.96,PA|US|Pennsylvania|-76.12|40.23,PE|CA|Prince Edward Island|-63.13|46.23,QC|CA|Quebec|-73.14|45.89,RI|US|Rhode Island|-71.45|41.79,SC|US|South Carolina|-80.69|33.6,SD|US|South Dakota|-98.66|43.89,SK|CA|Saskatchewan|-105.99|51.63,TN|US|Tennessee|-87.53|35.63,TX|US|Texas|-97.51|31.01,UT|US|Utah|-111.96|40.5,VA|US|Virginia|-77.08|37.61,VT|US|Vermont|-73.21|44.48,WA|US|Washington|-121.46|47.29,WI|US|Wisconsin|-88.6|43.36,WV|US|West Virginia|-81.42|38.99,WY|US|Wyoming|-105.54|42.26,YT|CA|Yukon|-135.05|60.72",X="006|-66.84|18.26,007|-66.15|18.15,008|-64.74|17.74,009|-66.12|18.37,010|-72.6|42.26,011|-72.53|42.07,012|-73.21|42.37,013|-72.51|42.58,014|-71.81|42.59,015|-71.85|42.23,016|-71.84|42.28,017|-71.44|42.33,018|-71.21|42.64,019|-70.89|42.66,020|-71.28|42.12,021|-71.05|42.31,022|-71.04|42.35,023|-70.86|41.98,024|-71.22|42.37,025|-70.6|41.71,026|-70.2|41.73,027|-71.07|41.77,028|-71.62|41.69,029|-71.47|41.82,030|-71.51|42.9,031|-71.48|43,032|-71.65|43.57,033|-71.58|43.26,034|-72.19|42.91,035|-71.31|44.69,036|-72.32|43.17,037|-72.13|43.69,038|-71.1|43.56,039|-70.76|43.24,040|-70.6|43.78,041|-70.27|43.7,042|-70.49|44.38,043|-69.75|44.3,044|-68.83|45.45,045|-69.57|43.99,046|-67.8|44.79,047|-68.34|46.55,048|-69.17|44.2,049|-69.97|44.99,050|-72.43|43.85,051|-72.65|43.28,052|-73.14|43.03,053|-72.77|42.94,054|-72.98|44.58,056|-72.6|44.35,057|-73.04|43.69,058|-72.12|44.68,059|-71.7|44.79,060|-72.81|41.88,061|-72.69|41.74,062|-72.12|41.81,063|-72.03|41.5,064|-72.61|41.46,065|-72.94|41.36,066|-73.22|41.24,067|-73.24|41.68,068|-73.42|41.28,069|-73.57|41.14,070|-74.28|40.76,071|-74.2|40.74,072|-74.2|40.68,073|-74.08|40.71,074|-74.4|41.09,075|-74.17|40.92,076|-74.01|40.94,077|-74.17|40.28,078|-74.81|40.97,079|-74.55|40.74,080|-74.98|39.78,081|-75.07|39.94,082|-74.68|39.32,083|-75.04|39.45,084|-74.48|39.35,085|-74.62|40.25,086|-74.68|40.23,087|-74.22|39.96,088|-74.72|40.54,089|-74.48|40.45,100|-73.96|40.77,101|-73.95|40.78,102|-74.02|40.72,103|-74.15|40.58,104|-73.85|40.9,105|-73.75|41.27,106|-73.74|41.02,107|-73.84|40.96,108|-73.8|40.95,109|-74.27|41.3,110|-73.69|40.74,111|-73.93|40.76,112|-73.94|40.66,113|-73.84|40.73,114|-73.77|40.69,115|-73.62|40.71,116|-73.88|40.57,117|-73.23|40.82,118|-73.5|40.77,119|-72.53|40.95,120|-74.22|42.92,121|-74.4|43.46,122|-73.81|42.7,123|-73.96|42.82,124|-74.27|42.09,125|-73.7|41.89,126|-73.88|41.69,127|-74.75|41.74,128|-73.91|43.61,129|-74.03|44.53,130|-76.16|43.08,131|-76.46|43.27,132|-76.2|43.03,133|-75.07|43.45,134|-75.35|43.03,135|-75.15|43.14,136|-75.39|44.33,137|-75.2|42.21,138|-75.46|42.43,139|-75.88|42.12,140|-78.48|43.01,141|-78.7|42.49,142|-78.8|42.91,143|-78.96|43.12,144|-77.71|42.96,145|-77.17|43.14,146|-77.65|43.17,147|-78.84|42.21,148|-77.18|42.29,149|-76.78|42.09,150|-80.23|40.56,151|-80.18|40.53,152|-79.97|40.46,153|-80.24|40.01,154|-79.65|39.92,155|-78.8|39.95,156|-79.47|40.33,157|-79.02|40.71,158|-78.66|41.32,159|-78.84|40.35,160|-79.88|40.93,161|-80.3|41.19,162|-79.35|41.08,163|-79.58|41.59,164|-80|41.87,165|-80.04|42.1,166|-78.28|40.48,167|-78.47|41.76,168|-78|40.97,169|-77.37|41.8,170|-77.29|40.44,171|-76.78|40.33,172|-77.81|39.98,173|-76.93|39.89,174|-76.72|39.97,175|-76.24|40.05,176|-76.34|40.05,177|-77.22|41.34,178|-76.77|40.93,179|-76.27|40.69,180|-75.45|40.67,181|-75.47|40.6,182|-75.88|40.9,183|-75.19|41.12,184|-75.38|41.53,185|-75.68|41.37,186|-76.17|41.4,187|-75.86|41.22,188|-76.12|41.82,189|-75.14|40.36,190|-75.37|39.97,191|-75.15|40.01,193|-75.78|39.92,194|-75.46|40.19,195|-75.9|40.42,196|-75.95|40.34,197|-75.68|39.53,198|-75.58|39.77,199|-75.46|38.83,200|-77.02|38.9,201|-77.68|38.9,202|-77.03|38.89,203|-77.01|38.86,204|-77.05|38.89,205|-77.01|38.87,206|-76.76|38.45,207|-76.78|38.88,208|-77.23|39.15,209|-76.99|39.05,210|-76.32|39.53,211|-76.73|39.58,212|-76.58|39.31,214|-76.55|39,215|-79.08|39.56,216|-76.02|38.86,217|-77.5|39.52,218|-75.57|38.27,219|-75.94|39.57,220|-77.25|38.78,221|-77.25|38.92,222|-77.11|38.88,223|-77.13|38.79,224|-77.25|38.22,225|-77.51|38.09,226|-78.25|39.03,227|-78.05|38.49,228|-78.79|38.57,229|-78.55|38.02,230|-78.09|37.66,231|-76.96|37.55,232|-77.46|37.51,233|-76.3|36.68,234|-76.66|36.77,235|-76.26|36.87,236|-76.44|37.12,237|-76.38|36.85,238|-77.41|36.94,239|-78.39|37.03,240|-80.1|37.23,241|-79.89|36.9,242|-82.49|36.83,243|-81.13|36.86,244|-79.51|38.05,245|-79.11|37.15,246|-81.8|37.19,247|-81.14|37.39,248|-81.64|37.47,249|-80.32|37.95,250|-81.45|38.27,251|-81.89|38.64,252|-81.45|38.77,253|-81.64|38.42,254|-78.11|39.45,255|-82.19|38.25,256|-82.08|37.76,257|-82.41|38.4,258|-81.21|37.72,259|-80.89|37.83,260|-80.63|40.05,261|-81.27|39.2,262|-80.02|38.75,263|-80.23|39.27,264|-80.65|39.21,265|-80.05|39.59,266|-80.8|38.48,267|-78.98|39.33,268|-79.12|38.88,270|-80.45|36.24,271|-80.24|36.06,272|-79.82|35.86,273|-79.52|35.55,274|-79.81|36.09,275|-78.54|35.93,276|-78.65|35.81,277|-78.9|35.99,278|-77.32|35.88,279|-76.5|36.19,280|-81.2|35.4,281|-80.41|35.21,282|-80.83|35.22,283|-78.94|34.96,284|-78.23|34.39,285|-77.23|35.06,286|-81.36|36.06,287|-82.78|35.51,288|-82.55|35.6,289|-83.97|35.11,290|-80.88|34.19,291|-80.62|33.71,292|-80.96|34.04,293|-81.86|34.78,294|-80.08|33.05,295|-79.49|34.07,296|-82.57|34.61,297|-80.92|34.83,298|-81.74|33.51,299|-80.96|32.55,300|-84.08|33.85,301|-84.91|34.04,302|-84.55|33.25,303|-84.42|33.77,304|-82.11|32.48,305|-83.81|34.58,306|-83.14|33.86,307|-85.1|34.71,308|-82.34|33.35,309|-82.01|33.4,310|-83.42|32.64,312|-83.64|32.83,313|-81.49|31.68,314|-81.15|32.03,315|-82.21|31.4,316|-83.21|31.02,317|-83.87|31.48,318|-84.69|32.45,319|-84.95|32.47,320|-82.58|30.27,321|-81.48|29.39,322|-81.69|30.3,323|-84.25|30.29,324|-85.58|30.55,325|-87.03|30.76,326|-82.6|29.58,327|-81.28|28.79,328|-81.32|28.47,329|-80.67|27.96,330|-80.58|25.31,331|-80.38|25.74,333|-80.25|26.13,334|-81.01|26.64,335|-82.22|28.19,336|-82.47|28.01,337|-82.73|27.85,338|-81.64|27.72,339|-81.71|26.77,341|-81.32|26.11,342|-82.16|27.29,344|-82.35|29.01,346|-82.52|28.41,347|-81.4|28.29,349|-80.72|27.34,350|-86.8|34.05,351|-86.38|33.43,352|-86.77|33.5,354|-87.86|33.07,355|-87.71|33.96,356|-87.4|34.67,357|-86.26|34.75,358|-86.59|34.69,359|-85.94|34.27,360|-86.09|32.09,361|-86.27|32.31,362|-85.65|33.53,363|-85.56|31.34,364|-86.97|31.38,365|-88.14|31.32,366|-88.19|30.68,367|-87.34|32.33,368|-85.41|32.61,369|-88.25|32.12,370|-87.02|36.12,371|-86.23|35.75,372|-86.83|36.15,373|-85.36|35.32,374|-85.33|35.06,376|-82.3|36.36,377|-84.31|36.27,378|-83.35|36.3,379|-83.97|35.97,380|-89.43|35.55,381|-89.96|35.1,382|-88.68|36.29,383|-88.5|35.61,384|-87.36|35.34,385|-85.34|36.18,386|-89.76|34.57,387|-90.81|33.54,388|-88.63|34.36,389|-89.9|33.77,390|-90|32.53,391|-90.67|32.51,392|-90.22|32.32,393|-88.8|32.42,394|-89.26|31.23,395|-89|30.59,396|-90.67|31.32,397|-88.87|33.53,398|-84.67|31.32,400|-85.29|38.07,401|-86.2|37.85,402|-85.66|38.19,403|-84.2|38.06,404|-84.42|37.53,405|-84.45|38.04,406|-84.87|38.22,407|-84.12|36.95,408|-83.26|36.9,409|-83.74|36.95,410|-84.32|38.64,411|-83.06|38.38,412|-82.67|37.89,413|-83.48|37.58,414|-83.15|37.84,415|-82.39|37.46,416|-82.78|37.54,417|-83.25|37.23,418|-82.88|37.21,420|-88.57|36.9,421|-86.09|36.89,422|-87.11|36.95,423|-87.02|37.52,424|-87.7|37.47,425|-84.71|37.15,426|-84.82|36.81,427|-85.73|37.32,430|-82.9|40.21,431|-82.99|39.69,432|-82.97|39.98,433|-83.38|40.55,434|-83.3|41.42,435|-84.22|41.46,436|-83.54|41.67,437|-81.66|39.85,438|-81.88|40.27,439|-80.9|40.25,440|-80.97|41.64,441|-81.66|41.42,442|-81.6|41.13,443|-81.54|41.07,444|-80.77|41.09,445|-80.64|41.05,446|-81.53|40.65,447|-81.39|40.83,448|-82.77|41.02,449|-82.55|40.74,450|-84.48|39.43,451|-83.84|39.16,452|-84.48|39.18,453|-84.3|39.97,454|-84.18|39.74,455|-83.81|39.94,456|-82.86|38.99,457|-81.78|39.35,458|-84.23|40.83,460|-86.13|40.17,461|-86.18|39.62,462|-86.14|39.79,463|-87.05|41.41,464|-87.34|41.55,465|-86.08|41.44,466|-86.28|41.66,467|-85.21|41.17,468|-85.17|41.09,469|-86.14|40.76,470|-85.08|39.16,471|-86.02|38.43,472|-85.74|39.05,473|-85.15|40.09,474|-86.63|38.99,475|-87.03|38.46,476|-87.53|38.13,477|-87.58|38.03,478|-87.29|39.45,479|-87.11|40.5,480|-82.79|42.83,481|-83.62|42.2,482|-83.1|42.38,483|-83.35|42.66,484|-83.22|43.29,485|-83.69|43.03,486|-84.36|43.99,487|-83.67|44.45,488|-84.67|43.02,489|-84.59|42.74,490|-85.54|42.2,491|-86.36|41.87,492|-84.36|42.06,493|-85.57|43.33,494|-86.14|43.39,495|-85.66|42.96,496|-85.52|44.44,497|-84.37|45.17,498|-86.94|46.17,499|-88.93|46.6,500|-94.77|41.63,501|-92.79|41.84,502|-93.67|42.12,503|-93.63|41.59,504|-93.37|43.17,505|-94.45|42.77,506|-92.45|42.65,507|-92.31|42.49,508|-94.56|40.96,510|-95.91|42.6,511|-96.39|42.52,512|-96.06|43.28,513|-95.16|43.27,514|-95.08|42.11,515|-95.55|41.44,516|-95.37|40.74,520|-90.98|42.46,521|-91.73|43.2,522|-92.31|41.9,523|-91.66|41.87,524|-91.69|41.96,525|-92.46|40.95,526|-91.44|40.88,527|-90.88|41.64,528|-90.61|41.56,530|-88.24|43.51,531|-88.33|42.75,532|-87.98|43.06,534|-87.86|42.74,535|-89.66|42.95,537|-89.38|43.08,538|-90.73|42.88,539|-89.55|43.64,540|-92.46|45.08,541|-88.23|45.09,542|-87.6|44.52,543|-88.01|44.53,544|-89.85|44.93,545|-89.86|45.89,546|-90.87|43.93,547|-91.52|44.85,548|-91.63|46.04,549|-88.96|44.19,550|-92.98|45.17,551|-93.08|44.96,553|-94.06|44.99,554|-93.31|45.01,556|-91.03|47.67,557|-92.68|47.39,558|-92.08|46.96,559|-92.28|43.89,560|-94.04|44.02,561|-95.65|43.92,562|-95.75|45.08,563|-94.59|45.83,564|-94.5|46.63,565|-96.08|46.86,566|-94.31|47.88,567|-96.22|48.39,570|-97.07|43.48,571|-96.76|43.54,572|-97.18|45.04,573|-98.53|43.91,574|-98.93|45.36,575|-100.61|43.86,576|-101.59|45.43,577|-103.11|44.26,580|-97.39|46.66,581|-96.83|46.86,582|-97.72|48.25,583|-99.34|48.32,584|-99.12|46.88,585|-100.98|46.76,586|-102.99|46.75,587|-101.7|48.34,588|-103.48|48.2,590|-108.62|45.98,591|-108.45|45.69,592|-105.6|48.2,593|-105.58|46.4,594|-111.24|47.79,595|-109.12|48.38,596|-111.74|46.65,597|-112.31|45.48,598|-114.25|46.97,599|-114.57|48.37,600|-88.15|42.29,601|-88.47|42.01,602|-87.69|42.04,603|-87.79|41.89,604|-88.09|41.39,605|-88.55|41.69,606|-87.69|41.83,607|-87.82|42.03,608|-87.76|41.84,609|-87.92|40.8,610|-89.56|42.18,611|-89.08|42.28,612|-90.29|41.5,613|-89.16|41.34,614|-90.43|40.82,615|-89.68|40.71,616|-89.61|40.72,617|-88.89|40.52,618|-88.15|40.11,619|-88.19|39.66,620|-90.01|39.13,622|-89.72|38.41,623|-91.02|39.99,624|-88.19|39.04,625|-89.21|39.63,626|-90|39.86,627|-89.66|39.8,628|-88.65|38.35,629|-88.89|37.55,630|-90.83|38.35,631|-90.32|38.64,633|-91.11|39.02,634|-91.78|39.93,635|-92.61|40.2,636|-90.64|37.61,637|-89.81|37.37,638|-89.73|36.55,639|-90.62|36.84,640|-94.1|39.07,641|-94.58|39.14,644|-94.69|40.13,645|-94.83|39.75,646|-93.55|39.89,647|-94.15|38.06,648|-94.35|36.93,650|-92.23|38.45,651|-92.19|38.51,652|-92.38|39.21,653|-93.26|38.71,654|-92.03|37.93,655|-91.92|37.67,656|-93.08|36.76,657|-92.43|37.03,658|-93.3|37.22,660|-95.12|38.84,661|-94.73|39.11,662|-94.72|38.95,664|-96.15|39.64,665|-96.34|39.4,666|-95.76|39.06,667|-95.23|37.64,668|-96.39|38.36,669|-97.86|39.77,670|-98.49|37.33,671|-98.4|37.44,672|-97.33|37.7,673|-95.81|37.23,674|-97.79|38.98,675|-98.99|38.25,676|-99.47|39.34,677|-101.15|39.35,678|-100.82|37.91,679|-101.43|37.18,680|-96.46|41.55,681|-96.05|41.24,683|-96.93|40.39,684|-97.26|40.89,685|-96.69|40.82,686|-97.68|41.55,687|-98.16|42.43,688|-99.15|41.34,689|-98.9|40.34,690|-100.99|40.37,691|-101.59|41.42,692|-100.64|42.67,693|-102.84|42.29,700|-89.93|29.63,701|-89.93|30.02,703|-90.65|29.62,704|-90.27|30.66,705|-92.25|30.2,706|-93.21|30.34,707|-91.2|30.57,708|-91.1|30.45,710|-93.4|32.45,711|-93.75|32.47,712|-91.95|32.56,713|-91.86|31.43,714|-92.84|31.57,716|-91.75|33.61,717|-92.79|33.48,718|-93.84|33.66,719|-93.61|34.4,720|-91.9|34.92,721|-92.56|34.93,722|-92.37|34.7,723|-90.59|35.07,724|-90.76|36.04,725|-91.81|36.01,726|-92.93|36.15,727|-94.05|36.11,728|-93.33|35.3,729|-94.08|35.29,730|-97.83|35.31,731|-97.5|35.43,734|-97.14|34.21,735|-98.81|34.53,736|-99.33|35.52,737|-98.2|36.42,738|-99.54|36.5,739|-101.67|36.74,740|-96.19|36.34,741|-95.96|36.15,743|-95.02|36.55,744|-95.44|35.64,745|-95.65|34.66,746|-97.05|36.71,747|-95.41|34.02,748|-96.66|35.17,749|-94.69|35.23,750|-96.76|33.06,751|-96.32|32.48,752|-96.78|32.79,753|-96.84|32.81,754|-95.67|33.37,755|-94.45|33.3,756|-94.58|32.49,757|-95.37|32.24,758|-95.68|31.44,759|-94.29|31.29,760|-97.54|32.59,761|-97.38|32.77,762|-97.44|33.52,763|-98.87|33.73,764|-98.59|32.61,765|-97.62|31.11,766|-97.06|31.7,767|-97.15|31.57,768|-99.37|31.23,769|-100.88|31.03,770|-95.39|29.79,772|-95.37|29.77,773|-95.24|30.48,774|-96.02|29.38,775|-94.98|29.68,776|-94.16|30.27,777|-94.19|29.96,778|-96.32|30.67,779|-96.95|28.92,780|-99.01|28.67,781|-97.93|29.08,782|-98.53|29.47,783|-98.14|27.63,784|-97.44|27.73,785|-98.19|26.39,786|-98.1|30.27,787|-97.78|30.3,788|-100.26|29.44,789|-96.87|29.92,790|-101.63|35.48,791|-101.85|35.21,792|-100.57|34.25,793|-102.15|33.37,794|-101.88|33.58,795|-100.31|32.7,796|-99.72|32.46,797|-102.22|31.57,798|-104.17|30.53,799|-106.16|31.8,800|-105.11|39.91,801|-104.47|39.51,802|-104.93|39.78,803|-105.31|40.04,804|-106.16|39.98,805|-105.35|40.57,806|-104.49|40.38,807|-103.09|40.4,808|-103.16|39.12,809|-104.67|38.79,810|-103.58|37.77,811|-106.39|37.54,812|-106.39|38.46,813|-108.42|37.49,814|-108.02|38.43,815|-108.7|38.92,816|-107.86|39.99,820|-105.27|41.31,821|-110.51|44.57,822|-104.67|42.39,823|-107.03|41.75,824|-108.65|44.32,825|-108.91|43.14,826|-106.43|43.1,827|-105|44.2,828|-106.71|44.55,829|-109.71|42.82,830|-110.51|43.7,831|-110.53|42.6,832|-112.17|42.66,833|-114.23|42.81,834|-111.63|43.86,835|-115.77|46.07,836|-115.99|44,837|-116.04|43.58,838|-116.47|47.77,840|-110.86|40.53,841|-111.81|40.71,843|-112.18|41.67,844|-112.01|41.23,845|-109.72|38.09,846|-111.68|39.63,847|-112.82|37.61,850|-112.09|33.63,851|-111.41|33,852|-111.69|33.6,853|-113.44|33.49,855|-110.3|33.43,856|-110.59|32,857|-111.09|32.18,859|-109.81|34.23,860|-111.15|35.89,863|-112.57|34.85,864|-113.79|35.66,865|-109.55|36.03,870|-106.9|35.22,871|-106.72|35.12,873|-108.56|35.44,874|-108.23|36.59,875|-106.04|36.27,877|-104.68|36.06,878|-107.94|34,879|-107.48|33.2,880|-108.03|32.37,881|-103.81|34.26,882|-104.07|32.87,883|-105.48|33.62,884|-103.79|35.74,890|-114.84|37,891|-115.42|36.33,893|-116.96|39.5,894|-118.06|41.29,895|-119.72|39.9,897|-119.8|39.18,898|-115.71|40.95,900|-118.32|34.04,902|-118.76|34.07,903|-118.34|33.95,904|-118.48|34.02,905|-118.33|33.83,906|-118.03|33.93,907|-118.45|33.39,908|-118.18|33.8,910|-118.25|34.28,911|-118.13|34.15,912|-118.25|34.19,913|-118.55|34.36,914|-118.47|34.18,915|-118.33|34.19,916|-118.38|34.18,917|-117.78|34.14,918|-118.13|34.09,919|-116.62|32.73,920|-116.7|33.16,921|-117.14|32.85,922|-115.5|33.59,923|-117.14|34.66,924|-117.33|34.17,925|-117.06|33.68,926|-117.73|33.63,927|-117.85|33.74,928|-117.71|33.85,930|-119.12|34.39,931|-119.97|34.48,932|-119.07|35.98,933|-119.01|35.35,934|-120.5|35.38,935|-118.36|37.37,936|-119.72|36.95,937|-119.85|36.71,939|-121.42|36.34,940|-122.31|37.41,941|-122.44|37.77,943|-122.13|37.44,944|-122.32|37.53,945|-122.05|38.09,946|-122.19|37.78,947|-122.26|37.89,948|-122.3|37.97,949|-122.74|38.14,950|-121.42|36.85,951|-121.76|37.33,952|-120.79|38.14,953|-120.56|37.62,954|-123.15|39.08,955|-123.75|40.5,956|-121.34|38.62,957|-120.86|39.13,958|-121.44|38.58,959|-121.73|39.47,960|-122.42|41.06,961|-120.33|40.52,967|-155.53|19.6,968|-157.83|21.34,969|144.77|13.45,970|-121.45|45.3,971|-123.79|45.64,972|-122.74|45.57,973|-123.26|44.68,974|-123.46|43.61,975|-123.06|42.34,976|-120.4|42.67,977|-120.77|44.32,978|-118.59|45.21,979|-117.63|43.34,980|-121.78|47.42,981|-122.32|47.6,982|-121.79|48.39,983|-123.87|47.96,984|-122.46|47.18,985|-123.27|46.94,986|-122.15|45.99,988|-119.91|48,989|-120.57|46.71,990|-117.56|47.62,991|-118.13|47.91,992|-117.4|47.67,993|-118.82|46.4,994|-117.21|46.2,995|-156.93|60.89,996|-151.66|60.82,997|-146.69|65.19,998|-136.2|58.94,999|-131.24|55.86",k="ABW|-70.02|12.54,AFG|68|34.63,AGO|14.24|-9.84,AIA|-63.06|18.22,ALA|19.93|60.1,ALB|19.81|41.14,AND|1.53|42.51,ARE|55.24|24.99,ARG|-61.28|-32.95,ARM|44.52|40.23,ASM|-170.7|-14.28,ATA|21.28|-80.52,ATF|70.22|-49.35,ATG|-61.84|17.12,AUS|144.91|-33.49,AUT|15.51|47.93,AZE|49.02|40.37,BDI|29.49|-3.34,BEL|4.37|50.89,BEN|2.33|7.65,BES|-68.27|12.15,BFA|-2.08|12.15,BGD|90.42|23.65,BGR|24.92|42.71,BHR|50.57|26.18,BHS|-77.34|25.06,BIH|17.97|44.18,BLM|-62.85|17.9,BLR|27.81|53.57,BLZ|-88.41|17.54,BMU|-64.78|32.29,BOL|-65.79|-17.39,BRA|-45.89|-17.51,BRB|-59.62|13.11,BRN|114.74|4.82,BTN|89.69|27.32,BWA|25.99|-23.43,CAF|18.32|4.94,CAN|-79.4|43.71,CCK|96.82|-12.16,CHE|7.96|47.07,CHL|-71.21|-33.72,CHN|114.44|32,CIV|-4.89|6.16,CMR|11.19|5.41,COD|20.23|-4.72,COG|14.18|-4.04,COK|-159.78|-21.21,COL|-74.85|5.93,COM|43.58|-11.89,CPV|-23.87|15.66,CRI|-84.14|9.99,CUB|-80.25|22.21,CUW|-68.88|12.12,CXR|105.68|-10.42,CYM|-81.38|19.32,CYP|33.31|35,CZE|15.44|49.89,DEU|9.65|51.24,DJI|43.15|11.59,DMA|-61.39|15.3,DNK|11.42|55.79,DOM|-70.07|18.75,DZA|3.55|35.62,ECU|-79.29|-1.4,EGY|31.22|29.84,ERI|38.84|15.25,ESH|-13.19|27.14,ESP|-2.91|39.69,EST|25.17|59.29,ETH|39.02|9.26,FIN|24.87|61.26,FJI|178.2|-17.85,FLK|-57.86|-51.69,FRA|2.87|47.28,FRO|-6.77|62.01,FSM|158.16|6.92,GAB|10.22|-0.06,GBR|-1.37|52.49,GEO|43.92|41.84,GGY|-2.54|49.46,GHA|-0.98|6.4,GIB|-5.35|36.14,GIN|-12.8|9.75,GLP|-61.53|16.23,GMB|-16.59|13.41,GNB|-15.48|11.9,GNQ|9.77|1.86,GRC|23.73|37.98,GRD|-61.75|12.05,GRL|-51.72|64.18,GTM|-90.71|14.73,GUF|-52.64|5.04,GUM|144.82|13.5,GUY|-58.11|6.63,HKG|114.15|22.33,HMD|73.5|-53.1,HND|-87.41|14.94,HRV|16.21|45.31,HTI|-72.34|18.54,HUN|19.21|47.39,IDN|106.85|-6.21,IMN|-4.48|54.15,IND|78.36|21,IOT|71.35|-6.19,IRL|-6.87|53.12,IRN|51.6|34.4,IRQ|44.78|33.65,ISL|-21.7|64.22,ISR|34.97|32.07,ITA|12|42.73,JAM|-76.91|18.03,JEY|-2.1|49.19,JOR|35.96|32.03,JPN|137.27|35.53,KAZ|70.17|47.24,KEN|36.81|-0.97,KGZ|73.96|41.94,KHM|104.7|11.75,KIR|172.98|1.33,KNA|-62.72|17.3,KOR|127.51|36.58,KWT|48.06|29.2,Kosovo|20.9|42.58,LAO|102.6|17.97,LBN|35.53|33.87,LBR|-10.39|6.36,LBY|13.19|32.89,LCA|-60.97|14.04,LIE|9.52|47.14,LKA|80.25|7.25,LSO|27.67|-29.38,LTU|24.18|55.04,LUX|6.08|49.56,LVA|24.13|56.85,MAC|113.55|22.19,MAF|-63.08|18.07,MAR|-6.65|33.43,MCO|7.42|43.74,MDA|28.82|47.09,MDG|47.46|-18.89,MDV|73.51|4.18,MEX|-100.65|21.59,MHL|171.38|7.09,MKD|21.47|41.8,MLI|-7.15|12.95,MLT|14.46|35.91,MMR|96.18|18.74,MNE|19.17|42.53,MNG|105.33|47.94,MNP|145.75|15.21,MOZ|32.58|-25.97,MRT|-14.58|18.01,MSR|-62.21|16.79,MTQ|-61.01|14.64,MUS|57.51|-20.23,MWI|34.34|-14.24,MYS|103.35|3.45,MYT|45.23|-12.77,N. Cyprus|33.56|35.27,NAM|17.19|-21.34,NCL|166.47|-22.26,NER|5.05|14.04,NFK|167.97|-29.05,NGA|5.91|7.87,NIC|-86.17|12.33,NIU|-169.92|-19.05,NLD|5.21|52.09,NOR|9.62|60.46,NPL|84.7|27.64,NRU|166.93|-0.55,NZL|174.54|-38.9,OMN|57.69|23.27,PAK|71.47|30.24,PAN|-79.83|8.98,PCN|-130.1|-25.07,PER|-76.4|-11.18,PHL|121.05|14.65,PLW|134.58|7.52,PNG|147.4|-7.71,POL|19.26|51.79,PRI|-66.24|18.35,PRK|126.54|39.52,PRT|-9.08|39.42,PRY|-57.15|-25.27,PSE|35.23|31.78,PYF|-149.59|-17.57,QAT|51.49|25.32,REU|55.45|-21.08,ROU|25.47|45.38,RUS|51.84|54.52,RWA|29.78|-1.98,SAU|43.01|23.76,SDN|31.67|14.67,SEN|-16.73|14.66,SGP|103.85|1.33,SGS|-36.51|-54.28,SHN|-5.72|-15.92,SJM|15.65|78.22,SLB|159.97|-9.44,SLE|-12.4|8.36,SLV|-89.08|13.7,SMR|12.45|43.94,SOM|44.96|4.91,SPM|-56.18|46.78,SRB|20.62|44.5,SSD|29.91|6.61,STP|6.73|0.34,SUR|-55.18|5.84,SVK|18.69|48.55,SVN|14.83|46.16,SWE|16.03|58.86,SWZ|31.28|-26.43,SXM|-63.05|18.03,SYC|55.46|-4.62,SYR|37.18|35.12,Somaliland|46.23|9.76,TCA|-72.1|21.74,TCD|16.57|11.53,TGO|1.16|6.8,THA|100.71|13.71,TJK|69.39|39.08,TKM|59.4|38.74,TLS|125.65|-8.67,TON|-175.2|-21.14,TTO|-61.4|10.5,TUN|10.23|35.87,TUR|32.1|39.5,TUV|179.19|-8.52,TWN|121.06|24.37,TZA|36.11|-5.88,UGA|32.23|0.59,UKR|32.8|48.99,URY|-56.28|-34.1,USA|-93.51|37.4,UZB|69.22|41.26,VAT|12.45|41.9,VCT|-61.21|13.14,VEN|-67.82|9.83,VGB|-64.62|18.43,VIR|-64.8|17.9,VNM|106.63|10.82,VUT|168.31|-17.74,WLF|-176.17|-13.28,WSM|-171.77|-13.83,YEM|44.62|14.36,ZAF|26.96|-28.33,ZMB|28.41|-13.86,ZWE|30.49|-18.56";var W={\u00F8:"o",\u0153:"oe",\u00E6:"ae",\u00DF:"ss",\u0142:"l",\u0111:"d",\u00F0:"d",\u00FE:"th",\u0131:"i",\u0127:"h",\u0167:"t",\u014B:"n",\u0138:"k",\u0259:"e",\u01DD:"e",\u0133:"ij",\u0140:"l",\u017F:"s"};function u(n){return n.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase().replace(/[øœæßłđðþıħŧŋəĸ]/g,e=>W[e]).replace(/[^\p{L}\p{Nd}\s]/gu," ").replace(/\s+/g," ").trim()}var _="AD AND,AE ARE,AF AFG,AG ATG,AI AIA,AL ALB,AM ARM,AO AGO,AQ ATA,AR ARG,AS ASM,AT AUT,AU AUS,AW ABW,AX ALA,AZ AZE,BA BIH,BB BRB,BD BGD,BE BEL,BF BFA,BG BGR,BH BHR,BI BDI,BJ BEN,BL BLM,BM BMU,BN BRN,BO BOL,BQ BES,BR BRA,BS BHS,BT BTN,BV BVT,BW BWA,BY BLR,BZ BLZ,CA CAN,CC CCK,CD COD,CF CAF,CG COG,CH CHE,CI CIV,CK COK,CL CHL,CM CMR,CN CHN,CO COL,CR CRI,CU CUB,CV CPV,CW CUW,CX CXR,CY CYP,CZ CZE,DE DEU,DJ DJI,DK DNK,DM DMA,DO DOM,DZ DZA,EC ECU,EE EST,EG EGY,EH ESH,ER ERI,ES ESP,ET ETH,FI FIN,FJ FJI,FK FLK,FM FSM,FO FRO,FR FRA,GA GAB,GB GBR,GD GRD,GE GEO,GF GUF,GG GGY,GH GHA,GI GIB,GL GRL,GM GMB,GN GIN,GP GLP,GQ GNQ,GR GRC,GS SGS,GT GTM,GU GUM,GW GNB,GY GUY,HK HKG,HM HMD,HN HND,HR HRV,HT HTI,HU HUN,ID IDN,IE IRL,IL ISR,IM IMN,IN IND,IO IOT,IQ IRQ,IR IRN,IS ISL,IT ITA,JE JEY,JM JAM,JO JOR,JP JPN,KE KEN,KG KGZ,KH KHM,KI KIR,KM COM,KN KNA,KP PRK,KR KOR,KW KWT,KY CYM,KZ KAZ,LA LAO,LB LBN,LC LCA,LI LIE,LK LKA,LR LBR,LS LSO,LT LTU,LU LUX,LV LVA,LY LBY,MA MAR,MC MCO,MD MDA,ME MNE,MF MAF,MG MDG,MH MHL,MK MKD,ML MLI,MM MMR,MN MNG,MO MAC,MP MNP,MQ MTQ,MR MRT,MS MSR,MT MLT,MU MUS,MV MDV,MW MWI,MX MEX,MY MYS,MZ MOZ,NA NAM,NC NCL,NE NER,NF NFK,NG NGA,NI NIC,NL NLD,NO NOR,NP NPL,NR NRU,NU NIU,NZ NZL,OM OMN,PA PAN,PE PER,PF PYF,PG PNG,PH PHL,PK PAK,PL POL,PM SPM,PN PCN,PR PRI,PS PSE,PT PRT,PW PLW,PY PRY,QA QAT,RE REU,RO ROU,RS SRB,RU RUS,RW RWA,SA SAU,SB SLB,SC SYC,SD SDN,SE SWE,SG SGP,SH SHN,SI SVN,SJ SJM,SK SVK,SL SLE,SM SMR,SN SEN,SO SOM,SR SUR,SS SSD,ST STP,SV SLV,SX SXM,SY SYR,SZ SWZ,TC TCA,TD TCD,TF ATF,TG TGO,TH THA,TJ TJK,TK TKL,TL TLS,TM TKM,TN TUN,TO TON,TR TUR,TT TTO,TV TUV,TW TWN,TZ TZA,UA UKR,UG UGA,UM UMI,US USA,UY URY,UZ UZB,VA VAT,VC VCT,VE VEN,VG VGB,VI VIR,VN VNM,VU VUT,WF WLF,WS WSM,YE YEM,YT MYT,ZA ZAF,ZM ZMB,ZW ZWE",N=(()=>{let n=new Map;for(let e of _.split(",")){let[t,o]=e.split(" ");t&&o&&n.set(t,o)}return n})(),z=new Set(N.keys()),J=new Set(N.values()),v=["en","fr","es","de","it","pt","ru","ja","zh","ko","ar","hi","tr","pl","he","nl","sv","fi","no","da","cs","el","uk","ro","id","vi","th"],Q={usa:"USA","u.s.":"USA","u.s.a.":"USA",us:"USA",america:"USA","united states of america":"USA","the united states":"USA",uk:"GBR","u.k.":"GBR","great britain":"GBR",britain:"GBR",england:"GBR","south korea":"KOR","north korea":"PRK",korea:"KOR","ivory coast":"CIV","cote d ivoire":"CIV",vietnam:"VNM",laos:"LAO",syria:"SYR",iran:"IRN",russia:"RUS",moldova:"MDA",tanzania:"TZA",bolivia:"BOL",venezuela:"VEN",brunei:"BRN","czech republic":"CZE",czechia:"CZE",slovakia:"SVK",uae:"ARE","united arab emirates":"ARE",drc:"COD","dr congo":"COD","democratic republic of the congo":"COD","republic of the congo":"COG",congo:"COG",swaziland:"SWZ",eswatini:"SWZ","cape verde":"CPV","cabo verde":"CPV",burma:"MMR",myanmar:"MMR",holland:"NLD","the netherlands":"NLD",netherlands:"NLD",vatican:"VAT","vatican city":"VAT",palestine:"PSE",macau:"MAC",macao:"MAC","hong kong":"HKG",taiwan:"TWN",turkey:"TUR",turkiye:"TUR",macedonia:"MKD","north macedonia":"MKD",gambia:"GMB","the gambia":"GMB",bahamas:"BHS","the bahamas":"BHS","east timor":"TLS","timor leste":"TLS"},b=null;function j(){if(b)return b;let n=new Map,e=["en",...v.filter(t=>t!=="en")];for(let t of e){let o=null;try{o=new Intl.DisplayNames([t],{type:"region"})}catch{continue}for(let[i,r]of N){let a;try{a=o.of(i)}catch{a=void 0}if(!a||a===i)continue;let s=u(a);s&&!n.has(s)&&n.set(s,r)}}for(let[t,o]of Object.entries(Q)){let i=u(t);i&&n.set(i,o)}return b=n,n}function T(n){return N.get(String(n||"").trim().toUpperCase())??null}function E(n){if(n==null)return null;let e=String(n).trim();if(!e)return null;let t=e.toUpperCase();return t.length===3&&J.has(t)?t:t.length===2&&z.has(t)?N.get(t)??null:j().get(u(e))??null}var f3=95,$=new Set(["n a","none","null","nil","unknown","not applicable","not available","not specified","unspecified","missing","blank","empty","tbd","to be determined"]);function V(n){return n?$.has(n):!0}var m3=80;var q={"north-america":"N",world:"W"};function F(n,e){let t=n.filter(o=>o.row.kinds.includes(q[e||"north-america"]));return t.length?t:(e||"north-america")==="world"?n:t}var P=w;function L3(n){n!==P&&(P=n||"",U=null,L=null,I=null)}function n3(){return P.length>0}var t3={US:"washington",CA:"ottawa",MX:"mexico city",GB:"london",FR:"paris",DE:"berlin",IT:"rome",ES:"madrid",PT:"lisbon",NL:"amsterdam",BE:"brussels",CH:"bern",AT:"vienna",IE:"dublin",PL:"warsaw",SE:"stockholm",NO:"oslo",DK:"copenhagen",FI:"helsinki",IS:"reykjavik",CZ:"prague",SK:"bratislava",HU:"budapest",RO:"bucharest",BG:"sofia",GR:"athens",TR:"ankara",UA:"kyiv",RU:"moscow",RS:"belgrade",HR:"zagreb",SI:"ljubljana",EE:"tallinn",LV:"riga",LT:"vilnius",JP:"tokyo",CN:"beijing",KR:"seoul",KP:"pyongyang",IN:"new delhi",PK:"islamabad",BD:"dhaka",LK:"colombo",TH:"bangkok",VN:"hanoi",PH:"manila",ID:"jakarta",MY:"kuala lumpur",SG:"singapore",MM:"naypyidaw",KH:"phnom penh",LA:"vientiane",NP:"kathmandu",AF:"kabul",IR:"tehran",IQ:"baghdad",SA:"riyadh",AE:"abu dhabi",QA:"doha",KW:"kuwait city",BH:"manama",OM:"muscat",JO:"amman",LB:"beirut",SY:"damascus",IL:"jerusalem",YE:"sanaa",EG:"cairo",LY:"tripoli",TN:"tunis",DZ:"algiers",MA:"rabat",SD:"khartoum",ET:"addis ababa",KE:"nairobi",TZ:"dodoma",UG:"kampala",NG:"abuja",GH:"accra",CI:"yamoussoukro",SN:"dakar",ML:"bamako",CM:"yaounde",CD:"kinshasa",CG:"brazzaville",AO:"luanda",ZM:"lusaka",ZW:"harare",MZ:"maputo",BW:"gaborone",NA:"windhoek",ZA:"pretoria",AU:"canberra",NZ:"wellington",PG:"port moresby",FJ:"suva",BR:"brasilia",AR:"buenos aires",CL:"santiago",PE:"lima",CO:"bogota",VE:"caracas",EC:"quito",BO:"la paz",PY:"asuncion",UY:"montevideo",GY:"georgetown",SR:"paramaribo",CU:"havana",DO:"santo domingo",HT:"port au prince",JM:"kingston",TT:"port of spain",PA:"panama city",CR:"san jose",NI:"managua",HN:"tegucigalpa",SV:"san salvador",GT:"guatemala city",BZ:"belmopan",AZ:"baku",AM:"yerevan",GE:"tbilisi",KZ:"astana",UZ:"tashkent",TM:"ashgabat",KG:"bishkek",TJ:"dushanbe",MN:"ulaanbaatar",BY:"minsk",MD:"chisinau",AL:"tirana",MK:"skopje",BA:"sarajevo",ME:"podgorica",XK:"pristina",CY:"nicosia",MT:"valletta",LU:"luxembourg"},U=null;function y(){if(U)return U;let n=new Map,e=P,t=(o,i,r)=>{if(!o)return;let a=n.get(o);a?a.some(s=>s.row===i)||a.push({row:i,primary:r}):n.set(o,[{row:i,primary:r}])};for(let o of e.split(",")){let i=o.split("|");if(i.length<7)continue;let r={a1:i[1],cc:i[2],lon:+i[3],lat:+i[4],pop:+i[5],kinds:i[6]||"N"};i.length>8&&i[8]&&(r.tags=i[8].split(";").filter(Boolean));let a=t3[r.cc];if(a&&u(i[0])===a&&(r.tags||(r.tags=[]),r.tags.includes("capital")||r.tags.push("capital")),t(u(i[0]),r,!0),i.length>7&&i[7])for(let s of i[7].split(";"))t(u(s),r,!1)}for(let o of n.values())o.sort((i,r)=>r.row.pop-i.row.pop);return U=n,n}var e3=200,L=null;function i3(){if(L)return L;let n=new Map;for(let[e,t]of y()){if(!e.endsWith(" city"))continue;let o=e.slice(0,-5);!o||y().get(o)?.some(i=>i.primary)||t[0].row.pop<e3||n.set(o,t)}return L=n,n}function O(n){if(!n)return;let e=y().get(n);if(e?.some(i=>i.primary))return e;let t=i3().get(n);if(!t)return e;let o=t.map(i=>({row:i.row,primary:!0}));return e?[...o,...e]:o}var I=null;function o3(){if(I)return I;let n=new Map;for(let t of k.split(",")){let o=t.split("|");o.length<3||n.set(o[0],{lon:+o[1],lat:+o[2]})}let e=new Map;for(let t of y().values())for(let o of t){let i=T(o.row.cc);if(!i)continue;let r=e.get(i);(r===void 0||o.row.pop>r)&&(e.set(i,o.row.pop),n.set(i,{lon:o.row.lon,lat:o.row.lat}))}return I=n,n}var B=null;function D(){if(B)return B;let n=new Map;for(let e of H.split(",")){let t=e.split("|");if(t.length<5)continue;let o={key:t[0],cc:t[1],name:t[2],lon:+t[3],lat:+t[4]};n.set(u(o.key),o);let i=u(o.name);i==="mexico"&&o.cc==="MX"?(n.set("estado de mexico",o),n.set("edomex",o)):n.set(i,o)}return B=n,n}var h=null;function a3(){if(h)return h;let n=new Map;for(let e of X.split(",")){let t=e.split("|");t.length<3||n.set(t[0],{lon:+t[1],lat:+t[2]})}return h=n,n}var r3=new Set(["USA","PRI","VIR","GUM","ASM","MNP"]),s3=new Set(["USA","CAN","MEX"]);function Y(n){if(n==null)return null;let e=u(String(n));return e?D().get(e)?.key??null:null}var l3={us:"US",usa:"US","u s":"US","u s a":"US",america:"US","united states":"US","united states of america":"US",ca:"CA",can:"CA",canada:"CA",mx:"MX",mex:"MX",mexico:"MX","estados unidos mexicanos":"MX"};function I3(n){if(n==null)return null;let e=u(String(n));return e?l3[e]??null:null}function u3(n){return D().get(u(n))?.cc??null}function c3(n){let e=u3(n);return e?T(e):null}function P3(n){return Z(n)[0]??null}function M3(n){if(n==null)return null;let e=String(n).trim().replace(/\.0+$/,"");if(!e)return null;let t=/^(\d{5})(-\d{4})?$/.exec(e);return t?t[1]:/^\d{3,4}$/.test(e)?e.padStart(5,"0"):null}function Z(n){if(n==null)return[];let e=String(n).trim().replace(/\.0+$/,"");if(!e)return[];if(/^\d{3}$/.test(e)){let o=e.padStart(5,"0").slice(0,3);return o===e?[e]:[e,o]}let t=M3(e);return t?[t.slice(0,3)]:[]}function S3(n){return!!n&&n.ambiguous===!0&&!("precision"in n)}function A3(n){let e=null,t=typeof n.lat=="string"?n.lat.trim():n.lat,o=typeof n.lon=="string"?n.lon.trim():n.lon;if(t!=null&&t!==""&&o!==void 0&&o!==null&&o!==""){let a=+t,s=+o;if(isFinite(a)&&isFinite(s)&&a>=-90&&a<=90&&s>=-180&&s<=180)if(a===0&&s===0)e={lat:0,lon:0,precision:"latlon"};else return{lat:a,lon:s,precision:"latlon"}}let i=E(n.country),r=Y(n.state);if(r&&i&&c3(r)!==i&&(r=null),n.city!==void 0&&n.city!==null){let a=u(String(n.city)),s=O(a),f=s?F(s,n.mapKind):null;if(f&&f.length){let d=n.state===void 0||n.state===null?"":String(n.state).trim(),R=d?u(d):"",g=d?Y(d):null,S=[],m=-1;for(let c of f){let l=c.row,A=0;if(d&&l.a1!=="")if(g&&l.a1===g||u(l.a1)===R)A++;else continue;if(i)if(T(l.cc)===i)A++;else continue;A>m?(m=A,S=[c]):A===m&&S.push(c)}S.some(c=>c.primary)&&(S=S.filter(c=>c.primary));let p=new Map;for(let c of S)p.set(c.row.lon.toFixed(2)+","+c.row.lat.toFixed(2),c.row);if(p.size===1){let c=S[0].row;return{lat:c.lat,lon:c.lon,precision:"city"}}if(p.size>1)return{ambiguous:!0,matches:p.size}}}if(!i||r3.has(i))for(let a of Z(n.zip)){let s=a3().get(a);if(s)return{lat:s.lat,lon:s.lon,precision:"zip3"}}if(r){let a=D().get(u(r));if(a)return{lat:a.lat,lon:a.lon,precision:"state"}}if(i&&(n.mapKind!=="north-america"||s3.has(i))){let a=o3().get(i);if(a)return{lat:a.lat,lon:a.lon,precision:"country"}}return e}var G={latlon:0,city:1,zip3:2,state:3,country:4},x=8;function y3(n,e){let t=new Array(n.length),o=new Array(n.length),i=new Array(n.length),r=new Set,a=[],s=new Set,f=[],d=new Set,R=[],g={latlon:0,city:0,zip3:0,state:0,country:0},S=0,m=0,p=null;for(let l=0;l<n.length;++l){let A=n[l],C=A3({...A,mapKind:e});if(S3(C)){t[l]=null,o[l]=null,i[l]=null,m++;let M=K(A);M&&!d.has(M.toLowerCase())&&(d.add(M.toLowerCase()),R.length<x&&R.push(M))}else if(C){if(t[l]=C.lat,o[l]=C.lon,i[l]=C.precision,S++,g[C.precision]++,(p===null||G[C.precision]>G[p])&&(p=C.precision),G[C.precision]>G.city){let M=K(A);M&&!s.has(M.toLowerCase())&&(s.add(M.toLowerCase()),f.length<x&&f.push(M))}}else{t[l]=null,o[l]=null,i[l]=null;let M=K(A);M&&!r.has(M.toLowerCase())&&(r.add(M.toLowerCase()),a.push(M))}}let c=!n3()&&n.some(l=>l.city!==null&&l.city!==void 0&&String(l.city).trim()!=="");return{lat:t,lon:o,precisions:i,precision:p,precisionCounts:g,coarseExamples:f,unmatched:a,ambiguousRows:m,ambiguousExamples:R,matchedRows:S,totalRows:n.length,...c?{cityTableMissing:!0}:{}}}function K(n){let e=[n.city,n.state,n.zip,n.country].filter(t=>t!=null&&String(t).trim()!=="").map(t=>String(t).trim()).join(", ");return e||(n.label===null||n.label===void 0?"":String(n.label).trim())}function b3(n,e){let t=u(String(n??""));if(!t)return[];let o=O(t);if(!o)return[];let i=E(e??null),r=new Set;for(let a of o)if(!(i&&T(a.row.cc)!==i))for(let s of a.row.tags??[])r.add(s);return Array.from(r)}function p3(n,e){if(!n)return!1;let t=O(n);return t?F(t,e).length>0:!1}function E3(n,e){let t=new Set,o=0;for(let i of n){if(i==null)continue;let r=u(String(i));V(r)||t.has(r)||(t.add(r),p3(r,e)&&o++)}return t.size===0?0:Math.round(o/t.size*1e3)/10}export{u as a,N as b,z as c,J as d,j as e,E as f,f3 as g,V as h,m3 as i,L3 as j,n3 as k,s3 as l,Y as m,I3 as n,P3 as o,M3 as p,Z as q,S3 as r,A3 as s,y3 as t,b3 as u,p3 as v,E3 as w};
|
|
2
|
+
import{a as w}from"./chunk-5MRZID36.mjs";var H="AB|CA|Alberta|-113.75|52.18,AK|US|Alaska|-148.32|61.29,AL|US|Alabama|-86.73|33.08,AR|US|Arkansas|-92.85|35.29,AZ|US|Arizona|-111.99|33.32,BC|CA|British Columbia|-122.73|49.27,CA|US|California|-119.21|35.2,CO|US|Colorado|-105|39.63,CT|US|Connecticut|-73.01|41.42,DC|US|District of Columbia|-77.04|38.9,DE|US|Delaware|-75.59|39.57,FL|US|Florida|-81.29|27.53,GA|US|Georgia|-84.02|33.43,HI|US|Hawaii|-157.73|21.26,IA|US|Iowa|-92.79|41.88,ID|US|Idaho|-115.65|44.2,IL|US|Illinois|-88.05|41.67,IN|US|Indiana|-86.27|40.23,KS|US|Kansas|-96|38.59,KY|US|Kentucky|-84.91|38.13,LA|US|Louisiana|-91.28|30.57,MA|US|Massachusetts|-71.28|42.32,MB|CA|Manitoba|-97.3|49.88,MD|US|Maryland|-76.79|39.18,ME|US|Maine|-70.01|43.92,MI|US|Michigan|-83.69|42.56,MN|US|Minnesota|-93.26|44.98,MO|US|Missouri|-92.66|38.73,MS|US|Mississippi|-89.62|32.36,MT|US|Montana|-111.07|46.37,MX01|MX|Aguascalientes|-102.29|21.91,MX02|MX|Baja California|-116.5|32.46,MX03|MX|Baja California Sur|-110.12|23.52,MX04|MX|Campeche|-91.08|19.25,MX05|MX|Chiapas|-92.77|16.28,MX06|MX|Chihuahua|-106.27|30.1,MX07|MX|Coahuila|-101.88|26.32,MX08|MX|Colima|-103.94|19.15,MX09|MX|Mexico City|-99.13|19.41,MX10|MX|Durango|-104.24|24.64,MX11|MX|Guanajuato|-101.37|20.87,MX12|MX|Guerrero|-99.83|17.31,MX13|MX|Hidalgo|-98.81|20.13,MX14|MX|Jalisco|-103.39|20.64,MX15|MX|M\xE9xico|-99.14|19.51,MX16|MX|Michoac\xE1n|-101.68|19.49,MX17|MX|Morelos|-99.15|18.88,MX18|MX|Nayarit|-104.89|21.5,MX19|MX|Nuevo Le\xF3n|-100.26|25.69,MX20|MX|Oaxaca|-96.23|17.05,MX21|MX|Puebla|-98.12|19.07,MX22|MX|Quer\xE9taro|-100.35|20.57,MX23|MX|Quintana Roo|-87.09|20.7,MX24|MX|San Luis Potos\xED|-100.7|22.22,MX25|MX|Sinaloa|-107.49|24.63,MX26|MX|Sonora|-111.05|29.37,MX27|MX|Tabasco|-92.98|17.99,MX28|MX|Tamaulipas|-98.33|24.92,MX29|MX|Tlaxcala|-98.19|19.31,MX30|MX|Veracruz|-96.31|19.2,MX31|MX|Yucat\xE1n|-89.52|20.94,MX32|MX|Zacatecas|-102.7|22.93,NB|CA|New Brunswick|-65.73|45.83,NC|US|North Carolina|-79.61|35.57,ND|US|North Dakota|-98.8|47.31,NE|US|Nebraska|-96.42|41.07,NH|US|New Hampshire|-71.37|43,NJ|US|New Jersey|-74.34|40.51,NL|CA|Newfoundland and Labrador|-52.77|47.55,NM|US|New Mexico|-106.28|34.69,NS|CA|Nova Scotia|-63.11|44.86,NV|US|Nevada|-115.95|36.72,NY|US|New York|-74.13|40.89,OH|US|Ohio|-82.75|40.53,OK|US|Oklahoma|-97.01|35.66,ON|CA|Ontario|-79.27|43.94,OR|US|Oregon|-122.75|44.96,PA|US|Pennsylvania|-76.12|40.23,PE|CA|Prince Edward Island|-63.13|46.23,QC|CA|Quebec|-73.14|45.89,RI|US|Rhode Island|-71.45|41.79,SC|US|South Carolina|-80.69|33.6,SD|US|South Dakota|-98.66|43.89,SK|CA|Saskatchewan|-105.99|51.63,TN|US|Tennessee|-87.53|35.63,TX|US|Texas|-97.51|31.01,UT|US|Utah|-111.96|40.5,VA|US|Virginia|-77.08|37.61,VT|US|Vermont|-73.21|44.48,WA|US|Washington|-121.46|47.29,WI|US|Wisconsin|-88.6|43.36,WV|US|West Virginia|-81.42|38.99,WY|US|Wyoming|-105.54|42.26,YT|CA|Yukon|-135.05|60.72",X="006|-66.84|18.26,007|-66.15|18.15,008|-64.74|17.74,009|-66.12|18.37,010|-72.6|42.26,011|-72.53|42.07,012|-73.21|42.37,013|-72.51|42.58,014|-71.81|42.59,015|-71.85|42.23,016|-71.84|42.28,017|-71.44|42.33,018|-71.21|42.64,019|-70.89|42.66,020|-71.28|42.12,021|-71.05|42.31,022|-71.04|42.35,023|-70.86|41.98,024|-71.22|42.37,025|-70.6|41.71,026|-70.2|41.73,027|-71.07|41.77,028|-71.62|41.69,029|-71.47|41.82,030|-71.51|42.9,031|-71.48|43,032|-71.65|43.57,033|-71.58|43.26,034|-72.19|42.91,035|-71.31|44.69,036|-72.32|43.17,037|-72.13|43.69,038|-71.1|43.56,039|-70.76|43.24,040|-70.6|43.78,041|-70.27|43.7,042|-70.49|44.38,043|-69.75|44.3,044|-68.83|45.45,045|-69.57|43.99,046|-67.8|44.79,047|-68.34|46.55,048|-69.17|44.2,049|-69.97|44.99,050|-72.43|43.85,051|-72.65|43.28,052|-73.14|43.03,053|-72.77|42.94,054|-72.98|44.58,056|-72.6|44.35,057|-73.04|43.69,058|-72.12|44.68,059|-71.7|44.79,060|-72.81|41.88,061|-72.69|41.74,062|-72.12|41.81,063|-72.03|41.5,064|-72.61|41.46,065|-72.94|41.36,066|-73.22|41.24,067|-73.24|41.68,068|-73.42|41.28,069|-73.57|41.14,070|-74.28|40.76,071|-74.2|40.74,072|-74.2|40.68,073|-74.08|40.71,074|-74.4|41.09,075|-74.17|40.92,076|-74.01|40.94,077|-74.17|40.28,078|-74.81|40.97,079|-74.55|40.74,080|-74.98|39.78,081|-75.07|39.94,082|-74.68|39.32,083|-75.04|39.45,084|-74.48|39.35,085|-74.62|40.25,086|-74.68|40.23,087|-74.22|39.96,088|-74.72|40.54,089|-74.48|40.45,100|-73.96|40.77,101|-73.95|40.78,102|-74.02|40.72,103|-74.15|40.58,104|-73.85|40.9,105|-73.75|41.27,106|-73.74|41.02,107|-73.84|40.96,108|-73.8|40.95,109|-74.27|41.3,110|-73.69|40.74,111|-73.93|40.76,112|-73.94|40.66,113|-73.84|40.73,114|-73.77|40.69,115|-73.62|40.71,116|-73.88|40.57,117|-73.23|40.82,118|-73.5|40.77,119|-72.53|40.95,120|-74.22|42.92,121|-74.4|43.46,122|-73.81|42.7,123|-73.96|42.82,124|-74.27|42.09,125|-73.7|41.89,126|-73.88|41.69,127|-74.75|41.74,128|-73.91|43.61,129|-74.03|44.53,130|-76.16|43.08,131|-76.46|43.27,132|-76.2|43.03,133|-75.07|43.45,134|-75.35|43.03,135|-75.15|43.14,136|-75.39|44.33,137|-75.2|42.21,138|-75.46|42.43,139|-75.88|42.12,140|-78.48|43.01,141|-78.7|42.49,142|-78.8|42.91,143|-78.96|43.12,144|-77.71|42.96,145|-77.17|43.14,146|-77.65|43.17,147|-78.84|42.21,148|-77.18|42.29,149|-76.78|42.09,150|-80.23|40.56,151|-80.18|40.53,152|-79.97|40.46,153|-80.24|40.01,154|-79.65|39.92,155|-78.8|39.95,156|-79.47|40.33,157|-79.02|40.71,158|-78.66|41.32,159|-78.84|40.35,160|-79.88|40.93,161|-80.3|41.19,162|-79.35|41.08,163|-79.58|41.59,164|-80|41.87,165|-80.04|42.1,166|-78.28|40.48,167|-78.47|41.76,168|-78|40.97,169|-77.37|41.8,170|-77.29|40.44,171|-76.78|40.33,172|-77.81|39.98,173|-76.93|39.89,174|-76.72|39.97,175|-76.24|40.05,176|-76.34|40.05,177|-77.22|41.34,178|-76.77|40.93,179|-76.27|40.69,180|-75.45|40.67,181|-75.47|40.6,182|-75.88|40.9,183|-75.19|41.12,184|-75.38|41.53,185|-75.68|41.37,186|-76.17|41.4,187|-75.86|41.22,188|-76.12|41.82,189|-75.14|40.36,190|-75.37|39.97,191|-75.15|40.01,193|-75.78|39.92,194|-75.46|40.19,195|-75.9|40.42,196|-75.95|40.34,197|-75.68|39.53,198|-75.58|39.77,199|-75.46|38.83,200|-77.02|38.9,201|-77.68|38.9,202|-77.03|38.89,203|-77.01|38.86,204|-77.05|38.89,205|-77.01|38.87,206|-76.76|38.45,207|-76.78|38.88,208|-77.23|39.15,209|-76.99|39.05,210|-76.32|39.53,211|-76.73|39.58,212|-76.58|39.31,214|-76.55|39,215|-79.08|39.56,216|-76.02|38.86,217|-77.5|39.52,218|-75.57|38.27,219|-75.94|39.57,220|-77.25|38.78,221|-77.25|38.92,222|-77.11|38.88,223|-77.13|38.79,224|-77.25|38.22,225|-77.51|38.09,226|-78.25|39.03,227|-78.05|38.49,228|-78.79|38.57,229|-78.55|38.02,230|-78.09|37.66,231|-76.96|37.55,232|-77.46|37.51,233|-76.3|36.68,234|-76.66|36.77,235|-76.26|36.87,236|-76.44|37.12,237|-76.38|36.85,238|-77.41|36.94,239|-78.39|37.03,240|-80.1|37.23,241|-79.89|36.9,242|-82.49|36.83,243|-81.13|36.86,244|-79.51|38.05,245|-79.11|37.15,246|-81.8|37.19,247|-81.14|37.39,248|-81.64|37.47,249|-80.32|37.95,250|-81.45|38.27,251|-81.89|38.64,252|-81.45|38.77,253|-81.64|38.42,254|-78.11|39.45,255|-82.19|38.25,256|-82.08|37.76,257|-82.41|38.4,258|-81.21|37.72,259|-80.89|37.83,260|-80.63|40.05,261|-81.27|39.2,262|-80.02|38.75,263|-80.23|39.27,264|-80.65|39.21,265|-80.05|39.59,266|-80.8|38.48,267|-78.98|39.33,268|-79.12|38.88,270|-80.45|36.24,271|-80.24|36.06,272|-79.82|35.86,273|-79.52|35.55,274|-79.81|36.09,275|-78.54|35.93,276|-78.65|35.81,277|-78.9|35.99,278|-77.32|35.88,279|-76.5|36.19,280|-81.2|35.4,281|-80.41|35.21,282|-80.83|35.22,283|-78.94|34.96,284|-78.23|34.39,285|-77.23|35.06,286|-81.36|36.06,287|-82.78|35.51,288|-82.55|35.6,289|-83.97|35.11,290|-80.88|34.19,291|-80.62|33.71,292|-80.96|34.04,293|-81.86|34.78,294|-80.08|33.05,295|-79.49|34.07,296|-82.57|34.61,297|-80.92|34.83,298|-81.74|33.51,299|-80.96|32.55,300|-84.08|33.85,301|-84.91|34.04,302|-84.55|33.25,303|-84.42|33.77,304|-82.11|32.48,305|-83.81|34.58,306|-83.14|33.86,307|-85.1|34.71,308|-82.34|33.35,309|-82.01|33.4,310|-83.42|32.64,312|-83.64|32.83,313|-81.49|31.68,314|-81.15|32.03,315|-82.21|31.4,316|-83.21|31.02,317|-83.87|31.48,318|-84.69|32.45,319|-84.95|32.47,320|-82.58|30.27,321|-81.48|29.39,322|-81.69|30.3,323|-84.25|30.29,324|-85.58|30.55,325|-87.03|30.76,326|-82.6|29.58,327|-81.28|28.79,328|-81.32|28.47,329|-80.67|27.96,330|-80.58|25.31,331|-80.38|25.74,333|-80.25|26.13,334|-81.01|26.64,335|-82.22|28.19,336|-82.47|28.01,337|-82.73|27.85,338|-81.64|27.72,339|-81.71|26.77,341|-81.32|26.11,342|-82.16|27.29,344|-82.35|29.01,346|-82.52|28.41,347|-81.4|28.29,349|-80.72|27.34,350|-86.8|34.05,351|-86.38|33.43,352|-86.77|33.5,354|-87.86|33.07,355|-87.71|33.96,356|-87.4|34.67,357|-86.26|34.75,358|-86.59|34.69,359|-85.94|34.27,360|-86.09|32.09,361|-86.27|32.31,362|-85.65|33.53,363|-85.56|31.34,364|-86.97|31.38,365|-88.14|31.32,366|-88.19|30.68,367|-87.34|32.33,368|-85.41|32.61,369|-88.25|32.12,370|-87.02|36.12,371|-86.23|35.75,372|-86.83|36.15,373|-85.36|35.32,374|-85.33|35.06,376|-82.3|36.36,377|-84.31|36.27,378|-83.35|36.3,379|-83.97|35.97,380|-89.43|35.55,381|-89.96|35.1,382|-88.68|36.29,383|-88.5|35.61,384|-87.36|35.34,385|-85.34|36.18,386|-89.76|34.57,387|-90.81|33.54,388|-88.63|34.36,389|-89.9|33.77,390|-90|32.53,391|-90.67|32.51,392|-90.22|32.32,393|-88.8|32.42,394|-89.26|31.23,395|-89|30.59,396|-90.67|31.32,397|-88.87|33.53,398|-84.67|31.32,400|-85.29|38.07,401|-86.2|37.85,402|-85.66|38.19,403|-84.2|38.06,404|-84.42|37.53,405|-84.45|38.04,406|-84.87|38.22,407|-84.12|36.95,408|-83.26|36.9,409|-83.74|36.95,410|-84.32|38.64,411|-83.06|38.38,412|-82.67|37.89,413|-83.48|37.58,414|-83.15|37.84,415|-82.39|37.46,416|-82.78|37.54,417|-83.25|37.23,418|-82.88|37.21,420|-88.57|36.9,421|-86.09|36.89,422|-87.11|36.95,423|-87.02|37.52,424|-87.7|37.47,425|-84.71|37.15,426|-84.82|36.81,427|-85.73|37.32,430|-82.9|40.21,431|-82.99|39.69,432|-82.97|39.98,433|-83.38|40.55,434|-83.3|41.42,435|-84.22|41.46,436|-83.54|41.67,437|-81.66|39.85,438|-81.88|40.27,439|-80.9|40.25,440|-80.97|41.64,441|-81.66|41.42,442|-81.6|41.13,443|-81.54|41.07,444|-80.77|41.09,445|-80.64|41.05,446|-81.53|40.65,447|-81.39|40.83,448|-82.77|41.02,449|-82.55|40.74,450|-84.48|39.43,451|-83.84|39.16,452|-84.48|39.18,453|-84.3|39.97,454|-84.18|39.74,455|-83.81|39.94,456|-82.86|38.99,457|-81.78|39.35,458|-84.23|40.83,460|-86.13|40.17,461|-86.18|39.62,462|-86.14|39.79,463|-87.05|41.41,464|-87.34|41.55,465|-86.08|41.44,466|-86.28|41.66,467|-85.21|41.17,468|-85.17|41.09,469|-86.14|40.76,470|-85.08|39.16,471|-86.02|38.43,472|-85.74|39.05,473|-85.15|40.09,474|-86.63|38.99,475|-87.03|38.46,476|-87.53|38.13,477|-87.58|38.03,478|-87.29|39.45,479|-87.11|40.5,480|-82.79|42.83,481|-83.62|42.2,482|-83.1|42.38,483|-83.35|42.66,484|-83.22|43.29,485|-83.69|43.03,486|-84.36|43.99,487|-83.67|44.45,488|-84.67|43.02,489|-84.59|42.74,490|-85.54|42.2,491|-86.36|41.87,492|-84.36|42.06,493|-85.57|43.33,494|-86.14|43.39,495|-85.66|42.96,496|-85.52|44.44,497|-84.37|45.17,498|-86.94|46.17,499|-88.93|46.6,500|-94.77|41.63,501|-92.79|41.84,502|-93.67|42.12,503|-93.63|41.59,504|-93.37|43.17,505|-94.45|42.77,506|-92.45|42.65,507|-92.31|42.49,508|-94.56|40.96,510|-95.91|42.6,511|-96.39|42.52,512|-96.06|43.28,513|-95.16|43.27,514|-95.08|42.11,515|-95.55|41.44,516|-95.37|40.74,520|-90.98|42.46,521|-91.73|43.2,522|-92.31|41.9,523|-91.66|41.87,524|-91.69|41.96,525|-92.46|40.95,526|-91.44|40.88,527|-90.88|41.64,528|-90.61|41.56,530|-88.24|43.51,531|-88.33|42.75,532|-87.98|43.06,534|-87.86|42.74,535|-89.66|42.95,537|-89.38|43.08,538|-90.73|42.88,539|-89.55|43.64,540|-92.46|45.08,541|-88.23|45.09,542|-87.6|44.52,543|-88.01|44.53,544|-89.85|44.93,545|-89.86|45.89,546|-90.87|43.93,547|-91.52|44.85,548|-91.63|46.04,549|-88.96|44.19,550|-92.98|45.17,551|-93.08|44.96,553|-94.06|44.99,554|-93.31|45.01,556|-91.03|47.67,557|-92.68|47.39,558|-92.08|46.96,559|-92.28|43.89,560|-94.04|44.02,561|-95.65|43.92,562|-95.75|45.08,563|-94.59|45.83,564|-94.5|46.63,565|-96.08|46.86,566|-94.31|47.88,567|-96.22|48.39,570|-97.07|43.48,571|-96.76|43.54,572|-97.18|45.04,573|-98.53|43.91,574|-98.93|45.36,575|-100.61|43.86,576|-101.59|45.43,577|-103.11|44.26,580|-97.39|46.66,581|-96.83|46.86,582|-97.72|48.25,583|-99.34|48.32,584|-99.12|46.88,585|-100.98|46.76,586|-102.99|46.75,587|-101.7|48.34,588|-103.48|48.2,590|-108.62|45.98,591|-108.45|45.69,592|-105.6|48.2,593|-105.58|46.4,594|-111.24|47.79,595|-109.12|48.38,596|-111.74|46.65,597|-112.31|45.48,598|-114.25|46.97,599|-114.57|48.37,600|-88.15|42.29,601|-88.47|42.01,602|-87.69|42.04,603|-87.79|41.89,604|-88.09|41.39,605|-88.55|41.69,606|-87.69|41.83,607|-87.82|42.03,608|-87.76|41.84,609|-87.92|40.8,610|-89.56|42.18,611|-89.08|42.28,612|-90.29|41.5,613|-89.16|41.34,614|-90.43|40.82,615|-89.68|40.71,616|-89.61|40.72,617|-88.89|40.52,618|-88.15|40.11,619|-88.19|39.66,620|-90.01|39.13,622|-89.72|38.41,623|-91.02|39.99,624|-88.19|39.04,625|-89.21|39.63,626|-90|39.86,627|-89.66|39.8,628|-88.65|38.35,629|-88.89|37.55,630|-90.83|38.35,631|-90.32|38.64,633|-91.11|39.02,634|-91.78|39.93,635|-92.61|40.2,636|-90.64|37.61,637|-89.81|37.37,638|-89.73|36.55,639|-90.62|36.84,640|-94.1|39.07,641|-94.58|39.14,644|-94.69|40.13,645|-94.83|39.75,646|-93.55|39.89,647|-94.15|38.06,648|-94.35|36.93,650|-92.23|38.45,651|-92.19|38.51,652|-92.38|39.21,653|-93.26|38.71,654|-92.03|37.93,655|-91.92|37.67,656|-93.08|36.76,657|-92.43|37.03,658|-93.3|37.22,660|-95.12|38.84,661|-94.73|39.11,662|-94.72|38.95,664|-96.15|39.64,665|-96.34|39.4,666|-95.76|39.06,667|-95.23|37.64,668|-96.39|38.36,669|-97.86|39.77,670|-98.49|37.33,671|-98.4|37.44,672|-97.33|37.7,673|-95.81|37.23,674|-97.79|38.98,675|-98.99|38.25,676|-99.47|39.34,677|-101.15|39.35,678|-100.82|37.91,679|-101.43|37.18,680|-96.46|41.55,681|-96.05|41.24,683|-96.93|40.39,684|-97.26|40.89,685|-96.69|40.82,686|-97.68|41.55,687|-98.16|42.43,688|-99.15|41.34,689|-98.9|40.34,690|-100.99|40.37,691|-101.59|41.42,692|-100.64|42.67,693|-102.84|42.29,700|-89.93|29.63,701|-89.93|30.02,703|-90.65|29.62,704|-90.27|30.66,705|-92.25|30.2,706|-93.21|30.34,707|-91.2|30.57,708|-91.1|30.45,710|-93.4|32.45,711|-93.75|32.47,712|-91.95|32.56,713|-91.86|31.43,714|-92.84|31.57,716|-91.75|33.61,717|-92.79|33.48,718|-93.84|33.66,719|-93.61|34.4,720|-91.9|34.92,721|-92.56|34.93,722|-92.37|34.7,723|-90.59|35.07,724|-90.76|36.04,725|-91.81|36.01,726|-92.93|36.15,727|-94.05|36.11,728|-93.33|35.3,729|-94.08|35.29,730|-97.83|35.31,731|-97.5|35.43,734|-97.14|34.21,735|-98.81|34.53,736|-99.33|35.52,737|-98.2|36.42,738|-99.54|36.5,739|-101.67|36.74,740|-96.19|36.34,741|-95.96|36.15,743|-95.02|36.55,744|-95.44|35.64,745|-95.65|34.66,746|-97.05|36.71,747|-95.41|34.02,748|-96.66|35.17,749|-94.69|35.23,750|-96.76|33.06,751|-96.32|32.48,752|-96.78|32.79,753|-96.84|32.81,754|-95.67|33.37,755|-94.45|33.3,756|-94.58|32.49,757|-95.37|32.24,758|-95.68|31.44,759|-94.29|31.29,760|-97.54|32.59,761|-97.38|32.77,762|-97.44|33.52,763|-98.87|33.73,764|-98.59|32.61,765|-97.62|31.11,766|-97.06|31.7,767|-97.15|31.57,768|-99.37|31.23,769|-100.88|31.03,770|-95.39|29.79,772|-95.37|29.77,773|-95.24|30.48,774|-96.02|29.38,775|-94.98|29.68,776|-94.16|30.27,777|-94.19|29.96,778|-96.32|30.67,779|-96.95|28.92,780|-99.01|28.67,781|-97.93|29.08,782|-98.53|29.47,783|-98.14|27.63,784|-97.44|27.73,785|-98.19|26.39,786|-98.1|30.27,787|-97.78|30.3,788|-100.26|29.44,789|-96.87|29.92,790|-101.63|35.48,791|-101.85|35.21,792|-100.57|34.25,793|-102.15|33.37,794|-101.88|33.58,795|-100.31|32.7,796|-99.72|32.46,797|-102.22|31.57,798|-104.17|30.53,799|-106.16|31.8,800|-105.11|39.91,801|-104.47|39.51,802|-104.93|39.78,803|-105.31|40.04,804|-106.16|39.98,805|-105.35|40.57,806|-104.49|40.38,807|-103.09|40.4,808|-103.16|39.12,809|-104.67|38.79,810|-103.58|37.77,811|-106.39|37.54,812|-106.39|38.46,813|-108.42|37.49,814|-108.02|38.43,815|-108.7|38.92,816|-107.86|39.99,820|-105.27|41.31,821|-110.51|44.57,822|-104.67|42.39,823|-107.03|41.75,824|-108.65|44.32,825|-108.91|43.14,826|-106.43|43.1,827|-105|44.2,828|-106.71|44.55,829|-109.71|42.82,830|-110.51|43.7,831|-110.53|42.6,832|-112.17|42.66,833|-114.23|42.81,834|-111.63|43.86,835|-115.77|46.07,836|-115.99|44,837|-116.04|43.58,838|-116.47|47.77,840|-110.86|40.53,841|-111.81|40.71,843|-112.18|41.67,844|-112.01|41.23,845|-109.72|38.09,846|-111.68|39.63,847|-112.82|37.61,850|-112.09|33.63,851|-111.41|33,852|-111.69|33.6,853|-113.44|33.49,855|-110.3|33.43,856|-110.59|32,857|-111.09|32.18,859|-109.81|34.23,860|-111.15|35.89,863|-112.57|34.85,864|-113.79|35.66,865|-109.55|36.03,870|-106.9|35.22,871|-106.72|35.12,873|-108.56|35.44,874|-108.23|36.59,875|-106.04|36.27,877|-104.68|36.06,878|-107.94|34,879|-107.48|33.2,880|-108.03|32.37,881|-103.81|34.26,882|-104.07|32.87,883|-105.48|33.62,884|-103.79|35.74,890|-114.84|37,891|-115.42|36.33,893|-116.96|39.5,894|-118.06|41.29,895|-119.72|39.9,897|-119.8|39.18,898|-115.71|40.95,900|-118.32|34.04,902|-118.76|34.07,903|-118.34|33.95,904|-118.48|34.02,905|-118.33|33.83,906|-118.03|33.93,907|-118.45|33.39,908|-118.18|33.8,910|-118.25|34.28,911|-118.13|34.15,912|-118.25|34.19,913|-118.55|34.36,914|-118.47|34.18,915|-118.33|34.19,916|-118.38|34.18,917|-117.78|34.14,918|-118.13|34.09,919|-116.62|32.73,920|-116.7|33.16,921|-117.14|32.85,922|-115.5|33.59,923|-117.14|34.66,924|-117.33|34.17,925|-117.06|33.68,926|-117.73|33.63,927|-117.85|33.74,928|-117.71|33.85,930|-119.12|34.39,931|-119.97|34.48,932|-119.07|35.98,933|-119.01|35.35,934|-120.5|35.38,935|-118.36|37.37,936|-119.72|36.95,937|-119.85|36.71,939|-121.42|36.34,940|-122.31|37.41,941|-122.44|37.77,943|-122.13|37.44,944|-122.32|37.53,945|-122.05|38.09,946|-122.19|37.78,947|-122.26|37.89,948|-122.3|37.97,949|-122.74|38.14,950|-121.42|36.85,951|-121.76|37.33,952|-120.79|38.14,953|-120.56|37.62,954|-123.15|39.08,955|-123.75|40.5,956|-121.34|38.62,957|-120.86|39.13,958|-121.44|38.58,959|-121.73|39.47,960|-122.42|41.06,961|-120.33|40.52,967|-155.53|19.6,968|-157.83|21.34,969|144.77|13.45,970|-121.45|45.3,971|-123.79|45.64,972|-122.74|45.57,973|-123.26|44.68,974|-123.46|43.61,975|-123.06|42.34,976|-120.4|42.67,977|-120.77|44.32,978|-118.59|45.21,979|-117.63|43.34,980|-121.78|47.42,981|-122.32|47.6,982|-121.79|48.39,983|-123.87|47.96,984|-122.46|47.18,985|-123.27|46.94,986|-122.15|45.99,988|-119.91|48,989|-120.57|46.71,990|-117.56|47.62,991|-118.13|47.91,992|-117.4|47.67,993|-118.82|46.4,994|-117.21|46.2,995|-156.93|60.89,996|-151.66|60.82,997|-146.69|65.19,998|-136.2|58.94,999|-131.24|55.86",k="ABW|-70.02|12.54,AFG|68|34.63,AGO|14.24|-9.84,AIA|-63.06|18.22,ALA|19.93|60.1,ALB|19.81|41.14,AND|1.53|42.51,ARE|55.24|24.99,ARG|-61.28|-32.95,ARM|44.52|40.23,ASM|-170.7|-14.28,ATA|21.28|-80.52,ATF|70.22|-49.35,ATG|-61.84|17.12,AUS|144.91|-33.49,AUT|15.51|47.93,AZE|49.02|40.37,BDI|29.49|-3.34,BEL|4.37|50.89,BEN|2.33|7.65,BES|-68.27|12.15,BFA|-2.08|12.15,BGD|90.42|23.65,BGR|24.92|42.71,BHR|50.57|26.18,BHS|-77.34|25.06,BIH|17.97|44.18,BLM|-62.85|17.9,BLR|27.81|53.57,BLZ|-88.41|17.54,BMU|-64.78|32.29,BOL|-65.79|-17.39,BRA|-45.89|-17.51,BRB|-59.62|13.11,BRN|114.74|4.82,BTN|89.69|27.32,BWA|25.99|-23.43,CAF|18.32|4.94,CAN|-79.4|43.71,CCK|96.82|-12.16,CHE|7.96|47.07,CHL|-71.21|-33.72,CHN|114.44|32,CIV|-4.89|6.16,CMR|11.19|5.41,COD|20.23|-4.72,COG|14.18|-4.04,COK|-159.78|-21.21,COL|-74.85|5.93,COM|43.58|-11.89,CPV|-23.87|15.66,CRI|-84.14|9.99,CUB|-80.25|22.21,CUW|-68.88|12.12,CXR|105.68|-10.42,CYM|-81.38|19.32,CYP|33.31|35,CZE|15.44|49.89,DEU|9.65|51.24,DJI|43.15|11.59,DMA|-61.39|15.3,DNK|11.42|55.79,DOM|-70.07|18.75,DZA|3.55|35.62,ECU|-79.29|-1.4,EGY|31.22|29.84,ERI|38.84|15.25,ESH|-13.19|27.14,ESP|-2.91|39.69,EST|25.17|59.29,ETH|39.02|9.26,FIN|24.87|61.26,FJI|178.2|-17.85,FLK|-57.86|-51.69,FRA|2.87|47.28,FRO|-6.77|62.01,FSM|158.16|6.92,GAB|10.22|-0.06,GBR|-1.37|52.49,GEO|43.92|41.84,GGY|-2.54|49.46,GHA|-0.98|6.4,GIB|-5.35|36.14,GIN|-12.8|9.75,GLP|-61.53|16.23,GMB|-16.59|13.41,GNB|-15.48|11.9,GNQ|9.77|1.86,GRC|23.73|37.98,GRD|-61.75|12.05,GRL|-51.72|64.18,GTM|-90.71|14.73,GUF|-52.64|5.04,GUM|144.82|13.5,GUY|-58.11|6.63,HKG|114.15|22.33,HMD|73.5|-53.1,HND|-87.41|14.94,HRV|16.21|45.31,HTI|-72.34|18.54,HUN|19.21|47.39,IDN|106.85|-6.21,IMN|-4.48|54.15,IND|78.36|21,IOT|71.35|-6.19,IRL|-6.87|53.12,IRN|51.6|34.4,IRQ|44.78|33.65,ISL|-21.7|64.22,ISR|34.97|32.07,ITA|12|42.73,JAM|-76.91|18.03,JEY|-2.1|49.19,JOR|35.96|32.03,JPN|137.27|35.53,KAZ|70.17|47.24,KEN|36.81|-0.97,KGZ|73.96|41.94,KHM|104.7|11.75,KIR|172.98|1.33,KNA|-62.72|17.3,KOR|127.51|36.58,KWT|48.06|29.2,Kosovo|20.9|42.58,LAO|102.6|17.97,LBN|35.53|33.87,LBR|-10.39|6.36,LBY|13.19|32.89,LCA|-60.97|14.04,LIE|9.52|47.14,LKA|80.25|7.25,LSO|27.67|-29.38,LTU|24.18|55.04,LUX|6.08|49.56,LVA|24.13|56.85,MAC|113.55|22.19,MAF|-63.08|18.07,MAR|-6.65|33.43,MCO|7.42|43.74,MDA|28.82|47.09,MDG|47.46|-18.89,MDV|73.51|4.18,MEX|-100.65|21.59,MHL|171.38|7.09,MKD|21.47|41.8,MLI|-7.15|12.95,MLT|14.46|35.91,MMR|96.18|18.74,MNE|19.17|42.53,MNG|105.33|47.94,MNP|145.75|15.21,MOZ|32.58|-25.97,MRT|-14.58|18.01,MSR|-62.21|16.79,MTQ|-61.01|14.64,MUS|57.51|-20.23,MWI|34.34|-14.24,MYS|103.35|3.45,MYT|45.23|-12.77,N. Cyprus|33.56|35.27,NAM|17.19|-21.34,NCL|166.47|-22.26,NER|5.05|14.04,NFK|167.97|-29.05,NGA|5.91|7.87,NIC|-86.17|12.33,NIU|-169.92|-19.05,NLD|5.21|52.09,NOR|9.62|60.46,NPL|84.7|27.64,NRU|166.93|-0.55,NZL|174.54|-38.9,OMN|57.69|23.27,PAK|71.47|30.24,PAN|-79.83|8.98,PCN|-130.1|-25.07,PER|-76.4|-11.18,PHL|121.05|14.65,PLW|134.58|7.52,PNG|147.4|-7.71,POL|19.26|51.79,PRI|-66.24|18.35,PRK|126.54|39.52,PRT|-9.08|39.42,PRY|-57.15|-25.27,PSE|35.23|31.78,PYF|-149.59|-17.57,QAT|51.49|25.32,REU|55.45|-21.08,ROU|25.47|45.38,RUS|51.84|54.52,RWA|29.78|-1.98,SAU|43.01|23.76,SDN|31.67|14.67,SEN|-16.73|14.66,SGP|103.85|1.33,SGS|-36.51|-54.28,SHN|-5.72|-15.92,SJM|15.65|78.22,SLB|159.97|-9.44,SLE|-12.4|8.36,SLV|-89.08|13.7,SMR|12.45|43.94,SOM|44.96|4.91,SPM|-56.18|46.78,SRB|20.62|44.5,SSD|29.91|6.61,STP|6.73|0.34,SUR|-55.18|5.84,SVK|18.69|48.55,SVN|14.83|46.16,SWE|16.03|58.86,SWZ|31.28|-26.43,SXM|-63.05|18.03,SYC|55.46|-4.62,SYR|37.18|35.12,Somaliland|46.23|9.76,TCA|-72.1|21.74,TCD|16.57|11.53,TGO|1.16|6.8,THA|100.71|13.71,TJK|69.39|39.08,TKM|59.4|38.74,TLS|125.65|-8.67,TON|-175.2|-21.14,TTO|-61.4|10.5,TUN|10.23|35.87,TUR|32.1|39.5,TUV|179.19|-8.52,TWN|121.06|24.37,TZA|36.11|-5.88,UGA|32.23|0.59,UKR|32.8|48.99,URY|-56.28|-34.1,USA|-93.51|37.4,UZB|69.22|41.26,VAT|12.45|41.9,VCT|-61.21|13.14,VEN|-67.82|9.83,VGB|-64.62|18.43,VIR|-64.8|17.9,VNM|106.63|10.82,VUT|168.31|-17.74,WLF|-176.17|-13.28,WSM|-171.77|-13.83,YEM|44.62|14.36,ZAF|26.96|-28.33,ZMB|28.41|-13.86,ZWE|30.49|-18.56";var W={\u00F8:"o",\u0153:"oe",\u00E6:"ae",\u00DF:"ss",\u0142:"l",\u0111:"d",\u00F0:"d",\u00FE:"th",\u0131:"i",\u0127:"h",\u0167:"t",\u014B:"n",\u0138:"k",\u0259:"e",\u01DD:"e",\u0133:"ij",\u0140:"l",\u017F:"s"};function u(n){return n.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase().replace(/[øœæßłđðþıħŧŋəĸ]/g,e=>W[e]).replace(/[^\p{L}\p{Nd}\s]/gu," ").replace(/\s+/g," ").trim()}var _="AD AND,AE ARE,AF AFG,AG ATG,AI AIA,AL ALB,AM ARM,AO AGO,AQ ATA,AR ARG,AS ASM,AT AUT,AU AUS,AW ABW,AX ALA,AZ AZE,BA BIH,BB BRB,BD BGD,BE BEL,BF BFA,BG BGR,BH BHR,BI BDI,BJ BEN,BL BLM,BM BMU,BN BRN,BO BOL,BQ BES,BR BRA,BS BHS,BT BTN,BV BVT,BW BWA,BY BLR,BZ BLZ,CA CAN,CC CCK,CD COD,CF CAF,CG COG,CH CHE,CI CIV,CK COK,CL CHL,CM CMR,CN CHN,CO COL,CR CRI,CU CUB,CV CPV,CW CUW,CX CXR,CY CYP,CZ CZE,DE DEU,DJ DJI,DK DNK,DM DMA,DO DOM,DZ DZA,EC ECU,EE EST,EG EGY,EH ESH,ER ERI,ES ESP,ET ETH,FI FIN,FJ FJI,FK FLK,FM FSM,FO FRO,FR FRA,GA GAB,GB GBR,GD GRD,GE GEO,GF GUF,GG GGY,GH GHA,GI GIB,GL GRL,GM GMB,GN GIN,GP GLP,GQ GNQ,GR GRC,GS SGS,GT GTM,GU GUM,GW GNB,GY GUY,HK HKG,HM HMD,HN HND,HR HRV,HT HTI,HU HUN,ID IDN,IE IRL,IL ISR,IM IMN,IN IND,IO IOT,IQ IRQ,IR IRN,IS ISL,IT ITA,JE JEY,JM JAM,JO JOR,JP JPN,KE KEN,KG KGZ,KH KHM,KI KIR,KM COM,KN KNA,KP PRK,KR KOR,KW KWT,KY CYM,KZ KAZ,LA LAO,LB LBN,LC LCA,LI LIE,LK LKA,LR LBR,LS LSO,LT LTU,LU LUX,LV LVA,LY LBY,MA MAR,MC MCO,MD MDA,ME MNE,MF MAF,MG MDG,MH MHL,MK MKD,ML MLI,MM MMR,MN MNG,MO MAC,MP MNP,MQ MTQ,MR MRT,MS MSR,MT MLT,MU MUS,MV MDV,MW MWI,MX MEX,MY MYS,MZ MOZ,NA NAM,NC NCL,NE NER,NF NFK,NG NGA,NI NIC,NL NLD,NO NOR,NP NPL,NR NRU,NU NIU,NZ NZL,OM OMN,PA PAN,PE PER,PF PYF,PG PNG,PH PHL,PK PAK,PL POL,PM SPM,PN PCN,PR PRI,PS PSE,PT PRT,PW PLW,PY PRY,QA QAT,RE REU,RO ROU,RS SRB,RU RUS,RW RWA,SA SAU,SB SLB,SC SYC,SD SDN,SE SWE,SG SGP,SH SHN,SI SVN,SJ SJM,SK SVK,SL SLE,SM SMR,SN SEN,SO SOM,SR SUR,SS SSD,ST STP,SV SLV,SX SXM,SY SYR,SZ SWZ,TC TCA,TD TCD,TF ATF,TG TGO,TH THA,TJ TJK,TK TKL,TL TLS,TM TKM,TN TUN,TO TON,TR TUR,TT TTO,TV TUV,TW TWN,TZ TZA,UA UKR,UG UGA,UM UMI,US USA,UY URY,UZ UZB,VA VAT,VC VCT,VE VEN,VG VGB,VI VIR,VN VNM,VU VUT,WF WLF,WS WSM,YE YEM,YT MYT,ZA ZAF,ZM ZMB,ZW ZWE",N=(()=>{let n=new Map;for(let e of _.split(",")){let[t,o]=e.split(" ");t&&o&&n.set(t,o)}return n})(),z=new Set(N.keys()),J=new Set(N.values()),v=["en","fr","es","de","it","pt","ru","ja","zh","ko","ar","hi","tr","pl","he","nl","sv","fi","nb","da","cs","el","uk","ro","id","vi","th","sk","hu","hr"],Q={usa:"USA","u.s.":"USA","u.s.a.":"USA",us:"USA",america:"USA","united states of america":"USA","the united states":"USA",uk:"GBR","u.k.":"GBR","great britain":"GBR",britain:"GBR",england:"GBR","south korea":"KOR","north korea":"PRK",korea:"KOR","ivory coast":"CIV","cote d ivoire":"CIV",vietnam:"VNM",laos:"LAO",syria:"SYR",iran:"IRN",russia:"RUS",moldova:"MDA",tanzania:"TZA",bolivia:"BOL",venezuela:"VEN",brunei:"BRN","czech republic":"CZE",czechia:"CZE",slovakia:"SVK",uae:"ARE","united arab emirates":"ARE",drc:"COD","dr congo":"COD","democratic republic of the congo":"COD","republic of the congo":"COG",congo:"COG",swaziland:"SWZ",eswatini:"SWZ","cape verde":"CPV","cabo verde":"CPV",burma:"MMR",myanmar:"MMR",holland:"NLD","the netherlands":"NLD",netherlands:"NLD",vatican:"VAT","vatican city":"VAT",palestine:"PSE",macau:"MAC",macao:"MAC","hong kong":"HKG",taiwan:"TWN",turkey:"TUR",turkiye:"TUR",macedonia:"MKD","north macedonia":"MKD",gambia:"GMB","the gambia":"GMB",bahamas:"BHS","the bahamas":"BHS","east timor":"TLS","timor leste":"TLS"},b=null;function j(){if(b)return b;let n=new Map,e=["en",...v.filter(t=>t!=="en")];for(let t of e){let o=null;try{o=new Intl.DisplayNames([t],{type:"region"})}catch{continue}for(let[i,r]of N){let a;try{a=o.of(i)}catch{a=void 0}if(!a||a===i)continue;let s=u(a);s&&!n.has(s)&&n.set(s,r)}}for(let[t,o]of Object.entries(Q)){let i=u(t);i&&n.set(i,o)}return b=n,n}function T(n){return N.get(String(n||"").trim().toUpperCase())??null}function E(n){if(n==null)return null;let e=String(n).trim();if(!e)return null;let t=e.toUpperCase();return t.length===3&&J.has(t)?t:t.length===2&&z.has(t)?N.get(t)??null:j().get(u(e))??null}var f3=95,$=new Set(["n a","none","null","nil","unknown","not applicable","not available","not specified","unspecified","missing","blank","empty","tbd","to be determined"]);function V(n){return n?$.has(n):!0}var m3=80;var q={"north-america":"N",world:"W"};function F(n,e){let t=n.filter(o=>o.row.kinds.includes(q[e||"north-america"]));return t.length?t:(e||"north-america")==="world"?n:t}var P=w;function L3(n){n!==P&&(P=n||"",U=null,L=null,I=null)}function n3(){return P.length>0}var t3={US:"washington",CA:"ottawa",MX:"mexico city",GB:"london",FR:"paris",DE:"berlin",IT:"rome",ES:"madrid",PT:"lisbon",NL:"amsterdam",BE:"brussels",CH:"bern",AT:"vienna",IE:"dublin",PL:"warsaw",SE:"stockholm",NO:"oslo",DK:"copenhagen",FI:"helsinki",IS:"reykjavik",CZ:"prague",SK:"bratislava",HU:"budapest",RO:"bucharest",BG:"sofia",GR:"athens",TR:"ankara",UA:"kyiv",RU:"moscow",RS:"belgrade",HR:"zagreb",SI:"ljubljana",EE:"tallinn",LV:"riga",LT:"vilnius",JP:"tokyo",CN:"beijing",KR:"seoul",KP:"pyongyang",IN:"new delhi",PK:"islamabad",BD:"dhaka",LK:"colombo",TH:"bangkok",VN:"hanoi",PH:"manila",ID:"jakarta",MY:"kuala lumpur",SG:"singapore",MM:"naypyidaw",KH:"phnom penh",LA:"vientiane",NP:"kathmandu",AF:"kabul",IR:"tehran",IQ:"baghdad",SA:"riyadh",AE:"abu dhabi",QA:"doha",KW:"kuwait city",BH:"manama",OM:"muscat",JO:"amman",LB:"beirut",SY:"damascus",IL:"jerusalem",YE:"sanaa",EG:"cairo",LY:"tripoli",TN:"tunis",DZ:"algiers",MA:"rabat",SD:"khartoum",ET:"addis ababa",KE:"nairobi",TZ:"dodoma",UG:"kampala",NG:"abuja",GH:"accra",CI:"yamoussoukro",SN:"dakar",ML:"bamako",CM:"yaounde",CD:"kinshasa",CG:"brazzaville",AO:"luanda",ZM:"lusaka",ZW:"harare",MZ:"maputo",BW:"gaborone",NA:"windhoek",ZA:"pretoria",AU:"canberra",NZ:"wellington",PG:"port moresby",FJ:"suva",BR:"brasilia",AR:"buenos aires",CL:"santiago",PE:"lima",CO:"bogota",VE:"caracas",EC:"quito",BO:"la paz",PY:"asuncion",UY:"montevideo",GY:"georgetown",SR:"paramaribo",CU:"havana",DO:"santo domingo",HT:"port au prince",JM:"kingston",TT:"port of spain",PA:"panama city",CR:"san jose",NI:"managua",HN:"tegucigalpa",SV:"san salvador",GT:"guatemala city",BZ:"belmopan",AZ:"baku",AM:"yerevan",GE:"tbilisi",KZ:"astana",UZ:"tashkent",TM:"ashgabat",KG:"bishkek",TJ:"dushanbe",MN:"ulaanbaatar",BY:"minsk",MD:"chisinau",AL:"tirana",MK:"skopje",BA:"sarajevo",ME:"podgorica",XK:"pristina",CY:"nicosia",MT:"valletta",LU:"luxembourg"},U=null;function y(){if(U)return U;let n=new Map,e=P,t=(o,i,r)=>{if(!o)return;let a=n.get(o);a?a.some(s=>s.row===i)||a.push({row:i,primary:r}):n.set(o,[{row:i,primary:r}])};for(let o of e.split(",")){let i=o.split("|");if(i.length<7)continue;let r={a1:i[1],cc:i[2],lon:+i[3],lat:+i[4],pop:+i[5],kinds:i[6]||"N"};i.length>8&&i[8]&&(r.tags=i[8].split(";").filter(Boolean));let a=t3[r.cc];if(a&&u(i[0])===a&&(r.tags||(r.tags=[]),r.tags.includes("capital")||r.tags.push("capital")),t(u(i[0]),r,!0),i.length>7&&i[7])for(let s of i[7].split(";"))t(u(s),r,!1)}for(let o of n.values())o.sort((i,r)=>r.row.pop-i.row.pop);return U=n,n}var e3=200,L=null;function i3(){if(L)return L;let n=new Map;for(let[e,t]of y()){if(!e.endsWith(" city"))continue;let o=e.slice(0,-5);!o||y().get(o)?.some(i=>i.primary)||t[0].row.pop<e3||n.set(o,t)}return L=n,n}function O(n){if(!n)return;let e=y().get(n);if(e?.some(i=>i.primary))return e;let t=i3().get(n);if(!t)return e;let o=t.map(i=>({row:i.row,primary:!0}));return e?[...o,...e]:o}var I=null;function o3(){if(I)return I;let n=new Map;for(let t of k.split(",")){let o=t.split("|");o.length<3||n.set(o[0],{lon:+o[1],lat:+o[2]})}let e=new Map;for(let t of y().values())for(let o of t){let i=T(o.row.cc);if(!i)continue;let r=e.get(i);(r===void 0||o.row.pop>r)&&(e.set(i,o.row.pop),n.set(i,{lon:o.row.lon,lat:o.row.lat}))}return I=n,n}var h=null;function D(){if(h)return h;let n=new Map;for(let e of H.split(",")){let t=e.split("|");if(t.length<5)continue;let o={key:t[0],cc:t[1],name:t[2],lon:+t[3],lat:+t[4]};n.set(u(o.key),o);let i=u(o.name);i==="mexico"&&o.cc==="MX"?(n.set("estado de mexico",o),n.set("edomex",o)):n.set(i,o)}return h=n,n}var B=null;function a3(){if(B)return B;let n=new Map;for(let e of X.split(",")){let t=e.split("|");t.length<3||n.set(t[0],{lon:+t[1],lat:+t[2]})}return B=n,n}var r3=new Set(["USA","PRI","VIR","GUM","ASM","MNP"]),s3=new Set(["USA","CAN","MEX"]);function Y(n){if(n==null)return null;let e=u(String(n));return e?D().get(e)?.key??null:null}var l3={us:"US",usa:"US","u s":"US","u s a":"US",america:"US","united states":"US","united states of america":"US",ca:"CA",can:"CA",canada:"CA",mx:"MX",mex:"MX",mexico:"MX","estados unidos mexicanos":"MX"};function I3(n){if(n==null)return null;let e=u(String(n));return e?l3[e]??null:null}function u3(n){return D().get(u(n))?.cc??null}function c3(n){let e=u3(n);return e?T(e):null}function P3(n){return Z(n)[0]??null}function M3(n){if(n==null)return null;let e=String(n).trim().replace(/\.0+$/,"");if(!e)return null;let t=/^(\d{5})(-\d{4})?$/.exec(e);return t?t[1]:/^\d{3,4}$/.test(e)?e.padStart(5,"0"):null}function Z(n){if(n==null)return[];let e=String(n).trim().replace(/\.0+$/,"");if(!e)return[];if(/^\d{3}$/.test(e)){let o=e.padStart(5,"0").slice(0,3);return o===e?[e]:[e,o]}let t=M3(e);return t?[t.slice(0,3)]:[]}function S3(n){return!!n&&n.ambiguous===!0&&!("precision"in n)}function A3(n){let e=null,t=typeof n.lat=="string"?n.lat.trim():n.lat,o=typeof n.lon=="string"?n.lon.trim():n.lon;if(t!=null&&t!==""&&o!==void 0&&o!==null&&o!==""){let a=+t,s=+o;if(isFinite(a)&&isFinite(s)&&a>=-90&&a<=90&&s>=-180&&s<=180)if(a===0&&s===0)e={lat:0,lon:0,precision:"latlon"};else return{lat:a,lon:s,precision:"latlon"}}let i=E(n.country),r=Y(n.state);if(r&&i&&c3(r)!==i&&(r=null),n.city!==void 0&&n.city!==null){let a=u(String(n.city)),s=O(a),f=s?F(s,n.mapKind):null;if(f&&f.length){let d=n.state===void 0||n.state===null?"":String(n.state).trim(),R=d?u(d):"",g=d?Y(d):null,S=[],m=-1;for(let c of f){let l=c.row,A=0;if(d&&l.a1!=="")if(g&&l.a1===g||u(l.a1)===R)A++;else continue;if(i)if(T(l.cc)===i)A++;else continue;A>m?(m=A,S=[c]):A===m&&S.push(c)}S.some(c=>c.primary)&&(S=S.filter(c=>c.primary));let p=new Map;for(let c of S)p.set(c.row.lon.toFixed(2)+","+c.row.lat.toFixed(2),c.row);if(p.size===1){let c=S[0].row;return{lat:c.lat,lon:c.lon,precision:"city"}}if(p.size>1)return{ambiguous:!0,matches:p.size}}}if(!i||r3.has(i))for(let a of Z(n.zip)){let s=a3().get(a);if(s)return{lat:s.lat,lon:s.lon,precision:"zip3"}}if(r){let a=D().get(u(r));if(a)return{lat:a.lat,lon:a.lon,precision:"state"}}if(i&&(n.mapKind!=="north-america"||s3.has(i))){let a=o3().get(i);if(a)return{lat:a.lat,lon:a.lon,precision:"country"}}return e}var G={latlon:0,city:1,zip3:2,state:3,country:4},x=8;function y3(n,e){let t=new Array(n.length),o=new Array(n.length),i=new Array(n.length),r=new Set,a=[],s=new Set,f=[],d=new Set,R=[],g={latlon:0,city:0,zip3:0,state:0,country:0},S=0,m=0,p=null;for(let l=0;l<n.length;++l){let A=n[l],C=A3({...A,mapKind:e});if(S3(C)){t[l]=null,o[l]=null,i[l]=null,m++;let M=K(A);M&&!d.has(M.toLowerCase())&&(d.add(M.toLowerCase()),R.length<x&&R.push(M))}else if(C){if(t[l]=C.lat,o[l]=C.lon,i[l]=C.precision,S++,g[C.precision]++,(p===null||G[C.precision]>G[p])&&(p=C.precision),G[C.precision]>G.city){let M=K(A);M&&!s.has(M.toLowerCase())&&(s.add(M.toLowerCase()),f.length<x&&f.push(M))}}else{t[l]=null,o[l]=null,i[l]=null;let M=K(A);M&&!r.has(M.toLowerCase())&&(r.add(M.toLowerCase()),a.push(M))}}let c=!n3()&&n.some(l=>l.city!==null&&l.city!==void 0&&String(l.city).trim()!=="");return{lat:t,lon:o,precisions:i,precision:p,precisionCounts:g,coarseExamples:f,unmatched:a,ambiguousRows:m,ambiguousExamples:R,matchedRows:S,totalRows:n.length,...c?{cityTableMissing:!0}:{}}}function K(n){let e=[n.city,n.state,n.zip,n.country].filter(t=>t!=null&&String(t).trim()!=="").map(t=>String(t).trim()).join(", ");return e||(n.label===null||n.label===void 0?"":String(n.label).trim())}function b3(n,e){let t=u(String(n??""));if(!t)return[];let o=O(t);if(!o)return[];let i=E(e??null),r=new Set;for(let a of o)if(!(i&&T(a.row.cc)!==i))for(let s of a.row.tags??[])r.add(s);return Array.from(r)}function p3(n,e){if(!n)return!1;let t=O(n);return t?F(t,e).length>0:!1}function E3(n,e){let t=new Set,o=0;for(let i of n){if(i==null)continue;let r=u(String(i));V(r)||t.has(r)||(t.add(r),p3(r,e)&&o++)}return t.size===0?0:Math.round(o/t.size*1e3)/10}export{u as a,N as b,z as c,J as d,j as e,E as f,f3 as g,V as h,m3 as i,L3 as j,n3 as k,s3 as l,Y as m,I3 as n,P3 as o,M3 as p,Z as q,S3 as r,A3 as s,y3 as t,b3 as u,p3 as v,E3 as w};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
+
import{B as D,I as E}from"./chunk-PFCJESUQ.mjs";import{v as S}from"./chunk-ILHBRGIO.mjs";import P from"papaparse";function L(e){if(!e)return".";try{return new Intl.NumberFormat(e).formatToParts(1.5).find(t=>t.type==="decimal")?.value===","?",":"."}catch{return"."}}var x="[ \\u00A0\\u202F]",p="(?:[eE][+-]?\\d+)?",O=new RegExp(`^[+-]?(?:\\d{1,3}(?:,\\d{3})+|\\d+)(?:\\.\\d+)?${p}$`),k=new RegExp(`^[+-]?(?:\\d{1,3}(?:\\.\\d{3})+|\\d{1,3}(?:${x}\\d{3})+|\\d+)(?:,\\d+)?${p}$`),N=/^[+-]?\d{1,3}[.,]\d{3}$/,_=[/^[+-]?\d{1,3}(?:,\d{3}){2,}$/,new RegExp(`^[+-]?(?:\\d{1,3}(?:,\\d{3})+|\\d+)\\.\\d+${p}$`)],j=[/^[+-]?\d{1,3}(?:\.\d{3}){2,}$/,new RegExp(`^[+-]?(?:\\d{1,3}(?:\\.\\d{3})+|\\d{1,3}(?:${x}\\d{3})+|\\d+),\\d+${p}$`)];function T(e,i){let t=0,n=0;for(let c of e){if(typeof c!="string")continue;let o=c.trim();o===""||N.test(o)||(_.some(s=>s.test(o))?t++:j.some(s=>s.test(o))&&n++)}return n>0&&t===0?",":t>0?".":L(i)}function y(e,i){let t=String(e??"").trim();return t===""?null:i===","?k.test(t)?parseFloat(t.replace(/[. ]/g,"").replace(",",".")):null:O.test(t)?parseFloat(t.replace(/,/g,"")):null}function R(e,i){return y(e,i)!==null}var C=500,M=/^[+-]?\d{1,15}$/,q=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/,F=/^\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4}$/;function V(e,i="."){let t=0,n=0,c=0,o=0;for(let s of e){if(s==null)continue;if(typeof s=="number"){o++,n++,Number.isInteger(s)&&t++;continue}if(s instanceof Date){o++,c++;continue}if(typeof s=="boolean"){o++;continue}let l=String(s).trim();if(l!==""){if(o++,M.test(l)){t++,n++;continue}if(R(l,i)){n++;continue}if((q.test(l)||F.test(l))&&!isNaN(Date.parse(l))){c++;continue}}}return o===0?"String":c===o?"DateTime":t===o?"Integer":n===o?"Decimal":"String"}function v(e,i,t="."){if(e==null)return null;if(typeof e=="number")return i==="String"?String(e):e;if(e instanceof Date)return i==="DateTime"?e:e.toISOString();if(typeof e=="boolean")return String(e);let n=String(e).trim();if(n==="")return null;switch(i){case"Integer":return M.test(n)?parseInt(n,10):null;case"Decimal":return y(n,t);case"DateTime":return S(n);default:return n}}function B(e){let i=(e||"").toLowerCase().replace(/\(.*$/,"").trim();return/^(tinyint|smallint|int|integer|int2|int4|int8|bigint|serial|bigserial)$/.test(i)?"Integer":/^(decimal|numeric|money|smallmoney|float|real|double|double precision|number)$/.test(i)?"Decimal":/^(date|datetime|datetime2|smalldatetime|datetimeoffset|timestamp|timestamptz|time)$/.test(i)?"DateTime":(/^(bit|bool|boolean)$/.test(i),"String")}function f(e,i,t){if(e.length===0)throw new Error("ingest: no columns were resolved from the source. Supply column descriptors, or use a source shape that carries them (grid/table/objects/sql).");let n=e.length,c=e.map((r,a)=>i.slice(0,C).map(m=>m?.[a])),o=c.map(r=>T(r,t.locale)),s=e.map((r,a)=>r.dataType??V(c[a],o[a])),l=new Set((t.measures??[]).map(r=>r.toLowerCase())),A=new Set((t.dimensions??[]).map(r=>r.toLowerCase())),I=new Set((t.nonAdditive??[]).map(r=>r.toLowerCase())),$=e.map((r,a)=>{let m=r.name.toLowerCase(),u=r.isMeasure??((s[a]==="Integer"||s[a]==="Decimal")&&!D(r.name));l.has(m)&&(u=!0),A.has(m)&&(u=!1);let b={name:r.name,dataType:s[a],isMeasure:u};return u&&I.has(m)&&(b.discourageAggregationAcrossGroups=!0),b}),d=new E;d.dedupRows=t.dedup!==!1,d.setColumns($);for(let r=0;r<i.length;r++){let a=i[r];d.addRow(Array.from({length:n},(m,u)=>v(a?.[u],s[u],o[u])),r)}let w=d.getColumnsWithStats(t.privacyLevel??"20",t.locale??"en"),g=new Map(w.map(r=>[r.name,r]));e.forEach(r=>{let a=g.get(r.name);a&&(r.format&&(a.modelFormat=r.format),r.description&&(a.modelDesc=r.description))});for(let[r,a]of Object.entries(t.formats??{})){let m=g.get(r);m&&(m.modelFormat=a)}for(let[r,a]of Object.entries(t.descriptions??{})){let m=g.get(r);m&&(m.modelDesc=a)}for(let r of t.groupBy??[]){let a=g.get(r);a&&(a.isGrouping=!0)}return{columns:w,rows:d.toObjectArray(),totalRows:d.getRowCount(),index:d}}function h(e,i){return e.map(t=>Array.isArray(t)?t:i.map(n=>t[n]))}function U(e,i){let t=[],n=new Set,c=Math.min(e.length,Math.max(1,i));for(let o=0;o<c;o++){let s=e[o];if(!(!s||typeof s!="object"))for(let l of Object.keys(s))n.has(l)||(n.add(l),t.push(l))}return t}function Y(e,i={}){switch(e.kind){case"csv":{let t=P.parse(e.text,{skipEmptyLines:!0});if(t.errors?.length&&t.data.length===0)throw new Error(`ingest: CSV parse failed - ${t.errors[0].message}`);let n=t.data;if(n.length<2)throw new Error("ingest: CSV needs a header line plus at least one data row.");let c=n[0].map(o=>(o??"").trim());return f(c.map(o=>({name:o})),n.slice(1),i)}case"grid":{if(!e.header?.length)throw new Error("ingest: 'grid' needs a non-empty header.");return f(e.header.map(t=>({name:(t??"").trim()})),e.rows??[],i)}case"table":{if(!e.columns?.length)throw new Error("ingest: 'table' needs at least one column descriptor.");let t=e.columns.map(n=>n.name);return f(e.columns,h(e.rows??[],t),i)}case"objects":{let t=e.rows??[],n=e.columns?.length?e.columns:U(t,i.columnScanLimit??C).map(c=>({name:c}));if(!n.length)throw new Error("ingest: 'objects' produced no columns - the rows array is empty or holds no object keys.");return f(n,h(t,n.map(c=>c.name)),i)}case"sql":{if(!e.schema?.length)throw new Error("ingest: 'sql' needs at least one schema column.");let t=e.schema.map(n=>{let c=B(n.dataType);return{name:n.name,dataType:c,isMeasure:n.isMeasure,format:n.format,description:n.description}});return f(t,h(e.rows??[],t.map(n=>n.name)),i)}default:{let t=e;throw new Error(`ingest: unknown source kind '${t?.kind}'. Expected one of: csv, grid, table, objects, sql.`)}}}export{L as a,T as b,y as c,B as d,Y as e};
|
package/dist/geoDetector.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-C5I73OM2.mjs";import"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-ILHBRGIO.mjs";export{a as ZIP_NAME_TOKENS,f as buildGeoIsoColumn,c as detectGeo,b as hasAnyToken,e as isJoinGeoKind,d as toGeoIso};
|
package/dist/geoPoint.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o}from"./chunk-
|
|
2
|
+
import{a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o}from"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";export{d as NORTH_AMERICA_COUNTRIES,l as buildGeoPointColumns,o as cityMatchPct,m as cityTagsFor,c as isCityTableLoaded,j as isGeoPointAmbiguity,n as isKnownCity,f as normalizeCountry,a as normalizePlaceName,h as normalizeZip5,b as registerCityTable,e as resolveAdmin1,k as resolveGeoPoint,i as zipPrefixCandidates,g as zipToPrefix3};
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as Dt,b as Lt}from"./chunk-UQU75XXR.mjs";import{a as Et,b as Gt,c as wt,d as Ot,e as kt,f as Ft,g as zt,h as $t}from"./chunk-BIC73LQV.mjs";import{a as bt,b as It,c as vt,d as Nt,e as _t}from"./chunk-ZFTP4NSP.mjs";import{A as ht,B as St,C as xt,D as Pt,E as Tt,F as Rt,G as At,I as Mt,a as He,b as Ke,c as We,d as Ve,e as Xe,f as Ye,g as Je,h as Qe,i as et,j as tt,k as nt,l as ot,m as rt,n as it,o as st,p as at,q as ut,r as lt,s as ct,t as mt,u as ft,v as pt,w as dt,x as gt,y as yt,z as Ct}from"./chunk-PFCJESUQ.mjs";import{a as je}from"./chunk-QEH7WTLB.mjs";import{a as qe,b as Ze}from"./chunk-2LR73DNS.mjs";import{a as K,b as W,c as ze,d as $e,e as Ue,f as Be}from"./chunk-C5I73OM2.mjs";import{a as M,f as b,g as C,h as I,i as E,j as Ne,k as _e,l as H,m as d,n as De,o as Le,p as Ee,q as v,r as Ge,s as we,t as Oe,u as ke,v as G,w as Fe}from"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import{a as be,b as Ie,c as ve}from"./chunk-35Z7JCND.mjs";import{A as Me,a as ee,b as te,c as ne,d as oe,e as re,f as ie,g as se,h as ae,i as ue,j as le,k as ce,l as me,m as fe,n as pe,o as de,p as ge,r as ye,s as Ce,t as he,u as Se,v as xe,w as Pe,x as Te,y as Re,z as Ae}from"./chunk-ILHBRGIO.mjs";var w=2,q=400;function k(r){return!!b(r)}function P(r){let n=new Set;for(let t of r){if(t==null)continue;let i=M(String(t));if(!I(i)&&!n.has(i)&&(n.add(i),n.size>=q))break}return Array.from(n)}function x(r){let n=P(r);if(n.length===0||F(r)<95)return!1;let t=n.filter(c=>k(c)&&!d(c)).length,i=n.filter(c=>!k(c)&&!!d(c)).length;return t>=1&&t>=i}function V(r,n){if(!d(r))return!1;let t=b(r);return t?n==="world"?!0:H.has(t):!1}function F(r){let n=P(r);if(n.length===0)return 0;let t=0;for(let i of n)k(i)&&t++;return Math.round(t/n.length*1e3)/10}function N(r){let n=P(r);if(n.length===0)return 0;let t=0;for(let i of n)d(i)&&t++;return Math.round(t/n.length*1e3)/10}function $(r){let n=new Set;for(let t of r){if(t==null)continue;let i=String(t).trim();if(!I(M(i))&&!n.has(i)&&(n.add(i),n.size>=q))break}return Array.from(n)}function z(r){let n=$(r);if(n.length===0)return 0;let t=0;for(let i of n)v(i).length>0&&t++;return Math.round(t/n.length*1e3)/10}function j(r,n){return W(n,K)?!0:$(r).some(t=>/^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/,"")))}function Ut(r,n){let t=P(r);if(t.length===0)return 0;let i=0;for(let c of t)G(c,n)&&i++;return Math.round(i/t.length*1e3)/10}function O(r,n){let t=0;for(let i of P(r))n(i)&&t++;return t}function Bt(r,n){let t=0;for(let i of $(r))n(i)&&t++;return t}function Ht(r,n,t,i,c){let u=[],a=[],o={},T={},h=new Set(r),m=e=>n.map(s=>s[e]);for(let e of["city","country"]){let s=t?.[e];s&&h.has(s)&&(o[e]=s)}let Y=new Set(c??r);for(let e of["lat","lon"]){let s=t?.[e];s&&Y.has(s)&&(o[e]=s)}let g=t?.zip;if(g&&h.has(g)){let e=m(g),s=z(e);s<95?a.push(`zip=${g} (only ${s}% of values read as ZIPs)`):j(e,g)?o.zip=g:a.push(`zip=${g} (all values are 3-4 digits with nothing to say they are postal)`)}let p=t?.state;if(p&&h.has(p)){let e=m(p),s=P(e);s.length>0&&s.every(l=>V(l,i))?a.push(`state=${p} (every value is "CA", which is both Canada and California)`):x(e)?(a.push(`state=${p} (every value is a country, not a state)`),o.country||(o.country=p)):N(e)<95?a.push(`state=${p} (only ${N(e)}% of values are states/provinces)`):o.state=p}let y=new Set(Object.values(o).filter(Boolean)),R=r.filter(e=>!y.has(e)&&!e.startsWith("__"));if(!o.state){let e=null;for(let s of R){let l=m(s);if(x(l))continue;let f=N(l);if(f<95)continue;let L=O(l,A=>!!d(A)),Q=O(l,A=>!!d(A)&&!V(A,i));L<w&&Q<1||(!e||f>e.pct)&&(e={name:s,pct:f})}e&&(o.state=e.name,y.add(e.name),u.push(`state=${e.name} (${e.pct}% states/provinces)`))}if(!o.zip)for(let e of R){if(y.has(e))continue;let s=m(e),l=z(s);if(!(l<95)&&j(s,e)&&!(Bt(s,f=>v(f).length>0)<w)){o.zip=e,y.add(e),u.push(`zip=${e} (${l}% ZIP codes)`);break}}let S=o.country;if(!S||!x(m(S))){let e=null;for(let s of R){if(y.has(s)||!x(m(s)))continue;let l=F(m(s));(!e||l>e.pct)&&(e={name:s,pct:l})}e&&(S&&(a.push(`country=${S} (only ${F(m(S))}% of values are country identifiers; using ${e.name} instead)`),T.country=S),o.country=e.name,y.add(e.name),u.push(`country=${e.name}`))}if(!o.city){let e=null;for(let s of R){if(y.has(s))continue;let l=m(s),f=Ut(l,i);f<E||O(l,L=>G(L,i))<w||(!e||f>e.pct)&&(e={name:s,pct:f})}e&&(o.city=e.name,u.push(`city=${e.name} (${e.pct}% known cities)`))}let U=o.country?m(o.country):[],_=!!o.country&&x(U),J=_?new Set(U.map(e=>b(e==null?null:String(e))).filter(Boolean)).size:0,B=_&&J>=2,D=!!(o.lat&&o.lon)&&n.some(e=>{let s=+String(e[o.lat]??"").trim(),l=+String(e[o.lon]??"").trim();return isFinite(s)&&isFinite(l)&&s>=-90&&s<=90&&l>=-180&&l<=180&&String(e[o.lat]??"").trim()!==""&&String(e[o.lon]??"").trim()!==""});return o.lat&&o.lon&&!D&&a.push(`lat/lon=${o.lat}/${o.lon} (no row holds a usable coordinate pair)`),o.country&&!B&&!(o.city||o.state||o.zip||D)&&a.push(_?`country=${o.country} (every row resolves to the same country - nothing to place apart)`:`country=${o.country} (values are not country identifiers)`),{bind:!!(o.city||o.state||o.zip||B||D)?o:null,backfilled:u,refused:a,...Object.keys(T).length?{labelFallback:T}:{}}}function Z(r,n){let t=n?.freemiumMaxShapeColumns;return typeof t!="number"||!isFinite(t)||t<1?null:!isFinite(r)||r<=t?0:Math.round(r-t)}function Kt(r,n,t){let i=Z(r,n);if(i===null||i<=0)return null;let c=typeof n?.freemiumColumnCapPivot=="number"?n.freemiumColumnCapPivot:4,u=i>c?n?.freemiumColumnCapMessageMany:n?.freemiumColumnCapMessageFew;if(typeof u!="string"||u.trim().length===0)return null;let a=u.split("{n}").join(String(i)).split("{fields}").join(i===1?"field":"fields"),o=X(t);return o.length===0?a:a+" "+o.join(" ")}function X(r){if(!r||r.length===0)return[];let n=[],t=new Map,i=new Map;for(let u of r){let a=typeof u?.dateGroupId=="string"?u.dateGroupId.trim():"";if(a!==""&&(t.has(a)||(n.push(a),t.set(a,0)),u.isDatePart===!0&&t.set(a,t.get(a)+1),u.isReassembledDate===!0&&!i.has(a))){let o=typeof u.sourceField=="string"?u.sourceField.trim():"",T=typeof u.name=="string"?u.name.trim():"",h=o!==""?o:T;h!==""&&i.set(a,h)}}let c=[];for(let u of n){let a=i.get(u),o=t.get(u)??0;!a||o===0||c.push(`'${a}' is a date hierarchy and counts as ${o+1} fields - bind the date itself instead of its hierarchy.`)}return c}export{E as CITY_ROLE_MATCH_PCT,le as COMPOUND_MIN_STEM,gt as DEFAULT_GAP_FACTOR,Se as DEFAULT_TEMPERATURE,Ce as GET_RANDOM,me as GLUED_STEM_MIN,Ye as INTENSIVE_SUFFIX_TOKENS,Xe as INTENSIVE_WORD_TOKENS,Mt as IndexedText,yt as MAX_RUN_BOUNDS,Qe as POSITIONAL_SUFFIX_TOKENS,Je as POSITIONAL_WORD_TOKENS,Dt as PREVIEW_OMITTED_FIELDS,C as ROLE_MATCH_PCT,ye as SIMPLE_STRING_HASH,ge as STR,pe as SUBSTRING_MIN,ee as SUPPORTED_LANGUAGES,te as SUPPORTED_LANGUAGE_CODES,N as admin1MatchPct,ut as allowedAggregations,Be as buildGeoIsoColumn,Oe as buildGeoPointColumns,Fe as cityMatchPct,ke as cityTagsFor,Rt as classifyAdditivity,at as classifyForAggregation,At as classifyNumericValueNature,Pt as classifyTemporal,ot as codeNeedsLegacyAggNames,ft as codeReadsColumn,pt as codeReadsColumnsByRoleOrPosition,nt as collapseRepeatedAggPrefix,dt as columnsTheCodeReads,We as countryRegion,bt as decimalSeparatorOf,lt as defaultAggregation,It as detectDecimalSeparator,je as detectFormatSignature,ze as detectGeo,ve as detectOrdinalDomain,xt as detectTextDatePattern,Gt as encodePayload,Nt as engineTypeForSqlType,rt as englishImplicitAggNames,re as foldName,Kt as freemiumColumnCapRefusal,Z as freemiumColumnsOverCap,X as freemiumDateHierarchyClauses,fe as gluedPrefixStems,Et as gzipWireText,tt as hasDefaultAggPrefix,ae as hasUnsegmentedScript,Tt as hostAggHint,_t as ingest,ct as isAggregationAllowed,I as isBlankLike,_e as isCityTableLoaded,he as isDeterministicRefusal,Ge as isGeoPointAmbiguity,St as isIdentifierName,Ue as isJoinGeoKind,Ft as isNdjsonContentType,be as isOrdinalFriendlyName,wt as keyedSigner,Ae as localMidnightDateColumns,Re as localMidnightToUtcDay,x as looksLikeCountryColumn,de as matchNameToken,ht as measureCadence,Ot as messageSignature,Ze as monthLookupFor,st as nameLooksIntensiveRate,it as nameLooksPositional,ie as nameWords,De as normalizeCountry,Me as normalizeLocalMidnightDates,qe as normalizeMonthKey,M as normalizePlaceName,Ee as normalizeZip5,xe as parseDateStable,vt as parseNumberText,Ct as parseTemporalPoint,Lt as payloadPreview,$t as readGenerateStream,se as readName,kt as readWireField,Ne as registerCityTable,Ke as registerIso3Regions,d as resolveAdmin1,we as resolveGeoPoint,oe as resolveLanguage,Ht as resolvePointRoles,Ie as safeDistinctValuesToShip,mt as shareOfTotalIsHonest,et as stripHostAggPrefix,Ve as summarizeCountryRegions,He as summarizeGeoExtent,ne as supportedLanguage,$e as toGeoIso,ue as unsegmentedRuns,Pe as wholeDayFrame,Te as wholeDayIso,zt as wireResponseFromFetch,ce as wordEndsWith,z as zipMatchPct,v as zipPrefixCandidates,Le as zipToPrefix3};
|
package/dist/indexedText.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{B as a,C as b,D as c,E as d,F as e,G as f,H as g,I as h}from"./chunk-
|
|
2
|
+
import{B as a,C as b,D as c,E as d,F as e,G as f,H as g,I as h}from"./chunk-PFCJESUQ.mjs";import"./chunk-QEH7WTLB.mjs";import"./chunk-2LR73DNS.mjs";import"./chunk-C5I73OM2.mjs";import"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-35Z7JCND.mjs";import"./chunk-ILHBRGIO.mjs";export{h as IndexedText,e as classifyAdditivity,f as classifyNumericValueNature,c as classifyTemporal,b as detectTextDatePattern,d as hostAggHint,a as isIdentifierName,g as trimmedCells};
|
package/dist/ingest.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{d as a,e as b}from"./chunk-ZFTP4NSP.mjs";import"./chunk-PFCJESUQ.mjs";import"./chunk-QEH7WTLB.mjs";import"./chunk-2LR73DNS.mjs";import"./chunk-C5I73OM2.mjs";import"./chunk-TPVDJHU6.mjs";import"./chunk-5MRZID36.mjs";import"./chunk-35Z7JCND.mjs";import"./chunk-ILHBRGIO.mjs";export{a as engineTypeForSqlType,b as ingest};
|
package/dist/ordinalDetector.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-35Z7JCND.mjs";import"./chunk-ILHBRGIO.mjs";export{c as detectOrdinalDomain,a as isOrdinalFriendlyName,b as safeDistinctValuesToShip};
|
package/dist/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{
|
|
2
|
+
import{f as y,h}from"./chunk-BIC73LQV.mjs";import"./chunk-ILHBRGIO.mjs";var p=class extends Error{contract;failures;constructor(e,r){super(`${e} conformance failed:
|
|
3
3
|
- ${r.join(`
|
|
4
4
|
- `)}`),this.name="ConformanceError",this.contract=e,this.failures=r}},u=class{constructor(e){this.contract=e}contract;failures=[];check(e,r){e||this.failures.push(r)}fail(e){this.failures.push(e)}throwIfFailed(){if(this.failures.length)throw new p(this.contract,this.failures.slice())}},f="H4sIAAAAAAAAA6tWyk0tSs5ITUxRslIqS8wpTVWqBQBL0RbkEwAAAA==",l="H4sIAAAAAAAAA6tWSkksSVSyUsrMyyrKz1OqBQBVrD9YEAAAAA==";function d(s){return s instanceof Error?`${s.name}: ${s.message}`:String(s)}function w(s){let e=new u("WireSigner");(!s||typeof s.sign!="function")&&(e.fail("the signer has no sign() method"),e.throwIfFailed());let r,a,i;try{r=s.sign(f),a=s.sign(f),i=s.sign(l)}catch(t){e.fail(`sign() threw on an ordinary encoded body: ${d(t)}`),e.throwIfFailed()}e.check(typeof r=="string",`sign() returned ${typeof r}, not a string`),e.check(typeof r!="string"||r.trim()!=="","sign() returned a blank signature"),e.check(r===a,"sign() is not deterministic: the same body signed twice gave two signatures"),e.check(r!==i,"sign() gave two different bodies the same signature"),e.throwIfFailed()}async function A(s){let e=new u("WireResponse"),r=new TextEncoder,a=[`{"type":"progress","stage":"Reading your data"}
|
|
5
5
|
`,`{"type":"result","result":{"code":"x","version":2}}
|
|
@@ -69,7 +69,12 @@ export declare const POSITIONAL_SUFFIX_TOKENS: readonly string[];
|
|
|
69
69
|
* `normalize("NFD").replace(...)` is NOT — that shortens the string, and `stripHostAggPrefix`
|
|
70
70
|
* below needs a match offset in the FOLDED text to slice the ORIGINAL. A character folds only
|
|
71
71
|
* when its decomposition collapses back to a single code point; anything else is passed
|
|
72
|
-
* through untouched, so a surrogate pair survives intact. The server mirrors this exactly.
|
|
72
|
+
* through untouched, so a surrogate pair survives intact. The server mirrors this exactly.
|
|
73
|
+
*
|
|
74
|
+
* NOW THE NAME READER'S FOLD (2026-09-24), which also folds `ł ı ø đ ð` - letters with no
|
|
75
|
+
* decomposition, so `udzial` and `sicaklik` above could never meet `Udział` and `Sıcaklık` -
|
|
76
|
+
* and reads native and full-width digits as ASCII. One fold for every vocabulary; see
|
|
77
|
+
* nameReader.ts. */
|
|
73
78
|
export declare function foldAccents(s: string): string;
|
|
74
79
|
/** DEFAULT host aggregation prefixes in the languages a Power BI model is authored in
|
|
75
80
|
* (2026-09-12) — the localized halves of "Sum of" and "Count of". Accent-folded and
|
|
@@ -3,13 +3,13 @@ export declare const ISO_3166_PAIRS: string;
|
|
|
3
3
|
export declare const ISO2_TO_ISO3: Map<string, string>;
|
|
4
4
|
export declare const ISO2_SET: Set<string>;
|
|
5
5
|
export declare const ISO3_SET: Set<string>;
|
|
6
|
-
export declare const SUPPORTED_LANGS: string[];
|
|
6
|
+
export declare const SUPPORTED_LANGS: readonly string[];
|
|
7
7
|
export declare const COUNTRY_ALIAS_OVERLAY: Record<string, string>;
|
|
8
8
|
export declare function countryNameMap(): Map<string, string>;
|
|
9
9
|
/** ISO-2 -> ISO-3 ("CA" -> "CAN"). Null when the code is not assigned. */
|
|
10
10
|
export declare function iso2ToIso3(a2: string): string | null;
|
|
11
11
|
/**
|
|
12
|
-
* Resolve ANY country identifier to ISO-3: a name in any of the
|
|
12
|
+
* Resolve ANY country identifier to ISO-3: a name in any of the 30 supported
|
|
13
13
|
* languages, an ISO-2 code, an ISO-3 code, or an overlay alias ("USA", "UK",
|
|
14
14
|
* "Holland"). Null when it is not a country.
|
|
15
15
|
*
|
|
@@ -11,7 +11,7 @@ export type GeoDetectionResult = {
|
|
|
11
11
|
* @param rawValues DISTINCT raw cell values (order irrelevant; duplicates are
|
|
12
12
|
* harmless but the caller usually passes the distinct set).
|
|
13
13
|
* @param columnName the source column name (tiebreaker/guard for ambiguous codes).
|
|
14
|
-
* @param _locale reserved (country names already union all
|
|
14
|
+
* @param _locale reserved (country names already union all 30 languages; the
|
|
15
15
|
* report locale is not needed to match). Kept for signature symmetry.
|
|
16
16
|
*/
|
|
17
17
|
export declare function detectGeo(rawValues: string[], columnName?: string, _locale?: string): GeoDetectionResult | null;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export { resolvePointRoles, looksLikeCountryColumn, admin1MatchPct, zipMatchPct,
|
|
|
23
23
|
export type { PointBind, PointRoleResolution } from "./geoPointRoles";
|
|
24
24
|
export { monthLookupFor, normalizeMonthKey } from "./monthNames";
|
|
25
25
|
export { STR, SIMPLE_STRING_HASH, GET_RANDOM, isDeterministicRefusal, nameWords, DEFAULT_TEMPERATURE } from "./util";
|
|
26
|
+
export { SUPPORTED_LANGUAGES, SUPPORTED_LANGUAGE_CODES, supportedLanguage, resolveLanguage, } from "./languages";
|
|
27
|
+
export type { SupportedLanguage, SupportedLanguageCode, LanguageScript, ResolvedLanguage, } from "./languages";
|
|
28
|
+
export { foldName, readName, matchNameToken, wordEndsWith, gluedPrefixStems, unsegmentedRuns, hasUnsegmentedScript, COMPOUND_MIN_STEM, GLUED_STEM_MIN, SUBSTRING_MIN, } from "./nameReader";
|
|
29
|
+
export type { NameReading, NameTokenView } from "./nameReader";
|
|
30
|
+
export { detectDecimalSeparator, decimalSeparatorOf, parseNumberText } from "./numberText";
|
|
31
|
+
export type { DecimalSeparator } from "./numberText";
|
|
26
32
|
export { ingest, engineTypeForSqlType } from "./ingest";
|
|
27
33
|
export type { DataSource, IngestOptions, IngestResult, ColumnDescriptor, SqlColumnMeta, EngineDataType, } from "./ingest";
|
|
28
34
|
export { payloadPreview, PREVIEW_OMITTED_FIELDS } from "./payloadPreview";
|
|
@@ -31,6 +37,6 @@ export { codeReadsColumn, codeReadsColumnsByRoleOrPosition, columnsTheCodeReads
|
|
|
31
37
|
export { freemiumColumnsOverCap, freemiumColumnCapRefusal, freemiumDateHierarchyClauses } from "./freemiumCaps";
|
|
32
38
|
export type { FreemiumColumnCapStatus, FreemiumDateGroupColumn } from "./freemiumCaps";
|
|
33
39
|
export type { WireSigner, WireTransport, WireResponse, CredentialTriple, CredentialSource, ViewportSource, Clock, DiagnosticEntry, DiagnosticsSink, RendererId, WireServices, } from "./host/services";
|
|
34
|
-
export { encodePayload, keyedSigner, messageSignature, readWireField } from "./wire";
|
|
40
|
+
export { encodePayload, gzipWireText, keyedSigner, messageSignature, readWireField } from "./wire";
|
|
35
41
|
export type { GzipText } from "./wire";
|
|
36
42
|
export { readGenerateStream, isNdjsonContentType, wireResponseFromFetch } from "./wireStream";
|
package/dist/types/ingest.d.ts
CHANGED
|
@@ -47,7 +47,9 @@ export interface IngestOptions {
|
|
|
47
47
|
nonAdditive?: string[];
|
|
48
48
|
/** "0" | "10" | "20" | "30" — how much detail the measured shape carries. Default "20". */
|
|
49
49
|
privacyLevel?: string;
|
|
50
|
-
/** Locale for temporal classification (month-name matching)
|
|
50
|
+
/** Locale for temporal classification (month-name matching), and the tiebreak for a text
|
|
51
|
+
* column whose values do not say which character is the decimal point (`12,500` alone could
|
|
52
|
+
* be either). Default "en". */
|
|
51
53
|
locale?: string;
|
|
52
54
|
/**
|
|
53
55
|
* Collapse value-identical rows. DEFAULT TRUE, which preserves the engine's long-standing
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** ISO 15924 script of a language's everyday writing. `Jpan` is Han + Hiragana + Katakana. */
|
|
2
|
+
export type LanguageScript = "Latn" | "Cyrl" | "Grek" | "Hani" | "Jpan" | "Hang" | "Arab" | "Hebr" | "Deva" | "Thai";
|
|
3
|
+
export type SupportedLanguageCode = "en" | "nl" | "de" | "fr" | "es" | "pt" | "it" | "pl" | "cs" | "sk" | "sv" | "da" | "nb" | "fi" | "hu" | "tr" | "ro" | "hr" | "id" | "vi" | "ru" | "uk" | "el" | "zh" | "ja" | "ko" | "ar" | "he" | "hi" | "th";
|
|
4
|
+
export interface SupportedLanguage {
|
|
5
|
+
/** The one code this language is known by everywhere in the product. */
|
|
6
|
+
code: SupportedLanguageCode;
|
|
7
|
+
/** English name, for diagnostics and tests - never shown to a reader as a label. */
|
|
8
|
+
name: string;
|
|
9
|
+
script: LanguageScript;
|
|
10
|
+
dir: "ltr" | "rtl";
|
|
11
|
+
/** The tag handed to `Intl` when a request names only the language. */
|
|
12
|
+
intl: string;
|
|
13
|
+
/** Other primary language subtags a host sends for this language. A region is never needed
|
|
14
|
+
* here: `pt-BR`, `nb-NO` and `zh-SG` resolve by their primary subtag. */
|
|
15
|
+
aliases: readonly string[];
|
|
16
|
+
/** FALSE where words are written without spaces between them (Chinese, Japanese, Thai): a
|
|
17
|
+
* word test cannot find anything there, and matching is by substring over the run. */
|
|
18
|
+
wordBreaks: boolean;
|
|
19
|
+
/** TRUE where a concept is routinely glued onto the END of another word
|
|
20
|
+
* (`Durchschnittstemperatur`): matching needs the compound-suffix view as well. */
|
|
21
|
+
compounds: boolean;
|
|
22
|
+
/** Particles glued onto the FRONT of a word (the Arabic article, Hebrew one-letter
|
|
23
|
+
* prefixes): matching needs the glued-prefix view, longest prefix first. */
|
|
24
|
+
gluedPrefixes: readonly string[];
|
|
25
|
+
/** TRUE where diacritics carry meaning, so folding merges different words (Vietnamese
|
|
26
|
+
* `tháng` month / `thang` ladder). Vocabulary in such a language is matched unfolded. */
|
|
27
|
+
foldSensitive: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The thirty Tier 1 languages, English first. The union of the two broadest lists the product
|
|
31
|
+
* already carried (the UI phrase list and the date-level list), so nothing a host already handled
|
|
32
|
+
* is dropped. Traditional Chinese is deliberately NOT here: it resolves to Tier 2 (formatting in
|
|
33
|
+
* Traditional, text from the Simplified entry).
|
|
34
|
+
*/
|
|
35
|
+
export declare const SUPPORTED_LANGUAGES: readonly SupportedLanguage[];
|
|
36
|
+
/** The thirty codes, in list order. */
|
|
37
|
+
export declare const SUPPORTED_LANGUAGE_CODES: readonly SupportedLanguageCode[];
|
|
38
|
+
/** The Tier 1 entry for a code or alias, or undefined. */
|
|
39
|
+
export declare function supportedLanguage(code: string | null | undefined): SupportedLanguage | undefined;
|
|
40
|
+
export interface ResolvedLanguage {
|
|
41
|
+
/** The Tier 1 language whose vetted text this reader gets - always one of the thirty. */
|
|
42
|
+
code: SupportedLanguageCode;
|
|
43
|
+
language: SupportedLanguage;
|
|
44
|
+
/** 1 when the request IS that language; 2 when only `Intl` formatting follows the request and
|
|
45
|
+
* the text comes from `code` (a neighbour, or English). */
|
|
46
|
+
tier: 1 | 2;
|
|
47
|
+
/** What to hand `Intl` for numbers, dates, plurals and lists: the request in canonical form
|
|
48
|
+
* when the runtime knows it, otherwise the fallback language's own tag. */
|
|
49
|
+
intl: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* THE ONE READING OF A HOST'S CULTURE. Every host resolves its culture here and nowhere else - the
|
|
53
|
+
* 2-letter cut each host used to make on its own sent `nb` into a table keyed `no`, read `zh-TW`
|
|
54
|
+
* as Simplified, and ignored every tag it did not expect.
|
|
55
|
+
*
|
|
56
|
+
* resolveLanguage("en-US") -> { code: "en", tier: 1, intl: "en-US" }
|
|
57
|
+
* resolveLanguage("nb-NO") -> { code: "nb", tier: 1, intl: "nb-NO" }
|
|
58
|
+
* resolveLanguage("no") -> { code: "nb", tier: 1, intl: "no" }
|
|
59
|
+
* resolveLanguage("zh-CN") -> { code: "zh", tier: 1, intl: "zh-CN" }
|
|
60
|
+
* resolveLanguage("zh-TW") -> { code: "zh", tier: 2, intl: "zh-TW" } Traditional: Tier 2
|
|
61
|
+
* resolveLanguage("sw-KE") -> { code: "en", tier: 2, intl: "sw-KE" } Intl formats Swahili
|
|
62
|
+
* resolveLanguage("") -> { code: "en", tier: 1, intl: "en" } no culture sent
|
|
63
|
+
*
|
|
64
|
+
* Never throws. An unparseable tag is treated as absent.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveLanguage(tag: string | null | undefined): ResolvedLanguage;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type SupportedLanguageCode } from "./languages";
|
|
2
|
+
/**
|
|
3
|
+
* THE FOLD - see the header. `Température` -> `Temperature`, `Udział` -> `Udzial`,
|
|
4
|
+
* `Sıcaklık` -> `Sicaklik`, `٢٠٢٤` -> `2024`. Length-preserving in UTF-16 units: a character is
|
|
5
|
+
* replaced only by a single BMP character, and anything else - a surrogate pair, a Hangul
|
|
6
|
+
* syllable, a letter with a mark outside the diacritical block - passes through untouched.
|
|
7
|
+
*/
|
|
8
|
+
export declare function foldName(s: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* The WORDS in a column name, lower-cased and unfolded: "OlympicYear" -> ["olympic", "year"],
|
|
11
|
+
* "fiscal_year" -> ["fiscal", "year"], "СредняяЦена" -> ["средняя", "цена"],
|
|
12
|
+
* "Umsatz – Summe" -> ["umsatz", "summe"], "平均温度" -> ["平均温度"] (one run - see
|
|
13
|
+
* `unsegmentedRuns`).
|
|
14
|
+
*
|
|
15
|
+
* WHAT SEPARATES, EXACTLY: whitespace, the four ASCII separators `_ - . /`, and every character
|
|
16
|
+
* OUTSIDE ASCII that is not a letter, mark or number (an en dash, a degree sign, an ideographic
|
|
17
|
+
* comma, full-width brackets). Other ASCII punctuation stays attached to its word, as it always
|
|
18
|
+
* has: `Sales (USD)` still reads `sales` + `(usd)`. That is a measured choice, not an oversight -
|
|
19
|
+
* splitting there too moved four English verdicts in a replay of every column name ever bound,
|
|
20
|
+
* all of them a unit in brackets read as a word (`Permit Sub-Limit (t CO2e/yr)` became a year
|
|
21
|
+
* name, `Net Sales (Wk)` an ordinal one). Widening it is a decision with its own replay.
|
|
22
|
+
*/
|
|
23
|
+
export declare function nameWords(name: string): string[];
|
|
24
|
+
export interface NameReading {
|
|
25
|
+
/** Lower-cased words, NFC, unfolded - for a fold-sensitive language's vocabulary. */
|
|
26
|
+
words: string[];
|
|
27
|
+
/** The same words folded (`foldName`) - what every other vocabulary matches. Same length and
|
|
28
|
+
* order as `words`. */
|
|
29
|
+
folded: string[];
|
|
30
|
+
}
|
|
31
|
+
/** Both views of a name at once.
|
|
32
|
+
*
|
|
33
|
+
* The folded view folds the NAME and then reads it, rather than folding each word: lower-casing
|
|
34
|
+
* first turns the Turkish `İ` into `i` plus a combining dot, which no per-letter fold can remove,
|
|
35
|
+
* while folding first gives a plain `I` that lower-cases to `i`. The fold keeps case, letters stay
|
|
36
|
+
* letters and digits stay digits, so both readings split at the same places. */
|
|
37
|
+
export declare function readName(name: string): NameReading;
|
|
38
|
+
/** TRUE when the text contains a character of a script written without word breaks. */
|
|
39
|
+
export declare function hasUnsegmentedScript(s: string): boolean;
|
|
40
|
+
/** The runs of Han, Hiragana, Katakana and Thai text in a name - the only places a substring match
|
|
41
|
+
* is meaningful. `売上高_2024年` -> ["売上高", "年"]. */
|
|
42
|
+
export declare function unsegmentedRuns(name: string): string[];
|
|
43
|
+
/** The minimum a compound's remaining stem must keep, in code points, before a suffix counts:
|
|
44
|
+
* `Temperatur` alone is a word match, `Durchschnittstemperatur` a suffix match, and a one- or
|
|
45
|
+
* two-letter "stem" is not a compound at all. */
|
|
46
|
+
export declare const COMPOUND_MIN_STEM = 3;
|
|
47
|
+
/** COMPOUND-SUFFIX VIEW: does this (folded) word end in the (folded) token, leaving a stem of at
|
|
48
|
+
* least `minStem` code points? A word EQUAL to the token is a whole-word match, not this. */
|
|
49
|
+
export declare function wordEndsWith(word: string, token: string, minStem?: number): boolean;
|
|
50
|
+
/** The minimum a word must keep after a glued prefix is removed, in code points. */
|
|
51
|
+
export declare const GLUED_STEM_MIN = 2;
|
|
52
|
+
/** GLUED-PREFIX VIEW: the stems left when each of the language's glued prefixes is removed from
|
|
53
|
+
* the front of the word, longest prefix first; only stems of at least `GLUED_STEM_MIN` code
|
|
54
|
+
* points. Empty for a language that glues nothing. `الإيرادات` (ar) -> ["إيرادات"];
|
|
55
|
+
* `והכנסות` (he) -> ["כנסות", "הכנסות"] - every candidate, because which letters are a prefix is
|
|
56
|
+
* the vocabulary's question, not the reader's. */
|
|
57
|
+
export declare function gluedPrefixStems(word: string, lang: SupportedLanguageCode | string): string[];
|
|
58
|
+
/** Which view found a token in a name. */
|
|
59
|
+
export type NameTokenView = "word" | "suffix" | "prefix" | "substring";
|
|
60
|
+
/** The shortest token a substring match will look for, in code points. One Han character is a
|
|
61
|
+
* morpheme, not a word, and matches far too much (`日` is in every date column). */
|
|
62
|
+
export declare const SUBSTRING_MIN = 2;
|
|
63
|
+
/**
|
|
64
|
+
* Does `token`, a vocabulary word of language `lang`, occur in the column name - and through which
|
|
65
|
+
* view? The view is chosen by the TOKEN's language, never the reader's culture:
|
|
66
|
+
*
|
|
67
|
+
* - a token written in Han, Kana or Thai: substring over the name's unsegmented runs, at least
|
|
68
|
+
* `SUBSTRING_MIN` code points;
|
|
69
|
+
* - otherwise a whole word - folded, or unfolded for a fold-sensitive language (vi);
|
|
70
|
+
* - then, for a compounding language, the end of a word (`wordEndsWith`);
|
|
71
|
+
* - then, for a glued-prefix language, a word whose stem after a prefix IS the token.
|
|
72
|
+
*
|
|
73
|
+
* Returns null when no view finds it. This is the reader only: a vocabulary still owns the
|
|
74
|
+
* one-language rule for short tokens and the English-wins rule for collisions.
|
|
75
|
+
*/
|
|
76
|
+
export declare function matchNameToken(name: string, token: string, lang: SupportedLanguageCode | string): NameTokenView | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type DecimalSeparator = "." | ",";
|
|
2
|
+
/** The runtime's decimal separator for a culture, reduced to the two this parser reads. Anything
|
|
3
|
+
* unparseable, or a separator that is neither (the Arabic `٫`), reads as the dot. */
|
|
4
|
+
export declare function decimalSeparatorOf(locale: string | null | undefined): DecimalSeparator;
|
|
5
|
+
/**
|
|
6
|
+
* THE COLUMN'S DECIMAL SEPARATOR, from its text values (non-strings are ignored - an already-typed
|
|
7
|
+
* number needs no reading). See the header for the rule; `locale` is the tiebreak for a column
|
|
8
|
+
* with no evidence either way.
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectDecimalSeparator(samples: ReadonlyArray<unknown>, locale?: string | null): DecimalSeparator;
|
|
11
|
+
/** The number a text value spells under the column's separator, or null when it spells none. */
|
|
12
|
+
export declare function parseNumberText(text: string, decimal: DecimalSeparator): number | null;
|
|
13
|
+
/** TRUE when the text is a number under the column's separator. */
|
|
14
|
+
export declare function isNumberText(text: string, decimal: DecimalSeparator): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mask one text value - see the header. `rand` is uniform [0,1); the host passes its own
|
|
3
|
+
* GET_RANDOM, a test passes a seeded one. Same-class, same-script, and no character of the value
|
|
4
|
+
* survives; length jitters by about a fifth, as it always has, so a length is not a fingerprint.
|
|
5
|
+
*/
|
|
6
|
+
export declare function maskSampleText(input: string, rand: () => number): string;
|
package/dist/types/util.d.ts
CHANGED
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
* shape. Three name tests already read names as words; the fourth did not, and nothing made them
|
|
12
12
|
* agree.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* consumer
|
|
17
|
-
*
|
|
18
|
-
|
|
14
|
+
* THE READING NOW LIVES IN nameReader.ts (2026-09-24), which extends the same two boundaries to
|
|
15
|
+
* every script: camelCase on any cased script, and a word is a run of letters, marks and digits.
|
|
16
|
+
* A consumer that re-derives this rule for itself has to match it exactly: this flag is read
|
|
17
|
+
* first and such a consumer only falls back to its own copy, so widening one side alone decides
|
|
18
|
+
* the same column two different ways depending on which side sees it. The shared fixture file
|
|
19
|
+
* (tests/fixtures/name-reader.json) is what both sides tokenise. */
|
|
20
|
+
export { nameWords } from "./nameReader";
|
|
19
21
|
/** Null/undefined-safe stringify. Mirrors Shared.STR. */
|
|
20
22
|
export declare function STR(v: any): string;
|
|
21
23
|
/** Linear-interpolated quantile over an ascending-sorted array (NaN for an empty one). One definition for
|
package/dist/types/wire.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { WireSigner } from "./host/services";
|
|
2
|
+
/** Gzip one string (the request's JSON) to bytes. */
|
|
3
|
+
export type GzipText = (text: string) => Uint8Array;
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* byte-identical to what it sent before this function existed only if it keeps its own. The
|
|
7
|
-
* server inflates any valid gzip.
|
|
5
|
+
* The envelope's compressor: pako's gzip at its default level (6), from the exact pako version
|
|
6
|
+
* this package pins. Exported so a host's test can derive a known answer from the same
|
|
7
|
+
* function the envelope uses; a host never needs to call it.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare const gzipWireText: GzipText;
|
|
10
|
+
/**
|
|
11
|
+
* JSON -> gzip -> base64 -> '/' to '.'. The body every signed request sends, compressed with
|
|
12
|
+
* `gzipWireText`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function encodePayload(payload: unknown): string;
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* the server and read as a network fault.
|
|
16
|
+
* @deprecated The compressor is no longer the host's: every envelope is compressed with this
|
|
17
|
+
* package's pinned pako (`gzipWireText`), and a second argument is IGNORED. The overload is
|
|
18
|
+
* kept only so a caller written against 0.6.1-0.6.3 still compiles; drop the argument.
|
|
15
19
|
*/
|
|
16
20
|
export declare function encodePayload(payload: unknown, gzip: GzipText): string;
|
|
17
21
|
/**
|
package/dist/util.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l
|
|
2
|
+
import{A as m,f as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i,x as j,y as k,z as l}from"./chunk-ILHBRGIO.mjs";export{g as DEFAULT_TEMPERATURE,e as GET_RANDOM,d as SIMPLE_STRING_HASH,b as STR,f as isDeterministicRefusal,l as localMidnightDateColumns,k as localMidnightToUtcDay,a as nameWords,m as normalizeLocalMidnightDates,h as parseDateStable,c as quantileSorted,i as wholeDayFrame,j as wholeDayIso};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/shape-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Host-agnostic data-shape profiler: ingest a dataset's rows through IValueCollection.addRow and read back the measured shape as an LLMColumnWithValue[] payload — types, cardinality, temporal/ordinal detection, geographic region and point resolution, cross-column signals. MEASUREMENT only: the policy that decides what a measured shape means for chart selection lives server-side.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"directory": "packages/shape-core"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
+
"pako": "3.0.2",
|
|
94
95
|
"papaparse": "^5.4.1"
|
|
95
96
|
},
|
|
96
97
|
"devDependencies": {
|
package/dist/chunk-ANY34FNP.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{d as f}from"./chunk-FUTSF2X5.mjs";function b(e,t){if(typeof t!="function")throw new TypeError("encodePayload needs the host's gzip function");return h(t(JSON.stringify(e))).replace(/\//g,".")}function h(e){let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)}function k(e){if(typeof e!="string"||e==="")throw new TypeError("keyedSigner needs the host's signing key");return{sign:t=>String(f(t+e))}}function v(e,t){let n=t.sign(e);if(typeof n!="string"||n.trim()==="")throw new TypeError("the host's signer returned a blank signature");return n}function u(e,t){if(e==null||typeof e!="object")return;let n=e,r=n[t];return r??n[t.charAt(0).toUpperCase()+t.slice(1)]}function w(e){return String(e??"").toLowerCase().includes("ndjson")}function W(e){let t=null;try{t=e.headers?.get?.("content-type")??null}catch{t=null}return{status:typeof e.status=="number"?e.status:0,contentType:t,body:e.body??null,text:()=>e.text()}}function m(e,t,n){let r=e.trim();if(!r)return{result:null,typed:!1,parsed:!1};let i;try{i=JSON.parse(r)}catch{return{result:null,typed:!1,parsed:!1}}return c(i,t,n)}function c(e,t,n){if(!e||typeof e!="object"||Array.isArray(e))return{result:null,typed:!1,parsed:!0};let r=u(e,"type");if(r!=null){if(r==="progress"){let s=String(u(e,"stage")??"").trim();return s&&t?.(s),{result:null,typed:!0,parsed:!0}}if(r==="result"){let s=u(e,"result");return{result:s&&typeof s=="object"?s:null,typed:!0,parsed:!0}}return{result:null,typed:!0,parsed:!0}}return n?{result:u(e,"code")!==void 0||u(e,"errorMessage")!==void 0?e:null,typed:!1,parsed:!0}:{result:e,typed:!1,parsed:!0}}var l=class{constructor(t){this.onStage=t}onStage;result=null;anyParsed=!1;take(t){let n=m(t,this.onStage,!0);n.parsed&&(this.anyParsed=!0),n.result&&(n.typed||this.result===null)&&(this.result=n.result)}};function d(){return new Error("the generate response ended without a result")}async function x(e,t){let n=e.body;if(!n||typeof n.getReader!="function")return y(await e.text(),t,null);let r=n.getReader(),i=new TextDecoder,s=new l(t),o="";try{for(;;){let{done:p,value:g}=await r.read();if(p)break;o+=i.decode(g,{stream:!0});let a;for(;(a=o.indexOf(`
|
|
3
|
-
`))>=0;)s.take(o.slice(0,a)),o=o.slice(a+1)}}finally{try{r.releaseLock?.()}catch{}}if(o+=i.decode(),s.take(o),!s.result)throw d();return s.result}function y(e,t,n){let r=new l(t);for(let i of e.split(`
|
|
4
|
-
`))r.take(i);if(r.result)return r.result;throw!r.anyParsed&&n?n:d()}async function S(e,t){let n=await e.text(),r;try{r=JSON.parse(n)}catch(s){return y(n,t,s)}if(!r||typeof r!="object"||Array.isArray(r))throw new SyntaxError("the generate response was JSON but not a result object");let i=c(r,t,!1);if(i.result)return i.result;throw d()}async function A(e,t){return w(e.contentType)?x(e,t):S(e,t)}export{b as a,k as b,v as c,u as d,w as e,W as f,A as g};
|
package/dist/chunk-FUTSF2X5.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
function T(n){return n?n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-./]+/g," ").toLowerCase().split(/\s+/).filter(e=>e.length>0):[]}function y(n){return n!=null?n.toString():""}function D(n,e){if(!n.length)return NaN;if(n.length===1)return n[0];let t=(n.length-1)*e,r=Math.floor(t),o=Math.ceil(t);return r===o?n[r]:n[r]+(n[o]-n[r])*(t-r)}function m(n){if(!n)return 0;let e=0xcbf29ce484222325n,t=0x100000001b3n,r=e;for(let o=0;o<n.length;o++)r^=BigInt(n.charCodeAt(o)),r=r*t&0xFFFFFFFFFFFFFFFFn;return Number(r&0x1FFFFFFFFFFFFFn)}function d(){let n=typeof globalThis<"u"?globalThis:{};if(n.crypto&&typeof n.crypto.getRandomValues=="function"){let e=new Uint32Array(1);return n.crypto.getRandomValues(e),e[0]/4294967296}return Math.floor(Date.now()%4294967295)/4294967296}function h(n){return!!n&&n.isRefusal===!0}var x=30;function M(n){let e=Date.parse(n);if(isNaN(e))return null;let t=new Date(e);if(F.test(n)||g.test(n.trim())||p.test(n))return t;let r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())),o=t.getFullYear();return o>=0&&o<100&&r.setUTCFullYear(o),r}function a(n){return!(n instanceof Date)||isNaN(n.getTime())?null:n.getUTCHours()===0&&n.getUTCMinutes()===0&&n.getUTCSeconds()===0&&n.getUTCMilliseconds()===0?"utc":n.getHours()===0&&n.getMinutes()===0&&n.getSeconds()===0&&n.getMilliseconds()===0?"local":null}function R(n){let e=a(n);if(!e)return null;let t=n;if(e==="utc")return t.toISOString().slice(0,10);let r=o=>(o<10?"0":"")+o;return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}`}function c(n){let e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())),t=n.getFullYear();return t>=0&&t<100&&e.setUTCFullYear(t),e}function f(n,e){let t=[];for(let r of n){if(!r||!/date|time/i.test(String(r.dataType??"")))continue;let o=0,l=!0;for(let u of e){let i=u?u[r.name]:void 0;if(i==null||i==="")continue;if(!(i instanceof Date)){l=!1;break}let s=a(i);if(s===null){l=!1;break}s==="local"&&o++}l&&o>0&&t.push(r.name)}return t}function b(n,e){let t=f(n,e);return t.length===0?{rows:e,columns:t}:{rows:e.map(o=>{if(!o)return o;let l={...o};for(let u of t){let i=l[u];i instanceof Date&&a(i)==="local"&&(l[u]=c(i))}return l}),columns:t}}var F=/^\s*\d{4}(-\d{2}(-\d{2})?)?\s*$/,g=/(?:Z|[+-]\d{2}:?\d{2})$/i,p=/\b(?:GMT|UTC)\b/i;export{T as a,y as b,D as c,m as d,d as e,h as f,x as g,M as h,a as i,R as j,c as k,f as l,b as m};
|
package/dist/chunk-IJXTU62R.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{B as b,I as S}from"./chunk-TDTXRIHS.mjs";import{h as w}from"./chunk-FUTSF2X5.mjs";import R from"papaparse";var D=500,E=/^[+-]?\d{1,15}$/,T=/^[+-]?(\d{1,3}(,\d{3})*|\d+)(\.\d+)?([eE][+-]?\d+)?$/,L=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/,I=/^\d{1,2}[\/\-.]\d{1,2}[\/\-.]\d{2,4}$/;function x(t){let i=0,e=0,r=0,o=0;for(let a of t){if(a==null)continue;if(typeof a=="number"){o++,e++,Number.isInteger(a)&&i++;continue}if(a instanceof Date){o++,r++;continue}if(typeof a=="boolean"){o++;continue}let c=String(a).trim();if(c!==""){if(o++,E.test(c)){i++,e++;continue}if(T.test(c)){e++;continue}if((L.test(c)||I.test(c))&&!isNaN(Date.parse(c))){r++;continue}}}return o===0?"String":r===o?"DateTime":i===o?"Integer":e===o?"Decimal":"String"}function M(t,i){if(t==null)return null;if(typeof t=="number")return i==="String"?String(t):t;if(t instanceof Date)return i==="DateTime"?t:t.toISOString();if(typeof t=="boolean")return String(t);let e=String(t).trim();if(e==="")return null;switch(i){case"Integer":return E.test(e)?parseInt(e,10):null;case"Decimal":return T.test(e)?parseFloat(e.replace(/,/g,"")):null;case"DateTime":return w(e);default:return e}}function A(t){let i=(t||"").toLowerCase().replace(/\(.*$/,"").trim();return/^(tinyint|smallint|int|integer|int2|int4|int8|bigint|serial|bigserial)$/.test(i)?"Integer":/^(decimal|numeric|money|smallmoney|float|real|double|double precision|number)$/.test(i)?"Decimal":/^(date|datetime|datetime2|smalldatetime|datetimeoffset|timestamp|timestamptz|time)$/.test(i)?"DateTime":(/^(bit|bool|boolean)$/.test(i),"String")}function g(t,i,e){if(t.length===0)throw new Error("ingest: no columns were resolved from the source. Supply column descriptors, or use a source shape that carries them (grid/table/objects/sql).");let r=t.length,o=t.map((n,s)=>n.dataType??x(i.slice(0,D).map(m=>m?.[s]))),a=new Set((e.measures??[]).map(n=>n.toLowerCase())),c=new Set((e.dimensions??[]).map(n=>n.toLowerCase())),d=new Set((e.nonAdditive??[]).map(n=>n.toLowerCase())),C=t.map((n,s)=>{let m=n.name.toLowerCase(),u=n.isMeasure??((o[s]==="Integer"||o[s]==="Decimal")&&!b(n.name));a.has(m)&&(u=!0),c.has(m)&&(u=!1);let h={name:n.name,dataType:o[s],isMeasure:u};return u&&d.has(m)&&(h.discourageAggregationAcrossGroups=!0),h}),l=new S;l.dedupRows=e.dedup!==!1,l.setColumns(C);for(let n=0;n<i.length;n++){let s=i[n];l.addRow(Array.from({length:r},(m,u)=>M(s?.[u],o[u])),n)}let y=l.getColumnsWithStats(e.privacyLevel??"20",e.locale??"en"),f=new Map(y.map(n=>[n.name,n]));t.forEach(n=>{let s=f.get(n.name);s&&(n.format&&(s.modelFormat=n.format),n.description&&(s.modelDesc=n.description))});for(let[n,s]of Object.entries(e.formats??{})){let m=f.get(n);m&&(m.modelFormat=s)}for(let[n,s]of Object.entries(e.descriptions??{})){let m=f.get(n);m&&(m.modelDesc=s)}for(let n of e.groupBy??[]){let s=f.get(n);s&&(s.isGrouping=!0)}return{columns:y,rows:l.toObjectArray(),totalRows:l.getRowCount(),index:l}}function p(t,i){return t.map(e=>Array.isArray(e)?e:i.map(r=>e[r]))}function k(t,i){let e=[],r=new Set,o=Math.min(t.length,Math.max(1,i));for(let a=0;a<o;a++){let c=t[a];if(!(!c||typeof c!="object"))for(let d of Object.keys(c))r.has(d)||(r.add(d),e.push(d))}return e}function _(t,i={}){switch(t.kind){case"csv":{let e=R.parse(t.text,{skipEmptyLines:!0});if(e.errors?.length&&e.data.length===0)throw new Error(`ingest: CSV parse failed - ${e.errors[0].message}`);let r=e.data;if(r.length<2)throw new Error("ingest: CSV needs a header line plus at least one data row.");let o=r[0].map(a=>(a??"").trim());return g(o.map(a=>({name:a})),r.slice(1),i)}case"grid":{if(!t.header?.length)throw new Error("ingest: 'grid' needs a non-empty header.");return g(t.header.map(e=>({name:(e??"").trim()})),t.rows??[],i)}case"table":{if(!t.columns?.length)throw new Error("ingest: 'table' needs at least one column descriptor.");let e=t.columns.map(r=>r.name);return g(t.columns,p(t.rows??[],e),i)}case"objects":{let e=t.rows??[],r=t.columns?.length?t.columns:k(e,i.columnScanLimit??D).map(o=>({name:o}));if(!r.length)throw new Error("ingest: 'objects' produced no columns - the rows array is empty or holds no object keys.");return g(r,p(e,r.map(o=>o.name)),i)}case"sql":{if(!t.schema?.length)throw new Error("ingest: 'sql' needs at least one schema column.");let e=t.schema.map(r=>{let o=A(r.dataType);return{name:r.name,dataType:o,isMeasure:r.isMeasure,format:r.format,description:r.description}});return g(e,p(t.rows??[],e.map(r=>r.name)),i)}default:{let e=t;throw new Error(`ingest: unknown source kind '${e?.kind}'. Expected one of: csv, grid, table, objects, sql.`)}}}export{A as a,_ as b};
|
package/dist/chunk-TDTXRIHS.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
|
|
2
|
-
import{a as be}from"./chunk-QEH7WTLB.mjs";import{a as ye,b as _e}from"./chunk-2LR73DNS.mjs";import{c as pe}from"./chunk-OZEOA6ZE.mjs";import{b as ge,f as he}from"./chunk-E6SVTFAW.mjs";import{a as me,b as de,c as fe}from"./chunk-DMLWYEQ2.mjs";import{a as X,b as ue,c as B,d as le,e as j,h as ne,j as ce}from"./chunk-FUTSF2X5.mjs";var Ye=[[24.4,49.4,-125,-66.9],[51.2,71.5,-168,-129.9],[18.9,22.3,-160.3,-154.8]],He=[7,72,-172,-52];function Ae(n,e,t){return n>=t[0]&&n<=t[1]&&e>=t[2]&&e<=t[3]}var $=n=>Math.round(n*10)/10;function Ce(n,e=3){let t=[],i=[],o=0,s=0;for(let l of n){let u=l?.lat,m=l?.lon;if(typeof u!="number"||typeof m!="number"||!isFinite(u)||!isFinite(m)||u<-90||u>90||m<-180||m>180)continue;t.push(u),i.push(m);let y=l?.country?String(l.country).trim().toUpperCase():"",S=y?te(y):null;S?((y==="US"||y==="USA")&&o++,S==="north-america"&&s++):(Ye.some(O=>Ae(u,m,O))&&o++,Ae(u,m,He)&&s++)}let r=t.length;return r<e?null:(t.sort((l,u)=>l-u),i.sort((l,u)=>l-u),{pctUsa:$(o/r*100),pctNa:$(s/r*100),latP5:$(B(t,.05)),latP95:$(B(t,.95)),lonP5:$(B(i,.05)),lonP95:$(B(i,.95)),n:r})}var Se={"north-america":"AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI","south-america":"AR BO BR CL CO EC FK GF GY PE PY SR UY VE",europe:"AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA",africa:"AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW",asia:"AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE",oceania:"AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS",antarctica:"AQ BV GS HM TF"},Q=(()=>{let n=new Map;for(let e of Object.keys(Se))for(let t of Se[e].split(/\s+/))t&&n.set(t,e);return n})();function $e(n){for(let[e,t]of n){let i=Q.get(e);i&&!Q.has(t)&&Q.set(t,i)}}$e(ge);function te(n){if(!n)return null;let e=String(n).trim().toUpperCase();if(!e)return null;let t=Q.get(e);if(t)return t;let i=he(String(n));return i?Q.get(i)??null:null}function Zt(n,e=2){return ie(n.map(t=>[t,1]),e)}function ie(n,e=2){let t=new Map,i=0;for(let[r,l]of n){let u=te(r);if(!u)continue;let m=typeof l=="number"&&isFinite(l)&&l>0?l:1;t.set(u,(t.get(u)??0)+m),i+=m}if(i<e||!t.size)return null;let o="europe",s=-1;for(let r of Array.from(t.keys()).sort()){let l=t.get(r);l>s&&(o=r,s=l)}return{dominantGeoRegion:o,dominantGeoRegionPct:$(s/i*100),regionCount:t.size,n:i}}import We from"papaparse";var Ke=["rate","ratio","pct","percent","percentage","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","z[_-]?score","average","avg","mean","median","stddev","variance","gpa","percentile","quantile","efficiency","accuracy","probability","multiplier","coefficient","correlation","occupancy","age","bmi","temperature","density","pressure","humidity","ph","velocity","speed","elevation","altitude","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps","temperatuur","temperatur","temperatura","teplota","lampotila","homerseklet","sicaklik","pression","presion","pressao","pressione","druck","tryck","tlak","paine","nyomas","presiune","humidite","humedad","umidade","umidita","feuchtigkeit","vochtigheid","kosteus","vlhkost","vitesse","velocidad","velocidade","velocita","geschwindigkeit","snelheid","hastighet","hastighed","rychlost","nopeus","sebesseg","brzina","predkosc","densite","densidad","densidade","densita","dichte","dichtheid","hustota","tiheys","gustoca","moyenne","mediane","promedio","mediana","gemiddelde","durchschnitt","mittelwert","genomsnitt","gennemsnit","gjennomsnitt","keskiarvo","atlag","ortalama","prosjek","srednia","prumer","priemer","medie","taux","tasa","taxa","tasso","verhaltnis","verhouding","aandeel","anteil","andel","osuus","podil","udzial","udio","pourcentage","porcentaje","percentual","prozent","procent","prosentti","szazalek","yuzde","participacion","participacao","pondere","omjer","arany","oran","rata","leeftijd","edad","idade","wiek","eletkor","varsta","puntuacion","pontuacao","punteggio","betyg","ocena","indice","indeks","wskaznik","puan"],Ze=["pct","percent","percentage","rate","ratio","rating","share","score","index","nps","csat","margin","yield","coverage","utilization","utilisation","gpa","percentile","quantile","bmi","density","pressure","humidity","velocity","efficiency","occupancy","latency","throughput","bandwidth","iops","ppm","ppb","dpmo","bps"],je=["latitude","longitude"],Xe=["latitude","longitude"];function K(n){return Array.from(n).map(e=>{let t=e.normalize("NFD").replace(/[̀-ͯ]/g,"");return t.length===1?t:e}).join("")}var se=["somme de","suma de","soma de","summe von","som van","somma di","summa av","sum av","sum af","soucet z","suma z","totaal van","total de","toplam","osszeg","nombre de","recuento de","contagem de","anzahl von","aantal van","conteggio di","antal av","lukumaara","pocet z"],Re=["moyenne de","promedio de","media de","media di","durchschnitt von","gemiddelde van","medelvarde av","genomsnitt av","gennemsnit af","keskiarvo","atlag","ortalama","prumer z","srednia z","medie de","minimum de","minimo de","minimo di","minimum von","maximum de","maximo de","massimo di","maximum von"];function Qe(n){return[...n].sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")}var Ne=new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:"+Qe(se)+")\\s+)","i"),qe=/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g,Je=new RegExp("\\b("+Ke.join("|")+")\\b|("+Ze.join("|")+")$","i"),et=new RegExp("\\b("+je.join("|")+")\\b|("+Xe.join("|")+")$","i");function Te(n){if(!n)return"";let e=String(n),t=Ne.exec(K(e));return(t?e.slice(t[0].length):e).trim()}function tt(n){return!!n&&Ne.test(K(String(n)))}var nt=["count (distinct)","count distinct","distinct count","standard deviation","average","variance","median","product","stddev","std dev","count","sum","avg","min","minimum","max","maximum","var"],Me=new RegExp("^\\s*("+[...nt].sort((n,e)=>e.length-n.length).map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")+")\\s+of\\s+","i");function ve(n){if(n==null)return"";let e=String(n),t=Me.exec(e);if(!t)return e;let i=l=>l.toLowerCase().replace(/\s+/g," ").trim(),o=i(t[1]),s=e.slice(t[0].length),r=0;for(;r<8;){let l=Me.exec(s);if(!l||i(l[1])!==o)break;let u=s.slice(l[0].length);if(u.trim()==="")break;s=u,r++}return r===0?e:e.slice(0,t[0].length)+s}function re(n,e){if(!n||!e)return!1;let t=String(n);for(let i of e){let o=i?.hostName;if(o&&o!==i?.name&&t.includes(o))return!0}return!1}var xe={Sum:["Sum of "],Avg:["Average of "],Average:["Average of "],Count:["Count of "],CountNonNull:["Count of "],Min:["Min of ","First ","Earliest "],Max:["Max of ","Last ","Latest "],Median:["Median of "],StandardDeviation:["Standard deviation of "],Variance:["Variance of "]},it=new RegExp("^("+Object.keys(xe).join("|")+")\\((.+)\\)$");function we(n){if(!n)return[];let e=it.exec(String(n).trim());if(!e)return[];let t=xe[e[1]],i=e[2],o=[];for(let s=i.indexOf(".");s>=0;s=i.indexOf(".",s+1)){if(s===0)continue;let r=i.slice(s+1);if(r.trim()!=="")for(let l of t){let u=l+r;o.includes(u)||o.push(u)}}return o}function st(n){let e=Te(n);return e.length===0?"":e.replace(qe," ")}function Ie(n,e){if(!e)return!1;let t=Te(e);return n.test(K(st(e)))||n.test(K(t))||n.test(K(X(t).join(" ")))}function Ee(n){return Ie(et,n)}function rt(n){return Ie(Je,n)||Ee(n)}var De=/int|double|decimal|single|float|number|currency|money/i;function ot(n){let e=String(n?.valueNature??"").trim().toLowerCase();return e==="categorical"?"Categorical":e==="ordinal"?"Ordinal":e==="continuous"||n?.isMeasure===!0||De.test(String(n?.dataType??""))?"Continuous":"Categorical"}function at(n){return n?.isMeasure===!0||De.test(String(n?.dataType??""))}function Oe(n){let e=n??{},t=ot(e);if(t!=="Continuous")return{nature:t,additivity:"unknown",basis:"role",suppressed:!1};if(Ee(e.name))return{nature:t,additivity:"positional",basis:"name",suppressed:!0};let i=String(e.additivity??"").trim().toLowerCase();if(!(i==="additive"&&tt(e.name))){if(i==="additive")return{nature:t,additivity:"additive",basis:"measured",suppressed:!1};if(i==="part_of_whole")return{nature:t,additivity:"part_of_whole",basis:"measured",suppressed:!1};if(i==="intensive_rate")return{nature:t,additivity:"intensive_rate",basis:"measured",suppressed:!1}}return e.discourageAggregationAcrossGroups===!0?{nature:t,additivity:"intensive_rate",basis:"host-flag",suppressed:!1}:rt(e.name)?{nature:t,additivity:"intensive_rate",basis:"name",suppressed:!1}:{nature:t,additivity:"additive",basis:"default",suppressed:!1}}function Le(n){let e=Oe(n),t=n??{};if(e.nature==="Categorical")return["first","distinctcount","count"];if(e.nature==="Ordinal")return at(t)?["median","average","min","max","first","distinctcount","count"]:["first","distinctcount","count"];switch(e.additivity){case"positional":return["min","max","count","distinctcount","first"];case"intensive_rate":return["average","median","min","max","count","distinctcount","first"];default:return["sum","average","median","min","max","count","distinctcount","first"]}}function Qt(n){return Le(n)[0]}function qt(n,e){return Le(n).indexOf(e)>=0}function Jt(n,e){if(e!=="sum"&&e!=="count")return!1;if(e==="count")return!0;let t=Oe(n);return t.additivity==="additive"||t.additivity==="part_of_whole"||t.additivity==="unknown"}var ut=/^[A-Za-z_$][A-Za-z0-9_$]*$/,lt=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ct=new RegExp([String.raw`\bisMeasure\b`,String.raw`\bdataType\b`,String.raw`\bcolumns\s*\[\s*-?\d`,String.raw`\.iloc\s*\[[^\]]*,`,String.raw`\.iat\s*\[`,String.raw`\bselect_dtypes\b`,String.raw`\b_get_numeric_data\b`,String.raw`\bis_numeric_dtype\b`,String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`,String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`,String.raw`\bdf\.dtypes\b`,String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`,String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));function q(n,e){if(!n||!e)return!1;let t=lt(e);return new RegExp("['\"`]"+t+"['\"`]").test(n)?!0:ut.test(e)&&new RegExp("\\."+t+"(?![A-Za-z0-9_$])").test(n)}function mt(n){return!!n&&ct.test(n)}function tn(n,e,t){return n?mt(n)?[...e]:[...t,...e].some(i=>q(n,i))?e.filter(i=>q(n,i)):[...e]:[]}var sn=5,rn=6;var dt=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,ft=/^(\d{4})[-/](\d{1,2})$/,gt=/^(\d{4})[-\s]?Q([1-4])$/i,ht=/^Q([1-4])[-\s](\d{4})$/i,pt=/^(\d{4})$/,bt=/^(\d{4})(0[1-9]|1[0-2])$/,yt=/^(\d{4})(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])$/;function Y(n,e,t,i=0,o=0,s=0){if(!(n>=1&&e>=1&&e<=12&&t>=1&&t<=31))return null;let r=Date.UTC(n,e-1,t,i,o,s);if(!Number.isFinite(r))return null;let l=u=>u<10?"0"+u:String(u);return{ms:r,y:n,m:e,d:t,iso:`${n}-${l(e)}-${l(t)}`}}function _t(n,e){let t=[],i="";for(let u=0;u<e.length;u++){if(e[u]!=="%"){i+=e[u].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");continue}switch(e[++u]){case"Y":t.push("Y"),i+="(\\d{4})";break;case"m":t.push("m"),i+="(\\d{1,2})";break;case"d":t.push("d"),i+="(\\d{1,2})";break;case"H":case"M":case"S":i+="\\d{1,2}";break;case"%":i+="%";break;default:return null}}let o=new RegExp("^"+i+"$").exec(n);if(!o)return null;let s=0,r=1,l=1;return t.forEach((u,m)=>{let y=+o[m+1];u==="Y"?s=y:u==="m"?r=y:l=y}),s?Y(s,r,l):null}function At(n,e){let t=(n??"").trim();if(t==="")return null;if(e){let o=_t(t,e);return o||null}let i=dt.exec(t);if(i)return Y(+i[1],+i[2],+i[3],+(i[4]??0),+(i[5]??0),+(i[6]??0));if(i=gt.exec(t),i)return Y(+i[1],(+i[2]-1)*3+1,1);if(i=ht.exec(t),i)return Y(+i[2],(+i[1]-1)*3+1,1);if(i=ft.exec(t),i&&+i[2]>=1&&+i[2]<=12)return Y(+i[1],+i[2],1);if(i=yt.exec(t),i)return Y(+i[1],+i[2],+i[3]);if(i=bt.exec(t),i)return Y(+i[1],+i[2],1);if(i=pt.exec(t),i){let o=+i[1];return o>=1900&&o<=2100?Y(o,1,1):null}return null}function Ge(n){let e=new Date(n).getUTCDay();return e>=1&&e<=5}function ke(n,e){if(e<=n)return 0;let t=Math.round((e-n)/864e5),i=Math.floor(t/7),o=i*5,s=n+i*7*864e5;for(;s<e;)Ge(s)&&o++,s+=864e5;return o}function St(n){if(n.length===0)return 0;let e=[...n].sort((i,o)=>i-o),t=e.length>>1;return e.length%2?e[t]:(e[t-1]+e[t])/2}function Ct(n){return n>0?n<.95?"hour":n<=1.05?"day":n>=6.5&&n<=7.5?"week":n>=27&&n<=31.5?"month":n>=88&&n<=93?"quarter":n>=362&&n<=368?"year":"irregular":"irregular"}function Pe(n,e,t,i){switch(t){case"year":return e.y-n.y;case"quarter":return e.y*4+Math.floor((e.m-1)/3)-(n.y*4+Math.floor((n.m-1)/3));case"month":return e.y*12+e.m-(n.y*12+n.m);case"week":return Math.round((e.ms-n.ms)/(7*864e5));case"weekday":return ke(n.ms,e.ms);case"day":return Math.round((e.ms-n.ms)/864e5);default:return i>0?Math.round((e.ms-n.ms)/i):0}}function Fe(n,e){let t=e?.gapFactor??5,i=0,o=0,s=new Map;for(let f of n){if(f==null||f==="")continue;i++;let G=At(String(f),e?.pattern);G&&(o++,s.set(G.ms,G))}let r=[...s.values()].sort((f,G)=>f.ms-G.ms);if(r.length<3||i>0&&o/i<.8)return null;let l=r[r.length-1].ms-r[0].ms;if(l<=0)return null;let u=[];for(let f=1;f<r.length;f++)u.push(r[f].ms-r[f-1].ms);let m=St(u);if(!(m>0))return null;let y=Ct(m/864e5);y==="day"&&l>=7*864e5&&r.every(f=>Ge(f.ms))&&ke(r[0].ms,r[r.length-1].ms)+1>r.length*.5&&(y="weekday");let S=y==="irregular"?r.length:Pe(r[0],r[r.length-1],y,m)+1,O=1,I=1,C=[],w=r[0],g=1;for(let f=1;f<r.length;f++){let G=Pe(r[f-1],r[f],y,m);G>O&&(O=G),y!=="irregular"&&G>t?(I++,C.push({from:w.iso,to:r[f-1].iso,points:g}),w=r[f],g=1):g++}C.push({from:w.iso,to:r[r.length-1].iso,points:g});let x={grain:y,points:r.length,expectedPoints:Math.max(S,r.length),coveragePct:Math.round(r.length/Math.max(S,r.length)*1e3)/10,runs:I,largestGapUnits:O,gapFactor:t};return e?.includeBounds&&C.length<=6&&(x.runBounds=C),x}var Mt=12,Rt=100,Nt=.3,Tt=.9,vt=120,xt=1900,wt=2100,It=0,Et=20,Dt=new Set(["id","ids","uuid","guid","key","zip","zipcode","postal","postalcode","ssn","code","codes","sku","isbn","msisdn","imei"]);function Ot(n){if(!n)return!1;let e=X(n);return e.length===0?!1:Dt.has(e[e.length-1])}var Lt=new Set(["year","yr","fy"]),Pt=n=>X(n).some(e=>Lt.has(e)),Gt=/^(?:(?:19|20)\d{2}(?:[-/ ]?(?:q[1-4]|w(?:0?[1-9]|[1-4]\d|5[0-3])|(?:0?[1-9]|1[0-2])))?|q[1-4][-/ ](?:19|20)\d{2}|(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*[-/ ]?(?:19|20)?\d{2})$/i;function oe(n){if(!Number.isInteger(n)||n<190001||n>210012)return!1;let e=n%100;return e>=1&&e<=12}function ae(n){if(!Number.isInteger(n)||n<19000101||n>21001231)return!1;let e=Math.floor(n/100)%100,t=n%100;return e>=1&&e<=12&&t>=1&&t<=31}var kt=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?(?:\.\d+)?Z?)?$/,Ft=/^(\d{4})([\/.])(\d{1,2})\2(\d{1,2})$/,Wt=/^(\d{1,2})([\/.\-])(\d{1,2})\2(\d{4})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function zt(n){let e=(n||"").toLowerCase();return e==="en-us"||e==="en"||e.startsWith("en-us-")||e==="en-ph"||e==="en-bz"}function Ve(n,e){let t=0,i=0,o=0,s=0,r=0,l="",u=0,m="",y=0,S=0,O=0,I=0,C=!1;for(let V of n){if(V==null)continue;let W=String(V).trim();if(W==="")continue;t++;let k;if(k=kt.exec(W)){let z=+k[2],U=+k[3];z>=1&&z<=12&&U>=1&&U<=31&&(i++,k[4]!==void 0&&o++,k[6]!==void 0&&s++)}else if(k=Ft.exec(W)){let z=+k[3],U=+k[4];z>=1&&z<=12&&U>=1&&U<=31&&(l&&l!==k[2]&&(C=!0),l=k[2],r++)}else if(k=Wt.exec(W)){let z=+k[1],U=+k[3];z>=1&&z<=31&&U>=1&&U<=31&&(z<=12||U<=12)&&(m&&m!==k[2]&&(C=!0),m=k[2],u++,z>12&&O++,U>12&&I++,k[5]!==void 0&&y++,k[7]!==void 0&&S++)}if(t>=200)break}if(t<2||(i+r+u)/t<.8||(i>0?1:0)+(r>0?1:0)+(u>0?1:0)!==1||C)return null;if(i>0)return o===i?{pattern:s===i?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M",orderFrom:"iso"}:{pattern:"%Y-%m-%d",orderFrom:"iso"};if(r>0)return{pattern:`%Y${l}%m${l}%d`,orderFrom:"iso"};if(O>0&&I>0)return null;let x,f;O>0?(x=!0,f="values"):I>0?(x=!1,f="values"):(x=!zt(e),f="locale");let G=x?`%d${m}%m${m}%Y`:`%m${m}%d${m}%Y`;return y===u?{pattern:G+(S===u?" %H:%M:%S":" %H:%M"),orderFrom:f}:{pattern:G,orderFrom:f}}function Ut(n,e){if(!e||!/\b(?:19|20)\d{2}\b/.test(n))return!1;let t=n.replace(/\b(?:19|20)\d{2}\b/g,"").replace(/[-/.,]/g," ").trim();if(!t)return!1;let i=ye(t);return i.length>0&&e[i]!==void 0}function Vt(n){let{dataType:e,name:t,isMeasure:i,distinctCount:o}=n;if(e==="DateTime")return!0;if(i)return!1;if(e==="Integer"||e==="Decimal"){let s=n.minNum,r=n.maxNum;if(!(s!=null&&r!=null&&Number.isFinite(s)&&Number.isFinite(r)&&Number.isInteger(s)&&Number.isInteger(r)&&r>=s))return!1;let u=s>=1900&&r<=2100;if(u&&o>=2&&Pt(t)||u&&o>=3&&o===r-s+1)return!0;let m=oe(s)&&oe(r),y=ae(s)&&ae(r);if(m||y){if(!n.sampleValues)return!0;let S=0,O=0;for(let I of n.sampleValues){if(I==null||I==="")continue;S++;let C=Number(String(I).trim());if(Number.isFinite(C)&&(m?oe(C):ae(C))&&O++,S>=60)break}if(S>=2&&O===S)return!0}return!1}if(n.sampleValues){let s=n.locale?_e(n.locale):null,r=0,l=0,u=[];for(let m of n.sampleValues){if(m==null||m==="")continue;r++;let y=String(m).trim();if(u.push(y),(Gt.test(y)||Ut(y,s))&&l++,r>=60)break}if(r>=2&&l/r>=.8||Ve(u,n.locale)!==null)return!0}return!1}function Bt(n){let e=K((n||"").trim().toLowerCase());return e.startsWith("sum ")||e.startsWith("total ")?"sum":e.startsWith("average ")||e.startsWith("avg. ")?"avg":e.startsWith("count ")||e.startsWith("distinct count ")||e.startsWith("count (distinct) ")?"count":e.startsWith("min ")||e.startsWith("minimum ")?"min":e.startsWith("max ")||e.startsWith("maximum ")?"max":Re.some(t=>e.startsWith(t+" "))?/^(minimum|minimo)\b/.test(e)?"min":/^(maximum|maximo|massimo)\b/.test(e)?"max":"avg":se.some(t=>e.startsWith(t+" ")||e===t)?/^(nombre|recuento|contagem|anzahl|aantal|conteggio|antal|lukumaara|pocet)\b/.test(e)?"count":"sum":null}function Yt(n){let{rows:e,measureColIdx:t,measureName:i,candidateDims:o,minNum:s,maxNum:r,discourageAgg:l}=n,u=100,m=.01,y="";for(let O of o){if(O.distinct<2||O.distinct>u)continue;let I=o.filter(f=>f.idx!==O.idx).map(f=>f.idx),C=new Map;for(let f of e){let G=f[t];if(typeof G!="number"||!Number.isFinite(G))continue;let V=I.length?I.map(k=>String(f[k])).join(y):"",W=C.get(V);W||(W={sum:0,cset:new Set},C.set(V,W)),W.sum+=G,W.cset.add(String(f[O.idx]))}let w=0,g=0,x=0;for(let f of C.values())f.cset.size<2||(x++,Math.abs(f.sum-100)<=100*m?w++:Math.abs(f.sum-1)<=1*m&&g++);if(x>=2&&(w/x>=.9||g/x>=.9))return{additivity:"part_of_whole",partOfWholeDim:O.name}}if(l)return{additivity:"intensive_rate"};let S=Bt(i);return S==="avg"||S==="min"||S==="max"?{additivity:"intensive_rate"}:S==="count"?{additivity:"additive"}:S==="sum"?{additivity:"unknown"}:s!=null&&r!=null&&Number.isFinite(s)&&Number.isFinite(r)&&s>=0&&r<=1.0001&&r>0?{additivity:"intensive_rate"}:{additivity:"unknown"}}function ze(n){let{dataType:e,isMeasure:t,name:i,distinct:o,nonblank:s,prec:r,maxval:l,minval:u}=n,m=l-u+1,y=m>0?o/m:1,S=s>0?o/s:0,O=e==="Decimal"||r>0;return Ot(i)?"Categorical":y>=Tt&&(me(i)&&o<=vt||u>=xt&&l<=wt||u>=It&&l<=Et)?"Ordinal":t||o>Mt&&(O||o>=Rt||S>=Nt)?"Continuous":"Categorical"}function Ht(n){let e=null;for(let t=0;t<n.length;t++){let i=n[t];if(typeof i!="string"||i.length===0)continue;let o=i.trim();o.length!==i.length&&(e||(e=n.slice()),e[t]=o)}return e||n}var Ue=class{_computedStatsForLevel=null;_cols=[];_rows=[];_origIndices=[];_rowHashes=new Set;_hostQueryNames=[];_englishAliases=new Map;dedupRows=!0;emitLegacyAggAliases=!1;STR(e){return e==null?"":e instanceof Date?this.wholeDayIso(e)??(isNaN(e.getTime())?"":e.toISOString()):e.toString()}getPrecision(e){if(!isFinite(e))return 0;let i=e.toString().split(".")[1];return i?i.length:0}getColumns(){return this._cols}wholeDayIso(e){return ce(e)}hasTimeComponent(e){return!(e instanceof Date)||isNaN(e.getTime())?!1:this.wholeDayIso(e)===null}getColumnsWithStats(e,t){if(this._computedStatsForLevel==e)return this._cols;let i=0,o=parseInt(e),s=[];for(let a of this._cols){let d=new Map,E=[],R=0,c=0,M=0,T=null,N=null,A=null,P=!1,L=!0,b=!0,_=null,v=!1;for(let h of this._rows){let p=h[i],D=this.STR(p);if(D!=""){if(R+=D.length,d.set(D,(d.get(D)||0)+1),c++,a.dataType=="Integer"||a.dataType=="Decimal"||a.dataType=="DateTime")if((T===null||p<T)&&(T=p),(N===null||p>N)&&(N=p),a.dataType=="Integer"||a.dataType=="Decimal"){if(A===null?A=p:A+=p,a.dataType=="Decimal"){let F=this.getPrecision(p);F>M&&(M=F)}E.push(p)}else P=P||this.hasTimeComponent(p);v&&(p<_?L=!1:p>_&&(b=!1)),_=p,v=!0}}if(c>=3&&(L&&!b?a.sortedDirection="asc":b&&!L?a.sortedDirection="desc":a.sortedDirection="none"),c>0&&d.size>0&&!a.isMeasure){let h=0,p=Number.MAX_SAFE_INTEGER;for(let D of d.values())D>h&&(h=D),D<p&&(p=D);if(a.modalShare=h/c,a.minGroupCount=p===Number.MAX_SAFE_INTEGER?null:p,d.size===2){let D=[...d.keys()].map(ee=>ue(ee).trim().toLowerCase()).sort(),J=[["false","true"],["no","yes"],["n","y"],["0","1"],["f","t"]].some(ee=>D[0]===ee[0]&&D[1]===ee[1]),Z=/^(is|has)[_a-z0-9]|(?:default|churn|fraud|approv|convert|active|cancel|delinquen|flag|paid|win|pass|fail)/i.test(a.name);(J||Z)&&(a.isBinaryFlag=!0)}}if(a.dataType=="DateTime"&&(a.dateWithTime=P),a.isTemporal=Vt({dataType:a.dataType,name:a.name,isMeasure:a.isMeasure,distinctCount:d.size,minNum:typeof T=="number"?T:null,maxNum:typeof N=="number"?N:null,sampleValues:d.keys(),locale:t}),a.isTemporal&&a.dataType==="String"&&!a.isMeasure){let h=Ve(d.keys(),t);h&&(a.temporalTextPattern=h.pattern)}if(a.isTemporal&&!a.isMeasure){let h=Fe(d.keys(),{includeBounds:o>=20,pattern:a.temporalTextPattern});h&&(a.temporalCadence=h)}this.updateColumnStats10(o,a,c,d,M,N,T),this.updateColumnStats20(o,E,c,A,a,R,P,T,N,M,d,t),!a.isMeasure&&(a.dataType==="Integer"||a.dataType==="Decimal")&&ze({dataType:a.dataType,isMeasure:!1,name:a.name,distinct:d.size,nonblank:c,prec:M,maxval:typeof N=="number"?N:0,minval:typeof T=="number"?T:0})==="Continuous"&&(a.isMeasure=!0,a.geoKind=void 0,a.geoMatchPct=void 0,a.geoAmbiguous=void 0,a.dominantGeoRegion=void 0,a.dominantGeoRegionPct=void 0,a.geoRegionCount=void 0),s[i]=a.isMeasure||d.size>2e3?null:new Set(d.keys()),i++}let r=[];this._cols.forEach((a,d)=>{a.isMeasure||r.push({idx:d,distinct:a.distinctCount??0,name:a.name})}),this._cols.forEach((a,d)=>{if(!a.isMeasure)return;let E=typeof a.lowValue=="number"?a.lowValue:null,R=typeof a.highValue=="number"?a.highValue:null,c=Yt({rows:this._rows,measureColIdx:d,measureName:a.name,candidateDims:r,minNum:E,maxNum:R,discourageAgg:!!a.discourageAggregationAcrossGroups});a.additivity=c.additivity,c.partOfWholeDim&&(a.partOfWholeDim=c.partOfWholeDim)});let l=50,u=4,m=r.filter(a=>a.distinct>=2&&a.distinct<=l);this._cols.forEach((a,d)=>{if(!a.isMeasure)return;let E=[];for(let b of this._rows){let _=b[d];if(_==null||_==="")continue;let v=typeof _=="number"?_:parseFloat(_);isNaN(v)||E.push(v)}if(E.length===0)return;let R=[...E].sort((b,_)=>b-_);if(R[0]===R[R.length-1])a.relativeDispersion=0;else if(R.length>=u){let b=B(R,.5),_=B(R,.1),v=B(R,.9);a.relativeDispersion=Math.abs(b)>1e-9?Math.round((v-_)/Math.abs(b)*1e3)/1e3:void 0}else a.relativeDispersion=void 0;let c=[];for(let b of m){let _=new Set;for(let v of this._rows){let h=v[d];h==null||h===""||_.add(this.STR(v[b.idx])+"")}c.push({otherColumn:b.name,nonBlankGroupCount:_.size})}c.length>0&&(a.nonBlankGroups=c);let M=0;for(let b of E)M+=b;M/=E.length;let T=0;for(let b of E)T+=(b-M)*(b-M);if(T<=1e-12)return;let N=[],A=[],P=b=>{if(b.length<4)return NaN;let _=[...b].sort((h,p)=>h-p),v=h=>_[Math.min(_.length-1,Math.max(0,Math.floor(h*(_.length-1))))];return v(.75)-v(.25)},L=P(E);for(let b of m){let _=new Map;for(let p of this._rows){let D=p[d];if(D==null||D==="")continue;let F=typeof D=="number"?D:parseFloat(D);if(isNaN(F))continue;let J=this.STR(p[b.idx])+"",Z=_.get(J);Z?(Z.s+=F,Z.n++,Z.vals.push(F)):_.set(J,{s:F,n:1,vals:[F]})}let v=0;for(let p of _.values()){let D=p.s/p.n;v+=p.n*(D-M)*(D-M)}N.push({otherColumn:b.name,eta2:Math.round(v/T*1e4)/1e4});let h=[];for(let p of _.values()){let D=P(p.vals);isNaN(D)||h.push(D)}if(h.length>=2&&isFinite(L)&&L>1e-9){let p=(Math.max(...h)-Math.min(...h))/L;A.push({otherColumn:b.name,spreadRatio:Math.round(p*1e4)/1e4})}}N.length>0&&(a.groupDiscrimination=N),A.length>0&&(a.spreadDiscrimination=A)});let y=.97,S=.8,O=8,I=5,C=this._cols.map((a,d)=>({c:a,i:d})).filter(a=>a.c.isMeasure);for(let a=0;a<C.length;a++)for(let d=a+1;d<C.length;d++){let E=C[a].i,R=C[d].i,c=0,M=0,T=0,N=0,A=0,P=0;for(let v of this._rows){let h=v[E],p=v[R];if(h==null||h===""||p===null||p===void 0||p==="")continue;let D=typeof h=="number"?h:parseFloat(h),F=typeof p=="number"?p:parseFloat(p);isNaN(D)||isNaN(F)||(c++,M+=D,T+=F,N+=D*D,A+=F*F,P+=D*F)}if(c<I)continue;let L=c*N-M*M,b=c*A-T*T;if(L<=1e-12||b<=1e-12)continue;let _=(c*P-M*T)/Math.sqrt(L*b);if(Math.abs(_)>=y){let v=C[a].c,h=C[d].c;v.collinearWithMeasures||(v.collinearWithMeasures=[]),h.collinearWithMeasures||(h.collinearWithMeasures=[]),v.collinearWithMeasures.push(h.name),h.collinearWithMeasures.push(v.name)}else if(Math.abs(_)>=S){let v=C[a].c,h=C[d].c,p=Math.round(_*1e3)/1e3;v.correlatedWithMeasures||(v.correlatedWithMeasures=[]),h.correlatedWithMeasures||(h.correlatedWithMeasures=[]),v.correlatedWithMeasures.push({otherColumn:h.name,r:p}),h.correlatedWithMeasures.push({otherColumn:v.name,r:p})}}for(let{c:a}of C)a.correlatedWithMeasures&&(a.correlatedWithMeasures.sort((d,E)=>Math.abs(E.r)-Math.abs(d.r)||(d.otherColumn<E.otherColumn?-1:1)),a.correlatedWithMeasures.length=Math.min(a.correlatedWithMeasures.length,O));for(let a=0;a<this._cols.length;a++){let d=s[a];if(!d||d.size===0)continue;let E=[];for(let R=0;R<this._cols.length;R++){if(R===a)continue;let c=s[R];if(!c||c.size===0)continue;let M=0;for(let N of d)c.has(N)&&M++;let T=Math.round(M/d.size*100);T>0&&E.push({otherColumn:this._cols[R].name,percentShared:T})}E.length>0&&(this._cols[a].sharedValueRatioWithOthers=E)}let w=50,g=[];for(let a=0;a<this._cols.length;a++){let d=s[a];d&&d.size>=2&&d.size<=w&&g.push(a)}if(g.length>=2){let a=new Map,d=(R,c)=>R+":"+c;for(let R=0;R<g.length;R++)for(let c=R+1;c<g.length;c++)a.set(d(g[R],g[c]),new Map);for(let R of this._rows)for(let c=0;c<g.length;c++){let M=this.STR(R[g[c]])+"";for(let T=c+1;T<g.length;T++){let N=""+this.STR(R[g[T]]),A=a.get(d(g[c],g[T])),P=M+""+N;A.set(P,(A.get(P)??0)+1)}}let E=new Map;for(let R=0;R<g.length;R++)for(let c=R+1;c<g.length;c++){let M=g[R],T=g[c],N=s[M].size,A=s[T].size,P=a.get(d(M,T)),L=P.size,b=0;for(let p of P.values())(b===0||p<b)&&(b=p);let _=Math.round(L/(N*A)*100),v=L===N,h=L===A;if((this._cols[M].categoricalPairStats||=[]).push({otherColumn:this._cols[T].name,fillPct:_,determinesOther:v,minCellCount:b,distinctCombinations:L}),(this._cols[T].categoricalPairStats||=[]).push({otherColumn:this._cols[M].name,fillPct:_,determinesOther:h,minCellCount:b,distinctCombinations:L}),v&&N>A){let p=E.get(M);(!p||A<p.card)&&E.set(M,{name:this._cols[T].name,card:A,ratio:A/N})}if(h&&A>N){let p=E.get(T);(!p||N<p.card)&&E.set(T,{name:this._cols[M].name,card:N,ratio:N/A})}}for(let[R,c]of E)this._cols[R].primaryParentColumn=c.name,this._cols[R].nestingRatio=Math.round(c.ratio*100)/100}let x=6,f=this._rows.length;for(let a=0;a<this._cols.length;a++){let d=this._cols[a];if(d.isMeasure||d.primaryParentColumn)continue;let E=d.distinctCount??0;if(E<=w||f>0&&E>=f)continue;let R=[];for(let c=0;c<this._cols.length;c++){if(c===a)continue;let M=this._cols[c];if(M.isMeasure)continue;let T=M.distinctCount??0;T<2||T>=E||R.push(c)}R.sort((c,M)=>(this._cols[c].distinctCount??0)-(this._cols[M].distinctCount??0));for(let c of R.slice(0,x)){let M=new Map,T=!0;for(let A of this._rows){let P=this.STR(A[a])+"",L=this.STR(A[c])+"",b=M.get(P);if(b===void 0)M.set(P,L);else if(b!==L){T=!1;break}}if(!T)continue;let N=this._cols[c].distinctCount??0;d.primaryParentColumn=this._cols[c].name,d.nestingRatio=Math.round(N/E*100)/100;break}}let G=.01,V=.05,W=.95,k=8,z=8,U=6,Be=500,H=[];for(let a=0;a<this._cols.length&&H.length<z;a++){let d=this._cols[a].dataType;(d==="Double"||d==="Integer"||d==="Decimal")&&H.push(a)}if(H.length>=3&&this._rows.length>=k){let a=Math.min(this._rows.length,Be),d=H.map(N=>{let A=[];for(let b=0;b<a;b++){let _=this._rows[b][N],v=typeof _=="number"?_:parseFloat(String(_).replace(/,/g,""));if(_==null||_===""||!isFinite(v))return null;A.push(v)}let P=A[0],L=!1;for(let b of A)if(b!==P){L=!0;break}return L?A:null}),E=H.map((N,A)=>A).filter(N=>d[N]!==null),R=N=>{let A=N.slice().sort((L,b)=>L-b),P=A.length>>1;return A.length%2?A[P]:(A[P-1]+A[P])/2},c=null,M=[],T=N=>{if(M.length>=3){let A=M.map(_=>d[_]),P=A[0].length,L=new Array(P);for(let _=0;_<P;_++){let v=0;for(let h of A)v+=h[_];L[_]=v}let b=R(L);if(b>0){let _=0;for(let h of L)Math.abs(h-b)<=b*G&&_++;let v=_/P;if(v>=W){let h=1;for(let p of A){let D=R(p)/b;D<h&&(h=D)}h>=V&&(!c||M.length>c.cols.length)&&(c={cols:M.slice(),total:b,matched:v})}}}if(!(M.length>=U))for(let A=N;A<E.length;A++)M.push(E[A]),T(A+1),M.pop()};if(T(0),c){let N=c,P={columns:N.cols.map(L=>this._cols[H[L]].name),total:Math.round(N.total*1e3)/1e3,matchedPct:Math.round(N.matched*100)/100};for(let L of N.cols)this._cols[H[L]].constantSumGroup=P}}return this._computedStatsForLevel=e,this._cols}updateColumnStats20(e,t,i,o,s,r,l,u,m,y,S,O){if(e>=20){let I=[...t].sort((g,x)=>g-x),C=Math.floor(I.length/2);if(i>0&&o!=null?s.avgValue=s.dataType=="Integer"?Math.round(o/i):o/i:s.avgValue=null,i>0&&(s.avgLength=r/i),this._rows.length>0){let g=x=>{let f=x instanceof Date?x:typeof x=="string"?ne(x)??new Date(x):new Date(x),G=this.wholeDayIso(f);return G?G+"T00:00:00.000Z":isNaN(f.getTime())?x:f.toISOString().slice(0,10)+"T00:00:00.000Z"};s.dataType!="DateTime"||l||!u?s.lowValue=u:s.lowValue=g(u),s.dataType!="DateTime"||l||!m?s.highValue=m:s.highValue=g(m),s.medianValue=I.length===0?null:I.length%2===0?s.dataType=="Integer"?Math.round((I[C-1]+I[C])/2):(I[C-1]+I[C])/2:I[C],s.numericPrecision=y}if(I.length>0){let g=s.avgValue??0,x=I.length,f=0,G=0;for(let W of I){let k=W-g;f+=k*k,G+=k*k*k}let V=f/x;s.skewness=V===0?0:G/x/Math.pow(Math.sqrt(V),3),s.stdDev=Math.sqrt(V)}o!==null&&(s.sum=o);let w=Array.from(S.entries()).sort((g,x)=>x[1]-g[1]);if(s.topCategories=w.slice(0,10).map(g=>g[1]),!s.isMeasure&&w.length>0){if(s.dataType==="String"){let g=w.map(f=>f[0]);s.formatSignature=be(g);let x=/^(UUID|EMAIL_LIKE|URL_LIKE|PHONE_LIKE|NUMERIC_ID|HEX_ID|OPAQUE_ID_ALPHANUMERIC|DATE_STR|BOOLEAN)$/;s.formatSignature&&!x.test(s.formatSignature)&&(s.avgLength===void 0||s.avgLength>=3)&&(s.isFreeText=!0)}else s.topCategoryValues=w.slice(0,5).map(g=>g[0]);if(e>=20){let g=w.map(f=>f[0]),x=fe(g,O);if(x!==null)s.ordinalPattern=x.pattern,s.orderedDomain=x.orderedDomain;else if(s.dataType==="String"){let f=de(g);f!==null&&(s.safeDistinctValues=f)}}}if(I.length>=8&&(s.dataType==="Integer"||s.dataType==="Decimal")){let g=x=>I[Math.floor((I.length-1)*x)];s.quantiles={p05:g(.05),p25:g(.25),p75:g(.75),p95:g(.95)}}}if(!s.isMeasure&&S.size>0){let I=Array.from(S.entries()).sort((w,g)=>g[1]-w[1]),C=pe(I.map(w=>w[0]),s.name,O);if(C!==null&&(s.geoKind=C.geoKind,s.geoMatchPct=C.geoMatchPct,C.geoAmbiguous&&(s.geoAmbiguous=!0),C.geoKind.indexOf("country")===0)){let w=ie(I);w&&(s.dominantGeoRegion=w.dominantGeoRegion,s.dominantGeoRegionPct=w.dominantGeoRegionPct,s.geoRegionCount=w.regionCount)}}}updateColumnStats10(e,t,i,o,s,r,l){e>=10&&(t.blankCount=this._rows.length-i,t.distinctCount=o.size+(t.blankCount!=0?1:0),t.valueNature="Categorical",i>0&&(t.dataType==="Integer"||t.dataType==="Decimal"?t.valueNature=ze({dataType:t.dataType,isMeasure:!!t.isMeasure,name:t.name,distinct:o.size,nonblank:i,prec:s,maxval:r,minval:l}):t.dataType==="DateTime"&&(t.valueNature=t.dateWithTime?"Continuous":"Ordinal")))}getRowCount(){return this._rows.length}getLeafCardinality(){if(this._leafCardinality!==null)return this._leafCardinality;let e=[];if(this._cols.forEach((i,o)=>{i.isMeasure||e.push(o)}),e.length===0)return this._leafCardinality=this._rows.length,this._leafCardinality;let t=new Set;for(let i of this._rows)t.add(JSON.stringify(e.map(o=>i[o])));return this._leafCardinality=t.size,this._leafCardinality}_leafCardinality=null;getGeoExtent(){if(this._geoExtentComputed)return this._geoExtent;this._geoExtentComputed=!0,this._geoExtent=null;let e=r=>String(r||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z]+/),t=-1,i=-1,o=-1;if(this._cols.forEach((r,l)=>{let u=e(r.name),m=r.dataType==="Integer"||r.dataType==="Decimal";m&&t<0&&u.some(y=>y==="lat"||y==="latitude")?t=l:m&&i<0&&u.some(y=>y==="lon"||y==="lng"||y==="long"||y==="longitude")&&(i=l),o<0&&!r.isMeasure&&typeof r.geoKind=="string"&&r.geoKind.indexOf("country")===0&&(o=l)}),t<0||i<0)return null;let s=[];for(let r of this._rows){let l=r[t],u=r[i],m=l==null||l===""?null:Number(l),y=u==null||u===""?null:Number(u);s.push({lat:m,lon:y,country:o>=0&&te(this.STR(r[o]))?this.STR(r[o]):null})}return this._geoExtent=Ce(s),this._geoExtent}_geoExtent=null;_geoExtentComputed=!1;obfuscateString(e){let t="abcdefghijklmnopqrstuvwxyz",i=()=>t[Math.floor(j()*t.length)],o=()=>i().toUpperCase(),s=()=>Math.floor(j()*10).toString(),r=C=>/[A-Z]/.test(C)?o():/[a-z]/.test(C)?i():/[0-9]/.test(C)?s():C,l=e.includes("@")&&e.includes("."),u=l?e.split("@"):[e],m=l?u[1]:"",y=m.endsWith(".com"),S=y?".com":"",O=y?m.slice(0,-4):m,I=C=>{let w="";for(let g of C)w+=r(g),/[a-zA-Z0-9]/.test(g)&&j()<.2&&(w+=r(g));if(w.length>6){let g=Math.floor(j()*Math.min(3,w.length-6));for(let x=0;x<g;x++){let f=0;for(;f<5;){let G=Math.floor(j()*w.length);if(/[a-zA-Z0-9]/.test(w[G])){w=w.slice(0,G)+w.slice(G+1);break}f++}}}return w};if(l){let C=I(u[0]),w=I(O);return`${C}@${w}${S}`}else return I(e)}toObjectArray(){let e=this.liveEnglishAliases();return this._rows.map(t=>{let i={};this._cols.forEach((o,s)=>{i[o.name]=t[s],this.emitLegacyAggAliases&&o.hostName&&o.hostName!==o.name&&!Object.prototype.hasOwnProperty.call(i,o.hostName)&&(i[o.hostName]=t[s])});for(let[o,s]of e)Object.prototype.hasOwnProperty.call(i,s.alias)||(i[s.alias]=t[o]);return i})}async getCSVAsync(e){let t=[],i=e?25:1e7,o=e?4e3:1e7,s=new Map;for(let l of this._rows){let u={};for(let m=0;m<this._cols.length;m++){let y=this._cols[m],S=l[m];if(this.STR(S)!=""){if(e&&y.dataType=="String")if(s.has(S))S=s.get(S);else{let O=this.obfuscateString(S);s.set(S,O),S=O}else if(y.dataType=="DateTime"&&!y.dateWithTime){let O=S instanceof Date?S:typeof S=="string"?ne(S)??new Date(S):new Date(S);S=(this.wholeDayIso(O)??O.toISOString().slice(0,10))+"T00:00:00.000Z"}o-=this.STR(S).length}else S=null;u[m]=S,--o}if(t.push(u),--i,i<=0||o<=0)break}return await We.unparse(t,{header:!1})}getCSVHeaderLine(){let e=this.liveEnglishAliases();return We.unparse([this._cols.map((t,i)=>{if(this.emitLegacyAggAliases&&t.hostName)return this.STR(t.hostName);let o=e.get(i);return this.STR(o&&o.headerName?o.alias:t.name)})])}setHostQueryNames(e){this._hostQueryNames=(e??[]).map(t=>t==null?null:this.STR(t)),this._englishAliases=new Map}aliasesForCode(e){let t=re(e,this._cols)?this.legacyAliases():[];for(let i of this.englishAliasesFor(e).values())t.push({name:i.name,alias:i.alias,reason:"english-implicit-agg"});return t}armAliasesForCode(e){return this.emitLegacyAggAliases=re(e,this._cols),this._englishAliases=this.englishAliasesFor(e),this.getArmedAliases()}getArmedAliases(){let e=this.emitLegacyAggAliases?this.legacyAliases():[];for(let t of this.liveEnglishAliases().values())e.push({name:t.name,alias:t.alias,reason:"english-implicit-agg"});return e}legacyAliases(){let e=[];for(let t of this._cols)t&&t.hostName&&t.hostName!==t.name&&e.push({name:this.STR(t.name),alias:this.STR(t.hostName),reason:"doubled-agg-prefix"});return e}englishAliasesFor(e){let t=new Map;if(!e||this._hostQueryNames.length===0||!this._cols||this._cols.length===0)return t;let i=String(e),o=new Set;for(let r of this._cols)r&&(o.add(this.STR(r.name)),r.hostName&&o.add(this.STR(r.hostName)));let s=new Map;for(let r=0;r<this._cols.length;r++){if(!this._cols[r])continue;let l=we(this._hostQueryNames[r]).filter(u=>!o.has(u)&&q(i,u));l.length===1&&s.set(l[0],[...s.get(l[0])??[],r])}for(let[r,l]of s){if(l.length!==1)continue;let u=this.STR(this._cols[l[0]].name);t.set(l[0],{name:u,alias:r,headerName:!q(i,u)})}return t}liveEnglishAliases(){let e=new Map;for(let[t,i]of this._englishAliases){let o=this._cols?this._cols[t]:null;o&&this.STR(o.name)===i.name&&e.set(t,i)}return e}addRow(e,t){if(this.dedupRows){let i="";for(let s of e)i+=this.STR(s)+"~";let o=le(i);if(this._rowHashes.has(o))return!1;this._rowHashes.add(o)}return this._rows.push(Ht(e)),this._origIndices.push(t??-1),!0}getOriginalRowIndex(e){return e<0||e>=this._origIndices.length?-1:this._origIndices[e]}reset(){this._cols=[],this._rows=[],this._origIndices=[],this._rowHashes=new Set,this._leafCardinality=null,this._hostQueryNames=[],this._englishAliases=new Map}setColumns(e){if(this._cols=e,!e||e.length===0)return;let t=new Set(e.map(i=>this.STR(i?.name)));for(let i of e){if(!i)continue;let o=this.STR(i.name),s=ve(o);!s||s===o||t.has(s)||(t.delete(o),t.add(s),i.hostName=o,i.name=s)}}};export{Ce as a,$e as b,te as c,Zt as d,Ke as e,Ze as f,je as g,Xe as h,Te as i,tt as j,ve as k,re as l,we as m,Ee as n,rt as o,Oe as p,Le as q,Qt as r,qt as s,Jt as t,q as u,mt as v,tn as w,sn as x,rn as y,At as z,Fe as A,Ot as B,Ve as C,Vt as D,Bt as E,Yt as F,ze as G,Ht as H,Ue as I};
|