@protobase/ui 0.23.4 → 0.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/app.d.ts +4 -1
- package/dist/app/app.js +22 -18
- package/dist/app/charts/chart-groups.js +3 -2
- package/dist/app/charts/period-chart.js +3 -2
- package/dist/app/create/create-values.js +1 -1
- package/dist/app/custom-section.js +1 -1
- package/dist/app/displays/board-column.js +2 -1
- package/dist/app/displays/custom-display.js +1 -1
- package/dist/app/displays/display-frame.js +3 -2
- package/dist/app/displays/map-display.js +4 -3
- package/dist/app/embedded-list/cut-off-note.js +2 -1
- package/dist/app/hand-order/hand-sorted-list.js +2 -1
- package/dist/app/hand-order/use-hand-order.js +1 -1
- package/dist/app/import/import-check-step.js +3 -2
- package/dist/app/import/import-counts.js +2 -1
- package/dist/app/import/import-dialog.js +2 -1
- package/dist/app/import/import-result-step.js +2 -1
- package/dist/app/incoming-relations.js +1 -1
- package/dist/app/list-edit/use-list-edits.js +1 -1
- package/dist/app/list-page.js +1 -1
- package/dist/app/main.js +3 -1
- package/dist/app/map/records-map.js +4 -3
- package/dist/app/meta-gate-messages.js +16 -0
- package/dist/app/meta-gate.js +13 -4
- package/dist/app/nav-recent.js +1 -1
- package/dist/app/pages/blocks/link.js +1 -1
- package/dist/app/pages/blocks/progress.js +3 -2
- package/dist/app/pages/blocks/stat.js +2 -1
- package/dist/app/pages/render-node.js +1 -1
- package/dist/app/pages/use-layout-data.js +1 -1
- package/dist/app/record-preview.js +1 -1
- package/dist/app/record-row/record-row-body.js +2 -1
- package/dist/app/saved/saved-records.js +1 -1
- package/dist/app/search/messages.js +18 -0
- package/dist/app/search/search-model.js +6 -5
- package/dist/app/searches/saved-search-rows.js +1 -1
- package/dist/app/searches/saved-searches.js +1 -1
- package/dist/app/searches/update-search-dialog.js +1 -1
- package/dist/app/searches/use-save-search.js +1 -1
- package/dist/app-shell/bottom-bar.js +3 -2
- package/dist/app-shell/breadcrumb.js +2 -1
- package/dist/app-shell/drawer.js +2 -1
- package/dist/app-shell/global-search.js +5 -4
- package/dist/app-shell/messages.js +64 -0
- package/dist/app-shell/profile-menu.js +5 -4
- package/dist/app-shell/sidebar-group.js +6 -5
- package/dist/app-shell/sidebar.js +4 -3
- package/dist/app-shell/theme-switch.js +8 -7
- package/dist/app-shell/top-bar.js +5 -4
- package/dist/data/meta-data.d.ts +3 -0
- package/dist/data/use-meta.js +1 -0
- package/dist/data/use-record.js +1 -1
- package/dist/data/use-update-record.js +1 -1
- package/dist/format/date.js +42 -50
- package/dist/format/intl-cache.js +12 -0
- package/dist/format/messages.js +24 -0
- package/dist/format/money.js +9 -16
- package/dist/format/number-text.js +3 -2
- package/dist/format/number.js +7 -5
- package/dist/format/zone.js +3 -5
- package/dist/invitations/pending-invitation-row.js +2 -1
- package/dist/live/display-value.js +2 -1
- package/dist/locale/active-locale.js +24 -0
- package/dist/locale/app-locale.js +18 -0
- package/dist/locale/messages.js +12 -0
- package/dist/organizations/organizations-page.js +2 -1
- package/dist/package.js +1 -1
- package/dist/shell/assets/app-Di4_EOe7.js +69 -0
- package/dist/shell/assets/export-worker-O1HF9R4j.js +2 -0
- package/dist/shell/assets/{index-Dxk5GdSQ.js → index-DIcL_2pR.js} +2 -2
- package/dist/shell/assets/{maplibre-CzKsADHj.js → maplibre-B8VhXCMb.js} +2 -2
- package/dist/shell/assets/{markdown-content-pV-6NJbB.js → markdown-content-CDcQeWQm.js} +1 -1
- package/dist/shell/assets/{record-map-CVhzR4LM.js → record-map-Bd0yjDXL.js} +1 -1
- package/dist/shell/assets/records-map-QR_MUceu.js +1 -0
- package/dist/shell/assets/{shared-protobase-ui-BxPtBpOH.js → shared-protobase-ui-CWBBcLfz.js} +1 -1
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/package.json +4 -4
- package/dist/shell/assets/app-CZR9_391.js +0 -69
- package/dist/shell/assets/export-worker-C1djGgjD.js +0 -2
- package/dist/shell/assets/records-map-CJLKyY62.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){let e=(e,t)=>t?.[e]??e,t=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,n=/* @__PURE__ */ new Map,r=e=>{let t=n.get(e);if(t)return t;let r=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`});return n.set(e,r),r},i=(e,t)=>{let n=Object.fromEntries(r(t).formatToParts(e).map(e=>[e.type,e.value]));return{year:Number(n.year),month:Number(n.month),day:Number(n.day),hour:Number(n.hour),minute:Number(n.minute),second:Number(n.second)}},a=(e,t)=>{let n=i(e,t);return Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-Math.floor(e/1e3)*1e3},o=new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,timeZone:`UTC`});new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`,timeZone:`UTC`}),new Intl.DateTimeFormat(`en-GB`,{month:`long`,year:`numeric`,timeZone:`UTC`}),new Intl.DateTimeFormat(`en-GB`,{weekday:`short`,timeZone:`UTC`}),new Intl.DateTimeFormat(`en-GB`,{weekday:`long`,day:`numeric`,month:`short`,year:`numeric`,timeZone:`UTC`});let s=e=>o.format(e),c=/* @__PURE__ */ new Map,l=e=>{let t=c.get(e);if(t)return t;let n={day:new Intl.DateTimeFormat(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,timeZone:e}),time:new Intl.DateTimeFormat(`en-GB`,{hour:`2-digit`,minute:`2-digit`,hour12:!1,timeZone:e})};return c.set(e,n),n},u=(e,n=t())=>{let r=l(n);return`${r.day.format(e)}, ${r.time.format(e)}`},d=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`}),f=[[`year`,31536e3],[`month`,2592e3],[`day`,86400],[`hour`,3600],[`minute`,60]],p=e=>{let t=Math.abs(e),[n,r]=f.find(([,e])=>t>=e)??[`second`,1];return n===`second`&&t<45?`just now`:d.format(-Math.sign(e)*Math.floor(t/r),n)},m=e=>typeof e==`object`&&!!e&&typeof e.uri==`string`,h=e=>typeof e==`object`&&!!e&&typeof e.uploaded?.value==`string`,g=e=>{if(h(e))return{...e.uploaded.file,...e.preview&&{url:e.preview},corrected:e.uploaded.corrected};if(m(e))return`missing`in e?{name:`File missing`,type:``,missing:!0}:e},_=(e,t)=>`${t.prefix??``}${e}${t.suffix??``}`,v=(n,r,i={},a=t(),o=Date.now())=>{if(r==null||r===``)return`—`;switch(n.type){case`boolean`:return r?`Yes`:`No`;case`file`:return g(r)?.name??`—`;case`enum`:return e(String(r),i.valueLabels);case`timestamp`:{let e=Date.parse(String(r));return i.format===`relative`?p(Math.round((o-e)/1e3)):u(e,a)}case`date`:return s(Date.parse(String(r)));case`decimal`:{let e=i.decimals===void 0?String(r):Number(r).toFixed(i.decimals);return i.format===`percent`?`${Number(r)}%`:_(Number(e).toLocaleString(`en-IE`,{minimumFractionDigits:i.decimals??0,maximumFractionDigits:i.decimals??20}),i)}case`integer`:case`bigint`:return _(String(r),i);default:return typeof r==`object`?JSON.stringify(r):String(r)}},y={kind:`empty`},b=e=>({kind:`text`,value:e}),x=e=>e==null||e===``,S=(e,t,n)=>n[e.name]?.[String(t)]??String(t),C=(e,t)=>m(e)?t===`raw`?e.uri:g(e)?.name??e.uri:String(e),w=(e,t,n,r)=>{if(x(t))return``;let{field:i,hints:a}=e;return i.type===`file`?C(t,r):i.type===`relation`?r===`shown`?S(e,t,n):String(t):r===`shown`?v(i,t,{...a,format:void 0}):typeof t==`object`?JSON.stringify(t):String(t)},T=e=>e/864e5+25569,E={shown:{date:`d mmm yyyy`,timestamp:`d mmm yyyy, hh:mm`},raw:{date:`yyyy-mm-dd`,timestamp:`yyyy-mm-dd hh:mm:ss`}},D=e=>[...e??``].map(e=>`\\${e}`).join(``),O=e=>{if(e.format===`percent`)return`General\\%`;let t=e.decimals===void 0?`General`:e.decimals>0?`#,##0.${`0`.repeat(e.decimals)}`:`#,##0`,n=`${D(e.prefix)}${t}${D(e.suffix)}`;return n===`General`?void 0:n},k=(e,t,n)=>{let r=Number(t);if(!Number.isFinite(r)||e.field.type===`bigint`&&!Number.isSafeInteger(r))return b(String(t));let i=n===`shown`?O(e.hints):void 0;return i?{kind:`number`,value:r,format:i}:{kind:`number`,value:r}},A=(e,t,n,r)=>{let i=Date.parse(String(t));if(Number.isNaN(i))return b(String(t));let o=e===`timestamp`&&n===`shown`?i+a(i,r):i;return{kind:`number`,value:T(o),format:E[n][e]}},j=(e,n,r,i,a=t())=>{if(x(n))return y;let{field:o}=e;switch(o.type){case`boolean`:return{kind:`boolean`,value:!!n};case`integer`:case`bigint`:case`decimal`:return k(e,n,i);case`date`:case`timestamp`:return A(o.type,n,i,a);case`relation`:return i===`shown`?b(S(e,n,r)):typeof n==`number`?{kind:`number`,value:n}:b(String(n));default:return b(w(e,n,r,i))}},M=new Uint8Array([239,187,191]),N=/[",\r\n]/,P=/^[=+\-@\t\r]/,F=e=>N.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e,ee=e=>F(P.test(e)?`'${e}`:e),I=e=>`${e.join(`,`)}\r\n`;var L=Uint8Array,R=Uint16Array,z=Int32Array,te=new L([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ne=new L([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),re=new L([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B=function(e,t){for(var n=new R(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new z(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},V=B(te,2),H=V.b,ie=V.r;H[28]=258,ie[258]=28;var ae=B(ne,0);ae.b;for(var oe=ae.r,se=new R(32768),U=0;U<32768;++U){var W=(U&43690)>>1|(U&21845)<<1;W=(W&52428)>>2|(W&13107)<<2,W=(W&61680)>>4|(W&3855)<<4,se[U]=((W&65280)>>8|(W&255)<<8)>>1}for(var G=(function(e,t,n){for(var r=e.length,i=0,a=new R(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new R(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new R(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[se[d]>>c]=l}else for(s=new R(r),i=0;i<r;++i)e[i]&&(s[i]=se[o[e[i]-1]++]>>15-e[i]);return s}),K=new L(288),U=0;U<144;++U)K[U]=8;for(var U=144;U<256;++U)K[U]=9;for(var U=256;U<280;++U)K[U]=7;for(var U=280;U<288;++U)K[U]=8;for(var q=new L(32),U=0;U<32;++U)q[U]=5;var ce=/*#__PURE__*/ G(K,9,0),le=/*#__PURE__*/ G(q,5,0),ue=function(e){return(e+7)/8|0},de=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new L(e.subarray(t,n))},fe=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],J=function(e,t,n){var r=Error(t||fe[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,J),!n)throw r;return r},Y=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},X=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},pe=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return{t:ye,l:0};if(i==1){var o=new L(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new R(f+1),m=me(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return{t:new L(p),l:m}},me=function(e,t,n){return e.s==-1?Math.max(me(e.l,t,n+1),me(e.r,t,n+1)):t[e.s]=n},he=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new R(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return{c:n.subarray(0,r),n:t}},Z=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ge=function(e,t,n){var r=n.length,i=ue(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},_e=function(e,t,n,r,i,a,o,s,c,l,u){Y(t,u++,n),++i[256];for(var d=pe(i,15),f=d.t,p=d.l,m=pe(a,15),h=m.t,g=m.l,_=he(f),v=_.c,y=_.n,b=he(h),x=b.c,S=b.n,C=new R(19),w=0;w<v.length;++w)++C[v[w]&31];for(var w=0;w<x.length;++w)++C[x[w]&31];for(var T=pe(C,7),E=T.t,D=T.l,O=19;O>4&&!E[re[O-1]];--O);var k=l+5<<3,A=Z(i,K)+Z(a,q)+o,j=Z(i,f)+Z(a,h)+o+14+3*O+Z(C,E)+2*C[16]+3*C[17]+7*C[18];if(c>=0&&k<=A&&k<=j)return ge(t,u,e.subarray(c,c+l));var M,N,P,F;if(Y(t,u,1+(j<A)),u+=2,j<A){M=G(f,p,0),N=f,P=G(h,g,0),F=h;var ee=G(E,D,0);Y(t,u,y-257),Y(t,u+5,S-1),Y(t,u+10,O-4),u+=14;for(var w=0;w<O;++w)Y(t,u+3*w,E[re[w]]);u+=3*O;for(var I=[v,x],L=0;L<2;++L)for(var z=I[L],w=0;w<z.length;++w){var B=z[w]&31;Y(t,u,ee[B]),u+=E[B],B>15&&(Y(t,u,z[w]>>5&127),u+=z[w]>>12)}}else M=ce,N=K,P=le,F=q;for(var w=0;w<s;++w){var V=r[w];if(V>255){var B=V>>18&31;X(t,u,M[B+257]),u+=N[B+257],B>7&&(Y(t,u,V>>23&31),u+=te[B]);var H=V&31;X(t,u,P[H]),u+=F[H],H>3&&(X(t,u,V>>5&8191),u+=ne[H])}else X(t,u,M[V]),u+=N[V]}return X(t,u,M[256]),u+N[256]},ve=/*#__PURE__*/ new z([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ye=/*#__PURE__*/ new L(0),be=function(e,t,n,r,i,a){var o=a.z||e.length,s=new L(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=a.l,u=(a.r||0)&7;if(t){u&&(c[0]=a.r>>3);for(var d=ve[t-1],f=d>>13,p=d&8191,m=(1<<n)-1,h=a.p||new R(32768),g=a.h||new R(m+1),_=Math.ceil(n/3),v=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<v)&m},b=new z(25e3),x=new R(288),S=new R(32),C=0,w=0,T=a.i||0,E=0,D=a.w||0,O=0;T+2<o;++T){var k=y(T),A=T&32767,j=g[k];if(h[A]=j,g[k]=A,D<=T){var M=o-T;if((C>7e3||E>24576)&&(M>423||!l)){u=_e(e,c,0,b,x,S,w,E,O,T-O,u),E=C=w=0,O=T;for(var N=0;N<286;++N)x[N]=0;for(var N=0;N<30;++N)S[N]=0}var P=2,F=0,ee=p,I=A-j&32767;if(M>2&&k==y(T-I))for(var re=Math.min(f,M)-1,B=Math.min(32767,T),V=Math.min(258,M);I<=B&&--ee&&A!=j;){if(e[T+P]==e[T+P-I]){for(var H=0;H<V&&e[T+H]==e[T+H-I];++H);if(H>P){if(P=H,F=I,H>re)break;for(var ae=Math.min(I,H-2),se=0,N=0;N<ae;++N){var U=T-I+N&32767,W=U-h[U]&32767;W>se&&(se=W,j=U)}}}A=j,j=h[A],I+=A-j&32767}if(F){b[E++]=268435456|ie[P]<<18|oe[F];var G=ie[P]&31,K=oe[F]&31;w+=te[G]+ne[K],++x[257+G],++S[K],D=T+P,++C}else b[E++]=e[T],++x[e[T]]}}for(T=Math.max(T,D);T<o;++T)b[E++]=e[T],++x[e[T]];u=_e(e,c,l,b,x,S,w,E,O,T-O,u),l||(a.r=u&7|c[u/8|0]<<3,u-=7,a.h=g,a.p=h,a.i=T,a.w=D)}else{for(var T=a.w||0;T<o+l;T+=65535){var q=T+65535;q>=o&&(c[u/8|0]=l,q=o),u=ge(c,u+1,e.subarray(T,q))}a.i=o}return de(s,0,r+ue(u)+i)},xe=/*#__PURE__*/ (function(){for(var e=/* @__PURE__ */ new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Se=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=xe[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Ce=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new L(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return be(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},we=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},Q=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Te=/* @__PURE__ */ function(){function e(e,t){if(typeof e==`function`&&(t=e,e={}),this.ondata=t,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new L(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return e.prototype.p=function(e,t){this.ondata(Ce(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,t){this.ondata||J(5),this.s.l&&J(4);var n=e.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var r=new L(n&-32768);r.set(this.b.subarray(0,this.s.z)),this.b=r}var i=this.b.length-this.s.z;this.b.set(e.subarray(0,i),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(i),32768),this.s.z=e.length-i+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=t&1,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2),t&&(this.s=this.o={},this.b=ye)},e.prototype.flush=function(e){if(this.ondata||J(5),this.s.l&&J(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,e){var t=new L(6);t[0]=this.s.r>>3;var n=ge(t,this.s.r,ye);this.s.r=0,this.ondata(t.subarray(0,n>>3),!1)}},e}(),Ee=typeof TextEncoder<`u`&&/*#__PURE__*/ new TextEncoder,De=typeof TextDecoder<`u`&&/*#__PURE__*/ new TextDecoder;try{De.decode(ye,{stream:!0})}catch{}function Oe(e,t){if(t){for(var n=new L(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if(Ee)return Ee.encode(e);for(var i=e.length,a=new L(e.length+(e.length>>1)),o=0,s=function(e){a[o++]=e},r=0;r<i;++r){if(o+5>a.length){var c=new L(o+8+(i-r<<1));c.set(a),a=c}var l=e.charCodeAt(r);l<128||t?s(l):l<2048?(s(192|l>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,s(240|l>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|l&63)):(s(224|l>>12),s(128|l>>6&63),s(128|l&63))}return de(a,0,o)}var ke=function(e){return e==1?3:e<6?2:+(e==9)},Ae=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;r>65535&&J(9),t+=r+4}return t},je=function(e,t,n,r,i,a,o,s){var c=r.length,l=n.extra,u=s&&s.length,d=Ae(l);Q(e,t,o==null?67324752:33639248),t+=4,o!=null&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(a<0&&8),e[t++]=i&&8,e[t++]=n.compression&255,e[t++]=n.compression>>8;var f=new Date(n.mtime==null?Date.now():n.mtime),p=f.getFullYear()-1980;if((p<0||p>119)&&J(10),Q(e,t,p<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(Q(e,t,n.crc),Q(e,t+4,a<0?-a-2:a),Q(e,t+8,n.size)),Q(e,t+12,c),Q(e,t+14,d),t+=16,o!=null&&(Q(e,t,u),Q(e,t+6,n.attrs),Q(e,t+10,o),t+=14),e.set(r,t),t+=c,d)for(var m in l){var h=l[m],g=h.length;Q(e,t,+m),Q(e,t+2,g),e.set(h,t+4),t+=4+g}return u&&(e.set(s,t),t+=u),t},Me=function(e,t,n,r,i){Q(e,t,101010256),Q(e,t+8,n),Q(e,t+10,n),Q(e,t+12,r),Q(e,t+16,i)},Ne=/* @__PURE__ */ function(){function e(e){this.filename=e,this.c=Se(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){this.ondata||J(5),this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),Pe=/* @__PURE__ */ function(){function e(e,t){var n=this;t||={},Ne.call(this,e),this.d=new Te(t,function(e,t){n.ondata(null,e,t)}),this.compression=8,this.flag=ke(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){Ne.prototype.push.call(this,e,t)},e}(),Fe=/* @__PURE__ */ function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(this.ondata||J(5),this.d&2)this.ondata(J(4+(this.d&1)*8,0,1),null,!1);else{var n=Oe(e.filename),r=n.length,i=e.comment,a=i&&Oe(i),o=r!=e.filename.length||a&&i.length!=a.length,s=r+Ae(e.extra)+30;r>65535&&this.ondata(J(11,0,1),null,!1);var c=new L(s);je(c,0,e,n,o,-1);var l=[c],u=function(){for(var e=0,n=l;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}l=[]},d=this.d;this.d=0;var f=this.u.length,p=we(e,{f:n,u:o,o:a,t:function(){e.terminate&&e.terminate()},r:function(){if(u(),d){var e=t.u[f+1];e?e.r():t.d=1}d=1}}),m=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(m+=r.length,l.push(r),i){var a=new L(16);Q(a,0,134695760),Q(a,4,e.crc),Q(a,8,m),Q(a,12,e.size),l.push(a),p.c=m,p.b=s+m+16,p.crc=e.crc,p.size=e.size,d&&p.r(),d=1}else d&&u()},this.u.push(p)}},e.prototype.end=function(){var e=this;if(this.d&2){this.ondata(J(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){e.d&1&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,i=this.u;r<i.length;r++){var a=i[r];n+=46+a.f.length+Ae(a.extra)+(a.o?a.o.length:0)}for(var o=new L(n+22),s=0,c=this.u;s<c.length;s++){var a=c[s];je(o,e,a,a.f,a.u,-a.c-2,t,a.o),e+=46+a.f.length+Ae(a.extra)+(a.o?a.o.length:0),t+=a.b}Me(o,e,this.u.length,n,t),this.ondata(null,o,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++)t[e].t();this.d=2},e}();let Ie=/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/g,Le=e=>e.replace(Ie,``).replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`),Re=e=>{let t=String.fromCharCode(65+e%26);return e<26?t:Re(Math.floor(e/26)-1)+t},ze=(e,t,n=``)=>`<c r="${e}"${n} t="inlineStr"><is><t xml:space="preserve">${Le(t.slice(0,32767))}</t></is></c>`,$=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
-
`,Be=`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,Ve=`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,He=`http://schemas.openxmlformats.org/package/2006/relationships`,Ue=`${$}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`,We=`${$}<Relationships xmlns="${He}"><Relationship Id="rId1" Type="${Ve}/officeDocument" Target="xl/workbook.xml"/></Relationships>`,Ge=`${$}<Relationships xmlns="${He}"><Relationship Id="rId1" Type="${Ve}/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="${Ve}/styles" Target="styles.xml"/></Relationships>`,Ke=e=>e.replace(/[:\\/?*[\]]/g,` `).slice(0,31).trim()||`Sheet1`,qe=e=>`${$}<workbook xmlns="${Be}" xmlns:r="${Ve}"><sheets><sheet name="${Le(Ke(e))}" sheetId="1" r:id="rId1"/></sheets></workbook>`,Je=e=>{let t=e.map((e,t)=>`<numFmt numFmtId="${164+t}" formatCode="${Le(e)}"/>`).join(``),n=e.map((e,t)=>`<xf numFmtId="${164+t}" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>`).join(``);return`${$}<styleSheet xmlns="${Be}">${e.length>0?`<numFmts count="${e.length}">${t}</numFmts>`:``}<fonts count="2"><font><sz val="11"/><name val="Calibri"/></font><font><b/><sz val="11"/><name val="Calibri"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${2+e.length}"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>${n}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`},Ye=new TextEncoder,Xe=(e,t)=>{let n=new Fe((e,n,r)=>{if(e)throw e;t(n,r)}),r=(e,t)=>{let r=new Pe(e,{level:6});n.add(r),r.push(Ye.encode(t),!0)};r(`[Content_Types].xml`,Ue),r(`_rels/.rels`,We),r(`xl/workbook.xml`,qe(e.name)),r(`xl/_rels/workbook.xml.rels`,Ge);let i=new Pe(`xl/worksheets/sheet1.xml`,{level:6});n.add(i);let a=e.widths.map((e,t)=>`<col min="${t+1}" max="${t+1}" width="${e}" customWidth="1"/>`).join(``),o=`<row r="1">${e.headers.map((e,t)=>ze(`${Re(t)}1`,e,` s="1"`)).join(``)}</row>`;i.push(Ye.encode(`${$}<worksheet xmlns="${Be}"><sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>${a?`<cols>${a}</cols>`:``}<sheetData>${o}`));let s=e.headers.map((e,t)=>Re(t)),c=[],l=e=>{let t=c.indexOf(e);return t>=0?t+2:(c.push(e),c.length+1)},u=(e,t)=>{switch(e.kind){case`empty`:return``;case`text`:return ze(t,e.value);case`boolean`:return`<c r="${t}" t="b"><v>${+!!e.value}</v></c>`;case`number`:return`<c r="${t}"${e.format?` s="${l(e.format)}"`:``}><v>${e.value}</v></c>`}},d=1;return{rows:e=>{let t=``;for(let n of e){if(d+=1,d>1048576)throw Error(`A sheet holds at most 1048575 rows`);t+=`<row r="${d}">${n.map((e,t)=>u(e,`${s[t]}${d}`)).join(``)}</row>`}i.push(Ye.encode(t))},finish:()=>{i.push(Ye.encode(`</sheetData></worksheet>`),!0),r(`xl/styles.xml`,Je(c)),n.end()}}},Ze=/* @__PURE__ */ new Set([`text`,`uuid`,`enum`,`relation`,`file`,`json`,`currency`,`country`]),Qe=(e,t,n)=>e.map(e=>{let r=Math.max(e.header.length,...t.map(t=>w(e,t[e.name],n,`shown`).length));return Math.min(60,Math.max(8,r+2))}),$e=(e,t)=>{let n=new TextEncoder;t(M),t(n.encode(I(e.columns.map(e=>F(e.header)))));let r=(t,n,r)=>{let i=w(t,n[t.name],r,e.mode);return Ze.has(t.field.type)?ee(i):F(i)};return{page:(i,a)=>{t(n.encode(i.map(t=>I(e.columns.map(e=>r(e,t,a)))).join(``)))},finish:()=>void 0}},et=(e,t)=>{let n,r=(n,r)=>Xe({name:e.name,headers:e.columns.map(e=>e.header),widths:Qe(e.columns,n,r)},t);return{page:(t,i)=>{n??=r(t,i),n.rows(t.map(t=>e.columns.map(n=>j(n,t[n.name],i,e.mode))))},finish:()=>{n??=r([],{}),n.finish()}}},tt=(e,t)=>e.format===`csv`?$e(e,t):et(e,t),nt=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},rt=(()=>{let e,t=[];return n=>{if(n.kind===`start`)e=tt(n.plan,e=>t.push(e));else if(e)n.kind===`page`?e.page(n.records,n.labels):e.finish();else throw Error(`The export was not started`);let r=nt(t);return t=[],r}})(),it=self;it.onmessage=e=>{let t=rt(e.data);it.postMessage({bytes:t},[t.buffer])}})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{o as n,yt as r}from"./app-CZR9_391.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./maplibre-CzKsADHj.js";import{t as f}from"./jsx-runtime-NZYk81nU.js";var p=e(t(),1),m=512,h=85.051129,g=16,_=Array.from({length:23},(e,t)=>t),v=e=>e.type===`LineString`?e.coordinates:e.type===`MultiPolygon`?e.coordinates.flat(2):e.coordinates.flat(),y=e=>{let t=Math.max(-85.051129,Math.min(h,e))*Math.PI/180;return .5-Math.log(Math.tan(Math.PI/4+t/2))/(2*Math.PI)},b=e=>{let t=v(e),n=t.map(([e])=>e),r=t.map(([,e])=>y(e)),i=(Math.max(...n)-Math.min(...n))/360*m,a=(Math.max(...r)-Math.min(...r))*m;return Math.max(i,a)},x=(e,t)=>{let n=e.flatMap(e=>{if(!e.area)return[];let n=e.area.type===`LineString`||e.area.type===`MultiLineString`?`line`:`polygon`;return[{type:`Feature`,geometry:e.area,properties:{key:e.key,kind:n,span:b(e.area),chosen:t?.includes(e.key)??!1}}]});return{type:`FeatureCollection`,features:[...n.filter(e=>!e.properties.chosen),...n.filter(e=>e.properties.chosen)]}},S=e=>[`interpolate`,[`linear`],[`zoom`],..._.flatMap(t=>[t,[`*`,e,[`min`,1,[`max`,0,[`/`,[`-`,[`*`,[`get`,`span`],2**t],g],32]]]]])],C=e(f(),1),w=`position-area-fills`,T=[`==`,[`get`,`kind`],`polygon`],E=[`==`,[`get`,`kind`],`line`],D=(e,t)=>[`case`,[`get`,`chosen`],e,t],O=({points:e,selected:t,colors:n})=>{let r=x(e,t);if(r.features.length===0)return null;let i=[`case`,[`get`,`chosen`],n.chosen,n.area];return(0,C.jsxs)(o,{id:`position-areas`,type:`geojson`,data:r,children:[(0,C.jsx)(l,{id:w,type:`fill`,filter:T,paint:{"fill-color":i,"fill-opacity":S(D(.15,.1))}}),(0,C.jsx)(l,{id:`position-area-outlines`,type:`line`,filter:T,paint:{"line-color":i,"line-width":1.5,"line-dasharray":[3,2],"line-opacity":S(.8)}}),(0,C.jsx)(l,{id:`position-area-lines`,type:`line`,filter:E,layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-color":i,"line-width":6,"line-opacity":S(D(.6,.35))}})]})},k=(e,t)=>{let n=document.createElement(`span`);n.style.color=`var(${t})`,e.append(n);let r=getComputedStyle(n).color;n.remove();let i=document.createElement(`canvas`);i.width=1,i.height=1;let a=i.getContext(`2d`,{willReadFrequently:!0});if(!a)return r;a.fillStyle=r,a.fillRect(0,0,1,1);let[o,s,c,l]=a.getImageData(0,0,1,1).data;return`rgba(${o}, ${s}, ${c}, ${l/255})`},A=28,j={padding:48,maxZoom:15,duration:0},M={padding:48,maxZoom:16,duration:300},N=32,P=new Intl.NumberFormat(`en-IE`,{notation:`compact`,maximumFractionDigits:1}),F=e=>[[e.west,e.south],[e.east,e.north]],I=({style:e,layers:t,initial:o,points:l,buckets:f,fit:m,onFitted:h,onMove:g,selected:_,covered:v,onSelect:y,onClear:b,markerLabel:x,bucketLabel:S})=>{let T=(0,p.useRef)(null),[E,D]=(0,p.useState)([]),[I,L]=(0,p.useState)(),R=new globalThis.Map(l.map(e=>[e.key,e])),z=l.map(e=>e.key).join(`,`),B=m&&JSON.stringify(m),V=()=>{let e=T.current?.getMap();e&&D(n(l.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),A))},H=()=>{let e=T.current?.getMap();if(!e)return;let t=e.getBounds(),n=e.getCenter();g({bounds:{south:t.getSouth(),west:t.getWest(),north:t.getNorth(),east:t.getEast()},zoom:e.getZoom()},{latitude:n.lat,longitude:n.lng,zoom:e.getZoom()})},U=()=>{let e=T.current?.getMap();e&&m&&(e.fitBounds(F(m),j),h(),H())};(0,p.useEffect)(V,[z]),(0,p.useEffect)(U,[B]);let W=E.find(e=>_!==void 0&&e.keys.some(e=>_.includes(e)))?.at;return(0,p.useEffect)(()=>{let e=T.current?.getMap(),t=W===void 0?void 0:R.get(W);if(!e||!t||v===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-v;n>N&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(N-v)/2],duration:300})},[W,v]),(0,C.jsxs)(u,{ref:T,mapLib:d,mapStyle:e,initialViewState:o??{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:()=>{let e=T.current.getMap().getContainer();L({area:k(e,`--primary`),chosen:k(e,`--foreground`)}),V(),m?U():H()},onZoomEnd:V,onMoveEnd:H,onClick:b,children:[(0,C.jsx)(i,{showCompass:!1}),(0,C.jsx)(s,{layers:t,below:w}),I&&(0,C.jsx)(O,{points:l,selected:_,colors:I}),f.map(e=>(0,C.jsx)(c,{latitude:e.latitude,longitude:e.longitude,anchor:`center`,children:(0,C.jsx)(`button`,{type:`button`,"aria-label":S(e.count),className:`flex size-10 cursor-pointer items-center justify-center rounded-full border-2 border-background bg-primary text-xs font-semibold text-primary-foreground tabular-nums shadow`,onClick:t=>{t.stopPropagation(),T.current?.getMap().fitBounds(F(e.bounds),M)},children:P.format(e.count)})},`${e.latitude},${e.longitude}`)),E.map(e=>{let t=R.get(e.at);if(!t)return null;let n=_!==void 0&&e.keys.some(e=>_.includes(e)),i=e.keys.every(e=>R.get(e)?.approximate);return(0,C.jsx)(c,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,style:{zIndex:+!!n},children:(0,C.jsxs)(`button`,{type:`button`,"aria-label":x(e.keys),"aria-pressed":n,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),y(e.keys)},children:[(0,C.jsx)(a,{"aria-hidden":!0,"data-approximate":i||void 0,className:r(`size-8 drop-shadow`,i?n?`fill-background text-foreground`:`fill-background text-primary`:n?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:i?2:1.5,strokeDasharray:i?`3 2`:void 0}),e.keys.length>1&&(0,C.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{I as RecordsMap};
|