PageSourceSearch

https://by-agency-rules.up.railway.app/static/js/index.Cq6szKqJ.js

js by-agency-rules.up.railway.app collected 2026-10-03 12:11:35 UTC 9,370 bytes, 1 lines download raw bytes

1import{r as i,E as K,_ as Q,l as Y,e as _,Q as Z,O as q,bo as j,bp as M,bq as ee,br as te,n as z,bs as k,V as G,W as ne,k as re,b8 as oe,bt as se,j as L,o as ae,b1 as ie}from"./index.Drusyo5m.js";import{w as ce,E as le}from"./withFullScreenWrapper.DfpAcJxf.js";import{a as H,S as B,T as ue}from"./Toolbar.BHDNzWBx.js";import{R as fe}from"./index.s_E0s7LB.js";import{a as J,c as de,b as me,e as pe,t as ge,S as he,d as ye}from"./embed.u3PPfLkw.js";import{u as Se}from"./FormClearHelper.C__r5Llk.js";import{T as be}from"./TableChart.esm.D6ydHcIm.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.B4tLYMwS.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.D_CmqChN.js";import"./throttle.Cyw_V0Dq.js";import"./toConsumableArray.gE9fMkLj.js";import"./formatNumber.CMRgW9EJ.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.BKgfzJZV.js";import"./createDownloadLinkElement.CG7nr2a4.js";import"./FileDownload.esm.AllYUuOW.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";
1var $=i.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return i.createElement(K,Q({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),i.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),i.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});$.displayName="InsertChart";const Ce=new Set(["red","orange","yellow","green","blue","violet","gray","grey","primary"]),we={red:"redColor",orange:"orangeColor",yellow:"yellowColor",green:"greenColor",blue:"blueColor",violet:"violetColor",gray:"grayColor",grey:"grayColor",primary:"primary"};function U(e){return typeof e=="string"&&Ce.has(e.toLowerCase())}function P(e,t){const o=e.toLowerCase(),r=we[o];return r?t.colors[r]:e}function x(e,t){if(Ee(e,t),Array.isArray(e.layer))for(const o of e.layer)o&&typeof o=="object"&&x(o,t);for(const o of["vconcat","hconcat","concat"])if(Array.isArray(e[o]))for(const r of e[o])r&&typeof r=="object"&&x(r,t);("facet"in e||"repeat"in e)&&e.spec&&typeof e.spec=="object"&&x(e.spec,t)}function Ee(e,t){const o=e.encoding;if(!o)return;const r=o.color;if(!r)return;"value"in r&&U(r.value)&&(r.value=P(r.value,t));const c=r.scale;c&&Array.isArray(c.range)&&(c.range=c.range.map(s=>U(s)?P(s,t):s))}const ve=20;function Ne(e){"params"in e&&"encoding"in e&&e.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&_(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}const Oe=(e,t,o,r,c,s,f,m)=>{const n=JSON.parse(e);if(typeof n.height=="number"&&n.height<=0&&delete n.height,typeof n.width=="number"&&n.width<=0&&delete n.width,r==="streamlit"?n.config=J(n.config,s):n.usermeta?.embedOptions?.theme==="streamlit"?(n.config=J(n.config,s),n.usermeta.embedOptions.theme=void 0):n.config=de(n.config,s),n.title&&(typeof n.title=="string"&&(n.title={text:n.title}),n.title.limit=n.title.limit??Math.max(f-40,0)),o&&m&&m>0&&(n.height=m),t&&f&&f>0&&(n.width=f,"vconcat"in n&&n.vconcat.forEach(a=>{a===null||typeof a!="object"||"hconcat"in a||"vconcat"in a||"concat"in a||"layer"in a||(a.width=f)})),n.padding||(n.padding={}),_(n.padding.bottom)&&(n.padding.bottom=ve),n.datasets)throw new Error("Datasets should not be passed as part of the spec");return c.length>0&&Ne(n),x(n,s),n},Ae=(e,t,o,r,c)=>{const s=Y(),{id:f,formId:m,spec:n,data:a,datasets:l,vegaLiteTheme:d,selectionMode:u}=e,g=i.useMemo(()=>u,[JSON.stringify(u)]),y=i.useMemo(()=>Oe(n,r,c,d,g,s,t,o),[n,r,c,d,g,s,t,o]);return{id:f,formId:m,vegaLiteTheme:d,spec:y,selectionMode:g,data:a,datasets:l,useContainerWidth:r}},Te={DATAFRAME_INDEX:"(index)"};function Ve(e){return!e||e.dimensions.numDataRows===0?null:I(e)}function De(e){const t=F(e);if(_(t))return null;const o={};for(const[r,c]of Object.entries(t))o[r]=I(c);return o}function F(e){if(e?.length===0)return null;const t={};return e.forEach(o=>{if(!o)return;const r=o.hasName?o.name:null;t[r]=o.data}),t}function I(e,t=0){if(e.dimensions.numDataRows===0)return[];const o=[],{numDataRows:r,numDataColumns:c,numIndexColumns:s}=e.dimensions,f=e.columnTypes[0]??void 0,m=f?.type===Z.INDEX&&(q(f)||j(f)||M(f));for(let n=t;n<r;n++){const a={};if(m){const{content:l}=e.getCell(n,0);a[Te.DATAFRAME_INDEX]=typeof l=="bigint"?Number(l):l}for(let l=0;l<c;l++){const d=l+s,{content:u,contentType:g}=e.getCell(n,d);if((u instanceof Date||typeof u=="number"&&Number.isFinite(u))&&(j(g)||M(g))&&!ee(g)){const y=new Date(u).getTimezoneOffset()*60*1e3;a[e.columnNames[0][d]]=u.valueOf()+y}else a[e.columnNames[0][d]]=typeof u=="bigint"?Number(u):u}o.push(a)}return o}const Re=150,Le=G.getLogger("useVegaLiteSelections"),xe=(e,t,o)=>{const{id:r,formId:c,selectionMode:s}=e,f=i.useCallback(n=>{s.forEach(l=>{n.addSignalListener(l,te(Re,(d,u)=>{const g=n.getState({data:(v,D)=>s.some(h=>`${h}_store`===v),recurse:!1});z(g)&&t.setElementState(r,"viewState",g);let y=u;"vlPoint"in u&&"or"in u.vlPoint&&(y=u.vlPoint.or);const O={id:r,formId:c},E=JSON.parse(t.getStringValue(O)||"{}"),N={selection:{...E?.selection||{},[d]:y||{}}};k(E,N)||t.setStringValue(O,JSON.stringify(N),{fromUi:!0},o)}))});const a=t.getElementState(r,"viewState");if(z(a))try{return n.setState(a)}catch(l){Le.warn("Failed to restore view state",l)}return n},[r,s,t,c,o]),m=i.useCallback(()=>{const n={selection:{}};
1s.forEach(u=>{n.selection[u]={}});const a={id:r,formId:c},l=t.getStringValue(a),d=l?JSON.parse(l):n;k(d,n)||t.setStringValue(a,JSON.stringify(n),{fromUi:!0},o)},[r,c,o,s,t]);return{maybeConfigureSelections:f,onFormCleared:m}},W="source",Ie=G.getLogger("useVegaEmbed");function Fe(e,t,o){const r=i.useRef(null),c=i.useRef(null),s=i.useRef(W),f=i.useRef(null),m=i.useRef([]),n=i.useRef(null),a=i.useRef([]),[l,d]=i.useState(!1),{maybeConfigureSelections:u,onFormCleared:g}=xe(e,t,o);Se({widgetMgr:t,element:e,onFormCleared:g});const{data:y,datasets:O}=e;i.useEffect(()=>{n.current=y,a.current=O,r.current===null&&(f.current=y,m.current=O)},[y,O]);const E=i.useCallback(()=>{c.current&&c.current(),c.current=null,r.current=null},[]),N=i.useCallback(async(h,b)=>{if(h.current===null)throw new Error("Element missing.");d(!0);try{E();const C={ast:!0,expr:me,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:S,view:R,finalize:T}=await pe(h.current,b,C);r.current=u(R),c.current=T;const p=De(a.current),w=p?Object.keys(p):[];if(w.length===1){const[V]=w;s.current=V}else w.length===0&&S.data&&(s.current=W);const A=Ve(n.current);if(A&&r.current.insert(s.current,A),p)for(const[V,X]of Object.entries(p))r.current.insert(V,X);return await r.current.runAsync(),await r.current.resize().runAsync(),f.current=n.current,m.current=a.current,r.current}finally{d(!1)}},[E,u]),v=i.useCallback((h,b,C,S)=>{if(!S||S.dimensions.numDataRows===0){try{h.remove(b,ge)}catch{}return}if(!C||C.dimensions.numDataRows===0){h.insert(b,I(S));return}S.hash!==C.hash&&(h.data(b,I(S)),Ie.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),D=i.useCallback(async(h,b)=>{if(r.current===null||l)return null;const C=f.current,S=m.current;(C||h)&&v(r.current,s.current,C,h);const R=F(S)??{},T=F(b)??{};for(const[p,w]of Object.entries(T)){const A=p||s.current,V=R[A];v(r.current,A,V,w)}for(const p of Object.keys(R))!Object.hasOwn(T,p)&&p!==s.current&&v(r.current,p,null,null);return await r.current?.resize().runAsync(),f.current=h,m.current=b,r.current},[v,l]);return{createView:N,updateView:D,finalizeView:E}}function _e(e){try{const t=typeof e=="string"?JSON.parse(e):e;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}function je(e){try{const t=typeof e=="string"?JSON.parse(e):e;return!("vconcat"in t)||!Array.isArray(t.vconcat)?!1:t.vconcat.some(o=>o!==null&&typeof o=="object"&&("hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o))}catch{return!1}}const Me=({disableFullscreenMode:e,element:t,fragmentId:o,widgetMgr:r,widthConfig:c,heightConfig:s})=>{const[f,m]=i.useState(!1),[n,a]=i.useState(!1),{expanded:l,height:d,width:u,expand:g,collapse:y}=ne(le),{width:O,height:E,elementRef:N}=re([f]),v=oe(c)||t.useContainerWidth,D=se(s),h=_e(t.spec),b=je(t.spec),C=Ae(t,h?u??0:O,(l?d:E)??0,l&&!b?!0:v,l?!0:D),{createView:S,updateView:R,finalizeView:T}=Fe(C,r,o),{data:p,datasets:w,spec:A}=C;if(i.useLayoutEffect(()=>(N.current!==null&&S(N,A),T),[S,T,A,u,d,f,N]),i.useEffect(()=>{R(p,w)},[p,w]),i.useEffect(()=>{p||w?.[0]?.data?a(!0):a(!1)},[p,w]),f){const V=d??(E>0?E:void 0);return L(fe,{data:p??w[0]?.data,height:V,width:c??void 0,customToolbarActions:[L(H,{label:"Show chart",icon:$,onClick:()=>{m(!1)}},"show-chart")]})}return ae(B,{height:D?l?d:"100%":d,useContainerWidth:l?!0:v,children:[L(ue,{target:B,isFullScreen:l,onExpand:g,onCollapse:y,disableFullscreenMode:e,children:n&&L(H,{label:"Show data",icon:be,onClick:()=>{m(!0)}})}),L(ie,{styles:[he]}),L(ye,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:v,useContainerHeight:D,ref:N})]})},ze=ce(Me),ut=i.memo(ze);export{he as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,ut as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.