@bicharts/shape-core 0.6.108 → 0.6.109
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/index.mjs +1 -1
- package/dist/types/models.d.ts +2 -0
- package/dist/types/wireBuild.d.ts +21 -0
- package/package.json +1 -1
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 yr,b as hr}from"./chunk-HIVICMC5.mjs";import{a as Cr,b as I,c as br,d as D,e as E,f as Er,g as J,h as Z}from"./chunk-4J7WPYLM.mjs";import{a as fr,b as pr,c as gr}from"./chunk-GR25KIHB.mjs";import{A as Hn,B as Kn,C as Bn,D as jn,E as Yn,F as Qn,G as Xn,H as Jn,I as Zn,J as er,K as tr,L as nr,M as rr,N as or,O as ir,P as sr,Q as ar,R as lr,S as ur,T as cr,U as dr,W as mr,a as pn,b as gn,c as yn,d as hn,e as Cn,g as wn,h as _n,i as On,j as Pn,k as vn,l as Ln,m as An,n as In,o as Mn,p as Nn,q as Fn,r as Dn,s as kn,t as Gn,u as Vn,v as Un,w as Wn,x as qn,y as $n,z as zn}from"./chunk-PUXXFTDT.mjs";import{a as bn}from"./chunk-U3H6UBOO.mjs";import{b as En,c as Tn,d as Sn,f as Rn,g as xn}from"./chunk-TZ74QIKA.mjs";import{a as de,c as me,e as cn,f as dn,g as mn,h as fn}from"./chunk-WTJVREEE.mjs";import{A as Q,B as Zt,C as en,D as ce,E as M,F as tn,G as nn,H as rn,I as W,J as on,K as sn,L as an,M as ln,N as X,O as un,a as A,b as G,c as j,d as V,j as U,k as Vt,l as Ut,m as Wt,n as qt,o as $t,q as zt,r as Ht,s as Y,t as Kt,u as Bt,v as jt,w as Yt,x as Qt,y as Xt,z as Jt}from"./chunk-AAPXJXEP.mjs";import"./chunk-5MRZID36.mjs";import{a as Et,b as Tt,c as St,d as Rt,e as xt,f as wt,g as _t,h as Ot,i as Pt,j as vt,k as Lt,l as At,m as Dt,n as kt,o as Gt}from"./chunk-3ZAS32F5.mjs";import{b as It,c as Mt,d as Nt,e as Ft}from"./chunk-5HI6TVMM.mjs";import{A as gt,B as yt,C as ht,D as Ct,E as bt,a as He,b as Ke,c as Be,d as je,e as Ye,f as Qe,g as Xe,h as Je,i as Ze,j as et,k as tt,l as nt,m as rt,n as ot,o as it,q as B,r as st,s as at,t as lt,u as ut,v as ct,w as dt,x as mt,y as ft,z as pt}from"./chunk-CZJ7M6A5.mjs";import{a as Ve,b as Ue,c as We,d as qe,e as $e,f as K,g as ze}from"./chunk-WC4JINEZ.mjs";var ee=2,ge=400;function ne(e){return!!U(e)}function F(e){let t=new Set;for(let n of e){if(n==null)continue;let o=V(String(n));if(!G(o)&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function N(e){let t=F(e);if(t.length===0||re(e)<95)return!1;let n=t.filter(a=>ne(a)&&!M(a)).length,o=t.filter(a=>!ne(a)&&!!M(a)).length;return n>=1&&n>=o}function fe(e,t){if(!M(e))return!1;let n=U(e);return n?t==="world"?!0:ce.has(n):!1}function re(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)ne(o)&&n++;return Math.round(n/t.length*1e3)/10}function oe(e){return M(e)?!0:Y()?Q(e).status!=="unmatched"||Q(e.trim().replace(/\s+/g,"-")).status!=="unmatched":!1}function q(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)oe(o)&&n++;return Math.round(n/t.length*1e3)/10}function se(e){let t=new Set;for(let n of e){if(n==null)continue;let o=String(n).trim();if(!G(V(o))&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function ie(e){let t=se(e);if(t.length===0)return 0;let n=0;for(let o of t)W(o).length>0&&n++;return Math.round(n/t.length*1e3)/10}function pe(e,t){return me(t,de)?!0:se(e).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Tr(e,t){let n=F(e);if(n.length===0)return 0;let o=0;for(let a of n)X(a,t)&&o++;return Math.round(o/n.length*1e3)/10}function te(e,t){let n=0;for(let o of F(e))t(o)&&n++;return n}function Sr(e,t){let n=0;for(let o of se(e))t(o)&&n++;return n}function Rr(e,t,n,o,a){let u=[],l=[],i={},C={},b=new Set(e),h=s=>t.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&b.has(d)&&(i[s]=d)}let g=new Set(a??e);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&b.has(f)){let s=h(f),d=ie(s);d<95?l.push(`zip=${f} (only ${d}% of values read as ZIPs)`):pe(s,f)?i.zip=f:l.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let c=n?.state;if(c&&b.has(c)){let s=h(c),d=F(s);d.length>0&&d.every(S=>fe(S,o))?l.push(`state=${c} (every value is "CA", which is both Canada and California)`):N(s)?(l.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):q(s)<95?l.push(`state=${c} (only ${q(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),y=e.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of y){let S=h(d);if(N(S))continue;let O=q(S);if(O<95)continue;let H=te(S,oe),Ge=te(S,ue=>oe(ue)&&!fe(ue,o));H<ee&&Ge<1||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.state=s.name,p.add(s.name),u.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of y){if(p.has(s))continue;let d=h(s),S=ie(d);if(!(S<95)&&pe(d,s)&&!(Sr(d,O=>W(O).length>0)<ee)){i.zip=s,p.add(s),u.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!N(h(T))){let s=null;for(let d of y){if(p.has(d)||!N(h(d)))continue;let S=re(h(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(l.push(`country=${T} (only ${re(h(T))}% of values are country identifiers; using ${s.name} instead)`),C.country=T),i.country=s.name,p.add(s.name),u.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of y){if(p.has(d))continue;let S=h(d),O=Tr(S,o);O<j||te(S,H=>X(H,o))<ee||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.city=s.name,u.push(`city=${s.name} (${s.pct}% known cities)`))}let v=i.country?h(i.country):[],R=!!i.country&&N(v),L=R?new Set(v.map(s=>U(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&L>=2,w=!!(i.lat&&i.lon)&&t.some(s=>{let d=+String(s[i.lat]??"").trim(),S=+String(s[i.lon]??"").trim();return isFinite(d)&&isFinite(S)&&d>=-90&&d<=90&&S>=-180&&S<=180&&String(s[i.lat]??"").trim()!==""&&String(s[i.lon]??"").trim()!==""});return i.lat&&i.lon&&!w&&l.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&l.push(R?`country=${i.country} (every row resolves to the same country - nothing to place apart)`:`country=${i.country} (values are not country identifiers)`),{bind:!!(i.city||i.state||i.zip||x||w)?i:null,backfilled:u,refused:l,...Object.keys(C).length?{labelFallback:C}:{}}}var r=(e,...t)=>({part:e,langs:Object.freeze(t)}),ae=Object.freeze({jaar:r("year","nl"),kwartaal:r("quarter","nl"),maand:r("month","nl"),dag:r("day","nl","sv","da","nb"),jahr:r("year","de"),quartal:r("quarter","de"),monat:r("month","de"),tag:r("day","de"),ann\u00E9e:r("year","fr"),mois:r("month","fr"),jour:r("day","fr"),trimestre:r("quarter","fr","es","pt","it"),a\u00F1o:r("year","es"),mes:r("month","es"),d\u00EDa:r("day","es"),ano:r("year","pt"),m\u00EAs:r("month","pt"),dia:r("day","pt"),anno:r("year","it"),mese:r("month","it"),giorno:r("day","it"),\u0433\u043E\u0434:r("year","ru"),\u043C\u0435\u0441\u044F\u0446:r("month","ru"),\u0440\u0456\u043A:r("year","uk"),\u043C\u0456\u0441\u044F\u0446\u044C:r("month","uk"),\u043A\u0432\u0430\u0440\u0442\u0430\u043B:r("quarter","ru","uk"),\u0434\u0435\u043D\u044C:r("day","ru","uk"),rok:r("year","pl","cs","sk"),kwarta\u0142:r("quarter","pl"),miesi\u0105c:r("month","pl"),dzie\u0144:r("day","pl"),\u010Dtvrtlet\u00ED:r("quarter","cs"),m\u011Bs\u00EDc:r("month","cs"),den:r("day","cs"),\u0161tvr\u0165rok:r("quarter","sk"),mesiac:r("month","sk"),de\u0148:r("day","sk"),\u00E5r:r("year","sv","da","nb"),kvartal:r("quarter","sv","da","nb"),m\u00E5nad:r("month","sv"),m\u00E5ned:r("month","da","nb"),vuosi:r("year","fi"),vuosinelj\u00E4nnes:r("quarter","fi"),kuukausi:r("month","fi"),p\u00E4iv\u00E4:r("day","fi"),\u00E9v:r("year","hu"),negyed\u00E9v:r("quarter","hu"),h\u00F3nap:r("month","hu"),nap:r("day","hu"),y\u0131l:r("year","tr"),\u00E7eyrek:r("quarter","tr"),ay:r("month","tr"),g\u00FCn:r("day","tr"),\u03AD\u03C4\u03BF\u03C2:r("year","el"),\u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF:r("quarter","el"),\u03BC\u03AE\u03BD\u03B1\u03C2:r("month","el"),\u03B7\u03BC\u03AD\u03C1\u03B1:r("day","el"),an:r("year","ro"),trimestru:r("quarter","ro"),lun\u0103:r("month","ro"),zi:r("day","ro"),godina:r("year","hr"),tromjese\u010Dje:r("quarter","hr"),mjesec:r("month","hr"),dan:r("day","hr"),\u5E74:r("year","ja","zh"),\u56DB\u534A\u671F:r("quarter","ja"),\u5B63\u5EA6:r("quarter","zh"),\u6708:r("month","ja","zh"),\u65E5:r("day","ja","zh"),\uC5F0\uB3C4:r("year","ko"),\uBD84\uAE30:r("quarter","ko"),\uC6D4:r("month","ko"),\uC77C:r("day","ko"),tahun:r("year","id"),kuartal:r("quarter","id"),triwulan:r("quarter","id"),bulan:r("month","id"),hari:r("day","id"),n\u0103m:r("year","vi"),qu\u00FD:r("quarter","vi"),th\u00E1ng:r("month","vi"),ng\u00E0y:r("day","vi"),\u0E1B\u0E35:r("year","th"),\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A:r("quarter","th"),\u0E40\u0E14\u0E37\u0E2D\u0E19:r("month","th"),\u0E27\u0E31\u0E19:r("day","th"),\u0627\u0644\u0633\u0646\u0629:r("year","ar"),\u0633\u0646\u0629:r("year","ar"),\u0627\u0644\u0639\u0627\u0645:r("year","ar"),\u0639\u0627\u0645:r("year","ar"),\u0627\u0644\u0631\u0628\u0639:r("quarter","ar"),\u0631\u0628\u0639:r("quarter","ar"),"\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629":r("quarter","ar"),\u0627\u0644\u0634\u0647\u0631:r("month","ar"),\u0634\u0647\u0631:r("month","ar"),\u0627\u0644\u064A\u0648\u0645:r("day","ar"),\u064A\u0648\u0645:r("day","ar"),\u05E9\u05E0\u05D4:r("year","he"),\u05E8\u05D1\u05E2\u05D5\u05DF:r("quarter","he"),\u05D7\u05D5\u05D3\u05E9:r("month","he"),\u05D9\u05D5\u05DD:r("day","he"),\u0935\u0930\u094D\u0937:r("year","hi"),\u0938\u093E\u0932:r("year","hi"),\u0924\u093F\u092E\u093E\u0939\u0940:r("quarter","hi"),\u092E\u0939\u0940\u0928\u093E:r("month","hi"),\u092E\u093E\u0939:r("month","hi"),\u0926\u093F\u0928:r("day","hi"),\u0633\u0627\u0644:r("year","fa"),\u0645\u0627\u0647:r("month","fa"),\u0631\u0648\u0632:r("day","fa")}),xr=Object.freeze(Array.from(new Set(Object.values(ae).flatMap(e=>e.langs)))),ye=Object.freeze(["fa","ar","he","th"]),he=1900,Ce=2100;function wr(e,t){let n=[],o=K(t);try{o&&n.push(e.toLocaleLowerCase(o.intl))}catch{}let a=e.toLowerCase();return n.includes(a)||n.push(a),n}function _r(e,t){let n=String(e??"").trim().normalize("NFC");if(!n)return null;for(let o of wr(n,t)){let a=ae[o];if(a&&a.langs.includes(t))return a.part}return null}function Or(e,t){return ye.includes(e)?typeof t=="number"&&Number.isFinite(t)&&t>=he&&t<=Ce:!0}function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Pr=/\b(?:columns|cols|column)\b/i;function $(e,t){let n=Math.max(0,t-240),o=e.slice(n,t),a=o.lastIndexOf(";");return a>=0&&(o=o.slice(a+1)),Pr.test(o)}function Ee(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(e))}function Te(e,t,n){let o=be(t),a=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),u=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),l=0,i;for(;(i=u.exec(e))!==null;)$(e,i.index)&&l++;let C=0;for(;(i=a.exec(e))!==null;){let b=i.index+i[0].lastIndexOf(".name");if(!$(e,b))continue;C++;let h=be(i[1]);if(!n(h))return!1}return C>0&&C===l}function vr(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(e)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(e))}var Se=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function Lr(e,t){if(!e)return[];let n=new Set(t);for(let i of Se)n.add(i);let o=new Set,a=/\.name\s*===?\s*(['"])([^'"]+)\1/g,u;for(;(u=a.exec(e))!==null;)$(e,u.index)&&o.add(u[2]);if(o.size===0)return[];let l=[];return o.forEach(i=>{n.has(i)||Ee(e,i)||l.push(i)}),l}function Ar(e,t){if(!e)return[];let n=(e.getColumns()||[]).map(o=>o.name);if(!t||typeof e.aliasesForCode!="function")return n;for(let o of e.aliasesForCode(t))n.push(o.alias);return n}function Re(e,t){let n=t?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(e)||e<=n?0:Math.round(e-n)}function Ir(e,t,n){let o=Re(e,t);if(o===null||o<=0)return null;let a=typeof t?.freemiumColumnCapPivot=="number"?t.freemiumColumnCapPivot:4,u=o>a?t?.freemiumColumnCapMessageMany:t?.freemiumColumnCapMessageFew;if(typeof u!="string"||u.trim().length===0)return null;let l=u.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=xe(n);return i.length===0?l:l+" "+i.join(" ")}function xe(e){if(!e||e.length===0)return[];let t=[],n=new Map,o=new Map;for(let u of e){let l=typeof u?.dateGroupId=="string"?u.dateGroupId.trim():"";if(l!==""&&(n.has(l)||(t.push(l),n.set(l,0)),u.isDatePart===!0&&n.set(l,n.get(l)+1),u.isReassembledDate===!0&&!o.has(l))){let i=typeof u.sourceField=="string"?u.sourceField.trim():"",C=typeof u.name=="string"?u.name.trim():"",b=i!==""?i:C;b!==""&&o.set(l,b)}}let a=[];for(let u of t){let l=o.get(u),i=n.get(u)??0;!l||i===0||a.push(`'${l}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return a}var m=e=>e==null?"":String(e),P=e=>e===!0,we=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Mr=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function _e(e,t){let n={};for(let[o,a]of Mr){let u=m(E(e,t+a));u&&(n[o]=u)}return n}function Nr(e){return Array.isArray(e)?e.map(t=>({code:m(E(t,"code")),severity:m(E(t,"severity")),text:m(E(t,"text"))})).filter(t=>t.text!==""):[]}function Fr(e){let t=b=>E(e,b),n=t("retryAfterSeconds"),o=t("overrideThumbnailUpload"),a=t("forceThumbnailUpload"),u=_e(e,"point"),l=_e(e,"destPoint");Object.keys(l).length&&(u.dest=l);let i=t("retryable"),C=t("isPollFinal");return{errorMessage:m(t("errorMessage")),errorCode:m(t("errorCode")),refusalCode:m(t("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:Nr(t("notices")),freemiumStatusCode:m(t("freemiumStatusCode")),code:m(t("code")),language:m(t("language")),version:Number(t("version")??0),codeSummary:m(t("codeSummary")),chartName:m(t("chartName")??t("chartType")),finalChartName:m(t("finalChartName")),warningMessage:m(t("warningMessage")),outputHash:m(t("outputHash")),validatorToken:m(t("validatorToken")),editCodeKey:m(t("editCodeKey")),signedLLMRequestID:m(t("signedLLMRequestID")),userReply:m(t("userReply")),userReplyOutcome:m(t("userReplyOutcome")),improvementSuggestion:m(t("improvementSuggestion")),geoColumn:m(t("geoColumn")),geoKind:m(t("geoKind")),geoPointCols:Object.keys(u).length?u:null,creditBalanceBefore:we(t("creditBalanceBefore")),creditCost:we(t("creditCost")),isServiceError:P(t("isServiceError")),isRateLimited:P(t("isRateLimited")),suppressSelectionGlyph:P(t("suppressSelectionGlyph")),isRefusal:P(t("isRefusal")),isVersionNotFound:P(t("isVersionNotFound")),isGenerationCancelled:P(t("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(t("servedCorrelationId")),...typeof C=="boolean"?{isPollFinal:C}:{},...m(t("pollOutcome"))!==""?{pollOutcome:m(t("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof a=="boolean"?{forceThumbnailUpload:a}:{}}}var Oe=e=>e==null?void 0:Number(e),k=e=>m(e)||void 0;function Dr(e){let t=E(e,"charts"),n=E(e,"refused"),o=Array.isArray(t)?t.map(u=>{let l=C=>E(u,C),i=l("recommended");return{name:m(l("chartTypeName")??l("name")),description:m(l("description")??l("chartDesc")),rank:Oe(l("rank")),score:Oe(l("score")),renderer:k(l("renderer")),language:k(l("language")),isPreview:P(l("isPreview")),alsoWorthALook:P(l("alsoWorthALook")),recommended:typeof i=="boolean"?i:void 0,viaProjection:k(l("viaProjection")),viaProjectionKey:k(l("viaProjectionKey")),detailNote:k(l("detailNote"))}}).filter(u=>u.name):null,a=Array.isArray(n)?n.map(u=>({name:m(E(u,"chartTypeName")??E(u,"name")),reason:m(E(u,"reason")),reasonCode:m(E(u,"reasonCode")),isVeto:P(E(u,"isVeto"))})).filter(u=>u.name):[];return{errorMessage:m(E(e,"errorMessage")),errorCode:m(E(e,"errorCode")),charts:o,refused:a,noFitSummary:m(E(e,"noFitSummary"))}}function kr(e){return!e||typeof e!="object"?null:{status:String(E(e,"status")??""),verdictReason:E(e,"verdictReason")??null,instruction:E(e,"instruction")??null,fix:E(e,"fix")??null,errorMessage:E(e,"errorMessage")??null,errorCode:E(e,"errorCode")??null}}var Pe=["working","analyze","generate","refine","review"];function Gr(e,t){let n=String(e??"").trim().toLowerCase();if(Pe.includes(n))return n;let o=String(t??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var Vr="FREEMIUM_ATTEMPT_SPENT",Ur="CLIENT_SECRET_MISMATCH",Wr="FREEMIUM_COLUMN_CAP",qr="OAUTH_TOKEN_EXPIRED",$r="OAUTH_SIGNED_OUT";function zr(e){let t=e?.retryable;return typeof t=="boolean"?t:null}function Hr(e){let t=e.linkNonce?(e.linkNonce()??"").trim():null,n=t?null:e.accessToken?(e.accessToken()??"").trim():null,o=t||n?{licensee:"",licenseKey:"",secretKey:""}:e.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:e.freemiumKey?.()??""},linkNonce:t,accessToken:n}}function Kr(e){let{width:t,height:n}=e.measure();return{request:{height:n,width:t},hints:{viewportWidth:t,viewportHeight:n}}}function Br(e){let t=0;for(let n of e){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>t&&(t=o)}return t}function ve(e){if(e.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(e.recoveryFetchVersion!=null)return{version:e.recoveryFetchVersion,fetchOnly:!0};let t=e.settingVersion??null;if(e.genNew)return{version:t,fetchOnly:void 0};let n=(t??0)>0?t:null,o=(e.codeVersion??0)>0?e.codeVersion:null,a=n??o??t;return{version:a,fetchOnly:a!=null&&a>0?!0:void 0}}function jr(e){let t=e.fetchCorrelationId!=null,o=t||e.recoveryFetchVersion!=null?!1:e.genNew,a=ve({genNew:o,recoveryFetchVersion:e.recoveryFetchVersion,recoveryFetchByCorrelation:t,settingVersion:e.settingVersion,codeVersion:e.codeVersion}),u=e.fetchArmedAtMs,l=t&&typeof u=="number"&&Number.isSafeInteger(u)&&u>0?u:void 0;return{genNew:o,version:a.version,fetchOnly:a.fetchOnly,fetchCorrelationId:e.fetchCorrelationId??void 0,...l!==void 0?{fetchArmedAtMs:l}:{}}}function Yr(e){let t=n=>e.renderers.has(n);return{supportsD3:t("D3"),supportsPlotly:t("PLOTLY"),supportsVega:t("VEGA")}}function Qr(e){let t=e.cap!=null&&e.budget>e.cap?e.cap:e.budget;return{triesLeft:e.triesLeft??t,maxTries:t}}function Xr(e){return e&&e>0?{leafCardinality:Math.round(e)}:{}}function Jr(e,t,n){let o=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;return{...typeof e=="boolean"?{dataComplete:e}:{},...o(t)?{rowsWithheld:t}:{},...o(n)?{rowsFilteredOut:n}:{}}}var Zr={fit:"Best fit",variety:"Something different"};function Le(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t==="fit"||t==="variety"?t:null}function eo(e){let t=Le(e);return t?{qualifyOrder:t}:{}}function Ae(e,t){return e!=null&&t!=null&&e!==t}function to(e,t){return e?Ae(t.capturedFor,t.now)?{shortlist:void 0,stale:!0}:{shortlist:{...e,ageMs:t.atMs>0?Math.max(0,Math.round(t.nowMs-t.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var no=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Ie(e){let t=String(e??"").trim().toLowerCase();return no[t]??t}function Me(e){let t="";for(let n of e)t+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Ie(n.dataType)]);return t}function ro(e){return B(Me(e))}var oo=2,io=3,so=4,ao=64,lo=8e3,uo=6e4,co=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict",REDRAW:"redraw",INTERACT:"interact"}),mo=Object.freeze(["open","generate","version","rebind","data","sample","fix","resize","other"]);function fo(e,t){return t?`${t};draw:${e}`:`draw:${e}`}function po(e){return e.hint?e.hint:e.generated?"generate":e.previous?e.outputHash!==e.previous.outputHash?"version":e.dataSignature!==e.previous.dataSignature?"data":e.viewport!==e.previous.viewport?"resize":"other":"open"}function go(){let e=new Set,t=new Set;return{firstDraw(n,o){if(!n)return!1;let a=`${n}|${o}`;return e.has(a)?!1:(e.add(a),!0)},firstInteract(n){return!n||t.has(n)?!1:(t.add(n),!0)}}}function yo(e){return!!e&&!e.includes("|")&&!e.includes(",")}function le(e,t,n,o){let a=`${e},${t}|${n}`;return o?`${a}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:a}function ho(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createTelemetryClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createTelemetryClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createTelemetryClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.clientVersion!="string"||t.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof t.timeoutMs!="number"||!Number.isFinite(t.timeoutMs)||t.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=t.timeoutMs,C=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,b=g=>{try{t.onFailure?.(g)}catch{}},h=async(g,f,c,p)=>{let y;try{let T=await a.post(f,c,p,{timeoutMs:i});y=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){b({channel:g,stage:"post",status:null,error:T});return}(y<200||y>299)&&b({channel:g,stage:"status",status:y,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${C()}${l}/LogClientMsg/?nocache=${u.now()}`,c=I(g),p=D(c,o)}catch(y){b({channel:"client-message",stage:"build",status:null,error:y});return}await h("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,y;try{p=`${C()}${l}/eventlog`,y=le(g,t.clientVersion,f,c)}catch(T){b({channel:"event-count",stage:"build",status:null,error:T});return}await h("event-count",p,y,{"Content-Type":"text/plain"})}}}var Ne=2**31-1;function Fe(e){return Object.assign(new Error(`The request did not finish within ${e} ms.`),{name:"TimeoutError"})}function Co(e){return typeof e=="number"&&e>0&&e<=Ne?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(e)} ms: it must be a number of milliseconds above 0 and at most ${Ne} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function bo(e,t={}){if(typeof e!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=e,o=t.credentials??"omit";return{async post(a,u,l,i){let C=i.timeoutMs,b=Co(C);if(b)throw b;let h=new AbortController,g=!1,f=setTimeout(()=>{g=!0,h.abort(Fe(C))},C),c=()=>h.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,y=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Fe(C):_,v;try{v=await n(a,{method:"POST",body:u,headers:l,credentials:o,signal:h.signal})}catch(_){throw y(),T(_)}let R=J(v),L=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...L,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(_){throw T(_)}finally{y()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){y(),_.close();return}_.enqueue(s.value)}catch(s){y(),_.error(T(s))}},cancel(_){return y(),x.cancel(_)}});return{status:R.status,...L,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var De=300;function ke(e){return String(e??"").toLowerCase().replace(/[^a-z0-9-]/g,"").slice(0,40)}var Eo="/LLMChart/",To="/LLMChart/qualify",So="/VisionReview/",Ro="/LLMChart/sample",xo="/RefundGenerate/",wo=e=>!!e&&typeof e=="object"&&e.name==="TimeoutError",z=async e=>JSON.parse(await e.text());function _o(e){try{e.body?e.body.cancel().catch(()=>{}):e.text().catch(()=>{})}catch{}}function Oo(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createGenerateClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createGenerateClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createGenerateClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(t.apiPath!==void 0&&typeof t.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(t.nocache!==void 0&&t.nocache!==null&&typeof t.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,C=g=>t.nocache?t.nocache(g):String(u.now());async function b(g,f,c,p,y){let T=`${i()}${l}${f}?nocache=${C(g)}`,v={"Content-Type":"text/plain","X-Signature":D(c,o)},R=p.signal??void 0,L=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&wo(_),cancelled:s,error:_}},x;try{x=await a.post(T,c,v,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return L(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)_o(x);else try{w=(await x.text()).slice(0,De)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await y(x)}}catch(w){return L(!0,w)}}function h(g,f){if(!f||typeof f.timeoutMs!="number"||!Number.isFinite(f.timeoutMs)||f.timeoutMs<=0)throw new TypeError(`The ${g} call needs a positive deadline in milliseconds`);return f}return{async generate(g,f){let c=h("generate",f),p=c.onStage??void 0;return b("generate",Eo,I(g),c,y=>Z(y,p))},async qualify(g,f){let c=h("qualify",f),p=c.route??To;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return b("qualify",p,I(g),c,z)},async review(g,f){let c=h("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return b("review",So,p,c,z)},async sample(g,f){let c=h("sample",f);return b("sample",Ro,I(g),c,z)},async refund(g,f,c){let p=h("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");let y=ke(c),T=y?{CorrelationID:g.trim(),Reason:y}:{CorrelationID:g.trim()};return b("refund",xo,JSON.stringify(T),p,z)}}}export{pn as ADMIN1_MATCH_PCT,gn as ADMIN1_MATCH_PCT_NAMED,j as CITY_ROLE_MATCH_PCT,jt as CITY_TIE_RATIO,co as CLIENT_EVENT_KINDS,Ur as CLIENT_SECRET_MISMATCH,Xe as COMPOUND_MIN_STEM,Et as CYCLE_MEMBERS,St as CYCLE_WORDS,Ce as DATE_LEVEL_GREGORIAN_YEAR_MAX,he as DATE_LEVEL_GREGORIAN_YEAR_MIN,xr as DATE_LEVEL_LANGUAGES,ae as DATE_LEVEL_NAMES,ye as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,jn as DEFAULT_GAP_FACTOR,lt as DEFAULT_TEMPERATURE,mo as DRAW_REASONS,Vr as FREEMIUM_ATTEMPT_SPENT,Wr as FREEMIUM_COLUMN_CAP,st as GET_RANDOM,Ze as GLUED_STEM_MIN,tt as HANGUL_MIN_STEM,Se as HOST_SYNTHETIC_COLUMNS,De as HTTP_BODY_START_CHARS,qn as IDENTIFIER_HEAD_INITIAL,$n as IDENTIFIER_UNFOLDED,Wn as IDENTIFIER_WORDS,_n as INTENSIVE_SUFFIX_TOKENS,wn as INTENSIVE_WORD_TOKENS,mr as IndexedText,Mt as LOOSE_KEY_MIN_LENGTH,Ft as LooseIndex,Yn as MAX_RUN_BOUNDS,$r as OAUTH_SIGNED_OUT,qr as OAUTH_TOKEN_EXPIRED,Ot as PERIOD_CODE_FORMS,_t as PERIOD_CODE_MEMBERS,Pt as PERIOD_ORDINALS,vt as PERIOD_UNFOLDED,Pn as POSITIONAL_SUFFIX_TOKENS,On as POSITIONAL_WORD_TOKENS,yr as PREVIEW_OMITTED_FIELDS,Pe as PROGRESS_STAGE_IDS,Zr as QUALIFY_ORDER_LABELS,Vt as REGION_FRAME_WINDOWS,A as ROLE_MATCH_PCT,Jn as SERIES_COMPLETENESS_MAX_LISTED,Zn as SERIES_COMPLETENESS_MIN_FILL,er as SERIES_KEY_MAX_DISTINCT,so as SEV_ERROR,oo as SEV_INFO,ao as SEV_USER_PRESENTED,io as SEV_WARNING,B as SIMPLE_STRING_HASH,it as STR,rt as SUBSTRING_MIN,Ve as SUPPORTED_LANGUAGES,Ue as SUPPORTED_LANGUAGE_CODES,uo as TELEMETRY_TIMEOUT_DEV_MS,lo as TELEMETRY_TIMEOUT_MS,$e as VOCABULARY_LANGUAGE_CODES,qe as VOCABULARY_ONLY_LANGUAGES,Tt as YEAR_WORDS,Qt as admin1CodesForName,Y as admin1LookupRegistered,q as admin1MatchPct,kn as allowedAggregations,Ct as anchorLocalWallClockDates,zr as answerIsRetryable,fn as buildGeoIsoColumn,an as buildGeoPointColumns,hn as buildProvinceIsoColumn,Rt as calendarWordIn,Yr as capabilityFields,un as cityMatchPct,ln as cityTagsFor,ur as classifyAdditivity,po as classifyDraw,Dn as classifyForAggregation,cr as classifyNumericValueNature,ar as classifyTemporal,Kt as clearAdmin1LookupForTests,In as codeNeedsLegacyAggNames,Hn as codeReadsColumn,Kn as codeReadsColumnsByRoleOrPosition,An as collapseRepeatedAggPrefix,Bn as columnsTheCodeReads,Bt as countryIso2,qt as countryRegion,go as createDrawLedger,Oo as createGenerateClient,ho as createTelemetryClient,Hr as credentialFields,Jr as dataCompletenessFields,_r as dateLevelPart,Or as dateLevelYearAdmits,bt as datesAreTimeOfDayOnly,yt as datesCarryTimeOfDay,En as decimalSeparatorOf,Gn as defaultAggregation,Tn as detectDecimalSeparator,bn as detectFormatSignature,cn as detectGeo,Gt as detectOrdinalDomain,sr as detectTextDatePattern,fo as drawLocation,I as encodePayload,fr as engineTypeForSqlType,Mn as englishImplicitAggNames,le as eventLogLine,jr as fetchFields,bo as fetchTransport,He as foldName,Ir as freemiumColumnCapRefusal,Re as freemiumColumnsOverCap,xe as freemiumDateHierarchyClauses,et as gluedPrefixStems,Ar as guardColumnNames,Cr as gzipWireText,nt as hangulWordEndsWith,Ln as hasDefaultAggPrefix,Ye as hasUnsegmentedScript,lr as hostAggHint,zt as inMiddleEast,gr as ingest,Vn as isAggregationAllowed,G as isBlankLike,en as isCityTableLoaded,$ as isColumnContextRef,at as isDeterministicRefusal,yo as isEventLogCode,on as isGeoPointAmbiguity,ir as isIdentifierName,mn as isJoinGeoKind,Jt as isKnownProvinceId,Er as isNdjsonContentType,Dt as isOrdinalFriendlyName,Nt as isUsableLooseKey,br as keyedSigner,Xr as leafCardinalityField,ft as localMidnightDateColumns,mt as localMidnightToUtcDay,ht as localWallClockDateColumns,wt as localizedCycleIn,zn as localizedIdentifierWordIn,xt as localizedYearWordIn,N as looksLikeCountryColumn,It as looseNameKey,ot as matchNameToken,Br as maxNonMeasureCardinality,Cn as measureAdmin1Columns,Xn as measureCadence,or as measurePersistence,rr as measureSeriesCompleteness,D as messageSignature,Lr as missingHardColumnRefs,xn as monthLookupFor,Be as nameLetterRuns,Fn as nameLooksIntensiveRate,Nn as nameLooksPositional,Ee as nameProbeIsGuarded,vr as nameProbeKeepsDrawing,Ke as nameWords,tn as normalizeCountry,pt as normalizeLocalMidnightDates,Rn as normalizeMonthKey,V as normalizePlaceName,rn as normalizeZip5,to as offeredShortlistFor,pr as parseCsvRows,ut as parseDateStable,Fr as parseGenerateResponse,Sn as parseNumberText,Dr as parseQualifyResponse,kr as parseReviewVerdict,Qn as parseTemporalPoint,hr as payloadPreview,At as periodCodeSeries,nr as pickSeriesColumn,Gr as progressStageOf,dr as promotesToMeasure,Xt as provinceIdForAdmin1Code,yn as provinceIdForRow,eo as qualifyOrderField,Le as qualifyOrderOf,Z as readGenerateStream,je as readName,Lt as readPeriodCode,E as readWireField,ke as refundReasonCode,Ht as registerAdmin1Lookup,Zt as registerCityTable,Wt as registerIso3Regions,M as resolveAdmin1,Yt as resolveCityAdmin1,ve as resolveFetchVersion,sn as resolveGeoPoint,ze as resolveLanguage,Rr as resolvePointRoles,Qr as retryFields,kt as safeDistinctValuesToShip,Me as schemaIdentity,ro as schemaIdentityKey,Ie as schemaTypeFamily,tr as seriesKeyVerdict,Un as shareOfTotalIsHonest,Ae as shortlistIsStale,vn as stripHostAggPrefix,$t as summarizeCountryRegions,Ut as summarizeGeoExtent,We as supportedLanguage,dn as toGeoIso,Qe as unsegmentedRuns,gt as utcWallClock,Kr as viewportFields,K as vocabularyLanguage,ct as wholeDayFrame,dt as wholeDayIso,J as wireResponseFromFetch,Je as wordEndsWith,ie as zipMatchPct,W as zipPrefixCandidates,nn as zipToPrefix3};
|
|
2
|
+
import{a as yr,b as hr}from"./chunk-HIVICMC5.mjs";import{a as Cr,b as M,c as br,d as D,e as E,f as Er,g as J,h as Z}from"./chunk-4J7WPYLM.mjs";import{a as fr,b as pr,c as gr}from"./chunk-GR25KIHB.mjs";import{A as Hn,B as Kn,C as Bn,D as jn,E as Yn,F as Qn,G as Xn,H as Jn,I as Zn,J as er,K as tr,L as nr,M as rr,N as or,O as ir,P as sr,Q as ar,R as lr,S as ur,T as cr,U as dr,W as mr,a as pn,b as gn,c as yn,d as hn,e as Cn,g as wn,h as _n,i as On,j as Pn,k as An,l as vn,m as Ln,n as Mn,o as In,p as Nn,q as Fn,r as Dn,s as kn,t as Gn,u as Vn,v as Un,w as Wn,x as qn,y as $n,z as zn}from"./chunk-PUXXFTDT.mjs";import{a as bn}from"./chunk-U3H6UBOO.mjs";import{b as En,c as Tn,d as Sn,f as Rn,g as xn}from"./chunk-TZ74QIKA.mjs";import{a as de,c as me,e as cn,f as dn,g as mn,h as fn}from"./chunk-WTJVREEE.mjs";import{A as Q,B as Zt,C as en,D as ce,E as I,F as tn,G as nn,H as rn,I as W,J as on,K as sn,L as an,M as ln,N as X,O as un,a as L,b as G,c as j,d as V,j as U,k as Vt,l as Ut,m as Wt,n as qt,o as $t,q as zt,r as Ht,s as Y,t as Kt,u as Bt,v as jt,w as Yt,x as Qt,y as Xt,z as Jt}from"./chunk-AAPXJXEP.mjs";import"./chunk-5MRZID36.mjs";import{a as Et,b as Tt,c as St,d as Rt,e as xt,f as wt,g as _t,h as Ot,i as Pt,j as At,k as vt,l as Lt,m as Dt,n as kt,o as Gt}from"./chunk-3ZAS32F5.mjs";import{b as Mt,c as It,d as Nt,e as Ft}from"./chunk-5HI6TVMM.mjs";import{A as gt,B as yt,C as ht,D as Ct,E as bt,a as He,b as Ke,c as Be,d as je,e as Ye,f as Qe,g as Xe,h as Je,i as Ze,j as et,k as tt,l as nt,m as rt,n as ot,o as it,q as B,r as st,s as at,t as lt,u as ut,v as ct,w as dt,x as mt,y as ft,z as pt}from"./chunk-CZJ7M6A5.mjs";import{a as Ve,b as Ue,c as We,d as qe,e as $e,f as K,g as ze}from"./chunk-WC4JINEZ.mjs";var ee=2,ge=400;function ne(e){return!!U(e)}function F(e){let t=new Set;for(let n of e){if(n==null)continue;let o=V(String(n));if(!G(o)&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function N(e){let t=F(e);if(t.length===0||re(e)<95)return!1;let n=t.filter(a=>ne(a)&&!I(a)).length,o=t.filter(a=>!ne(a)&&!!I(a)).length;return n>=1&&n>=o}function fe(e,t){if(!I(e))return!1;let n=U(e);return n?t==="world"?!0:ce.has(n):!1}function re(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)ne(o)&&n++;return Math.round(n/t.length*1e3)/10}function oe(e){return I(e)?!0:Y()?Q(e).status!=="unmatched"||Q(e.trim().replace(/\s+/g,"-")).status!=="unmatched":!1}function q(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)oe(o)&&n++;return Math.round(n/t.length*1e3)/10}function se(e){let t=new Set;for(let n of e){if(n==null)continue;let o=String(n).trim();if(!G(V(o))&&!t.has(o)&&(t.add(o),t.size>=ge))break}return Array.from(t)}function ie(e){let t=se(e);if(t.length===0)return 0;let n=0;for(let o of t)W(o).length>0&&n++;return Math.round(n/t.length*1e3)/10}function pe(e,t){return me(t,de)?!0:se(e).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Tr(e,t){let n=F(e);if(n.length===0)return 0;let o=0;for(let a of n)X(a,t)&&o++;return Math.round(o/n.length*1e3)/10}function te(e,t){let n=0;for(let o of F(e))t(o)&&n++;return n}function Sr(e,t){let n=0;for(let o of se(e))t(o)&&n++;return n}function Rr(e,t,n,o,a){let u=[],l=[],i={},y={},h=new Set(e),b=s=>t.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&h.has(d)&&(i[s]=d)}let g=new Set(a??e);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&h.has(f)){let s=b(f),d=ie(s);d<95?l.push(`zip=${f} (only ${d}% of values read as ZIPs)`):pe(s,f)?i.zip=f:l.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let c=n?.state;if(c&&h.has(c)){let s=b(c),d=F(s);d.length>0&&d.every(S=>fe(S,o))?l.push(`state=${c} (every value is "CA", which is both Canada and California)`):N(s)?(l.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):q(s)<95?l.push(`state=${c} (only ${q(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),C=e.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of C){let S=b(d);if(N(S))continue;let O=q(S);if(O<95)continue;let H=te(S,oe),Ge=te(S,ue=>oe(ue)&&!fe(ue,o));H<ee&&Ge<1||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.state=s.name,p.add(s.name),u.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of C){if(p.has(s))continue;let d=b(s),S=ie(d);if(!(S<95)&&pe(d,s)&&!(Sr(d,O=>W(O).length>0)<ee)){i.zip=s,p.add(s),u.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!N(b(T))){let s=null;for(let d of C){if(p.has(d)||!N(b(d)))continue;let S=re(b(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(l.push(`country=${T} (only ${re(b(T))}% of values are country identifiers; using ${s.name} instead)`),y.country=T),i.country=s.name,p.add(s.name),u.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of C){if(p.has(d))continue;let S=b(d),O=Tr(S,o);O<j||te(S,H=>X(H,o))<ee||(!s||O>s.pct)&&(s={name:d,pct:O})}s&&(i.city=s.name,u.push(`city=${s.name} (${s.pct}% known cities)`))}let A=i.country?b(i.country):[],R=!!i.country&&N(A),v=R?new Set(A.map(s=>U(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&v>=2,w=!!(i.lat&&i.lon)&&t.some(s=>{let d=+String(s[i.lat]??"").trim(),S=+String(s[i.lon]??"").trim();return isFinite(d)&&isFinite(S)&&d>=-90&&d<=90&&S>=-180&&S<=180&&String(s[i.lat]??"").trim()!==""&&String(s[i.lon]??"").trim()!==""});return i.lat&&i.lon&&!w&&l.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&l.push(R?`country=${i.country} (every row resolves to the same country - nothing to place apart)`:`country=${i.country} (values are not country identifiers)`),{bind:!!(i.city||i.state||i.zip||x||w)?i:null,backfilled:u,refused:l,...Object.keys(y).length?{labelFallback:y}:{}}}var r=(e,...t)=>({part:e,langs:Object.freeze(t)}),ae=Object.freeze({jaar:r("year","nl"),kwartaal:r("quarter","nl"),maand:r("month","nl"),dag:r("day","nl","sv","da","nb"),jahr:r("year","de"),quartal:r("quarter","de"),monat:r("month","de"),tag:r("day","de"),ann\u00E9e:r("year","fr"),mois:r("month","fr"),jour:r("day","fr"),trimestre:r("quarter","fr","es","pt","it"),a\u00F1o:r("year","es"),mes:r("month","es"),d\u00EDa:r("day","es"),ano:r("year","pt"),m\u00EAs:r("month","pt"),dia:r("day","pt"),anno:r("year","it"),mese:r("month","it"),giorno:r("day","it"),\u0433\u043E\u0434:r("year","ru"),\u043C\u0435\u0441\u044F\u0446:r("month","ru"),\u0440\u0456\u043A:r("year","uk"),\u043C\u0456\u0441\u044F\u0446\u044C:r("month","uk"),\u043A\u0432\u0430\u0440\u0442\u0430\u043B:r("quarter","ru","uk"),\u0434\u0435\u043D\u044C:r("day","ru","uk"),rok:r("year","pl","cs","sk"),kwarta\u0142:r("quarter","pl"),miesi\u0105c:r("month","pl"),dzie\u0144:r("day","pl"),\u010Dtvrtlet\u00ED:r("quarter","cs"),m\u011Bs\u00EDc:r("month","cs"),den:r("day","cs"),\u0161tvr\u0165rok:r("quarter","sk"),mesiac:r("month","sk"),de\u0148:r("day","sk"),\u00E5r:r("year","sv","da","nb"),kvartal:r("quarter","sv","da","nb"),m\u00E5nad:r("month","sv"),m\u00E5ned:r("month","da","nb"),vuosi:r("year","fi"),vuosinelj\u00E4nnes:r("quarter","fi"),kuukausi:r("month","fi"),p\u00E4iv\u00E4:r("day","fi"),\u00E9v:r("year","hu"),negyed\u00E9v:r("quarter","hu"),h\u00F3nap:r("month","hu"),nap:r("day","hu"),y\u0131l:r("year","tr"),\u00E7eyrek:r("quarter","tr"),ay:r("month","tr"),g\u00FCn:r("day","tr"),\u03AD\u03C4\u03BF\u03C2:r("year","el"),\u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF:r("quarter","el"),\u03BC\u03AE\u03BD\u03B1\u03C2:r("month","el"),\u03B7\u03BC\u03AD\u03C1\u03B1:r("day","el"),an:r("year","ro"),trimestru:r("quarter","ro"),lun\u0103:r("month","ro"),zi:r("day","ro"),godina:r("year","hr"),tromjese\u010Dje:r("quarter","hr"),mjesec:r("month","hr"),dan:r("day","hr"),\u5E74:r("year","ja","zh"),\u56DB\u534A\u671F:r("quarter","ja"),\u5B63\u5EA6:r("quarter","zh"),\u6708:r("month","ja","zh"),\u65E5:r("day","ja","zh"),\uC5F0\uB3C4:r("year","ko"),\uBD84\uAE30:r("quarter","ko"),\uC6D4:r("month","ko"),\uC77C:r("day","ko"),tahun:r("year","id"),kuartal:r("quarter","id"),triwulan:r("quarter","id"),bulan:r("month","id"),hari:r("day","id"),n\u0103m:r("year","vi"),qu\u00FD:r("quarter","vi"),th\u00E1ng:r("month","vi"),ng\u00E0y:r("day","vi"),\u0E1B\u0E35:r("year","th"),\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A:r("quarter","th"),\u0E40\u0E14\u0E37\u0E2D\u0E19:r("month","th"),\u0E27\u0E31\u0E19:r("day","th"),\u0627\u0644\u0633\u0646\u0629:r("year","ar"),\u0633\u0646\u0629:r("year","ar"),\u0627\u0644\u0639\u0627\u0645:r("year","ar"),\u0639\u0627\u0645:r("year","ar"),\u0627\u0644\u0631\u0628\u0639:r("quarter","ar"),\u0631\u0628\u0639:r("quarter","ar"),"\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629":r("quarter","ar"),\u0627\u0644\u0634\u0647\u0631:r("month","ar"),\u0634\u0647\u0631:r("month","ar"),\u0627\u0644\u064A\u0648\u0645:r("day","ar"),\u064A\u0648\u0645:r("day","ar"),\u05E9\u05E0\u05D4:r("year","he"),\u05E8\u05D1\u05E2\u05D5\u05DF:r("quarter","he"),\u05D7\u05D5\u05D3\u05E9:r("month","he"),\u05D9\u05D5\u05DD:r("day","he"),\u0935\u0930\u094D\u0937:r("year","hi"),\u0938\u093E\u0932:r("year","hi"),\u0924\u093F\u092E\u093E\u0939\u0940:r("quarter","hi"),\u092E\u0939\u0940\u0928\u093E:r("month","hi"),\u092E\u093E\u0939:r("month","hi"),\u0926\u093F\u0928:r("day","hi"),\u0633\u0627\u0644:r("year","fa"),\u0645\u0627\u0647:r("month","fa"),\u0631\u0648\u0632:r("day","fa")}),xr=Object.freeze(Array.from(new Set(Object.values(ae).flatMap(e=>e.langs)))),ye=Object.freeze(["fa","ar","he","th"]),he=1900,Ce=2100;function wr(e,t){let n=[],o=K(t);try{o&&n.push(e.toLocaleLowerCase(o.intl))}catch{}let a=e.toLowerCase();return n.includes(a)||n.push(a),n}function _r(e,t){let n=String(e??"").trim().normalize("NFC");if(!n)return null;for(let o of wr(n,t)){let a=ae[o];if(a&&a.langs.includes(t))return a.part}return null}function Or(e,t){return ye.includes(e)?typeof t=="number"&&Number.isFinite(t)&&t>=he&&t<=Ce:!0}function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Pr=/\b(?:columns|cols|column)\b/i;function $(e,t){let n=Math.max(0,t-240),o=e.slice(n,t),a=o.lastIndexOf(";");return a>=0&&(o=o.slice(a+1)),Pr.test(o)}function Ee(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(e))}function Te(e,t,n){let o=be(t),a=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),u=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),l=0,i;for(;(i=u.exec(e))!==null;)$(e,i.index)&&l++;let y=0;for(;(i=a.exec(e))!==null;){let h=i.index+i[0].lastIndexOf(".name");if(!$(e,h))continue;y++;let b=be(i[1]);if(!n(b))return!1}return y>0&&y===l}function Ar(e,t){return Te(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(e)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(e))}var Se=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function vr(e,t){if(!e)return[];let n=new Set(t);for(let i of Se)n.add(i);let o=new Set,a=/\.name\s*===?\s*(['"])([^'"]+)\1/g,u;for(;(u=a.exec(e))!==null;)$(e,u.index)&&o.add(u[2]);if(o.size===0)return[];let l=[];return o.forEach(i=>{n.has(i)||Ee(e,i)||l.push(i)}),l}function Lr(e,t){if(!e)return[];let n=(e.getColumns()||[]).map(o=>o.name);if(!t||typeof e.aliasesForCode!="function")return n;for(let o of e.aliasesForCode(t))n.push(o.alias);return n}function Re(e,t){let n=t?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(e)||e<=n?0:Math.round(e-n)}function Mr(e,t,n){let o=Re(e,t);if(o===null||o<=0)return null;let a=typeof t?.freemiumColumnCapPivot=="number"?t.freemiumColumnCapPivot:4,u=o>a?t?.freemiumColumnCapMessageMany:t?.freemiumColumnCapMessageFew;if(typeof u!="string"||u.trim().length===0)return null;let l=u.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=xe(n);return i.length===0?l:l+" "+i.join(" ")}function xe(e){if(!e||e.length===0)return[];let t=[],n=new Map,o=new Map;for(let u of e){let l=typeof u?.dateGroupId=="string"?u.dateGroupId.trim():"";if(l!==""&&(n.has(l)||(t.push(l),n.set(l,0)),u.isDatePart===!0&&n.set(l,n.get(l)+1),u.isReassembledDate===!0&&!o.has(l))){let i=typeof u.sourceField=="string"?u.sourceField.trim():"",y=typeof u.name=="string"?u.name.trim():"",h=i!==""?i:y;h!==""&&o.set(l,h)}}let a=[];for(let u of t){let l=o.get(u),i=n.get(u)??0;!l||i===0||a.push(`'${l}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return a}var m=e=>e==null?"":String(e),P=e=>e===!0,we=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Ir=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function _e(e,t){let n={};for(let[o,a]of Ir){let u=m(E(e,t+a));u&&(n[o]=u)}return n}function Nr(e){return Array.isArray(e)?e.map(t=>({code:m(E(t,"code")),severity:m(E(t,"severity")),text:m(E(t,"text"))})).filter(t=>t.text!==""):[]}function Fr(e){let t=h=>E(e,h),n=t("retryAfterSeconds"),o=t("overrideThumbnailUpload"),a=t("forceThumbnailUpload"),u=_e(e,"point"),l=_e(e,"destPoint");Object.keys(l).length&&(u.dest=l);let i=t("retryable"),y=t("isPollFinal");return{errorMessage:m(t("errorMessage")),errorCode:m(t("errorCode")),refusalCode:m(t("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:Nr(t("notices")),freemiumStatusCode:m(t("freemiumStatusCode")),code:m(t("code")),language:m(t("language")),version:Number(t("version")??0),codeSummary:m(t("codeSummary")),chartName:m(t("chartName")??t("chartType")),finalChartName:m(t("finalChartName")),warningMessage:m(t("warningMessage")),outputHash:m(t("outputHash")),validatorToken:m(t("validatorToken")),editCodeKey:m(t("editCodeKey")),signedLLMRequestID:m(t("signedLLMRequestID")),userReply:m(t("userReply")),userReplyOutcome:m(t("userReplyOutcome")),improvementSuggestion:m(t("improvementSuggestion")),geoColumn:m(t("geoColumn")),geoKind:m(t("geoKind")),geoPointCols:Object.keys(u).length?u:null,creditBalanceBefore:we(t("creditBalanceBefore")),creditCost:we(t("creditCost")),isServiceError:P(t("isServiceError")),isRateLimited:P(t("isRateLimited")),suppressSelectionGlyph:P(t("suppressSelectionGlyph")),isRefusal:P(t("isRefusal")),isVersionNotFound:P(t("isVersionNotFound")),isGenerationCancelled:P(t("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(t("servedCorrelationId")),...typeof y=="boolean"?{isPollFinal:y}:{},...m(t("pollOutcome"))!==""?{pollOutcome:m(t("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof a=="boolean"?{forceThumbnailUpload:a}:{}}}var Oe=e=>e==null?void 0:Number(e),k=e=>m(e)||void 0;function Dr(e){let t=E(e,"charts"),n=E(e,"refused"),o=Array.isArray(t)?t.map(u=>{let l=y=>E(u,y),i=l("recommended");return{name:m(l("chartTypeName")??l("name")),description:m(l("description")??l("chartDesc")),rank:Oe(l("rank")),score:Oe(l("score")),renderer:k(l("renderer")),language:k(l("language")),isPreview:P(l("isPreview")),alsoWorthALook:P(l("alsoWorthALook")),recommended:typeof i=="boolean"?i:void 0,viaProjection:k(l("viaProjection")),viaProjectionKey:k(l("viaProjectionKey")),detailNote:k(l("detailNote"))}}).filter(u=>u.name):null,a=Array.isArray(n)?n.map(u=>({name:m(E(u,"chartTypeName")??E(u,"name")),reason:m(E(u,"reason")),reasonCode:m(E(u,"reasonCode")),isVeto:P(E(u,"isVeto"))})).filter(u=>u.name):[];return{errorMessage:m(E(e,"errorMessage")),errorCode:m(E(e,"errorCode")),charts:o,refused:a,noFitSummary:m(E(e,"noFitSummary"))}}function kr(e){return!e||typeof e!="object"?null:{status:String(E(e,"status")??""),verdictReason:E(e,"verdictReason")??null,instruction:E(e,"instruction")??null,fix:E(e,"fix")??null,errorMessage:E(e,"errorMessage")??null,errorCode:E(e,"errorCode")??null}}var Pe=["working","analyze","generate","refine","review"];function Gr(e,t){let n=String(e??"").trim().toLowerCase();if(Pe.includes(n))return n;let o=String(t??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var Vr="FREEMIUM_ATTEMPT_SPENT",Ur="CLIENT_SECRET_MISMATCH",Wr="FREEMIUM_COLUMN_CAP",qr="OAUTH_TOKEN_EXPIRED",$r="OAUTH_SIGNED_OUT";function zr(e){let t=e?.retryable;return typeof t=="boolean"?t:null}function Hr(e){let t=e.linkNonce?(e.linkNonce()??"").trim():null,n=t?null:e.accessToken?(e.accessToken()??"").trim():null,o=t||n?{licensee:"",licenseKey:"",secretKey:""}:e.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:e.freemiumKey?.()??""},linkNonce:t,accessToken:n}}function Kr(e){let{width:t,height:n}=e.measure();return{request:{height:n,width:t},hints:{viewportWidth:t,viewportHeight:n}}}function Br(e){let t=0;for(let n of e){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>t&&(t=o)}return t}function Ae(e){if(e.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(e.recoveryFetchVersion!=null)return{version:e.recoveryFetchVersion,fetchOnly:!0};let t=e.settingVersion??null;if(e.genNew)return{version:t,fetchOnly:void 0};let n=(t??0)>0?t:null,o=(e.codeVersion??0)>0?e.codeVersion:null,a=n??o??t;return{version:a,fetchOnly:a!=null&&a>0?!0:void 0}}function jr(e){let t=e.fetchCorrelationId!=null,o=t||e.recoveryFetchVersion!=null?!1:e.genNew,a=Ae({genNew:o,recoveryFetchVersion:e.recoveryFetchVersion,recoveryFetchByCorrelation:t,settingVersion:e.settingVersion,codeVersion:e.codeVersion}),u=e.fetchArmedAtMs,l=t&&typeof u=="number"&&Number.isSafeInteger(u)&&u>0?u:void 0,i=e.fetchCutAtMs,y=t&&typeof i=="number"&&Number.isSafeInteger(i)&&i>0?i:void 0,h=t?Yr(e.fetchCause):"";return{genNew:o,version:a.version,fetchOnly:a.fetchOnly,fetchCorrelationId:e.fetchCorrelationId??void 0,...l!==void 0?{fetchArmedAtMs:l}:{},...y!==void 0?{fetchCutAtMs:y}:{},...h?{fetchCause:h}:{}}}function Yr(e){if(typeof e!="string")return"";let t=e.replace(/[\u0000-\u001f\u007f]+/g," ").trim().slice(0,120);return/[\ud800-\udbff]$/.test(t)&&(t=t.slice(0,-1)),t.trimEnd()}function Qr(e){let t=n=>e.renderers.has(n);return{supportsD3:t("D3"),supportsPlotly:t("PLOTLY"),supportsVega:t("VEGA")}}function Xr(e){let t=e.cap!=null&&e.budget>e.cap?e.cap:e.budget;return{triesLeft:e.triesLeft??t,maxTries:t}}function Jr(e){return e&&e>0?{leafCardinality:Math.round(e)}:{}}function Zr(e,t,n){let o=a=>typeof a=="number"&&Number.isInteger(a)&&a>0;return{...typeof e=="boolean"?{dataComplete:e}:{},...o(t)?{rowsWithheld:t}:{},...o(n)?{rowsFilteredOut:n}:{}}}var eo={fit:"Best fit",variety:"Something different"};function ve(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t==="fit"||t==="variety"?t:null}function to(e){let t=ve(e);return t?{qualifyOrder:t}:{}}function Le(e,t){return e!=null&&t!=null&&e!==t}function no(e,t){return e?Le(t.capturedFor,t.now)?{shortlist:void 0,stale:!0}:{shortlist:{...e,ageMs:t.atMs>0?Math.max(0,Math.round(t.nowMs-t.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var ro=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Me(e){let t=String(e??"").trim().toLowerCase();return ro[t]??t}function Ie(e){let t="";for(let n of e)t+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Me(n.dataType)]);return t}function oo(e){return B(Ie(e))}var io=2,so=3,ao=4,lo=64,uo=8e3,co=6e4,mo=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict",REDRAW:"redraw",INTERACT:"interact"}),fo=Object.freeze(["open","generate","version","rebind","data","sample","fix","resize","other"]);function po(e,t){return t?`${t};draw:${e}`:`draw:${e}`}function go(e){return e.hint?e.hint:e.generated?"generate":e.previous?e.outputHash!==e.previous.outputHash?"version":e.dataSignature!==e.previous.dataSignature?"data":e.viewport!==e.previous.viewport?"resize":"other":"open"}function yo(){let e=new Set,t=new Set;return{firstDraw(n,o){if(!n)return!1;let a=`${n}|${o}`;return e.has(a)?!1:(e.add(a),!0)},firstInteract(n){return!n||t.has(n)?!1:(t.add(n),!0)}}}function ho(e){return!!e&&!e.includes("|")&&!e.includes(",")}function le(e,t,n,o){let a=`${e},${t}|${n}`;return o?`${a}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:a}function Co(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createTelemetryClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createTelemetryClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createTelemetryClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof t.clientVersion!="string"||t.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof t.timeoutMs!="number"||!Number.isFinite(t.timeoutMs)||t.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=t.timeoutMs,y=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,h=g=>{try{t.onFailure?.(g)}catch{}},b=async(g,f,c,p)=>{let C;try{let T=await a.post(f,c,p,{timeoutMs:i});C=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){h({channel:g,stage:"post",status:null,error:T});return}(C<200||C>299)&&h({channel:g,stage:"status",status:C,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${y()}${l}/LogClientMsg/?nocache=${u.now()}`,c=M(g),p=D(c,o)}catch(C){h({channel:"client-message",stage:"build",status:null,error:C});return}await b("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,C;try{p=`${y()}${l}/eventlog`,C=le(g,t.clientVersion,f,c)}catch(T){h({channel:"event-count",stage:"build",status:null,error:T});return}await b("event-count",p,C,{"Content-Type":"text/plain"})}}}var Ne=2**31-1;function Fe(e){return Object.assign(new Error(`The request did not finish within ${e} ms.`),{name:"TimeoutError"})}function bo(e){return typeof e=="number"&&e>0&&e<=Ne?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(e)} ms: it must be a number of milliseconds above 0 and at most ${Ne} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function Eo(e,t={}){if(typeof e!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=e,o=t.credentials??"omit";return{async post(a,u,l,i){let y=i.timeoutMs,h=bo(y);if(h)throw h;let b=new AbortController,g=!1,f=setTimeout(()=>{g=!0,b.abort(Fe(y))},y),c=()=>b.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,C=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Fe(y):_,A;try{A=await n(a,{method:"POST",body:u,headers:l,credentials:o,signal:b.signal})}catch(_){throw C(),T(_)}let R=J(A),v=R.statusText!==void 0?{statusText:R.statusText}:{};if(!R.body)return{status:R.status,...v,contentType:R.contentType,body:null,text:async()=>{try{return await R.text()}catch(_){throw T(_)}finally{C()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){C(),_.close();return}_.enqueue(s.value)}catch(s){C(),_.error(T(s))}},cancel(_){return C(),x.cancel(_)}});return{status:R.status,...v,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var De=300;function ke(e){return String(e??"").toLowerCase().replace(/[^a-z0-9-]/g,"").slice(0,40)}var To="/LLMChart/",So="/LLMChart/qualify",Ro="/VisionReview/",xo="/LLMChart/sample",wo="/RefundGenerate/",_o=e=>!!e&&typeof e=="object"&&e.name==="TimeoutError",z=async e=>JSON.parse(await e.text());function Oo(e){try{e.body?e.body.cancel().catch(()=>{}):e.text().catch(()=>{})}catch{}}function Po(e,t){let n=e;if(!n||!n.signer||typeof n.signer.sign!="function")throw new TypeError("createGenerateClient needs the host's signer");if(!n.transport||typeof n.transport.post!="function")throw new TypeError("createGenerateClient needs the host's transport");if(!n.clock||typeof n.clock.now!="function")throw new TypeError("createGenerateClient needs the host's clock");if(!t||typeof t.baseUrl!="string"&&typeof t.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof t.baseUrl=="string"&&t.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(t.apiPath!==void 0&&typeof t.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(t.nocache!==void 0&&t.nocache!==null&&typeof t.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:a,clock:u}=n,l=t.apiPath??"/api",i=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,y=g=>t.nocache?t.nocache(g):String(u.now());async function h(g,f,c,p,C){let T=`${i()}${l}${f}?nocache=${y(g)}`,A={"Content-Type":"text/plain","X-Signature":D(c,o)},R=p.signal??void 0,v=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&_o(_),cancelled:s,error:_}},x;try{x=await a.post(T,c,A,R?{timeoutMs:p.timeoutMs,signal:R}:{timeoutMs:p.timeoutMs})}catch(w){return v(!1,w)}if(x.status<200||x.status>299){let w="";if(p.readErrorBody===!1)Oo(x);else try{w=(await x.text()).slice(0,De)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await C(x)}}catch(w){return v(!0,w)}}function b(g,f){if(!f||typeof f.timeoutMs!="number"||!Number.isFinite(f.timeoutMs)||f.timeoutMs<=0)throw new TypeError(`The ${g} call needs a positive deadline in milliseconds`);return f}return{async generate(g,f){let c=b("generate",f),p=c.onStage??void 0;return h("generate",To,M(g),c,C=>Z(C,p))},async qualify(g,f){let c=b("qualify",f),p=c.route??So;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return h("qualify",p,M(g),c,z)},async review(g,f){let c=b("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return h("review",Ro,p,c,z)},async sample(g,f){let c=b("sample",f);return h("sample",xo,M(g),c,z)},async refund(g,f,c){let p=b("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");let C=ke(c),T=C?{CorrelationID:g.trim(),Reason:C}:{CorrelationID:g.trim()};return h("refund",wo,JSON.stringify(T),p,z)}}}export{pn as ADMIN1_MATCH_PCT,gn as ADMIN1_MATCH_PCT_NAMED,j as CITY_ROLE_MATCH_PCT,jt as CITY_TIE_RATIO,mo as CLIENT_EVENT_KINDS,Ur as CLIENT_SECRET_MISMATCH,Xe as COMPOUND_MIN_STEM,Et as CYCLE_MEMBERS,St as CYCLE_WORDS,Ce as DATE_LEVEL_GREGORIAN_YEAR_MAX,he as DATE_LEVEL_GREGORIAN_YEAR_MIN,xr as DATE_LEVEL_LANGUAGES,ae as DATE_LEVEL_NAMES,ye as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,jn as DEFAULT_GAP_FACTOR,lt as DEFAULT_TEMPERATURE,fo as DRAW_REASONS,Vr as FREEMIUM_ATTEMPT_SPENT,Wr as FREEMIUM_COLUMN_CAP,st as GET_RANDOM,Ze as GLUED_STEM_MIN,tt as HANGUL_MIN_STEM,Se as HOST_SYNTHETIC_COLUMNS,De as HTTP_BODY_START_CHARS,qn as IDENTIFIER_HEAD_INITIAL,$n as IDENTIFIER_UNFOLDED,Wn as IDENTIFIER_WORDS,_n as INTENSIVE_SUFFIX_TOKENS,wn as INTENSIVE_WORD_TOKENS,mr as IndexedText,It as LOOSE_KEY_MIN_LENGTH,Ft as LooseIndex,Yn as MAX_RUN_BOUNDS,$r as OAUTH_SIGNED_OUT,qr as OAUTH_TOKEN_EXPIRED,Ot as PERIOD_CODE_FORMS,_t as PERIOD_CODE_MEMBERS,Pt as PERIOD_ORDINALS,At as PERIOD_UNFOLDED,Pn as POSITIONAL_SUFFIX_TOKENS,On as POSITIONAL_WORD_TOKENS,yr as PREVIEW_OMITTED_FIELDS,Pe as PROGRESS_STAGE_IDS,eo as QUALIFY_ORDER_LABELS,Vt as REGION_FRAME_WINDOWS,L as ROLE_MATCH_PCT,Jn as SERIES_COMPLETENESS_MAX_LISTED,Zn as SERIES_COMPLETENESS_MIN_FILL,er as SERIES_KEY_MAX_DISTINCT,ao as SEV_ERROR,io as SEV_INFO,lo as SEV_USER_PRESENTED,so as SEV_WARNING,B as SIMPLE_STRING_HASH,it as STR,rt as SUBSTRING_MIN,Ve as SUPPORTED_LANGUAGES,Ue as SUPPORTED_LANGUAGE_CODES,co as TELEMETRY_TIMEOUT_DEV_MS,uo as TELEMETRY_TIMEOUT_MS,$e as VOCABULARY_LANGUAGE_CODES,qe as VOCABULARY_ONLY_LANGUAGES,Tt as YEAR_WORDS,Qt as admin1CodesForName,Y as admin1LookupRegistered,q as admin1MatchPct,kn as allowedAggregations,Ct as anchorLocalWallClockDates,zr as answerIsRetryable,fn as buildGeoIsoColumn,an as buildGeoPointColumns,hn as buildProvinceIsoColumn,Rt as calendarWordIn,Qr as capabilityFields,un as cityMatchPct,ln as cityTagsFor,ur as classifyAdditivity,go as classifyDraw,Dn as classifyForAggregation,cr as classifyNumericValueNature,ar as classifyTemporal,Kt as clearAdmin1LookupForTests,Mn as codeNeedsLegacyAggNames,Hn as codeReadsColumn,Kn as codeReadsColumnsByRoleOrPosition,Ln as collapseRepeatedAggPrefix,Bn as columnsTheCodeReads,Bt as countryIso2,qt as countryRegion,yo as createDrawLedger,Po as createGenerateClient,Co as createTelemetryClient,Hr as credentialFields,Zr as dataCompletenessFields,_r as dateLevelPart,Or as dateLevelYearAdmits,bt as datesAreTimeOfDayOnly,yt as datesCarryTimeOfDay,En as decimalSeparatorOf,Gn as defaultAggregation,Tn as detectDecimalSeparator,bn as detectFormatSignature,cn as detectGeo,Gt as detectOrdinalDomain,sr as detectTextDatePattern,po as drawLocation,M as encodePayload,fr as engineTypeForSqlType,In as englishImplicitAggNames,le as eventLogLine,jr as fetchFields,Eo as fetchTransport,He as foldName,Mr as freemiumColumnCapRefusal,Re as freemiumColumnsOverCap,xe as freemiumDateHierarchyClauses,et as gluedPrefixStems,Lr as guardColumnNames,Cr as gzipWireText,nt as hangulWordEndsWith,vn as hasDefaultAggPrefix,Ye as hasUnsegmentedScript,lr as hostAggHint,zt as inMiddleEast,gr as ingest,Vn as isAggregationAllowed,G as isBlankLike,en as isCityTableLoaded,$ as isColumnContextRef,at as isDeterministicRefusal,ho as isEventLogCode,on as isGeoPointAmbiguity,ir as isIdentifierName,mn as isJoinGeoKind,Jt as isKnownProvinceId,Er as isNdjsonContentType,Dt as isOrdinalFriendlyName,Nt as isUsableLooseKey,br as keyedSigner,Jr as leafCardinalityField,ft as localMidnightDateColumns,mt as localMidnightToUtcDay,ht as localWallClockDateColumns,wt as localizedCycleIn,zn as localizedIdentifierWordIn,xt as localizedYearWordIn,N as looksLikeCountryColumn,Mt as looseNameKey,ot as matchNameToken,Br as maxNonMeasureCardinality,Cn as measureAdmin1Columns,Xn as measureCadence,or as measurePersistence,rr as measureSeriesCompleteness,D as messageSignature,vr as missingHardColumnRefs,xn as monthLookupFor,Be as nameLetterRuns,Fn as nameLooksIntensiveRate,Nn as nameLooksPositional,Ee as nameProbeIsGuarded,Ar as nameProbeKeepsDrawing,Ke as nameWords,tn as normalizeCountry,pt as normalizeLocalMidnightDates,Rn as normalizeMonthKey,V as normalizePlaceName,rn as normalizeZip5,no as offeredShortlistFor,pr as parseCsvRows,ut as parseDateStable,Fr as parseGenerateResponse,Sn as parseNumberText,Dr as parseQualifyResponse,kr as parseReviewVerdict,Qn as parseTemporalPoint,hr as payloadPreview,Lt as periodCodeSeries,nr as pickSeriesColumn,Gr as progressStageOf,dr as promotesToMeasure,Xt as provinceIdForAdmin1Code,yn as provinceIdForRow,to as qualifyOrderField,ve as qualifyOrderOf,Z as readGenerateStream,je as readName,vt as readPeriodCode,E as readWireField,ke as refundReasonCode,Ht as registerAdmin1Lookup,Zt as registerCityTable,Wt as registerIso3Regions,I as resolveAdmin1,Yt as resolveCityAdmin1,Ae as resolveFetchVersion,sn as resolveGeoPoint,ze as resolveLanguage,Rr as resolvePointRoles,Xr as retryFields,kt as safeDistinctValuesToShip,Ie as schemaIdentity,oo as schemaIdentityKey,Me as schemaTypeFamily,tr as seriesKeyVerdict,Un as shareOfTotalIsHonest,Le as shortlistIsStale,An as stripHostAggPrefix,$t as summarizeCountryRegions,Ut as summarizeGeoExtent,We as supportedLanguage,dn as toGeoIso,Qe as unsegmentedRuns,gt as utcWallClock,Kr as viewportFields,K as vocabularyLanguage,ct as wholeDayFrame,dt as wholeDayIso,J as wireResponseFromFetch,Je as wordEndsWith,ie as zipMatchPct,W as zipPrefixCandidates,nn as zipToPrefix3};
|
package/dist/types/models.d.ts
CHANGED
|
@@ -90,6 +90,16 @@ export interface FetchRequest {
|
|
|
90
90
|
* milliseconds on the host's own clock. Used only with `fetchCorrelationId`; see `fetchFields`.
|
|
91
91
|
*/
|
|
92
92
|
fetchArmedAtMs?: number | null;
|
|
93
|
+
/**
|
|
94
|
+
* When the stream of the generation a correlation poll recovers was cut: epoch milliseconds on the host's own
|
|
95
|
+
* clock (the clock `fetchArmedAtMs` uses). Used only with `fetchCorrelationId`; logged, never a decision input.
|
|
96
|
+
*/
|
|
97
|
+
fetchCutAtMs?: number | null;
|
|
98
|
+
/**
|
|
99
|
+
* Why that poll runs - what cut the stream, as the host saw it ("stream-cut: terminated", "transport-lost").
|
|
100
|
+
* Used only with `fetchCorrelationId`; sent as one line of at most 120 characters, logged, never parsed.
|
|
101
|
+
*/
|
|
102
|
+
fetchCause?: string | null;
|
|
93
103
|
/** A recovery poll keyed by version. null/absent = not one. */
|
|
94
104
|
recoveryFetchVersion?: number | null;
|
|
95
105
|
/** A version the reader stated - asked for by number. null or 0 mean "no preference", never "version zero". */
|
|
@@ -105,6 +115,10 @@ export interface FetchFields {
|
|
|
105
115
|
fetchCorrelationId: string | undefined;
|
|
106
116
|
/** Present only on a poll by correlation that stated a usable arm time; never a key holding `undefined`. */
|
|
107
117
|
fetchArmedAtMs?: number;
|
|
118
|
+
/** Present only on a poll by correlation that stated a usable cut time. */
|
|
119
|
+
fetchCutAtMs?: number;
|
|
120
|
+
/** Present only on a poll by correlation that stated a cause with any text in it. */
|
|
121
|
+
fetchCause?: string;
|
|
108
122
|
}
|
|
109
123
|
/**
|
|
110
124
|
* WHICH VERSION A REQUEST ASKS FOR, AND WHETHER THE SERVER MAY FALL THROUGH TO MAKING A NEW ONE.
|
|
@@ -152,6 +166,13 @@ export declare function resolveFetchVersion(i: {
|
|
|
152
166
|
* server binds it as an integer, and a value it cannot bind (a fraction, a string, an exponent form)
|
|
153
167
|
* fails the whole request rather than just that field, so it is sent only as a positive whole number
|
|
154
168
|
* and its key is left off otherwise. A server that predates the field drops it unread.
|
|
169
|
+
*
|
|
170
|
+
* THE CUT TIME AND CAUSE ride a poll by correlation too, when the host knows them: when the stream it is
|
|
171
|
+
* recovering was cut, on the same clock as the arm time, and why. The server logs them and stores them on
|
|
172
|
+
* the row the poll writes; it decides nothing on them. The cut time follows the arm time's integer rule.
|
|
173
|
+
* The cause is free text from the host, so it is sent as one line - control characters become a space -
|
|
174
|
+
* of at most 120 characters, and not at all when nothing is left. Both keys come after the arm time, so a
|
|
175
|
+
* caller that states neither serialises exactly as before.
|
|
155
176
|
*/
|
|
156
177
|
export declare function fetchFields(r: FetchRequest): FetchFields;
|
|
157
178
|
/** The renderer capability flags a generate request carries. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/shape-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.109",
|
|
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",
|