@bicharts/shape-core 0.6.69 → 0.6.74
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/index.d.ts +2 -2
- package/dist/types/telemetry.d.ts +62 -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 qn,b as zn}from"./chunk-HIVICMC5.mjs";import{a as $n,b as I,c as Kn,d as k,e as E,f as Hn,g as X,h as J}from"./chunk-HMLAY26J.mjs";import{a as Gn,b as Dn,c as Vn,d as Un,e as Wn}from"./chunk-N52JPYZI.mjs";import{A as bn,B as En,C as Tn,D as Sn,E as Rn,F as xn,G as wn,H as _n,I as Pn,J as On,K as vn,L as Ln,M as Mn,N as In,O as Nn,P as An,Q as Fn,S as kn,a as zt,b as $t,c as Kt,d as Ht,e as Qt,f as Xt,g as Jt,h as Zt,i as en,j as tn,k as nn,l as rn,m as on,n as sn,o as an,p as ln,q as un,r as cn,s as dn,t as mn,u as fn,v as pn,w as gn,x as yn,y as hn,z as Cn}from"./chunk-OPDY2YEA.mjs";import{a as Bt}from"./chunk-U3H6UBOO.mjs";import{a as jt,b as Yt}from"./chunk-555PKUBU.mjs";import{a as le,b as ue,c as Vt,d as Ut,e as Wt,f as qt}from"./chunk-KQOVPOVU.mjs";import{a as M,b as V,c as Y,d as U,k as W,l as vt,m as Lt,n as ae,o as O,p as Mt,q as It,r as Nt,s as q,t as At,u as Ft,v as kt,w as Gt,x as Q,y as Dt}from"./chunk-INMDBTAR.mjs";import"./chunk-5MRZID36.mjs";import{a as ct,b as dt,c as mt,d as ft,e as pt,f as gt,g as yt,h as ht,i as Ct,j as bt,k as Et,l as Tt,m as _t,n as Pt,o as Ot}from"./chunk-GKXYRUK5.mjs";import{A as rt,B as ot,C as it,D as st,E as at,F as lt,G as ut,a as Ae,b as Fe,c as ke,d as Ge,e as De,f as B,g as Ve,h as Ue,i as We,j as qe,k as ze,l as $e,m as Ke,n as He,o as Be,p as je,q as Ye,r as Qe,s as Xe,t as Je,u as Ze,v as et,x as j,y as tt,z as nt}from"./chunk-4VN252CK.mjs";import{b as St,c as Rt,d as xt,e as wt}from"./chunk-5HI6TVMM.mjs";var Z=2,me=400;function te(t){return!!W(t)}function F(t){let e=new Set;for(let n of t){if(n==null)continue;let o=U(String(n));if(!V(o)&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function A(t){let e=F(t);if(e.length===0||ne(t)<95)return!1;let n=e.filter(u=>te(u)&&!O(u)).length,o=e.filter(u=>!te(u)&&!!O(u)).length;return n>=1&&n>=o}function ce(t,e){if(!O(t))return!1;let n=W(t);return n?e==="world"?!0:ae.has(n):!1}function ne(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)te(o)&&n++;return Math.round(n/e.length*1e3)/10}function z(t){let e=F(t);if(e.length===0)return 0;let n=0;for(let o of e)O(o)&&n++;return Math.round(n/e.length*1e3)/10}function oe(t){let e=new Set;for(let n of t){if(n==null)continue;let o=String(n).trim();if(!V(U(o))&&!e.has(o)&&(e.add(o),e.size>=me))break}return Array.from(e)}function re(t){let e=oe(t);if(e.length===0)return 0;let n=0;for(let o of e)q(o).length>0&&n++;return Math.round(n/e.length*1e3)/10}function de(t,e){return ue(e,le)?!0:oe(t).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Bn(t,e){let n=F(t);if(n.length===0)return 0;let o=0;for(let u of n)Q(u,e)&&o++;return Math.round(o/n.length*1e3)/10}function ee(t,e){let n=0;for(let o of F(t))e(o)&&n++;return n}function jn(t,e){let n=0;for(let o of oe(t))e(o)&&n++;return n}function Yn(t,e,n,o,u){let l=[],a=[],i={},h={},C=new Set(t),y=s=>e.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&C.has(d)&&(i[s]=d)}let g=new Set(u??t);for(let s of["lat","lon"]){let d=n?.[s];d&&g.has(d)&&(i[s]=d)}let f=n?.zip;if(f&&C.has(f)){let s=y(f),d=re(s);d<95?a.push(`zip=${f} (only ${d}% of values read as ZIPs)`):de(s,f)?i.zip=f:a.push(`zip=${f} (all values are 3-4 digits with nothing to say they are postal)`)}let c=n?.state;if(c&&C.has(c)){let s=y(c),d=F(s);d.length>0&&d.every(S=>ce(S,o))?a.push(`state=${c} (every value is "CA", which is both Canada and California)`):A(s)?(a.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):z(s)<95?a.push(`state=${c} (only ${z(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),b=t.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of b){let S=y(d);if(A(S))continue;let P=z(S);if(P<95)continue;let H=ee(S,D=>!!O(D)),Ne=ee(S,D=>!!O(D)&&!ce(D,o));H<Z&&Ne<1||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.state=s.name,p.add(s.name),l.push(`state=${s.name} (${s.pct}% states/provinces)`))}if(!i.zip)for(let s of b){if(p.has(s))continue;let d=y(s),S=re(d);if(!(S<95)&&de(d,s)&&!(jn(d,P=>q(P).length>0)<Z)){i.zip=s,p.add(s),l.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!A(y(T))){let s=null;for(let d of b){if(p.has(d)||!A(y(d)))continue;let S=ne(y(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(a.push(`country=${T} (only ${ne(y(T))}% of values are country identifiers; using ${s.name} instead)`),h.country=T),i.country=s.name,p.add(s.name),l.push(`country=${s.name}`))}if(!i.city){let s=null;for(let d of b){if(p.has(d))continue;let S=y(d),P=Bn(S,o);P<Y||ee(S,H=>Q(H,o))<Z||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.city=s.name,l.push(`city=${s.name} (${s.pct}% known cities)`))}let v=i.country?y(i.country):[],R=!!i.country&&A(v),L=R?new Set(v.map(s=>W(s==null?null:String(s))).filter(Boolean)).size:0,x=R&&L>=2,w=!!(i.lat&&i.lon)&&e.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&&a.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`),i.country&&!x&&!(i.city||i.state||i.zip||w)&&a.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:l,refused:a,...Object.keys(h).length?{labelFallback:h}:{}}}var r=(t,...e)=>({part:t,langs:Object.freeze(e)}),ie=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")}),Qn=Object.freeze(Array.from(new Set(Object.values(ie).flatMap(t=>t.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function Xn(t,e){let n=[],o=B(e);try{o&&n.push(t.toLocaleLowerCase(o.intl))}catch{}let u=t.toLowerCase();return n.includes(u)||n.push(u),n}function Jn(t,e){let n=String(t??"").trim().normalize("NFC");if(!n)return null;for(let o of Xn(n,e)){let u=ie[o];if(u&&u.langs.includes(e))return u.part}return null}function Zn(t,e){return fe.includes(t)?typeof e=="number"&&Number.isFinite(e)&&e>=pe&&e<=ge:!0}function ye(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var er=/\b(?:columns|cols|column)\b/i;function $(t,e){let n=Math.max(0,e-240),o=t.slice(n,e),u=o.lastIndexOf(";");return u>=0&&(o=o.slice(u+1)),er.test(o)}function he(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(t))}function Ce(t,e,n){let o=ye(e),u=new RegExp(String.raw`(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*?\.name\s*===?\s*(['"])${o}\2`,"g"),l=new RegExp(String.raw`\.name\s*===?\s*(['"])${o}\1`,"g"),a=0,i;for(;(i=l.exec(t))!==null;)$(t,i.index)&&a++;let h=0;for(;(i=u.exec(t))!==null;){let C=i.index+i[0].lastIndexOf(".name");if(!$(t,C))continue;h++;let y=ye(i[1]);if(!n(y))return!1}return h>0&&h===a}function tr(t,e){return Ce(t,e,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|!==?\s*-1)`).test(t)&&!new RegExp(String.raw`\b${n}\s*===?\s*-1`).test(t))}var be=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function nr(t,e){if(!t)return[];let n=new Set(e);for(let i of be)n.add(i);let o=new Set,u=/\.name\s*===?\s*(['"])([^'"]+)\1/g,l;for(;(l=u.exec(t))!==null;)$(t,l.index)&&o.add(l[2]);if(o.size===0)return[];let a=[];return o.forEach(i=>{n.has(i)||he(t,i)||a.push(i)}),a}function rr(t,e){if(!t)return[];let n=(t.getColumns()||[]).map(o=>o.name);if(!e||typeof t.aliasesForCode!="function")return n;for(let o of t.aliasesForCode(e))n.push(o.alias);return n}function Ee(t,e){let n=e?.freemiumMaxShapeColumns;return typeof n!="number"||!isFinite(n)||n<1?null:!isFinite(t)||t<=n?0:Math.round(t-n)}function or(t,e,n){let o=Ee(t,e);if(o===null||o<=0)return null;let u=typeof e?.freemiumColumnCapPivot=="number"?e.freemiumColumnCapPivot:4,l=o>u?e?.freemiumColumnCapMessageMany:e?.freemiumColumnCapMessageFew;if(typeof l!="string"||l.trim().length===0)return null;let a=l.split("{n}").join(String(o)).split("{fields}").join(o===1?"field":"fields"),i=Te(n);return i.length===0?a:a+" "+i.join(" ")}function Te(t){if(!t||t.length===0)return[];let e=[],n=new Map,o=new Map;for(let l of t){let a=typeof l?.dateGroupId=="string"?l.dateGroupId.trim():"";if(a!==""&&(n.has(a)||(e.push(a),n.set(a,0)),l.isDatePart===!0&&n.set(a,n.get(a)+1),l.isReassembledDate===!0&&!o.has(a))){let i=typeof l.sourceField=="string"?l.sourceField.trim():"",h=typeof l.name=="string"?l.name.trim():"",C=i!==""?i:h;C!==""&&o.set(a,C)}}let u=[];for(let l of e){let a=o.get(l),i=n.get(l)??0;!a||i===0||u.push(`'${a}' is a date hierarchy and counts as ${i+1} fields - bind the date itself instead of its hierarchy.`)}return u}var m=t=>t==null?"":String(t),N=t=>t===!0,Se=t=>{if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let e=Number(t);return Number.isFinite(e)?e:null}return null},ir=[["city","CityColumn"],["state","StateColumn"],["zip","ZipColumn"],["lat","LatColumn"],["lon","LonColumn"],["country","CountryColumn"]];function Re(t,e){let n={};for(let[o,u]of ir){let l=m(E(t,e+u));l&&(n[o]=l)}return n}function sr(t){return Array.isArray(t)?t.map(e=>({code:m(E(e,"code")),severity:m(E(e,"severity")),text:m(E(e,"text"))})).filter(e=>e.text!==""):[]}function ar(t){let e=C=>E(t,C),n=e("retryAfterSeconds"),o=e("overrideThumbnailUpload"),u=e("forceThumbnailUpload"),l=Re(t,"point"),a=Re(t,"destPoint");Object.keys(a).length&&(l.dest=a);let i=e("retryable"),h=e("isPollFinal");return{errorMessage:m(e("errorMessage")),errorCode:m(e("errorCode")),refusalCode:m(e("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:sr(e("notices")),freemiumStatusCode:m(e("freemiumStatusCode")),code:m(e("code")),language:m(e("language")),version:Number(e("version")??0),codeSummary:m(e("codeSummary")),chartName:m(e("chartName")??e("chartType")),finalChartName:m(e("finalChartName")),warningMessage:m(e("warningMessage")),outputHash:m(e("outputHash")),validatorToken:m(e("validatorToken")),editCodeKey:m(e("editCodeKey")),signedLLMRequestID:m(e("signedLLMRequestID")),userReply:m(e("userReply")),userReplyOutcome:m(e("userReplyOutcome")),improvementSuggestion:m(e("improvementSuggestion")),geoColumn:m(e("geoColumn")),geoKind:m(e("geoKind")),geoPointCols:Object.keys(l).length?l:null,creditBalanceBefore:Se(e("creditBalanceBefore")),creditCost:Se(e("creditCost")),isServiceError:N(e("isServiceError")),isRateLimited:N(e("isRateLimited")),isRefusal:N(e("isRefusal")),isVersionNotFound:N(e("isVersionNotFound")),isGenerationCancelled:N(e("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(e("servedCorrelationId")),...typeof h=="boolean"?{isPollFinal:h}:{},...m(e("pollOutcome"))!==""?{pollOutcome:m(e("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof u=="boolean"?{forceThumbnailUpload:u}:{}}}var xe=t=>t==null?void 0:Number(t),G=t=>m(t)||void 0;function lr(t){let e=E(t,"charts"),n=E(t,"refused"),o=Array.isArray(e)?e.map(l=>{let a=h=>E(l,h),i=a("recommended");return{name:m(a("chartTypeName")??a("name")),description:m(a("description")??a("chartDesc")),rank:xe(a("rank")),score:xe(a("score")),renderer:G(a("renderer")),language:G(a("language")),isPreview:N(a("isPreview")),recommended:typeof i=="boolean"?i:void 0,viaProjection:G(a("viaProjection")),viaProjectionKey:G(a("viaProjectionKey")),detailNote:G(a("detailNote"))}}).filter(l=>l.name):null,u=Array.isArray(n)?n.map(l=>({name:m(E(l,"chartTypeName")??E(l,"name")),reason:m(E(l,"reason")),reasonCode:m(E(l,"reasonCode")),isVeto:N(E(l,"isVeto"))})).filter(l=>l.name):[];return{errorMessage:m(E(t,"errorMessage")),errorCode:m(E(t,"errorCode")),charts:o,refused:u,noFitSummary:m(E(t,"noFitSummary"))}}function ur(t){return!t||typeof t!="object"?null:{status:String(E(t,"status")??""),verdictReason:E(t,"verdictReason")??null,instruction:E(t,"instruction")??null,fix:E(t,"fix")??null,errorMessage:E(t,"errorMessage")??null,errorCode:E(t,"errorCode")??null}}var we=["working","analyze","generate","refine","review"];function cr(t,e){let n=String(t??"").trim().toLowerCase();if(we.includes(n))return n;let o=String(e??"").toLowerCase();return o.includes("analyz")?"analyze":o.includes("generat")?"generate":o.includes("refin")?"refine":o.includes("review")?"review":null}var dr="FREEMIUM_ATTEMPT_SPENT",mr="CLIENT_SECRET_MISMATCH",fr="FREEMIUM_COLUMN_CAP",pr="OAUTH_TOKEN_EXPIRED",gr="OAUTH_SIGNED_OUT";function yr(t){let e=t?.retryable;return typeof e=="boolean"?e:null}function hr(t){let e=t.linkNonce?(t.linkNonce()??"").trim():null,n=e?null:t.accessToken?(t.accessToken()??"").trim():null,o=e||n?{licensee:"",licenseKey:"",secretKey:""}:t.triple();return{request:{licenseKey:o.licenseKey,licensee:o.licensee,secretKey:o.secretKey,freemiumKey:t.freemiumKey?.()??""},linkNonce:e,accessToken:n}}function Cr(t){let{width:e,height:n}=t.measure();return{request:{height:n,width:e},hints:{viewportWidth:e,viewportHeight:n}}}function br(t){let e=0;for(let n of t){if(n.isMeasure)continue;let o=n.distinctCount;typeof o=="number"&&o>e&&(e=o)}return e}function _e(t){if(t.recoveryFetchByCorrelation)return{version:null,fetchOnly:!0};if(t.recoveryFetchVersion!=null)return{version:t.recoveryFetchVersion,fetchOnly:!0};let e=t.settingVersion??null;if(t.genNew)return{version:e,fetchOnly:void 0};let n=(e??0)>0?e:null,o=(t.codeVersion??0)>0?t.codeVersion:null,u=n??o??e;return{version:u,fetchOnly:u!=null&&u>0?!0:void 0}}function Er(t){let e=t.fetchCorrelationId!=null,o=e||t.recoveryFetchVersion!=null?!1:t.genNew,u=_e({genNew:o,recoveryFetchVersion:t.recoveryFetchVersion,recoveryFetchByCorrelation:e,settingVersion:t.settingVersion,codeVersion:t.codeVersion});return{genNew:o,version:u.version,fetchOnly:u.fetchOnly,fetchCorrelationId:t.fetchCorrelationId??void 0}}function Tr(t){let e=n=>t.renderers.has(n);return{supportsD3:e("D3"),supportsPlotly:e("PLOTLY"),supportsVega:e("VEGA")}}function Sr(t){let e=t.cap!=null&&t.budget>t.cap?t.cap:t.budget;return{triesLeft:t.triesLeft??e,maxTries:e}}function Rr(t){return t&&t>0?{leafCardinality:Math.round(t)}:{}}function Pe(t,e){return t!=null&&e!=null&&t!==e}function xr(t,e){return t?Pe(e.capturedFor,e.now)?{shortlist:void 0,stale:!0}:{shortlist:{...t,ageMs:e.atMs>0?Math.max(0,Math.round(e.nowMs-e.atMs)):void 0},stale:!1}:{shortlist:void 0,stale:!1}}var wr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function Oe(t){let e=String(t??"").trim().toLowerCase();return wr[e]??e}function ve(t){let e="";for(let n of t)e+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",Oe(n.dataType)]);return e}function _r(t){return j(ve(t))}var Pr=2,Or=3,vr=4,Lr=64,Mr=8e3,Ir=6e4,Nr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict"});function Ar(t){return!!t&&!t.includes("|")&&!t.includes(",")}function se(t,e,n,o){let u=`${t},${e}|${n}`;return o?`${u}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:u}function Fr(t,e){let n=t;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(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createTelemetryClient needs the service's base URL");if(typeof e.clientVersion!="string"||e.clientVersion==="")throw new TypeError("createTelemetryClient needs the client version");if(typeof e.timeoutMs!="number"||!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw new TypeError("createTelemetryClient needs a positive deadline in milliseconds");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=e.timeoutMs,h=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,C=g=>{try{e.onFailure?.(g)}catch{}},y=async(g,f,c,p)=>{let b;try{let T=await u.post(f,c,p,{timeoutMs:i});b=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){C({channel:g,stage:"post",status:null,error:T});return}(b<200||b>299)&&C({channel:g,stage:"status",status:b,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${h()}${a}/LogClientMsg/?nocache=${l.now()}`,c=I(g),p=k(c,o)}catch(b){C({channel:"client-message",stage:"build",status:null,error:b});return}await y("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,b;try{p=`${h()}${a}/eventlog`,b=se(g,e.clientVersion,f,c)}catch(T){C({channel:"event-count",stage:"build",status:null,error:T});return}await y("event-count",p,b,{"Content-Type":"text/plain"})}}}var Le=2**31-1;function Me(t){return Object.assign(new Error(`The request did not finish within ${t} ms.`),{name:"TimeoutError"})}function kr(t){return typeof t=="number"&&t>0&&t<=Le?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(t)} ms: it must be a number of milliseconds above 0 and at most ${Le} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function Gr(t,e={}){if(typeof t!="function")throw new TypeError("fetchTransport needs the host's fetch");let n=t,o=e.credentials??"omit";return{async post(u,l,a,i){let h=i.timeoutMs,C=kr(h);if(C)throw C;let y=new AbortController,g=!1,f=setTimeout(()=>{g=!0,y.abort(Me(h))},h),c=()=>y.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,b=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Me(h):_,v;try{v=await n(u,{method:"POST",body:l,headers:a,credentials:o,signal:y.signal})}catch(_){throw b(),T(_)}let R=X(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{b()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){b(),_.close();return}_.enqueue(s.value)}catch(s){b(),_.error(T(s))}},cancel(_){return b(),x.cancel(_)}});return{status:R.status,...L,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Ie=300,Dr="/LLMChart/",Vr="/LLMChart/qualify",Ur="/VisionReview/",Wr="/LLMChart/sample",qr="/RefundGenerate/",zr=t=>!!t&&typeof t=="object"&&t.name==="TimeoutError",K=async t=>JSON.parse(await t.text());function $r(t){try{t.body?t.body.cancel().catch(()=>{}):t.text().catch(()=>{})}catch{}}function Kr(t,e){let n=t;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(!e||typeof e.baseUrl!="string"&&typeof e.baseUrl!="function")throw new TypeError("createGenerateClient needs the service's base URL");if(typeof e.baseUrl=="string"&&e.baseUrl==="")throw new TypeError("createGenerateClient needs the service's base URL");if(e.apiPath!==void 0&&typeof e.apiPath!="string")throw new TypeError("createGenerateClient's apiPath must be a string");if(e.nocache!==void 0&&e.nocache!==null&&typeof e.nocache!="function")throw new TypeError("createGenerateClient's nocache must be a function");let{signer:o,transport:u,clock:l}=n,a=e.apiPath??"/api",i=()=>typeof e.baseUrl=="function"?e.baseUrl():e.baseUrl,h=g=>e.nocache?e.nocache(g):String(l.now());async function C(g,f,c,p,b){let T=`${i()}${a}${f}?nocache=${h(g)}`,v={"Content-Type":"text/plain","X-Signature":k(c,o)},R=p.signal??void 0,L=(w,_)=>{let s=!!R?.aborted;return{kind:"transport",headersReceived:w,timedOut:!s&&zr(_),cancelled:s,error:_}},x;try{x=await u.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)$r(x);else try{w=(await x.text()).slice(0,Ie)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await b(x)}}catch(w){return L(!0,w)}}function y(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=y("generate",f),p=c.onStage??void 0;return C("generate",Dr,I(g),c,b=>J(b,p))},async qualify(g,f){let c=y("qualify",f),p=c.route??Vr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return C("qualify",p,I(g),c,K)},async review(g,f){let c=y("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return C("review",Ur,p,c,K)},async sample(g,f){let c=y("sample",f);return C("sample",Wr,I(g),c,K)},async refund(g,f){let c=y("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");return C("refund",qr,JSON.stringify({CorrelationID:g.trim()}),c,K)}}}export{Y as CITY_ROLE_MATCH_PCT,Nr as CLIENT_EVENT_KINDS,mr as CLIENT_SECRET_MISMATCH,He as COMPOUND_MIN_STEM,ct as CYCLE_MEMBERS,mt as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,Qn as DATE_LEVEL_LANGUAGES,ie as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,En as DEFAULT_GAP_FACTOR,rt as DEFAULT_TEMPERATURE,dr as FREEMIUM_ATTEMPT_SPENT,fr as FREEMIUM_COLUMN_CAP,tt as GET_RANDOM,je as GLUED_STEM_MIN,Qe as HANGUL_MIN_STEM,be as HOST_SYNTHETIC_COLUMNS,Ie as HTTP_BODY_START_CHARS,pn as IDENTIFIER_HEAD_INITIAL,gn as IDENTIFIER_UNFOLDED,fn as IDENTIFIER_WORDS,Xt as INTENSIVE_SUFFIX_TOKENS,Qt as INTENSIVE_WORD_TOKENS,kn as IndexedText,Rt as LOOSE_KEY_MIN_LENGTH,wt as LooseIndex,Tn as MAX_RUN_BOUNDS,gr as OAUTH_SIGNED_OUT,pr as OAUTH_TOKEN_EXPIRED,ht as PERIOD_CODE_FORMS,yt as PERIOD_CODE_MEMBERS,Ct as PERIOD_ORDINALS,bt as PERIOD_UNFOLDED,Zt as POSITIONAL_SUFFIX_TOKENS,Jt as POSITIONAL_WORD_TOKENS,qn as PREVIEW_OMITTED_FIELDS,we as PROGRESS_STAGE_IDS,M as ROLE_MATCH_PCT,xn as SERIES_COMPLETENESS_MAX_LISTED,wn as SERIES_COMPLETENESS_MIN_FILL,_n as SERIES_KEY_MAX_DISTINCT,vr as SEV_ERROR,Pr as SEV_INFO,Lr as SEV_USER_PRESENTED,Or as SEV_WARNING,j as SIMPLE_STRING_HASH,et as STR,Je as SUBSTRING_MIN,Ae as SUPPORTED_LANGUAGES,Fe as SUPPORTED_LANGUAGE_CODES,Ir as TELEMETRY_TIMEOUT_DEV_MS,Mr as TELEMETRY_TIMEOUT_MS,De as VOCABULARY_LANGUAGE_CODES,Ge as VOCABULARY_ONLY_LANGUAGES,dt as YEAR_WORDS,z as admin1MatchPct,un as allowedAggregations,yr as answerIsRetryable,qt as buildGeoIsoColumn,kt as buildGeoPointColumns,ft as calendarWordIn,Tr as capabilityFields,Dt as cityMatchPct,Gt as cityTagsFor,An as classifyAdditivity,ln as classifyForAggregation,Fn as classifyNumericValueNature,In as classifyTemporal,rn as codeNeedsLegacyAggNames,hn as codeReadsColumn,Cn as codeReadsColumnsByRoleOrPosition,nn as collapseRepeatedAggPrefix,bn as columnsTheCodeReads,Kt as countryRegion,Kr as createGenerateClient,Fr as createTelemetryClient,hr as credentialFields,Jn as dateLevelPart,Zn as dateLevelYearAdmits,Gn as decimalSeparatorOf,cn as defaultAggregation,Dn as detectDecimalSeparator,Bt as detectFormatSignature,Vt as detectGeo,Ot as detectOrdinalDomain,Mn as detectTextDatePattern,I as encodePayload,Un as engineTypeForSqlType,on as englishImplicitAggNames,se as eventLogLine,Er as fetchFields,Gr as fetchTransport,Ue as foldName,or as freemiumColumnCapRefusal,Ee as freemiumColumnsOverCap,Te as freemiumDateHierarchyClauses,Ye as gluedPrefixStems,rr as guardColumnNames,$n as gzipWireText,Xe as hangulWordEndsWith,tn as hasDefaultAggPrefix,$e as hasUnsegmentedScript,Nn as hostAggHint,Wn as ingest,dn as isAggregationAllowed,V as isBlankLike,Lt as isCityTableLoaded,$ as isColumnContextRef,nt as isDeterministicRefusal,Ar as isEventLogCode,At as isGeoPointAmbiguity,Ln as isIdentifierName,Wt as isJoinGeoKind,Hn as isNdjsonContentType,_t as isOrdinalFriendlyName,xt as isUsableLooseKey,Kn as keyedSigner,Rr as leafCardinalityField,lt as localMidnightDateColumns,at as localMidnightToUtcDay,gt as localizedCycleIn,yn as localizedIdentifierWordIn,pt as localizedYearWordIn,A as looksLikeCountryColumn,St as looseNameKey,Ze as matchNameToken,br as maxNonMeasureCardinality,Rn as measureCadence,vn as measureSeriesCompleteness,k as messageSignature,nr as missingHardColumnRefs,Yt as monthLookupFor,qe as nameLetterRuns,an as nameLooksIntensiveRate,sn as nameLooksPositional,he as nameProbeIsGuarded,tr as nameProbeKeepsDrawing,We as nameWords,Mt as normalizeCountry,ut as normalizeLocalMidnightDates,jt as normalizeMonthKey,U as normalizePlaceName,Nt as normalizeZip5,xr as offeredShortlistFor,ot as parseDateStable,ar as parseGenerateResponse,Vn as parseNumberText,lr as parseQualifyResponse,ur as parseReviewVerdict,Sn as parseTemporalPoint,zn as payloadPreview,Tt as periodCodeSeries,On as pickSeriesColumn,cr as progressStageOf,J as readGenerateStream,ze as readName,Et as readPeriodCode,E as readWireField,vt as registerCityTable,$t as registerIso3Regions,O as resolveAdmin1,_e as resolveFetchVersion,Ft as resolveGeoPoint,Ve as resolveLanguage,Yn as resolvePointRoles,Sr as retryFields,Pt as safeDistinctValuesToShip,ve as schemaIdentity,_r as schemaIdentityKey,Oe as schemaTypeFamily,Pn as seriesKeyVerdict,mn as shareOfTotalIsHonest,Pe as shortlistIsStale,en as stripHostAggPrefix,Ht as summarizeCountryRegions,zt as summarizeGeoExtent,ke as supportedLanguage,Ut as toGeoIso,Ke as unsegmentedRuns,Cr as viewportFields,B as vocabularyLanguage,it as wholeDayFrame,st as wholeDayIso,X as wireResponseFromFetch,Be as wordEndsWith,re as zipMatchPct,q as zipPrefixCandidates,It as zipToPrefix3};
|
|
2
|
+
import{a as $n,b as zn}from"./chunk-HIVICMC5.mjs";import{a as Hn,b as I,c as qn,d as D,e as E,f as Kn,g as X,h as J}from"./chunk-HMLAY26J.mjs";import{a as kn,b as Gn,c as Vn,d as Un,e as Wn}from"./chunk-N52JPYZI.mjs";import{A as bn,B as En,C as Tn,D as Sn,E as Rn,F as xn,G as wn,H as _n,I as Pn,J as vn,K as On,L as Ln,M as Mn,N as In,O as Nn,P as An,Q as Fn,S as Dn,a as zt,b as Ht,c as qt,d as Kt,e as Qt,f as Xt,g as Jt,h as Zt,i as en,j as tn,k as nn,l as rn,m as on,n as sn,o as an,p as ln,q as un,r as cn,s as dn,t as mn,u as fn,v as pn,w as gn,x as yn,y as hn,z as Cn}from"./chunk-OPDY2YEA.mjs";import{a as Bt}from"./chunk-U3H6UBOO.mjs";import{a as jt,b as Yt}from"./chunk-555PKUBU.mjs";import{a as le,b as ue,c as Vt,d as Ut,e as Wt,f as $t}from"./chunk-KQOVPOVU.mjs";import{a as M,b as V,c as Y,d as U,k as W,l as Ot,m as Lt,n as ae,o as v,p as Mt,q as It,r as Nt,s as $,t as At,u as Ft,v as Dt,w as kt,x as Q,y as Gt}from"./chunk-INMDBTAR.mjs";import"./chunk-5MRZID36.mjs";import{a as ct,b as dt,c as mt,d as ft,e as pt,f as gt,g as yt,h as ht,i as Ct,j as bt,k as Et,l as Tt,m as _t,n as Pt,o as vt}from"./chunk-GKXYRUK5.mjs";import{A as rt,B as ot,C as it,D as st,E as at,F as lt,G as ut,a as Ae,b as Fe,c as De,d as ke,e as Ge,f as B,g as Ve,h as Ue,i as We,j as $e,k as ze,l as He,m as qe,n as Ke,o as Be,p as je,q as Ye,r as Qe,s as Xe,t as Je,u as Ze,v as et,x as j,y as tt,z as nt}from"./chunk-4VN252CK.mjs";import{b as St,c as Rt,d as xt,e as wt}from"./chunk-5HI6TVMM.mjs";var Z=2,me=400;function te(e){return!!W(e)}function F(e){let t=new Set;for(let n of e){if(n==null)continue;let o=U(String(n));if(!V(o)&&!t.has(o)&&(t.add(o),t.size>=me))break}return Array.from(t)}function A(e){let t=F(e);if(t.length===0||ne(e)<95)return!1;let n=t.filter(a=>te(a)&&!v(a)).length,o=t.filter(a=>!te(a)&&!!v(a)).length;return n>=1&&n>=o}function ce(e,t){if(!v(e))return!1;let n=W(e);return n?t==="world"?!0:ae.has(n):!1}function ne(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)te(o)&&n++;return Math.round(n/t.length*1e3)/10}function z(e){let t=F(e);if(t.length===0)return 0;let n=0;for(let o of t)v(o)&&n++;return Math.round(n/t.length*1e3)/10}function oe(e){let t=new Set;for(let n of e){if(n==null)continue;let o=String(n).trim();if(!V(U(o))&&!t.has(o)&&(t.add(o),t.size>=me))break}return Array.from(t)}function re(e){let t=oe(e);if(t.length===0)return 0;let n=0;for(let o of t)$(o).length>0&&n++;return Math.round(n/t.length*1e3)/10}function de(e,t){return ue(t,le)?!0:oe(e).some(n=>/^\d{5}(-\d{4})?$/.test(n.replace(/\.0+$/,"")))}function Bn(e,t){let n=F(e);if(n.length===0)return 0;let o=0;for(let a of n)Q(a,t)&&o++;return Math.round(o/n.length*1e3)/10}function ee(e,t){let n=0;for(let o of F(e))t(o)&&n++;return n}function jn(e,t){let n=0;for(let o of oe(e))t(o)&&n++;return n}function Yn(e,t,n,o,a){let u=[],l=[],i={},h={},C=new Set(e),y=s=>t.map(d=>d[s]);for(let s of["city","country"]){let d=n?.[s];d&&C.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&&C.has(f)){let s=y(f),d=re(s);d<95?l.push(`zip=${f} (only ${d}% of values read as ZIPs)`):de(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&&C.has(c)){let s=y(c),d=F(s);d.length>0&&d.every(S=>ce(S,o))?l.push(`state=${c} (every value is "CA", which is both Canada and California)`):A(s)?(l.push(`state=${c} (every value is a country, not a state)`),i.country||(i.country=c)):z(s)<95?l.push(`state=${c} (only ${z(s)}% of values are states/provinces)`):i.state=c}let p=new Set(Object.values(i).filter(Boolean)),b=e.filter(s=>!p.has(s)&&!s.startsWith("__"));if(!i.state){let s=null;for(let d of b){let S=y(d);if(A(S))continue;let P=z(S);if(P<95)continue;let K=ee(S,G=>!!v(G)),Ne=ee(S,G=>!!v(G)&&!ce(G,o));K<Z&&Ne<1||(!s||P>s.pct)&&(s={name:d,pct:P})}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 b){if(p.has(s))continue;let d=y(s),S=re(d);if(!(S<95)&&de(d,s)&&!(jn(d,P=>$(P).length>0)<Z)){i.zip=s,p.add(s),u.push(`zip=${s} (${S}% ZIP codes)`);break}}let T=i.country;if(!T||!A(y(T))){let s=null;for(let d of b){if(p.has(d)||!A(y(d)))continue;let S=ne(y(d));(!s||S>s.pct)&&(s={name:d,pct:S})}s&&(T&&(l.push(`country=${T} (only ${ne(y(T))}% of values are country identifiers; using ${s.name} instead)`),h.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 b){if(p.has(d))continue;let S=y(d),P=Bn(S,o);P<Y||ee(S,K=>Q(K,o))<Z||(!s||P>s.pct)&&(s={name:d,pct:P})}s&&(i.city=s.name,u.push(`city=${s.name} (${s.pct}% known cities)`))}let O=i.country?y(i.country):[],R=!!i.country&&A(O),L=R?new Set(O.map(s=>W(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(h).length?{labelFallback:h}:{}}}var r=(e,...t)=>({part:e,langs:Object.freeze(t)}),ie=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")}),Qn=Object.freeze(Array.from(new Set(Object.values(ie).flatMap(e=>e.langs)))),fe=Object.freeze(["fa","ar","he","th"]),pe=1900,ge=2100;function Xn(e,t){let n=[],o=B(t);try{o&&n.push(e.toLocaleLowerCase(o.intl))}catch{}let a=e.toLowerCase();return n.includes(a)||n.push(a),n}function Jn(e,t){let n=String(e??"").trim().normalize("NFC");if(!n)return null;for(let o of Xn(n,t)){let a=ie[o];if(a&&a.langs.includes(t))return a.part}return null}function Zn(e,t){return fe.includes(e)?typeof t=="number"&&Number.isFinite(t)&&t>=pe&&t<=ge:!0}function ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var er=/\b(?:columns|cols|column)\b/i;function H(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)),er.test(o)}function he(e,t){return Ce(e,t,n=>new RegExp(String.raw`\b${n}\s*(?:>=\s*0|>\s*-1|[!=]==?\s*-1)`).test(e))}function Ce(e,t,n){let o=ye(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;)H(e,i.index)&&l++;let h=0;for(;(i=a.exec(e))!==null;){let C=i.index+i[0].lastIndexOf(".name");if(!H(e,C))continue;h++;let y=ye(i[1]);if(!n(y))return!1}return h>0&&h===l}function tr(e,t){return Ce(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 be=["__rowIdx__","__geoIso__","__geoLat__","__geoLon__","__geoPrecision__"];function nr(e,t){if(!e)return[];let n=new Set(t);for(let i of be)n.add(i);let o=new Set,a=/\.name\s*===?\s*(['"])([^'"]+)\1/g,u;for(;(u=a.exec(e))!==null;)H(e,u.index)&&o.add(u[2]);if(o.size===0)return[];let l=[];return o.forEach(i=>{n.has(i)||he(e,i)||l.push(i)}),l}function rr(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 Ee(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 or(e,t,n){let o=Ee(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=Te(n);return i.length===0?l:l+" "+i.join(" ")}function Te(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():"",h=typeof u.name=="string"?u.name.trim():"",C=i!==""?i:h;C!==""&&o.set(l,C)}}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),N=e=>e===!0,Se=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 Re(e,t){let n={};for(let[o,a]of ir){let u=m(E(e,t+a));u&&(n[o]=u)}return n}function sr(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 ar(e){let t=C=>E(e,C),n=t("retryAfterSeconds"),o=t("overrideThumbnailUpload"),a=t("forceThumbnailUpload"),u=Re(e,"point"),l=Re(e,"destPoint");Object.keys(l).length&&(u.dest=l);let i=t("retryable"),h=t("isPollFinal");return{errorMessage:m(t("errorMessage")),errorCode:m(t("errorCode")),refusalCode:m(t("refusalCode")),retryable:typeof i=="boolean"?i:null,notices:sr(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:Se(t("creditBalanceBefore")),creditCost:Se(t("creditCost")),isServiceError:N(t("isServiceError")),isRateLimited:N(t("isRateLimited")),isRefusal:N(t("isRefusal")),isVersionNotFound:N(t("isVersionNotFound")),isGenerationCancelled:N(t("isGenerationCancelled")),retryAfterSeconds:typeof n=="number"&&Number.isFinite(n)?n:null,servedCorrelationId:m(t("servedCorrelationId")),...typeof h=="boolean"?{isPollFinal:h}:{},...m(t("pollOutcome"))!==""?{pollOutcome:m(t("pollOutcome"))}:{},...typeof o=="boolean"?{overrideThumbnailUpload:o}:{},...typeof a=="boolean"?{forceThumbnailUpload:a}:{}}}var xe=e=>e==null?void 0:Number(e),k=e=>m(e)||void 0;function lr(e){let t=E(e,"charts"),n=E(e,"refused"),o=Array.isArray(t)?t.map(u=>{let l=h=>E(u,h),i=l("recommended");return{name:m(l("chartTypeName")??l("name")),description:m(l("description")??l("chartDesc")),rank:xe(l("rank")),score:xe(l("score")),renderer:k(l("renderer")),language:k(l("language")),isPreview:N(l("isPreview")),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:N(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 ur(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 we=["working","analyze","generate","refine","review"];function cr(e,t){let n=String(e??"").trim().toLowerCase();if(we.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 dr="FREEMIUM_ATTEMPT_SPENT",mr="CLIENT_SECRET_MISMATCH",fr="FREEMIUM_COLUMN_CAP",pr="OAUTH_TOKEN_EXPIRED",gr="OAUTH_SIGNED_OUT";function yr(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 Cr(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 _e(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 Er(e){let t=e.fetchCorrelationId!=null,o=t||e.recoveryFetchVersion!=null?!1:e.genNew,a=_e({genNew:o,recoveryFetchVersion:e.recoveryFetchVersion,recoveryFetchByCorrelation:t,settingVersion:e.settingVersion,codeVersion:e.codeVersion});return{genNew:o,version:a.version,fetchOnly:a.fetchOnly,fetchCorrelationId:e.fetchCorrelationId??void 0}}function Tr(e){let t=n=>e.renderers.has(n);return{supportsD3:t("D3"),supportsPlotly:t("PLOTLY"),supportsVega:t("VEGA")}}function Sr(e){let t=e.cap!=null&&e.budget>e.cap?e.cap:e.budget;return{triesLeft:e.triesLeft??t,maxTries:t}}function Rr(e){return e&&e>0?{leafCardinality:Math.round(e)}:{}}function Pe(e,t){return e!=null&&t!=null&&e!==t}function xr(e,t){return e?Pe(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 wr=Object.freeze({integer:"number",decimal:"number",double:"number",datetime:"date",date:"date",boolean:"boolean",string:"text"});function ve(e){let t=String(e??"").trim().toLowerCase();return wr[t]??t}function Oe(e){let t="";for(let n of e)t+=JSON.stringify([String(n.name??""),n.isMeasure?"M":"D",ve(n.dataType)]);return t}function _r(e){return j(Oe(e))}var Pr=2,vr=3,Or=4,Lr=64,Mr=8e3,Ir=6e4,Nr=Object.freeze({RENDER_START:"render-start",RENDER_OK:"render-ok",RENDER_ERROR:"render-error",VIEW:"view",VIEW_VERDICT:"view-verdict",REDRAW:"redraw",INTERACT:"interact"}),Ar=Object.freeze(["open","generate","version","rebind","data","sample","fix","resize","other"]);function Fr(e,t){return t?`${t};draw:${e}`:`draw:${e}`}function Dr(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 kr(){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 Gr(e){return!!e&&!e.includes("|")&&!e.includes(",")}function se(e,t,n,o){let a=`${e},${t}|${n}`;return o?`${a}|${Math.max(0,Math.round(o.count))}|${o.nonce}`:a}function Vr(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,h=()=>typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl,C=g=>{try{t.onFailure?.(g)}catch{}},y=async(g,f,c,p)=>{let b;try{let T=await a.post(f,c,p,{timeoutMs:i});b=T.status;try{T.body?.cancel().catch(()=>{})}catch{}}catch(T){C({channel:g,stage:"post",status:null,error:T});return}(b<200||b>299)&&C({channel:g,stage:"status",status:b,error:null})};return{async sendClientMessage(g){let f,c,p;try{f=`${h()}${l}/LogClientMsg/?nocache=${u.now()}`,c=I(g),p=D(c,o)}catch(b){C({channel:"client-message",stage:"build",status:null,error:b});return}await y("client-message",f,c,{"Content-Type":"text/plain","X-Signature":p})},async countEvent(g,f,c){let p,b;try{p=`${h()}${l}/eventlog`,b=se(g,t.clientVersion,f,c)}catch(T){C({channel:"event-count",stage:"build",status:null,error:T});return}await y("event-count",p,b,{"Content-Type":"text/plain"})}}}var Le=2**31-1;function Me(e){return Object.assign(new Error(`The request did not finish within ${e} ms.`),{name:"TimeoutError"})}function Ur(e){return typeof e=="number"&&e>0&&e<=Le?null:new RangeError(`fetchTransport cannot keep a deadline of ${String(e)} ms: it must be a number of milliseconds above 0 and at most ${Le} (about 24.8 days), the longest a timer can wait. Nothing was sent.`)}function Wr(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 h=i.timeoutMs,C=Ur(h);if(C)throw C;let y=new AbortController,g=!1,f=setTimeout(()=>{g=!0,y.abort(Me(h))},h),c=()=>y.abort(i.signal?.reason);i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c,{once:!0}));let p=!1,b=()=>{p||(p=!0,clearTimeout(f),i.signal?.removeEventListener("abort",c))},T=_=>g?Me(h):_,O;try{O=await n(a,{method:"POST",body:u,headers:l,credentials:o,signal:y.signal})}catch(_){throw b(),T(_)}let R=X(O),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{b()}}};let x=R.body.getReader(),w=new ReadableStream({async pull(_){try{let s=await x.read();if(s.done){b(),_.close();return}_.enqueue(s.value)}catch(s){b(),_.error(T(s))}},cancel(_){return b(),x.cancel(_)}});return{status:R.status,...L,contentType:R.contentType,body:w,text:()=>new Response(w).text()}}}}var Ie=300,$r="/LLMChart/",zr="/LLMChart/qualify",Hr="/VisionReview/",qr="/LLMChart/sample",Kr="/RefundGenerate/",Br=e=>!!e&&typeof e=="object"&&e.name==="TimeoutError",q=async e=>JSON.parse(await e.text());function jr(e){try{e.body?e.body.cancel().catch(()=>{}):e.text().catch(()=>{})}catch{}}function Yr(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,h=g=>t.nocache?t.nocache(g):String(u.now());async function C(g,f,c,p,b){let T=`${i()}${l}${f}?nocache=${h(g)}`,O={"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&&Br(_),cancelled:s,error:_}},x;try{x=await a.post(T,c,O,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)jr(x);else try{w=(await x.text()).slice(0,Ie)}catch{}return{kind:"http",status:x.status,statusText:x.statusText??"",bodyStart:w}}try{return{kind:"answer",status:x.status,value:await b(x)}}catch(w){return L(!0,w)}}function y(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=y("generate",f),p=c.onStage??void 0;return C("generate",$r,I(g),c,b=>J(b,p))},async qualify(g,f){let c=y("qualify",f),p=c.route??zr;if(typeof p!="string"||!p.startsWith("/"))throw new TypeError("The qualify route must start with '/'");return C("qualify",p,I(g),c,q)},async review(g,f){let c=y("review",f),p=JSON.stringify(g);if(typeof p!="string")throw new TypeError("The review wire did not serialize to JSON");return C("review",Hr,p,c,q)},async sample(g,f){let c=y("sample",f);return C("sample",qr,I(g),c,q)},async refund(g,f){let c=y("refund",f);if(typeof g!="string"||g.trim()==="")throw new TypeError("A refund needs the generation's correlation id");return C("refund",Kr,JSON.stringify({CorrelationID:g.trim()}),c,q)}}}export{Y as CITY_ROLE_MATCH_PCT,Nr as CLIENT_EVENT_KINDS,mr as CLIENT_SECRET_MISMATCH,Ke as COMPOUND_MIN_STEM,ct as CYCLE_MEMBERS,mt as CYCLE_WORDS,ge as DATE_LEVEL_GREGORIAN_YEAR_MAX,pe as DATE_LEVEL_GREGORIAN_YEAR_MIN,Qn as DATE_LEVEL_LANGUAGES,ie as DATE_LEVEL_NAMES,fe as DATE_LEVEL_NON_GREGORIAN_LANGUAGES,En as DEFAULT_GAP_FACTOR,rt as DEFAULT_TEMPERATURE,Ar as DRAW_REASONS,dr as FREEMIUM_ATTEMPT_SPENT,fr as FREEMIUM_COLUMN_CAP,tt as GET_RANDOM,je as GLUED_STEM_MIN,Qe as HANGUL_MIN_STEM,be as HOST_SYNTHETIC_COLUMNS,Ie as HTTP_BODY_START_CHARS,pn as IDENTIFIER_HEAD_INITIAL,gn as IDENTIFIER_UNFOLDED,fn as IDENTIFIER_WORDS,Xt as INTENSIVE_SUFFIX_TOKENS,Qt as INTENSIVE_WORD_TOKENS,Dn as IndexedText,Rt as LOOSE_KEY_MIN_LENGTH,wt as LooseIndex,Tn as MAX_RUN_BOUNDS,gr as OAUTH_SIGNED_OUT,pr as OAUTH_TOKEN_EXPIRED,ht as PERIOD_CODE_FORMS,yt as PERIOD_CODE_MEMBERS,Ct as PERIOD_ORDINALS,bt as PERIOD_UNFOLDED,Zt as POSITIONAL_SUFFIX_TOKENS,Jt as POSITIONAL_WORD_TOKENS,$n as PREVIEW_OMITTED_FIELDS,we as PROGRESS_STAGE_IDS,M as ROLE_MATCH_PCT,xn as SERIES_COMPLETENESS_MAX_LISTED,wn as SERIES_COMPLETENESS_MIN_FILL,_n as SERIES_KEY_MAX_DISTINCT,Or as SEV_ERROR,Pr as SEV_INFO,Lr as SEV_USER_PRESENTED,vr as SEV_WARNING,j as SIMPLE_STRING_HASH,et as STR,Je as SUBSTRING_MIN,Ae as SUPPORTED_LANGUAGES,Fe as SUPPORTED_LANGUAGE_CODES,Ir as TELEMETRY_TIMEOUT_DEV_MS,Mr as TELEMETRY_TIMEOUT_MS,Ge as VOCABULARY_LANGUAGE_CODES,ke as VOCABULARY_ONLY_LANGUAGES,dt as YEAR_WORDS,z as admin1MatchPct,un as allowedAggregations,yr as answerIsRetryable,$t as buildGeoIsoColumn,Dt as buildGeoPointColumns,ft as calendarWordIn,Tr as capabilityFields,Gt as cityMatchPct,kt as cityTagsFor,An as classifyAdditivity,Dr as classifyDraw,ln as classifyForAggregation,Fn as classifyNumericValueNature,In as classifyTemporal,rn as codeNeedsLegacyAggNames,hn as codeReadsColumn,Cn as codeReadsColumnsByRoleOrPosition,nn as collapseRepeatedAggPrefix,bn as columnsTheCodeReads,qt as countryRegion,kr as createDrawLedger,Yr as createGenerateClient,Vr as createTelemetryClient,hr as credentialFields,Jn as dateLevelPart,Zn as dateLevelYearAdmits,kn as decimalSeparatorOf,cn as defaultAggregation,Gn as detectDecimalSeparator,Bt as detectFormatSignature,Vt as detectGeo,vt as detectOrdinalDomain,Mn as detectTextDatePattern,Fr as drawLocation,I as encodePayload,Un as engineTypeForSqlType,on as englishImplicitAggNames,se as eventLogLine,Er as fetchFields,Wr as fetchTransport,Ue as foldName,or as freemiumColumnCapRefusal,Ee as freemiumColumnsOverCap,Te as freemiumDateHierarchyClauses,Ye as gluedPrefixStems,rr as guardColumnNames,Hn as gzipWireText,Xe as hangulWordEndsWith,tn as hasDefaultAggPrefix,He as hasUnsegmentedScript,Nn as hostAggHint,Wn as ingest,dn as isAggregationAllowed,V as isBlankLike,Lt as isCityTableLoaded,H as isColumnContextRef,nt as isDeterministicRefusal,Gr as isEventLogCode,At as isGeoPointAmbiguity,Ln as isIdentifierName,Wt as isJoinGeoKind,Kn as isNdjsonContentType,_t as isOrdinalFriendlyName,xt as isUsableLooseKey,qn as keyedSigner,Rr as leafCardinalityField,lt as localMidnightDateColumns,at as localMidnightToUtcDay,gt as localizedCycleIn,yn as localizedIdentifierWordIn,pt as localizedYearWordIn,A as looksLikeCountryColumn,St as looseNameKey,Ze as matchNameToken,br as maxNonMeasureCardinality,Rn as measureCadence,On as measureSeriesCompleteness,D as messageSignature,nr as missingHardColumnRefs,Yt as monthLookupFor,$e as nameLetterRuns,an as nameLooksIntensiveRate,sn as nameLooksPositional,he as nameProbeIsGuarded,tr as nameProbeKeepsDrawing,We as nameWords,Mt as normalizeCountry,ut as normalizeLocalMidnightDates,jt as normalizeMonthKey,U as normalizePlaceName,Nt as normalizeZip5,xr as offeredShortlistFor,ot as parseDateStable,ar as parseGenerateResponse,Vn as parseNumberText,lr as parseQualifyResponse,ur as parseReviewVerdict,Sn as parseTemporalPoint,zn as payloadPreview,Tt as periodCodeSeries,vn as pickSeriesColumn,cr as progressStageOf,J as readGenerateStream,ze as readName,Et as readPeriodCode,E as readWireField,Ot as registerCityTable,Ht as registerIso3Regions,v as resolveAdmin1,_e as resolveFetchVersion,Ft as resolveGeoPoint,Ve as resolveLanguage,Yn as resolvePointRoles,Sr as retryFields,Pt as safeDistinctValuesToShip,Oe as schemaIdentity,_r as schemaIdentityKey,ve as schemaTypeFamily,Pn as seriesKeyVerdict,mn as shareOfTotalIsHonest,Pe as shortlistIsStale,en as stripHostAggPrefix,Kt as summarizeCountryRegions,zt as summarizeGeoExtent,De as supportedLanguage,Ut as toGeoIso,qe as unsegmentedRuns,Cr as viewportFields,B as vocabularyLanguage,it as wholeDayFrame,st as wholeDayIso,X as wireResponseFromFetch,Be as wordEndsWith,re as zipMatchPct,$ as zipPrefixCandidates,It as zipToPrefix3};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -61,8 +61,8 @@ export { viewportFields, maxNonMeasureCardinality, credentialFields, resolveFetc
|
|
|
61
61
|
export type { ViewportFields, CredentialFields, FetchRequest, FetchFields, CapabilityFields, RetryFields, } from "./wireBuild";
|
|
62
62
|
export { schemaIdentity, schemaIdentityKey, schemaTypeFamily } from "./schemaIdentity";
|
|
63
63
|
export type { SchemaIdentityColumn } from "./schemaIdentity";
|
|
64
|
-
export { SEV_INFO, SEV_WARNING, SEV_ERROR, SEV_USER_PRESENTED, CLIENT_EVENT_KINDS, isEventLogCode, eventLogLine, TELEMETRY_TIMEOUT_MS, TELEMETRY_TIMEOUT_DEV_MS, } from "./telemetry";
|
|
65
|
-
export type { ClientMessage } from "./telemetry";
|
|
64
|
+
export { SEV_INFO, SEV_WARNING, SEV_ERROR, SEV_USER_PRESENTED, CLIENT_EVENT_KINDS, isEventLogCode, eventLogLine, TELEMETRY_TIMEOUT_MS, TELEMETRY_TIMEOUT_DEV_MS, DRAW_REASONS, drawLocation, classifyDraw, createDrawLedger, } from "./telemetry";
|
|
65
|
+
export type { ClientMessage, DrawReason, DrawFacts, DrawLedger } from "./telemetry";
|
|
66
66
|
export { createTelemetryClient } from "./telemetryClient";
|
|
67
67
|
export type { TelemetryClient, TelemetryServices, TelemetryEnv, TelemetryFailure, TelemetryChannel } from "./telemetryClient";
|
|
68
68
|
export { fetchTransport } from "./fetchTransport";
|
|
@@ -48,7 +48,69 @@ export declare const CLIENT_EVENT_KINDS: Readonly<{
|
|
|
48
48
|
readonly RENDER_ERROR: "render-error";
|
|
49
49
|
readonly VIEW: "view";
|
|
50
50
|
readonly VIEW_VERDICT: "view-verdict";
|
|
51
|
+
/** A later draw of a chart version this session already reported, for a reason not yet said. */
|
|
52
|
+
readonly REDRAW: "redraw";
|
|
53
|
+
/** The reader selected something in a chart version, said once per version per session. */
|
|
54
|
+
readonly INTERACT: "interact";
|
|
51
55
|
}>;
|
|
56
|
+
/**
|
|
57
|
+
* WHY A CHART WAS DRAWN. Each value names the event that caused the draw:
|
|
58
|
+
* - `open`: a saved chart drawn when the document or report opened.
|
|
59
|
+
* - `generate`: a new version arriving.
|
|
60
|
+
* - `version`: a switch to another saved version.
|
|
61
|
+
* - `rebind`: the chart pointed at other data.
|
|
62
|
+
* - `data`: the data under it changed (an edit, a refresh, a filter from elsewhere).
|
|
63
|
+
* - `sample`: an example chart shown.
|
|
64
|
+
* - `fix`: a review's correction redrawn.
|
|
65
|
+
* - `resize`: the frame changed size.
|
|
66
|
+
* - `other`: a redraw with none of those causes.
|
|
67
|
+
* A draw-row only says a chart drew. The reason says whether a reader came back, the data moved, or
|
|
68
|
+
* the frame changed size, and a view count that cannot tell those apart overcounts.
|
|
69
|
+
*/
|
|
70
|
+
export declare const DRAW_REASONS: readonly ["open", "generate", "version", "rebind", "data", "sample", "fix", "resize", "other"];
|
|
71
|
+
export type DrawReason = (typeof DRAW_REASONS)[number];
|
|
72
|
+
/**
|
|
73
|
+
* The render row's Location for a draw: `draw:<reason>`, after the host's own Location when it has one
|
|
74
|
+
* (`excel-view;draw:open`). The reason rides Location because that field is kept per render row; the
|
|
75
|
+
* behaviour flags are kept once per chart version, so a reason sent there after the first draw is lost.
|
|
76
|
+
*/
|
|
77
|
+
export declare function drawLocation(reason: DrawReason, base?: string | null): string;
|
|
78
|
+
/** What a host knows about one draw, and about the draw before it in this session (null on the first). */
|
|
79
|
+
export interface DrawFacts {
|
|
80
|
+
/** The reason when the caller knows it (a review fix, an example); it wins over everything below. */
|
|
81
|
+
hint?: DrawReason | null;
|
|
82
|
+
/** The draw shows a version that was generated just now. */
|
|
83
|
+
generated: boolean;
|
|
84
|
+
outputHash: string;
|
|
85
|
+
/** Changes whenever new data arrives under the chart; equal across draws of the same data. */
|
|
86
|
+
dataSignature: string;
|
|
87
|
+
/** The frame's size, as any string that changes when the size does. */
|
|
88
|
+
viewport: string;
|
|
89
|
+
previous: {
|
|
90
|
+
outputHash: string;
|
|
91
|
+
dataSignature: string;
|
|
92
|
+
viewport: string;
|
|
93
|
+
} | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The reason for a draw a host has to infer. Checked in order: the caller's hint; a new version;
|
|
97
|
+
* the session's first draw; another version than the last draw; new data; a new frame size. Anything
|
|
98
|
+
* else is `other`. A host whose every draw call knows its reason passes that reason and never calls this.
|
|
99
|
+
*/
|
|
100
|
+
export declare function classifyDraw(f: DrawFacts): DrawReason;
|
|
101
|
+
/**
|
|
102
|
+
* The once-per-session gates for the two signals. A chart version's reason is said once (a slicer
|
|
103
|
+
* dragged across fifty values is one `data`, not fifty rows), and its first selection is said once:
|
|
104
|
+
* the question is whether a chart was clicked at all, never how often, and a count of gestures is a
|
|
105
|
+
* trace of one reader. Nothing about what was selected is ever sent.
|
|
106
|
+
*/
|
|
107
|
+
export interface DrawLedger {
|
|
108
|
+
/** True the first time this (version, reason) is seen this session. */
|
|
109
|
+
firstDraw(outputHash: string, reason: DrawReason): boolean;
|
|
110
|
+
/** True the first time this version is selected in this session. */
|
|
111
|
+
firstInteract(outputHash: string): boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare function createDrawLedger(): DrawLedger;
|
|
52
114
|
/**
|
|
53
115
|
* Can this code name an event counter? The service splits the line on "|" and keys the counter on
|
|
54
116
|
* everything before it, with "," separating code from version - so a code carrying either delimiter
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/shape-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.74",
|
|
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",
|