jobtrack 1.0.5 → 1.0.7
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/LICENSE +21 -21
- package/bin/jobtrack.js +0 -0
- package/package.json +2 -2
- package/src/assets.ts +5 -0
- package/src/cli.ts +2 -1
- package/src/server.ts +4 -1
- package/src/tray.ts +15 -2
- package/src/version.ts +21 -0
- package/vendor/web-dist/assets/{index-Dl-TlJUw.js → index-Bqi0Bj8-.js} +5 -5
- package/vendor/web-dist/favicon.svg +45 -45
- package/vendor/web-dist/index.html +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Martin Dahl
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Martin Dahl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/jobtrack.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jobtrack",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Runs the JobTrack API + web UI as one background process with a Windows tray icon",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@fastify/static": "^10.1.3",
|
|
30
|
-
"@jobtrack/api": "^1.0.
|
|
30
|
+
"@jobtrack/api": "^1.0.4",
|
|
31
31
|
"fastify": "^5.12.1",
|
|
32
32
|
"systray": "^1.0.5",
|
|
33
33
|
"tsx": "^4.23.12"
|
package/src/assets.ts
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* and falls back to the sibling location in this monorepo, for local development before that
|
|
6
6
|
* staging step has ever run.
|
|
7
7
|
*
|
|
8
|
+
* That preference has a sharp edge in a checkout: publishing leaves `vendor/` behind, and it
|
|
9
|
+
* then shadows `apps/web/dist` for every later `npm run tray` — so a rebuilt UI appears not
|
|
10
|
+
* to take effect. `npm run clean` deletes it; reach for that when the tray serves a UI older
|
|
11
|
+
* than the source.
|
|
12
|
+
*
|
|
8
13
|
* Distinct from `resolveAppDataDir` in `@jobtrack/api/config`: that's where *user* data lives
|
|
9
14
|
* (the database, the model cache); this is where the package's own *shipped* assets live.
|
|
10
15
|
*/
|
package/src/cli.ts
CHANGED
|
@@ -10,11 +10,12 @@ import { createTray } from './tray.js';
|
|
|
10
10
|
import { isAutostartEnabled, enableAutostart, disableAutostart } from './autostart.js';
|
|
11
11
|
import { openSettingsFile } from './settings.js';
|
|
12
12
|
import { openUrl } from './os.js';
|
|
13
|
+
import { APP_VERSION } from './version.js';
|
|
13
14
|
|
|
14
15
|
const { app, config, repos, search } = await startServer();
|
|
15
16
|
|
|
16
17
|
const url = `http://${config.host === '0.0.0.0' ? '127.0.0.1' : config.host}:${config.port}`;
|
|
17
|
-
console.log(`JobTrack running at ${url} (driver: ${config.driver})`);
|
|
18
|
+
console.log(`JobTrack v${APP_VERSION} running at ${url} (driver: ${config.driver})`);
|
|
18
19
|
|
|
19
20
|
let shuttingDown = false;
|
|
20
21
|
async function shutdown(): Promise<void> {
|
package/src/server.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { SearchIndex } from '@jobtrack/api/search';
|
|
|
15
15
|
import { DisabledEmbedder, type Embedder } from '@jobtrack/api/search/embedder';
|
|
16
16
|
import { TransformersEmbedder } from '@jobtrack/api/search/transformers-embedder';
|
|
17
17
|
import { resolveWebDist } from './assets.js';
|
|
18
|
+
import { APP_PACKAGE } from './version.js';
|
|
18
19
|
|
|
19
20
|
export interface RunningServer {
|
|
20
21
|
app: FastifyInstance;
|
|
@@ -43,7 +44,9 @@ export async function startServer(): Promise<RunningServer> {
|
|
|
43
44
|
log: (message, error) => console.warn(`[search] ${message}`, error ?? ''),
|
|
44
45
|
});
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
// `app` so /api/meta — and the web UI's About card — report the `jobtrack` package the
|
|
48
|
+
// user installed, rather than the @jobtrack/api version underneath it.
|
|
49
|
+
const app = await buildApp({ repos, search, config }, { logger: true, app: APP_PACKAGE });
|
|
47
50
|
|
|
48
51
|
const webDist = resolveWebDist();
|
|
49
52
|
if (webDist) {
|
package/src/tray.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { readFileSync } from 'node:fs';
|
|
|
7
7
|
import { createRequire } from 'node:module';
|
|
8
8
|
import { resolve } from 'node:path';
|
|
9
9
|
import { resolveWebDist } from './assets.js';
|
|
10
|
+
import { APP_VERSION } from './version.js';
|
|
10
11
|
|
|
11
12
|
// `systray` is CommonJS and sets an `__esModule: true` flag on its own exports while also
|
|
12
13
|
// assigning `exports.default`. Node's native ESM/CJS interop does not honor that flag the way
|
|
@@ -18,7 +19,11 @@ import { resolveWebDist } from './assets.js';
|
|
|
18
19
|
type SysTrayCtor = typeof import('systray').default;
|
|
19
20
|
const SysTray = createRequire(import.meta.url)('systray').default as SysTrayCtor;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Positions in the `items` array below — `systray` identifies a clicked item by its index,
|
|
24
|
+
* so these must be kept in step with that array's order.
|
|
25
|
+
*/
|
|
26
|
+
const ITEM = { VERSION: 0, OPEN: 1, AUTOSTART: 2, SETTINGS: 3, QUIT: 4 } as const;
|
|
22
27
|
|
|
23
28
|
export interface TrayHandlers {
|
|
24
29
|
autostartEnabled: boolean;
|
|
@@ -39,8 +44,16 @@ export function createTray(handlers: TrayHandlers): InstanceType<SysTrayCtor> {
|
|
|
39
44
|
menu: {
|
|
40
45
|
icon,
|
|
41
46
|
title: 'JobTrack',
|
|
42
|
-
tooltip:
|
|
47
|
+
tooltip: `JobTrack v${APP_VERSION} is running`,
|
|
43
48
|
items: [
|
|
49
|
+
// Disabled on purpose: a label, not an action. It heads the menu so the version is
|
|
50
|
+
// the first thing visible on right-click, without having to hover for the tooltip.
|
|
51
|
+
{
|
|
52
|
+
title: `JobTrack v${APP_VERSION}`,
|
|
53
|
+
tooltip: 'The installed version of the jobtrack package',
|
|
54
|
+
checked: false,
|
|
55
|
+
enabled: false,
|
|
56
|
+
},
|
|
44
57
|
{ title: 'Open JobTrack', tooltip: 'Open the web UI', checked: false, enabled: true },
|
|
45
58
|
{
|
|
46
59
|
title: 'Autostart with Windows',
|
package/src/version.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This package's own name and version — what `npm ls -g jobtrack` prints, what the tray menu
|
|
3
|
+
* shows, and what the composed server reports from `GET /api/meta`. Read from `package.json`
|
|
4
|
+
* at runtime for the same reason `@jobtrack/api` does it (see its `version.ts`): this package
|
|
5
|
+
* ships TypeScript sources, so there is no build step to bake a constant into.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately not routed through `assets.ts`: that file resolves assets this package
|
|
8
|
+
* doesn't own the source of, and falls back to a sibling monorepo path when a staged copy
|
|
9
|
+
* is missing. `package.json` is this package's own, always sits one level above `src/`, and
|
|
10
|
+
* npm includes it in every tarball regardless of the `files` list.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { createRequire } from 'node:module';
|
|
14
|
+
|
|
15
|
+
const { name, version } = createRequire(import.meta.url)('../package.json') as {
|
|
16
|
+
name: string;
|
|
17
|
+
version: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const APP_PACKAGE = { name, version };
|
|
21
|
+
export const APP_VERSION = version;
|
|
@@ -377,9 +377,9 @@ html body {
|
|
|
377
377
|
${n}-eye,
|
|
378
378
|
${n}-download,
|
|
379
379
|
${n}-delete
|
|
380
|
-
`]:{zIndex:10,width:r,margin:`0 ${$(e.marginXXS)}`,fontSize:r,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,color:i,"&:hover":{color:i},svg:{verticalAlign:`baseline`}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:`static`,display:`block`,width:`100%`,height:`100%`,objectFit:`contain`},[`${s}-name`]:{display:`none`,textAlign:`center`},[`${s}-file + ${s}-name`]:{position:`absolute`,bottom:e.margin,display:`block`,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:`none`}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}},[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:`50%`}}}},mZ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},hZ=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:{...nd(e),[t]:{outline:0,"input[type='file']":{cursor:`pointer`}},[`${t}-select`]:{display:`inline-block`},[`${t}-hidden`]:{display:`none`},[`${t}-disabled`]:{color:n,cursor:`not-allowed`}}}},gZ=fd(`Upload`,e=>{let{fontSizeHeading3:t,marginXS:n,lineWidth:r,pictureCardSize:i,calc:a}=e,o=wl(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:i});return[hZ(o),lZ(o),fZ(o),pZ(o),uZ(o),dZ(o),mZ(o),mv(o)]},e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55})),_Z=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z`}}]},name:`paper-clip`,theme:`outlined`}}))());function vZ(){return vZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vZ.apply(this,arguments)}var yZ=_.forwardRef((e,t)=>_.createElement(qd,vZ({},e,{ref:t,icon:_Z.default}))),bZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z`}}]},name:`picture`,theme:`outlined`}}))());function xZ(){return xZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xZ.apply(this,arguments)}var SZ=_.forwardRef((e,t)=>_.createElement(qd,xZ({},e,{ref:t,icon:bZ.default})));function CZ(e){return{...e,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e}}function wZ(e,t){let n=Do(t),r=n.findIndex(({uid:t})=>t===e.uid);return r===-1?n.push(e):n[r]=e,n}function TZ(e,t){let n=e.uid===void 0?`name`:`uid`;return t.filter(t=>t[n]===e[n])[0]}function EZ(e,t){let n=e.uid===void 0?`name`:`uid`,r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}var DZ=(e=``)=>{let t=e.split(`/`),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[``])[0]},OZ=e=>e.indexOf(`image/`)===0,kZ=[`.avif`,`.bmp`,`.dpg`,`.gif`,`.heic`,`.heif`,`.ico`,`.jfif`,`.jpg`,`.jpeg`,`.png`,`.svg`,`.tif`,`.tiff`,`.webp`],AZ=e=>{if(e.type&&!e.thumbUrl)return OZ(e.type);let t=e.thumbUrl||e.url||``,n=DZ(t||e.name);return/^data:image\//.test(t)||kZ.includes(n?.toLowerCase()||``)?!0:!(/^data:/.test(t)||n)},jZ=200;function MZ(e){return new Promise(t=>{if(!e.type||!OZ(e.type)){t(``);return}let n=document.createElement(`canvas`);n.width=jZ,n.height=jZ,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${jZ}px; height: ${jZ}px; z-index: 9999; display: none;`,document.body.appendChild(n);let r=n.getContext(`2d`),i=new Image;if(i.onload=()=>{let{width:e,height:a}=i,o=jZ,s=jZ,c=0,l=0;e>a?(s=jZ/e*a,l=-(s-o)/2):(o=jZ/a*e,c=-(o-s)/2),r.drawImage(i,c,l,o,s);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(i.src),t(u)},i.crossOrigin=`anonymous`,e.type.startsWith(`image/svg+xml`)){let t=new FileReader;t.onload=()=>{t.result&&typeof t.result==`string`&&(i.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith(`image/gif`)){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var NZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`download`,theme:`outlined`}}))());function PZ(){return PZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PZ.apply(this,arguments)}var FZ=_.forwardRef((e,t)=>_.createElement(qd,PZ({},e,{ref:t,icon:NZ.default}))),IZ=_.forwardRef(({prefixCls:e,className:t,style:n,classNames:r,styles:i,locale:a,listType:o,file:s,items:c,progress:l,iconRender:u,actionIconRender:d,itemRender:f,isImgUrl:p,showPreviewIcon:m,showRemoveIcon:h,showDownloadIcon:g,previewIcon:v,removeIcon:y,downloadIcon:b,extra:x,onPreview:S,onDownload:C,onClose:w},T)=>{let{status:E}=s,[D,O]=_.useState(E);_.useEffect(()=>{E!==`removed`&&O(E)},[E]);let[k,A]=ci(!1);_.useEffect(()=>{A(!0,{ms:300})},[]);let j=u(s),M=_.createElement(`div`,{className:`${e}-icon`},j);if(o===`picture`||o===`picture-card`||o===`picture-circle`){if(D===`uploading`||!s.thumbUrl&&!s.url){let t=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:D!==`uploading`});M=_.createElement(`div`,{className:t},j)}else{let t=p?.(s)?_.createElement(`img`,{src:s.thumbUrl||s.url,alt:s.name,className:`${e}-list-item-image`,crossOrigin:s.crossOrigin}):j,n=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(s)});M=_.createElement(`a`,{className:n,onClick:e=>S(s,e),href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`},t)}}let N=Q(`${e}-list-item`,`${e}-list-item-${D}`,r?.item),P=typeof s.linkProps==`string`?JSON.parse(s.linkProps):s.linkProps,F=(op(h)?h(s):h)?d((op(y)?y(s):y)||_.createElement(YY,null),()=>w(s),e,a.removeFile,!0):null,I=(op(g)?g(s):g)&&D===`done`?d((op(b)?b(s):b)||_.createElement(FZ,null),()=>C(s),e,a.downloadFile):null,L=o!==`picture-card`&&o!==`picture-circle`&&_.createElement(`span`,{key:`download-delete`,className:Q(`${e}-list-item-actions`,{picture:o===`picture`})},I,F),R=op(x)?x(s):x,z=R&&_.createElement(`span`,{className:`${e}-list-item-extra`},R),B=Q(`${e}-list-item-name`),V=s.url?_.createElement(`a`,{key:`view`,target:`_blank`,rel:`noopener noreferrer`,className:B,title:s.name,...P,href:s.url,onClick:e=>S(s,e)},s.name,z):_.createElement(`span`,{key:`view`,role:`button`,tabIndex:0,className:B,onClick:e=>S(s,e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(s,e))},title:s.name},s.name,z),H=(op(m)?m(s):m)&&(s.url||s.thumbUrl)?_.createElement(`a`,{href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>S(s,e),title:a.previewFile,"aria-label":a.previewFile||void 0},op(v)?v(s):v||_.createElement(sV,null)):null,U=(o===`picture-card`||o===`picture-circle`)&&D!==`uploading`&&_.createElement(`span`,{className:`${e}-list-item-actions`},H,D===`done`&&I,F),{getPrefixCls:W}=_.useContext(Ao),ee=W(),G=_.createElement(`div`,{className:N,style:i?.item},M,V,L,U,k&&_.createElement(ep,{motionName:`${ee}-fade`,visible:D===`uploading`,motionDeadline:2e3},({className:t})=>{let n=`percent`in s?_.createElement(bU,{type:`line`,percent:s.percent,"aria-label":s[`aria-label`],"aria-labelledby":s[`aria-labelledby`],...l}):null;return _.createElement(`div`,{className:Q(`${e}-list-item-progress`,t)},n)})),K=s.response&&typeof s.response==`string`?s.response:s.error?.statusText||s.error?.message||a.uploadError,q=D===`error`?_.createElement(gD,{title:K,getPopupContainer:e=>e.parentNode},G):G;return _.createElement(`div`,{className:Q(`${e}-list-item-container`,t),style:n,ref:T},f?f(q,s,c,{download:C.bind(null,s),preview:S.bind(null,s),remove:w.bind(null,s)}):q)}),LZ=_.forwardRef((e,t)=>{let{listType:n=`text`,previewFile:r=MZ,onPreview:i,onDownload:a,onRemove:o,locale:s,iconRender:c,isImageUrl:l=AZ,prefixCls:u,items:d=[],showPreviewIcon:f=!0,showRemoveIcon:p=!0,showDownloadIcon:m=!1,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,progress:b={size:[-1,2],showInfo:!1},appendAction:x,appendActionVisible:S=!0,itemRender:C,disabled:w,classNames:T,styles:E}=e,[,D]=Sg(),[O,k]=_.useState(!1),A=[`picture-card`,`picture-circle`].includes(n);_.useEffect(()=>{n.startsWith(`picture`)&&(d||[]).forEach(e=>{!(e.originFileObj instanceof File||e.originFileObj instanceof Blob)||e.thumbUrl!==void 0||(e.thumbUrl=``,r?.(e.originFileObj).then(t=>{e.thumbUrl=t||``,D()}))})},[n,d,r]),_.useEffect(()=>{k(!0)},[]);let j=(e,t)=>{if(i)return t?.preventDefault(),i(e)},M=e=>{op(a)?a(e):e.url&&window.open(e.url,`_blank`,`noopener`)},N=e=>{o?.(e)},P=e=>{if(c)return c(e,n);let t=e.status===`uploading`;if(n.startsWith(`picture`)){let r=n===`picture`?_.createElement(fg,null):s.uploading,i=l?.(e)?_.createElement(SZ,null):_.createElement(vq,null);return t?r:i}return t?_.createElement(fg,null):_.createElement(yZ,null)},F=(e,t,n,r,i)=>{let a={type:`text`,size:`small`,title:r,"aria-label":r||void 0,onClick:n=>{t(),_.isValidElement(e)&&e.props.onClick?.(n)},className:`${n}-list-item-action`,disabled:i?w:!1};return _.isValidElement(e)?_.createElement(Fy,{...a,icon:ch(e,{...e.props,onClick:()=>{}})}):_.createElement(Fy,{...a},_.createElement(`span`,null,e))};_.useImperativeHandle(t,()=>({handlePreview:j,handleDownload:M}));let{getPrefixCls:I}=_.useContext(Ao),L=I(`upload`,u),R=I(),z=Q(`${L}-list`,`${L}-list-${n}`,T?.list),B=_.useMemo(()=>Na(I_(R),[`onAppearEnd`,`onEnterEnd`,`onLeaveEnd`]),[R]),V={...A?{}:B,motionDeadline:2e3,motionName:`${L}-${A?`animate-inline`:`animate`}`,keys:Do(d.map(e=>({key:e.uid,file:e}))),motionAppear:O};return _.createElement(`div`,{className:z,style:E?.list},_.createElement($f,{...V,component:!1},({key:e,file:t,className:r,style:i})=>_.createElement(IZ,{key:e,locale:s,prefixCls:L,className:r,style:i,classNames:T,styles:E,file:t,items:d,progress:b,listType:n,isImgUrl:l,showPreviewIcon:f,showRemoveIcon:p,showDownloadIcon:m,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,iconRender:P,actionIconRender:F,itemRender:C,onPreview:j,onDownload:M,onClose:N})),x&&_.createElement(ep,{...V,visible:S,forceRender:!0},({className:e,style:t})=>ch(x,n=>({className:Q(n.className,e),style:{...t,pointerEvents:e?`none`:void 0,...n.style}}))))}),RZ=`__LIST_IGNORE_${Date.now()}__`,zZ=_.forwardRef((e,t)=>{let n=No(`upload`),{fileList:r,defaultFileList:i,onRemove:a,showUploadList:o=!0,listType:s=`text`,onPreview:c,onDownload:l,onChange:u,onDrop:d,previewFile:f,disabled:p,locale:m,iconRender:h,isImageUrl:g,progress:v,prefixCls:y,className:b,type:x=`select`,children:S,style:C,itemRender:w,maxCount:T,data:E={},multiple:D=!1,hasControlInside:O=!0,action:k=``,accept:A,supportServerRender:j=!0,rootClassName:M,styles:N,classNames:P}=e,F=_.useContext(ph),I=p??F,L=e.customRequest||n.customRequest,R=n.progress||v?{...n.progress,...v}:void 0,z=pg(A,n.accept,``),[B,V]=ti(i,r),H=B||[],U=Yr(()=>H),[W,ee]=_.useState(`drop`),G=_.useRef(null),K=_.useRef(null);_.useMemo(()=>{let e=Date.now();(r||[]).forEach((t,n)=>{!t.uid&&!Object.isFrozen(t)&&(t.uid=`__AUTO__${e}_${n}__`)})},[r]);let q=(e,t,n)=>{let r=Do(t),i=!1;T===1?r=r.slice(-1):T&&(i=r.length>T,r=r.slice(0,T)),(0,$a.flushSync)(()=>{V(r)});let a={file:e,fileList:r};n&&(a.event=n),(!i||e.status===`removed`||r.some(t=>t.uid===e.uid))&&(0,$a.flushSync)(()=>{u?.(a)})},J=async(t,n)=>{let{beforeUpload:r}=e,i=t;if(r){let e=await r(t,n);if(e===!1)return!1;if(delete t[RZ],e===RZ)return Object.defineProperty(t,RZ,{value:!0,configurable:!0}),!1;ap(e)&&(i=e)}return i},te=e=>{let t=e.filter(e=>!e.file[RZ]);if(!t.length)return;let n=t.map(e=>CZ(e.file)),r=Do(H);n.forEach(e=>{r=wZ(e,r)}),n.forEach((e,n)=>{let i=e;if(t[n].parsedFile)e.status=`uploading`;else{let{originFileObj:t}=e,n;try{n=new File([t],t.name,{type:t.type})}catch{n=new Blob([t],{type:t.type}),n.name=t.name,n.lastModifiedDate=new Date,n.lastModified=new Date().getTime()}n.uid=e.uid,i=n}q(i,r)})},Y=(e,t,n)=>{try{typeof e==`string`&&(e=JSON.parse(e))}catch{}if(!TZ(t,H))return;let r=CZ(t);r.status=`done`,r.percent=100,r.response=e,r.xhr=n;let i=wZ(r,H);q(r,i)},ne=(e,t)=>{if(!TZ(t,H))return;let n=CZ(t);n.status=`uploading`,n.percent=e.percent;let r=wZ(n,H);q(n,r,e)},X=(e,t,n)=>{if(!TZ(n,H))return;let r=CZ(n);r.error=e,r.response=t,r.status=`error`;let i=wZ(r,H);q(r,i)},re=e=>{let t;Promise.resolve(op(a)?a(e):a).then(n=>{if(n===!1)return;let r=U(),i=EZ(e,r);i&&(t={...e,status:`removed`},r.forEach(e=>{let n=t.uid===void 0?`name`:`uid`;e[n]===t[n]&&!Object.isFrozen(e)&&(e.status=`removed`)}),G.current?.abort(t),q(t,i))})},ie=e=>{ee(e.type),e.type===`drop`&&d?.(e)};_.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:Y,onProgress:ne,onError:X,fileList:H,upload:G.current,nativeElement:K.current}));let{getPrefixCls:ae,direction:oe,className:se,style:ce,classNames:le,styles:ue}=No(`upload`),de=ae(`upload`,y),fe={...e,listType:s,showUploadList:o,type:x,multiple:D,hasControlInside:O,supportServerRender:j,disabled:I},pe=vp(ce,`trigger`),me=vp(C,`trigger`),[he,ge]=bp([le,P],[ue,pe,N,me],{props:fe}),_e={onBatchStart:te,onError:X,onProgress:ne,onSuccess:Y,...e,customRequest:L,data:E,multiple:D,action:k,accept:z,supportServerRender:j,prefixCls:de,disabled:I,beforeUpload:J,onChange:void 0,hasControlInside:O};delete _e.className,delete _e.style,(!S||I)&&delete _e.id;let ve=`${de}-wrapper`,[ye,be]=gZ(de,ve),[xe]=im(`Upload`,Zp.Upload),{showRemoveIcon:Se,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,extra:Oe}=typeof o==`boolean`?{}:o,ke=Se===void 0?!I:Se,Ae=(e,t)=>o?_.createElement(LZ,{classNames:he,styles:ge,prefixCls:de,listType:s,items:H,previewFile:f,onPreview:c,onDownload:l,onRemove:re,showRemoveIcon:ke,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,iconRender:h,extra:Oe,locale:{...xe,...m},isImageUrl:g,progress:R,appendAction:e,appendActionVisible:t,itemRender:w,disabled:I}):e,je=Q(ve,b,M,ye,be,se,he.root,{[`${de}-rtl`]:oe===`rtl`,[`${de}-picture-card-wrapper`]:s===`picture-card`,[`${de}-picture-circle-wrapper`]:s===`picture-circle`}),Me={...ge.root};if(x===`drag`){let e=Q(ye,de,`${de}-drag`,{[`${de}-drag-uploading`]:H.some(e=>e.status===`uploading`),[`${de}-drag-hover`]:W===`dragover`,[`${de}-disabled`]:I,[`${de}-rtl`]:oe===`rtl`},he.trigger);return _.createElement(`span`,{className:je,ref:K,style:Me},_.createElement(`div`,{className:e,style:ge.trigger,onDrop:ie,onDragOver:ie,onDragLeave:ie},_.createElement(cZ,{..._e,ref:G,className:`${de}-btn`},_.createElement(`div`,{className:`${de}-drag-container`},S))),Ae())}let Ne=Q(de,`${de}-select`,{[`${de}-disabled`]:I,[`${de}-hidden`]:!S},he.trigger),Pe=_.createElement(`div`,{className:Ne,style:ge.trigger},_.createElement(cZ,{..._e,ref:G}));return s===`picture-card`||s===`picture-circle`?_.createElement(`span`,{className:je,ref:K,style:Me},Ae(Pe,!!S)):_.createElement(`span`,{className:je,ref:K,style:Me},Pe,Ae())}),BZ=_.forwardRef((e,t)=>{let{style:n,height:r,hasControlInside:i=!1,children:a,...o}=e,s={...n,height:r};return _.createElement(zZ,{ref:t,hasControlInside:i,...o,style:s,type:`drag`},a)}),VZ=zZ;VZ.Dragger=BZ,VZ.LIST_IGNORE=RZ;var HZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`}}))());function UZ(){return UZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UZ.apply(this,arguments)}var WZ=_.forwardRef((e,t)=>_.createElement(qd,UZ({},e,{ref:t,icon:HZ.default}))),GZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z`}}]},name:`bulb`,theme:`outlined`}}))());function KZ(){return KZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KZ.apply(this,arguments)}var qZ=_.forwardRef((e,t)=>_.createElement(qd,KZ({},e,{ref:t,icon:GZ.default}))),JZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z`}}]},name:`dashboard`,theme:`outlined`}}))());function YZ(){return YZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YZ.apply(this,arguments)}var XZ=_.forwardRef((e,t)=>_.createElement(qd,YZ({},e,{ref:t,icon:JZ.default}))),ZZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`database`,theme:`outlined`}}))());function QZ(){return QZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QZ.apply(this,arguments)}var $Z=_.forwardRef((e,t)=>_.createElement(qd,QZ({},e,{ref:t,icon:ZZ.default}))),eQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z`}}]},name:`experiment`,theme:`outlined`}}))());function tQ(){return tQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tQ.apply(this,arguments)}var nQ=_.forwardRef((e,t)=>_.createElement(qd,tQ({},e,{ref:t,icon:eQ.default}))),rQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z`}}]},name:`filter`,theme:`outlined`}}))());function iQ(){return iQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iQ.apply(this,arguments)}var aQ=_.forwardRef((e,t)=>_.createElement(qd,iQ({},e,{ref:t,icon:rQ.default}))),oQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z`}}]},name:`inbox`,theme:`outlined`}}))());function sQ(){return sQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sQ.apply(this,arguments)}var cQ=_.forwardRef((e,t)=>_.createElement(qd,sQ({},e,{ref:t,icon:oQ.default}))),lQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z`}}]},name:`link`,theme:`outlined`}}))());function uQ(){return uQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uQ.apply(this,arguments)}var dQ=_.forwardRef((e,t)=>_.createElement(qd,uQ({},e,{ref:t,icon:lQ.default}))),fQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z`}}]},name:`moon`,theme:`outlined`}}))());function pQ(){return pQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pQ.apply(this,arguments)}var mQ=_.forwardRef((e,t)=>_.createElement(qd,pQ({},e,{ref:t,icon:fQ.default}))),hQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM492 400h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zM340 368a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`profile`,theme:`outlined`}}))());function gQ(){return gQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gQ.apply(this,arguments)}var _Q=_.forwardRef((e,t)=>_.createElement(qd,gQ({},e,{ref:t,icon:hQ.default}))),vQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z`}}]},name:`pushpin`,theme:`filled`}}))());function yQ(){return yQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yQ.apply(this,arguments)}var bQ=_.forwardRef((e,t)=>_.createElement(qd,yQ({},e,{ref:t,icon:vQ.default}))),xQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z`}}]},name:`rollback`,theme:`outlined`}}))());function SQ(){return SQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SQ.apply(this,arguments)}var CQ=_.forwardRef((e,t)=>_.createElement(qd,SQ({},e,{ref:t,icon:xQ.default}))),wQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z`}}]},name:`safety-certificate`,theme:`outlined`}}))());function TQ(){return TQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TQ.apply(this,arguments)}var EQ=_.forwardRef((e,t)=>_.createElement(qd,TQ({},e,{ref:t,icon:wQ.default}))),DQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z`}}]},name:`setting`,theme:`outlined`}}))());function OQ(){return OQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OQ.apply(this,arguments)}var kQ=_.forwardRef((e,t)=>_.createElement(qd,OQ({},e,{ref:t,icon:DQ.default}))),AQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M882 272.1V144c0-17.7-14.3-32-32-32H174c-17.7 0-32 14.3-32 32v128.1c-16.7 1-30 14.9-30 31.9v131.7a177 177 0 0014.4 70.4c4.3 10.2 9.6 19.8 15.6 28.9v345c0 17.6 14.3 32 32 32h676c17.7 0 32-14.3 32-32V535a175 175 0 0015.6-28.9c9.5-22.3 14.4-46 14.4-70.4V304c0-17-13.3-30.9-30-31.9zM214 184h596v88H214v-88zm362 656.1H448V736h128v104.1zm234 0H640V704c0-17.7-14.3-32-32-32H416c-17.7 0-32 14.3-32 32v136.1H214V597.9c2.9 1.4 5.9 2.8 9 4 22.3 9.4 46 14.1 70.4 14.1s48-4.7 70.4-14.1c13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 3-1.3 6-2.6 9-4v242.2zm30-404.4c0 59.8-49 108.3-109.3 108.3-40.8 0-76.4-22.1-95.2-54.9-2.9-5-8.1-8.1-13.9-8.1h-.6c-5.7 0-11 3.1-13.9 8.1A109.24 109.24 0 01512 544c-40.7 0-76.2-22-95-54.7-3-5.1-8.4-8.3-14.3-8.3s-11.4 3.2-14.3 8.3a109.63 109.63 0 01-95.1 54.7C233 544 184 495.5 184 435.7v-91.2c0-.3.2-.5.5-.5h655c.3 0 .5.2.5.5v91.2z`}}]},name:`shop`,theme:`outlined`}}))());function jQ(){return jQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jQ.apply(this,arguments)}var MQ=_.forwardRef((e,t)=>_.createElement(qd,jQ({},e,{ref:t,icon:AQ.default}))),NQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z`}}]},name:`sun`,theme:`outlined`}}))());function PQ(){return PQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PQ.apply(this,arguments)}var FQ=_.forwardRef((e,t)=>_.createElement(qd,PQ({},e,{ref:t,icon:NQ.default}))),IQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z`}}]},name:`thunderbolt`,theme:`outlined`}}))());function LQ(){return LQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LQ.apply(this,arguments)}var RQ=_.forwardRef((e,t)=>_.createElement(qd,LQ({},e,{ref:t,icon:IQ.default}))),zQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`upload`,theme:`outlined`}}))());function BQ(){return BQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BQ.apply(this,arguments)}var VQ=_.forwardRef((e,t)=>_.createElement(qd,BQ({},e,{ref:t,icon:zQ.default}))),HQ=[`applied`,`screening`,`interview`,`offer`,`rejected`,`withdrawn`,`ghosted`],UQ=[`applied`,`screening`,`interview`,`offer`];function WQ(e){let t=UQ.indexOf(e);return t===-1||t===UQ.length-1?null:UQ[t+1]??null}var GQ={applied:`blue`,screening:`cyan`,interview:`gold`,offer:`green`,rejected:`red`,withdrawn:`default`,ghosted:`purple`},KQ={applied:`Applied`,screening:`Screening`,interview:`Interview`,offer:`Offer`,rejected:`Rejected`,withdrawn:`Withdrawn`,ghosted:`Ghosted`},qQ=[`remote`,`hybrid`,`onsite`,`unspecified`],JQ={remote:`Remote`,hybrid:`Hybrid`,onsite:`On-site`,unspecified:`Unspecified`},YQ=[`company`,`application`],XQ=[`company`,`application`,`standalone`],ZQ=[`company`,`application`,`both`],QQ=/^(\d{4})-(\d{2})-(\d{2})$/;function $Q(e){let t=QQ.exec(e);if(!t)throw Error(`Not a YYYY-MM-DD date: ${JSON.stringify(e)}`);let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(Date.UTC(n,r-1,i));if(a.getUTCFullYear()!==n||a.getUTCMonth()!==r-1||a.getUTCDate()!==i)throw Error(`Not a real calendar date: ${e}`);return a}function e$(e){let t=typeof e==`string`?$Q(e):e;return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1}}function t$(e=new Date){return`${String(e.getFullYear()).padStart(4,`0`)}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}var n$=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function r$(e){return n$[e-1]??`Month ${e}`}var i$;function a$(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var o$=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},s$=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(i$=globalThis).__zod_globalConfig??(i$.__zod_globalConfig={});var c$=globalThis.__zod_globalConfig;function l$(e){return e&&Object.assign(c$,e),c$}function u$(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function d$(e,t){return typeof t==`bigint`?t.toString():t}function f$(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function p$(e){return e==null}function m$(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function h$(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var g$=Symbol(`evaluating`);function _$(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==g$)return r===void 0&&(r=g$,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function v$(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function y$(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function b$(e){return JSON.stringify(e)}function x$(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var S$=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function C$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var w$=f$(()=>{if(c$.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T$(e){if(C$(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return C$(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function E$(e){return T$(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var D$=new Set([`string`,`number`,`symbol`]);function O$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function k$(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function A$(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function j$(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var M$={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function N$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return k$(e,y$(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return v$(this,`shape`,e),e},checks:[]}))}function P$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return k$(e,y$(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return v$(this,`shape`,r),r},checks:[]}))}function F$(e,t){if(!T$(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return k$(e,y$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return v$(this,`shape`,n),n}}))}function I$(e,t){if(!T$(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return k$(e,y$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return v$(this,`shape`,n),n}}))}function L$(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return k$(e,y$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return v$(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function R$(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return k$(t,y$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return v$(this,`shape`,i),i},checks:[]}))}function z$(e,t,n){return k$(t,y$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return v$(this,`shape`,i),i}}))}function B$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function V$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function H$(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function U$(e){return typeof e==`string`?e:e?.message}function W$(e,t,n){let r=e.message?e.message:U$(e.inst?._zod.def?.error?.(e))??U$(t?.error?.(e))??U$(n.customError?.(e))??U$(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function G$(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function K$(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var q$=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,d$,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},J$=a$(`$ZodError`,q$),Y$=a$(`$ZodError`,q$,{Parent:Error});function X$(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Z$(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Q$=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new o$;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>W$(e,a,l$())));throw S$(t,i?.callee),t}return o.value},$$=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>W$(e,a,l$())));throw S$(t,i?.callee),t}return o.value},e1=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new o$;return a.issues.length?{success:!1,error:new(e??J$)(a.issues.map(e=>W$(e,i,l$())))}:{success:!0,data:a.value}},t1=e1(Y$),n1=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>W$(e,i,l$())))}:{success:!0,data:a.value}},r1=n1(Y$),i1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Q$(e)(t,n,i)},a1=e=>(t,n,r)=>Q$(e)(t,n,r),o1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return $$(e)(t,n,i)},s1=e=>async(t,n,r)=>$$(e)(t,n,r),c1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return e1(e)(t,n,i)},l1=e=>(t,n,r)=>e1(e)(t,n,r),u1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return n1(e)(t,n,i)},d1=e=>async(t,n,r)=>n1(e)(t,n,r),f1=/^[cC][0-9a-z]{6,}$/,p1=/^[0-9a-z]+$/,m1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,h1=/^[0-9a-vA-V]{20}$/,g1=/^[A-Za-z0-9]{27}$/,_1=/^[a-zA-Z0-9_-]{21}$/,v1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,b1=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,x1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,S1=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function C1(){return new RegExp(S1,`u`)}var w1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,E1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,D1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,O1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,k1=/^[A-Za-z0-9_-]*$/,A1=/^https?$/,j1=/^\+[1-9]\d{6,14}$/,M1=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,N1=RegExp(`^${M1}$`);function P1(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function F1(e){return RegExp(`^${P1(e)}$`)}function I1(e){let t=P1({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${M1}T(?:${r})$`)}var L1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},R1=/^-?\d+$/,z1=/^-?\d+(?:\.\d+)?$/,B1=/^(?:true|false)$/i,V1=/^[^A-Z]*$/,H1=/^[^a-z]*$/,U1=a$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),W1={number:`number`,bigint:`bigint`,object:`date`},G1=a$(`$ZodCheckLessThan`,(e,t)=>{U1.init(e,t);let n=W1[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),K1=a$(`$ZodCheckGreaterThan`,(e,t)=>{U1.init(e,t);let n=W1[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),q1=a$(`$ZodCheckMultipleOf`,(e,t)=>{U1.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):h$(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),J1=a$(`$ZodCheckNumberFormat`,(e,t)=>{U1.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=M$[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=R1)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Y1=a$(`$ZodCheckMaxLength`,(e,t)=>{var n;U1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=G$(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),X1=a$(`$ZodCheckMinLength`,(e,t)=>{var n;U1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=G$(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Z1=a$(`$ZodCheckLengthEquals`,(e,t)=>{var n;U1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!p$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=G$(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Q1=a$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;U1.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),$1=a$(`$ZodCheckRegex`,(e,t)=>{Q1.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e0=a$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=V1,Q1.init(e,t)}),t0=a$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=H1,Q1.init(e,t)}),n0=a$(`$ZodCheckIncludes`,(e,t)=>{U1.init(e,t);let n=O$(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),r0=a$(`$ZodCheckStartsWith`,(e,t)=>{U1.init(e,t);let n=RegExp(`^${O$(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),i0=a$(`$ZodCheckEndsWith`,(e,t)=>{U1.init(e,t);let n=RegExp(`.*${O$(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),a0=a$(`$ZodCheckOverwrite`,(e,t)=>{U1.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),o0=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
380
|
+
`]:{zIndex:10,width:r,margin:`0 ${$(e.marginXXS)}`,fontSize:r,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,color:i,"&:hover":{color:i},svg:{verticalAlign:`baseline`}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:`static`,display:`block`,width:`100%`,height:`100%`,objectFit:`contain`},[`${s}-name`]:{display:`none`,textAlign:`center`},[`${s}-file + ${s}-name`]:{position:`absolute`,bottom:e.margin,display:`block`,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:`none`}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}},[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:`50%`}}}},mZ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},hZ=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:{...nd(e),[t]:{outline:0,"input[type='file']":{cursor:`pointer`}},[`${t}-select`]:{display:`inline-block`},[`${t}-hidden`]:{display:`none`},[`${t}-disabled`]:{color:n,cursor:`not-allowed`}}}},gZ=fd(`Upload`,e=>{let{fontSizeHeading3:t,marginXS:n,lineWidth:r,pictureCardSize:i,calc:a}=e,o=wl(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:i});return[hZ(o),lZ(o),fZ(o),pZ(o),uZ(o),dZ(o),mZ(o),mv(o)]},e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55})),_Z=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z`}}]},name:`paper-clip`,theme:`outlined`}}))());function vZ(){return vZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vZ.apply(this,arguments)}var yZ=_.forwardRef((e,t)=>_.createElement(qd,vZ({},e,{ref:t,icon:_Z.default}))),bZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z`}}]},name:`picture`,theme:`outlined`}}))());function xZ(){return xZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xZ.apply(this,arguments)}var SZ=_.forwardRef((e,t)=>_.createElement(qd,xZ({},e,{ref:t,icon:bZ.default})));function CZ(e){return{...e,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e}}function wZ(e,t){let n=Do(t),r=n.findIndex(({uid:t})=>t===e.uid);return r===-1?n.push(e):n[r]=e,n}function TZ(e,t){let n=e.uid===void 0?`name`:`uid`;return t.filter(t=>t[n]===e[n])[0]}function EZ(e,t){let n=e.uid===void 0?`name`:`uid`,r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}var DZ=(e=``)=>{let t=e.split(`/`),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[``])[0]},OZ=e=>e.indexOf(`image/`)===0,kZ=[`.avif`,`.bmp`,`.dpg`,`.gif`,`.heic`,`.heif`,`.ico`,`.jfif`,`.jpg`,`.jpeg`,`.png`,`.svg`,`.tif`,`.tiff`,`.webp`],AZ=e=>{if(e.type&&!e.thumbUrl)return OZ(e.type);let t=e.thumbUrl||e.url||``,n=DZ(t||e.name);return/^data:image\//.test(t)||kZ.includes(n?.toLowerCase()||``)?!0:!(/^data:/.test(t)||n)},jZ=200;function MZ(e){return new Promise(t=>{if(!e.type||!OZ(e.type)){t(``);return}let n=document.createElement(`canvas`);n.width=jZ,n.height=jZ,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${jZ}px; height: ${jZ}px; z-index: 9999; display: none;`,document.body.appendChild(n);let r=n.getContext(`2d`),i=new Image;if(i.onload=()=>{let{width:e,height:a}=i,o=jZ,s=jZ,c=0,l=0;e>a?(s=jZ/e*a,l=-(s-o)/2):(o=jZ/a*e,c=-(o-s)/2),r.drawImage(i,c,l,o,s);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(i.src),t(u)},i.crossOrigin=`anonymous`,e.type.startsWith(`image/svg+xml`)){let t=new FileReader;t.onload=()=>{t.result&&typeof t.result==`string`&&(i.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith(`image/gif`)){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var NZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`download`,theme:`outlined`}}))());function PZ(){return PZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PZ.apply(this,arguments)}var FZ=_.forwardRef((e,t)=>_.createElement(qd,PZ({},e,{ref:t,icon:NZ.default}))),IZ=_.forwardRef(({prefixCls:e,className:t,style:n,classNames:r,styles:i,locale:a,listType:o,file:s,items:c,progress:l,iconRender:u,actionIconRender:d,itemRender:f,isImgUrl:p,showPreviewIcon:m,showRemoveIcon:h,showDownloadIcon:g,previewIcon:v,removeIcon:y,downloadIcon:b,extra:x,onPreview:S,onDownload:C,onClose:w},T)=>{let{status:E}=s,[D,O]=_.useState(E);_.useEffect(()=>{E!==`removed`&&O(E)},[E]);let[k,A]=ci(!1);_.useEffect(()=>{A(!0,{ms:300})},[]);let j=u(s),M=_.createElement(`div`,{className:`${e}-icon`},j);if(o===`picture`||o===`picture-card`||o===`picture-circle`){if(D===`uploading`||!s.thumbUrl&&!s.url){let t=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:D!==`uploading`});M=_.createElement(`div`,{className:t},j)}else{let t=p?.(s)?_.createElement(`img`,{src:s.thumbUrl||s.url,alt:s.name,className:`${e}-list-item-image`,crossOrigin:s.crossOrigin}):j,n=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(s)});M=_.createElement(`a`,{className:n,onClick:e=>S(s,e),href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`},t)}}let N=Q(`${e}-list-item`,`${e}-list-item-${D}`,r?.item),P=typeof s.linkProps==`string`?JSON.parse(s.linkProps):s.linkProps,F=(op(h)?h(s):h)?d((op(y)?y(s):y)||_.createElement(YY,null),()=>w(s),e,a.removeFile,!0):null,I=(op(g)?g(s):g)&&D===`done`?d((op(b)?b(s):b)||_.createElement(FZ,null),()=>C(s),e,a.downloadFile):null,L=o!==`picture-card`&&o!==`picture-circle`&&_.createElement(`span`,{key:`download-delete`,className:Q(`${e}-list-item-actions`,{picture:o===`picture`})},I,F),R=op(x)?x(s):x,z=R&&_.createElement(`span`,{className:`${e}-list-item-extra`},R),B=Q(`${e}-list-item-name`),V=s.url?_.createElement(`a`,{key:`view`,target:`_blank`,rel:`noopener noreferrer`,className:B,title:s.name,...P,href:s.url,onClick:e=>S(s,e)},s.name,z):_.createElement(`span`,{key:`view`,role:`button`,tabIndex:0,className:B,onClick:e=>S(s,e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(s,e))},title:s.name},s.name,z),H=(op(m)?m(s):m)&&(s.url||s.thumbUrl)?_.createElement(`a`,{href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>S(s,e),title:a.previewFile,"aria-label":a.previewFile||void 0},op(v)?v(s):v||_.createElement(sV,null)):null,U=(o===`picture-card`||o===`picture-circle`)&&D!==`uploading`&&_.createElement(`span`,{className:`${e}-list-item-actions`},H,D===`done`&&I,F),{getPrefixCls:W}=_.useContext(Ao),ee=W(),G=_.createElement(`div`,{className:N,style:i?.item},M,V,L,U,k&&_.createElement(ep,{motionName:`${ee}-fade`,visible:D===`uploading`,motionDeadline:2e3},({className:t})=>{let n=`percent`in s?_.createElement(bU,{type:`line`,percent:s.percent,"aria-label":s[`aria-label`],"aria-labelledby":s[`aria-labelledby`],...l}):null;return _.createElement(`div`,{className:Q(`${e}-list-item-progress`,t)},n)})),K=s.response&&typeof s.response==`string`?s.response:s.error?.statusText||s.error?.message||a.uploadError,q=D===`error`?_.createElement(gD,{title:K,getPopupContainer:e=>e.parentNode},G):G;return _.createElement(`div`,{className:Q(`${e}-list-item-container`,t),style:n,ref:T},f?f(q,s,c,{download:C.bind(null,s),preview:S.bind(null,s),remove:w.bind(null,s)}):q)}),LZ=_.forwardRef((e,t)=>{let{listType:n=`text`,previewFile:r=MZ,onPreview:i,onDownload:a,onRemove:o,locale:s,iconRender:c,isImageUrl:l=AZ,prefixCls:u,items:d=[],showPreviewIcon:f=!0,showRemoveIcon:p=!0,showDownloadIcon:m=!1,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,progress:b={size:[-1,2],showInfo:!1},appendAction:x,appendActionVisible:S=!0,itemRender:C,disabled:w,classNames:T,styles:E}=e,[,D]=Sg(),[O,k]=_.useState(!1),A=[`picture-card`,`picture-circle`].includes(n);_.useEffect(()=>{n.startsWith(`picture`)&&(d||[]).forEach(e=>{!(e.originFileObj instanceof File||e.originFileObj instanceof Blob)||e.thumbUrl!==void 0||(e.thumbUrl=``,r?.(e.originFileObj).then(t=>{e.thumbUrl=t||``,D()}))})},[n,d,r]),_.useEffect(()=>{k(!0)},[]);let j=(e,t)=>{if(i)return t?.preventDefault(),i(e)},M=e=>{op(a)?a(e):e.url&&window.open(e.url,`_blank`,`noopener`)},N=e=>{o?.(e)},P=e=>{if(c)return c(e,n);let t=e.status===`uploading`;if(n.startsWith(`picture`)){let r=n===`picture`?_.createElement(fg,null):s.uploading,i=l?.(e)?_.createElement(SZ,null):_.createElement(vq,null);return t?r:i}return t?_.createElement(fg,null):_.createElement(yZ,null)},F=(e,t,n,r,i)=>{let a={type:`text`,size:`small`,title:r,"aria-label":r||void 0,onClick:n=>{t(),_.isValidElement(e)&&e.props.onClick?.(n)},className:`${n}-list-item-action`,disabled:i?w:!1};return _.isValidElement(e)?_.createElement(Fy,{...a,icon:ch(e,{...e.props,onClick:()=>{}})}):_.createElement(Fy,{...a},_.createElement(`span`,null,e))};_.useImperativeHandle(t,()=>({handlePreview:j,handleDownload:M}));let{getPrefixCls:I}=_.useContext(Ao),L=I(`upload`,u),R=I(),z=Q(`${L}-list`,`${L}-list-${n}`,T?.list),B=_.useMemo(()=>Na(I_(R),[`onAppearEnd`,`onEnterEnd`,`onLeaveEnd`]),[R]),V={...A?{}:B,motionDeadline:2e3,motionName:`${L}-${A?`animate-inline`:`animate`}`,keys:Do(d.map(e=>({key:e.uid,file:e}))),motionAppear:O};return _.createElement(`div`,{className:z,style:E?.list},_.createElement($f,{...V,component:!1},({key:e,file:t,className:r,style:i})=>_.createElement(IZ,{key:e,locale:s,prefixCls:L,className:r,style:i,classNames:T,styles:E,file:t,items:d,progress:b,listType:n,isImgUrl:l,showPreviewIcon:f,showRemoveIcon:p,showDownloadIcon:m,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,iconRender:P,actionIconRender:F,itemRender:C,onPreview:j,onDownload:M,onClose:N})),x&&_.createElement(ep,{...V,visible:S,forceRender:!0},({className:e,style:t})=>ch(x,n=>({className:Q(n.className,e),style:{...t,pointerEvents:e?`none`:void 0,...n.style}}))))}),RZ=`__LIST_IGNORE_${Date.now()}__`,zZ=_.forwardRef((e,t)=>{let n=No(`upload`),{fileList:r,defaultFileList:i,onRemove:a,showUploadList:o=!0,listType:s=`text`,onPreview:c,onDownload:l,onChange:u,onDrop:d,previewFile:f,disabled:p,locale:m,iconRender:h,isImageUrl:g,progress:v,prefixCls:y,className:b,type:x=`select`,children:S,style:C,itemRender:w,maxCount:T,data:E={},multiple:D=!1,hasControlInside:O=!0,action:k=``,accept:A,supportServerRender:j=!0,rootClassName:M,styles:N,classNames:P}=e,F=_.useContext(ph),I=p??F,L=e.customRequest||n.customRequest,R=n.progress||v?{...n.progress,...v}:void 0,z=pg(A,n.accept,``),[B,V]=ti(i,r),H=B||[],U=Yr(()=>H),[W,ee]=_.useState(`drop`),G=_.useRef(null),K=_.useRef(null);_.useMemo(()=>{let e=Date.now();(r||[]).forEach((t,n)=>{!t.uid&&!Object.isFrozen(t)&&(t.uid=`__AUTO__${e}_${n}__`)})},[r]);let q=(e,t,n)=>{let r=Do(t),i=!1;T===1?r=r.slice(-1):T&&(i=r.length>T,r=r.slice(0,T)),(0,$a.flushSync)(()=>{V(r)});let a={file:e,fileList:r};n&&(a.event=n),(!i||e.status===`removed`||r.some(t=>t.uid===e.uid))&&(0,$a.flushSync)(()=>{u?.(a)})},J=async(t,n)=>{let{beforeUpload:r}=e,i=t;if(r){let e=await r(t,n);if(e===!1)return!1;if(delete t[RZ],e===RZ)return Object.defineProperty(t,RZ,{value:!0,configurable:!0}),!1;ap(e)&&(i=e)}return i},te=e=>{let t=e.filter(e=>!e.file[RZ]);if(!t.length)return;let n=t.map(e=>CZ(e.file)),r=Do(H);n.forEach(e=>{r=wZ(e,r)}),n.forEach((e,n)=>{let i=e;if(t[n].parsedFile)e.status=`uploading`;else{let{originFileObj:t}=e,n;try{n=new File([t],t.name,{type:t.type})}catch{n=new Blob([t],{type:t.type}),n.name=t.name,n.lastModifiedDate=new Date,n.lastModified=new Date().getTime()}n.uid=e.uid,i=n}q(i,r)})},Y=(e,t,n)=>{try{typeof e==`string`&&(e=JSON.parse(e))}catch{}if(!TZ(t,H))return;let r=CZ(t);r.status=`done`,r.percent=100,r.response=e,r.xhr=n;let i=wZ(r,H);q(r,i)},ne=(e,t)=>{if(!TZ(t,H))return;let n=CZ(t);n.status=`uploading`,n.percent=e.percent;let r=wZ(n,H);q(n,r,e)},X=(e,t,n)=>{if(!TZ(n,H))return;let r=CZ(n);r.error=e,r.response=t,r.status=`error`;let i=wZ(r,H);q(r,i)},re=e=>{let t;Promise.resolve(op(a)?a(e):a).then(n=>{if(n===!1)return;let r=U(),i=EZ(e,r);i&&(t={...e,status:`removed`},r.forEach(e=>{let n=t.uid===void 0?`name`:`uid`;e[n]===t[n]&&!Object.isFrozen(e)&&(e.status=`removed`)}),G.current?.abort(t),q(t,i))})},ie=e=>{ee(e.type),e.type===`drop`&&d?.(e)};_.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:Y,onProgress:ne,onError:X,fileList:H,upload:G.current,nativeElement:K.current}));let{getPrefixCls:ae,direction:oe,className:se,style:ce,classNames:le,styles:ue}=No(`upload`),de=ae(`upload`,y),fe={...e,listType:s,showUploadList:o,type:x,multiple:D,hasControlInside:O,supportServerRender:j,disabled:I},pe=vp(ce,`trigger`),me=vp(C,`trigger`),[he,ge]=bp([le,P],[ue,pe,N,me],{props:fe}),_e={onBatchStart:te,onError:X,onProgress:ne,onSuccess:Y,...e,customRequest:L,data:E,multiple:D,action:k,accept:z,supportServerRender:j,prefixCls:de,disabled:I,beforeUpload:J,onChange:void 0,hasControlInside:O};delete _e.className,delete _e.style,(!S||I)&&delete _e.id;let ve=`${de}-wrapper`,[ye,be]=gZ(de,ve),[xe]=im(`Upload`,Zp.Upload),{showRemoveIcon:Se,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,extra:Oe}=typeof o==`boolean`?{}:o,ke=Se===void 0?!I:Se,Ae=(e,t)=>o?_.createElement(LZ,{classNames:he,styles:ge,prefixCls:de,listType:s,items:H,previewFile:f,onPreview:c,onDownload:l,onRemove:re,showRemoveIcon:ke,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,iconRender:h,extra:Oe,locale:{...xe,...m},isImageUrl:g,progress:R,appendAction:e,appendActionVisible:t,itemRender:w,disabled:I}):e,je=Q(ve,b,M,ye,be,se,he.root,{[`${de}-rtl`]:oe===`rtl`,[`${de}-picture-card-wrapper`]:s===`picture-card`,[`${de}-picture-circle-wrapper`]:s===`picture-circle`}),Me={...ge.root};if(x===`drag`){let e=Q(ye,de,`${de}-drag`,{[`${de}-drag-uploading`]:H.some(e=>e.status===`uploading`),[`${de}-drag-hover`]:W===`dragover`,[`${de}-disabled`]:I,[`${de}-rtl`]:oe===`rtl`},he.trigger);return _.createElement(`span`,{className:je,ref:K,style:Me},_.createElement(`div`,{className:e,style:ge.trigger,onDrop:ie,onDragOver:ie,onDragLeave:ie},_.createElement(cZ,{..._e,ref:G,className:`${de}-btn`},_.createElement(`div`,{className:`${de}-drag-container`},S))),Ae())}let Ne=Q(de,`${de}-select`,{[`${de}-disabled`]:I,[`${de}-hidden`]:!S},he.trigger),Pe=_.createElement(`div`,{className:Ne,style:ge.trigger},_.createElement(cZ,{..._e,ref:G}));return s===`picture-card`||s===`picture-circle`?_.createElement(`span`,{className:je,ref:K,style:Me},Ae(Pe,!!S)):_.createElement(`span`,{className:je,ref:K,style:Me},Pe,Ae())}),BZ=_.forwardRef((e,t)=>{let{style:n,height:r,hasControlInside:i=!1,children:a,...o}=e,s={...n,height:r};return _.createElement(zZ,{ref:t,hasControlInside:i,...o,style:s,type:`drag`},a)}),VZ=zZ;VZ.Dragger=BZ,VZ.LIST_IGNORE=RZ;var HZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`}}))());function UZ(){return UZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UZ.apply(this,arguments)}var WZ=_.forwardRef((e,t)=>_.createElement(qd,UZ({},e,{ref:t,icon:HZ.default}))),GZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z`}}]},name:`bulb`,theme:`outlined`}}))());function KZ(){return KZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KZ.apply(this,arguments)}var qZ=_.forwardRef((e,t)=>_.createElement(qd,KZ({},e,{ref:t,icon:GZ.default}))),JZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z`}}]},name:`dashboard`,theme:`outlined`}}))());function YZ(){return YZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YZ.apply(this,arguments)}var XZ=_.forwardRef((e,t)=>_.createElement(qd,YZ({},e,{ref:t,icon:JZ.default}))),ZZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`database`,theme:`outlined`}}))());function QZ(){return QZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QZ.apply(this,arguments)}var $Z=_.forwardRef((e,t)=>_.createElement(qd,QZ({},e,{ref:t,icon:ZZ.default}))),eQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z`}}]},name:`experiment`,theme:`outlined`}}))());function tQ(){return tQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tQ.apply(this,arguments)}var nQ=_.forwardRef((e,t)=>_.createElement(qd,tQ({},e,{ref:t,icon:eQ.default}))),rQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z`}}]},name:`filter`,theme:`outlined`}}))());function iQ(){return iQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iQ.apply(this,arguments)}var aQ=_.forwardRef((e,t)=>_.createElement(qd,iQ({},e,{ref:t,icon:rQ.default}))),oQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z`}}]},name:`inbox`,theme:`outlined`}}))());function sQ(){return sQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sQ.apply(this,arguments)}var cQ=_.forwardRef((e,t)=>_.createElement(qd,sQ({},e,{ref:t,icon:oQ.default}))),lQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`}},{tag:`path`,attrs:{d:`M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z`}}]},name:`info-circle`,theme:`outlined`}}))());function uQ(){return uQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uQ.apply(this,arguments)}var dQ=_.forwardRef((e,t)=>_.createElement(qd,uQ({},e,{ref:t,icon:lQ.default}))),fQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z`}}]},name:`link`,theme:`outlined`}}))());function pQ(){return pQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pQ.apply(this,arguments)}var mQ=_.forwardRef((e,t)=>_.createElement(qd,pQ({},e,{ref:t,icon:fQ.default}))),hQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z`}}]},name:`moon`,theme:`outlined`}}))());function gQ(){return gQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gQ.apply(this,arguments)}var _Q=_.forwardRef((e,t)=>_.createElement(qd,gQ({},e,{ref:t,icon:hQ.default}))),vQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM492 400h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zM340 368a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`profile`,theme:`outlined`}}))());function yQ(){return yQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yQ.apply(this,arguments)}var bQ=_.forwardRef((e,t)=>_.createElement(qd,yQ({},e,{ref:t,icon:vQ.default}))),xQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z`}}]},name:`pushpin`,theme:`filled`}}))());function SQ(){return SQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SQ.apply(this,arguments)}var CQ=_.forwardRef((e,t)=>_.createElement(qd,SQ({},e,{ref:t,icon:xQ.default}))),wQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z`}}]},name:`rollback`,theme:`outlined`}}))());function TQ(){return TQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TQ.apply(this,arguments)}var EQ=_.forwardRef((e,t)=>_.createElement(qd,TQ({},e,{ref:t,icon:wQ.default}))),DQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z`}}]},name:`safety-certificate`,theme:`outlined`}}))());function OQ(){return OQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OQ.apply(this,arguments)}var kQ=_.forwardRef((e,t)=>_.createElement(qd,OQ({},e,{ref:t,icon:DQ.default}))),AQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z`}}]},name:`setting`,theme:`outlined`}}))());function jQ(){return jQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jQ.apply(this,arguments)}var MQ=_.forwardRef((e,t)=>_.createElement(qd,jQ({},e,{ref:t,icon:AQ.default}))),NQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M882 272.1V144c0-17.7-14.3-32-32-32H174c-17.7 0-32 14.3-32 32v128.1c-16.7 1-30 14.9-30 31.9v131.7a177 177 0 0014.4 70.4c4.3 10.2 9.6 19.8 15.6 28.9v345c0 17.6 14.3 32 32 32h676c17.7 0 32-14.3 32-32V535a175 175 0 0015.6-28.9c9.5-22.3 14.4-46 14.4-70.4V304c0-17-13.3-30.9-30-31.9zM214 184h596v88H214v-88zm362 656.1H448V736h128v104.1zm234 0H640V704c0-17.7-14.3-32-32-32H416c-17.7 0-32 14.3-32 32v136.1H214V597.9c2.9 1.4 5.9 2.8 9 4 22.3 9.4 46 14.1 70.4 14.1s48-4.7 70.4-14.1c13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 3-1.3 6-2.6 9-4v242.2zm30-404.4c0 59.8-49 108.3-109.3 108.3-40.8 0-76.4-22.1-95.2-54.9-2.9-5-8.1-8.1-13.9-8.1h-.6c-5.7 0-11 3.1-13.9 8.1A109.24 109.24 0 01512 544c-40.7 0-76.2-22-95-54.7-3-5.1-8.4-8.3-14.3-8.3s-11.4 3.2-14.3 8.3a109.63 109.63 0 01-95.1 54.7C233 544 184 495.5 184 435.7v-91.2c0-.3.2-.5.5-.5h655c.3 0 .5.2.5.5v91.2z`}}]},name:`shop`,theme:`outlined`}}))());function PQ(){return PQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PQ.apply(this,arguments)}var FQ=_.forwardRef((e,t)=>_.createElement(qd,PQ({},e,{ref:t,icon:NQ.default}))),IQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z`}}]},name:`sun`,theme:`outlined`}}))());function LQ(){return LQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LQ.apply(this,arguments)}var RQ=_.forwardRef((e,t)=>_.createElement(qd,LQ({},e,{ref:t,icon:IQ.default}))),zQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z`}}]},name:`thunderbolt`,theme:`outlined`}}))());function BQ(){return BQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BQ.apply(this,arguments)}var VQ=_.forwardRef((e,t)=>_.createElement(qd,BQ({},e,{ref:t,icon:zQ.default}))),HQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`upload`,theme:`outlined`}}))());function UQ(){return UQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UQ.apply(this,arguments)}var WQ=_.forwardRef((e,t)=>_.createElement(qd,UQ({},e,{ref:t,icon:HQ.default}))),GQ=[`applied`,`screening`,`interview`,`offer`,`rejected`,`withdrawn`,`ghosted`],KQ=[`applied`,`screening`,`interview`,`offer`];function qQ(e){let t=KQ.indexOf(e);return t===-1||t===KQ.length-1?null:KQ[t+1]??null}var JQ={applied:`blue`,screening:`cyan`,interview:`gold`,offer:`green`,rejected:`red`,withdrawn:`default`,ghosted:`purple`},YQ={applied:`Applied`,screening:`Screening`,interview:`Interview`,offer:`Offer`,rejected:`Rejected`,withdrawn:`Withdrawn`,ghosted:`Ghosted`},XQ=[`remote`,`hybrid`,`onsite`,`unspecified`],ZQ={remote:`Remote`,hybrid:`Hybrid`,onsite:`On-site`,unspecified:`Unspecified`},QQ=[`company`,`application`],$Q=[`company`,`application`,`standalone`],e$=[`company`,`application`,`both`],t$=/^(\d{4})-(\d{2})-(\d{2})$/;function n$(e){let t=t$.exec(e);if(!t)throw Error(`Not a YYYY-MM-DD date: ${JSON.stringify(e)}`);let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(Date.UTC(n,r-1,i));if(a.getUTCFullYear()!==n||a.getUTCMonth()!==r-1||a.getUTCDate()!==i)throw Error(`Not a real calendar date: ${e}`);return a}function r$(e){let t=typeof e==`string`?n$(e):e;return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1}}function i$(e=new Date){return`${String(e.getFullYear()).padStart(4,`0`)}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}var a$=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function o$(e){return a$[e-1]??`Month ${e}`}var s$;function c$(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var l$=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},u$=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(s$=globalThis).__zod_globalConfig??(s$.__zod_globalConfig={});var d$=globalThis.__zod_globalConfig;function f$(e){return e&&Object.assign(d$,e),d$}function p$(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m$(e,t){return typeof t==`bigint`?t.toString():t}function h$(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function g$(e){return e==null}function _$(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function v$(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var y$=Symbol(`evaluating`);function b$(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==y$)return r===void 0&&(r=y$,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function x$(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function S$(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function C$(e){return JSON.stringify(e)}function w$(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var T$=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function E$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var D$=h$(()=>{if(d$.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function O$(e){if(E$(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return E$(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function k$(e){return O$(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var A$=new Set([`string`,`number`,`symbol`]);function j$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function M$(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function N$(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function P$(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var F$={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function I$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return M$(e,S$(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return x$(this,`shape`,e),e},checks:[]}))}function L$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return M$(e,S$(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return x$(this,`shape`,r),r},checks:[]}))}function R$(e,t){if(!O$(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return M$(e,S$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x$(this,`shape`,n),n}}))}function z$(e,t){if(!O$(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return M$(e,S$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return x$(this,`shape`,n),n}}))}function B$(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return M$(e,S$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return x$(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function V$(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return M$(t,S$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return x$(this,`shape`,i),i},checks:[]}))}function H$(e,t,n){return M$(t,S$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return x$(this,`shape`,i),i}}))}function U$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function W$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function G$(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function K$(e){return typeof e==`string`?e:e?.message}function q$(e,t,n){let r=e.message?e.message:K$(e.inst?._zod.def?.error?.(e))??K$(t?.error?.(e))??K$(n.customError?.(e))??K$(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function J$(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Y$(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var X$=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,m$,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Z$=c$(`$ZodError`,X$),Q$=c$(`$ZodError`,X$,{Parent:Error});function $$(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function e1(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var t1=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new l$;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>q$(e,a,f$())));throw T$(t,i?.callee),t}return o.value},n1=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>q$(e,a,f$())));throw T$(t,i?.callee),t}return o.value},r1=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new l$;return a.issues.length?{success:!1,error:new(e??Z$)(a.issues.map(e=>q$(e,i,f$())))}:{success:!0,data:a.value}},i1=r1(Q$),a1=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>q$(e,i,f$())))}:{success:!0,data:a.value}},o1=a1(Q$),s1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return t1(e)(t,n,i)},c1=e=>(t,n,r)=>t1(e)(t,n,r),l1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return n1(e)(t,n,i)},u1=e=>async(t,n,r)=>n1(e)(t,n,r),d1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return r1(e)(t,n,i)},f1=e=>(t,n,r)=>r1(e)(t,n,r),p1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return a1(e)(t,n,i)},m1=e=>async(t,n,r)=>a1(e)(t,n,r),h1=/^[cC][0-9a-z]{6,}$/,g1=/^[0-9a-z]+$/,_1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,v1=/^[0-9a-vA-V]{20}$/,y1=/^[A-Za-z0-9]{27}$/,b1=/^[a-zA-Z0-9_-]{21}$/,x1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,S1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,C1=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,w1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,T1=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function E1(){return new RegExp(T1,`u`)}var D1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,k1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,A1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,j1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,M1=/^[A-Za-z0-9_-]*$/,N1=/^https?$/,P1=/^\+[1-9]\d{6,14}$/,F1=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,I1=RegExp(`^${F1}$`);function L1(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function R1(e){return RegExp(`^${L1(e)}$`)}function z1(e){let t=L1({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${F1}T(?:${r})$`)}var B1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},V1=/^-?\d+$/,H1=/^-?\d+(?:\.\d+)?$/,U1=/^(?:true|false)$/i,W1=/^[^A-Z]*$/,G1=/^[^a-z]*$/,K1=c$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),q1={number:`number`,bigint:`bigint`,object:`date`},J1=c$(`$ZodCheckLessThan`,(e,t)=>{K1.init(e,t);let n=q1[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Y1=c$(`$ZodCheckGreaterThan`,(e,t)=>{K1.init(e,t);let n=q1[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),X1=c$(`$ZodCheckMultipleOf`,(e,t)=>{K1.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):v$(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Z1=c$(`$ZodCheckNumberFormat`,(e,t)=>{K1.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=F$[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=V1)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Q1=c$(`$ZodCheckMaxLength`,(e,t)=>{var n;K1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=J$(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$1=c$(`$ZodCheckMinLength`,(e,t)=>{var n;K1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=J$(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),e0=c$(`$ZodCheckLengthEquals`,(e,t)=>{var n;K1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=J$(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),t0=c$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;K1.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),n0=c$(`$ZodCheckRegex`,(e,t)=>{t0.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),r0=c$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=W1,t0.init(e,t)}),i0=c$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=G1,t0.init(e,t)}),a0=c$(`$ZodCheckIncludes`,(e,t)=>{K1.init(e,t);let n=j$(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),o0=c$(`$ZodCheckStartsWith`,(e,t)=>{K1.init(e,t);let n=RegExp(`^${j$(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),s0=c$(`$ZodCheckEndsWith`,(e,t)=>{K1.init(e,t);let n=RegExp(`.*${j$(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),c0=c$(`$ZodCheckOverwrite`,(e,t)=>{K1.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),l0=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
381
381
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
382
|
-
`))}},
|
|
382
|
+
`))}},u0={major:4,minor:4,patch:3},d0=c$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=u0;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=U$(e),i;for(let a of t){if(a._zod.def.when){if(W$(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l$;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=U$(e,t))});else{if(e.issues.length===t)continue;r||=U$(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(U$(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new l$;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new l$;return o.then(e=>t(e,r,a))}return t(o,r,a)}}b$(e,`~standard`,()=>({validate:t=>{try{let n=i1(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return o1(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),f0=c$(`$ZodString`,(e,t)=>{d0.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??B1(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),p0=c$(`$ZodStringFormat`,(e,t)=>{t0.init(e,t),f0.init(e,t)}),m0=c$(`$ZodGUID`,(e,t)=>{t.pattern??=S1,p0.init(e,t)}),h0=c$(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=C1(e)}else t.pattern??=C1();p0.init(e,t)}),g0=c$(`$ZodEmail`,(e,t)=>{t.pattern??=w1,p0.init(e,t)}),_0=c$(`$ZodURL`,(e,t)=>{p0.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===N1.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),v0=c$(`$ZodEmoji`,(e,t)=>{t.pattern??=E1(),p0.init(e,t)}),y0=c$(`$ZodNanoID`,(e,t)=>{t.pattern??=b1,p0.init(e,t)}),b0=c$(`$ZodCUID`,(e,t)=>{t.pattern??=h1,p0.init(e,t)}),x0=c$(`$ZodCUID2`,(e,t)=>{t.pattern??=g1,p0.init(e,t)}),S0=c$(`$ZodULID`,(e,t)=>{t.pattern??=_1,p0.init(e,t)}),C0=c$(`$ZodXID`,(e,t)=>{t.pattern??=v1,p0.init(e,t)}),w0=c$(`$ZodKSUID`,(e,t)=>{t.pattern??=y1,p0.init(e,t)}),T0=c$(`$ZodISODateTime`,(e,t)=>{t.pattern??=z1(t),p0.init(e,t)}),E0=c$(`$ZodISODate`,(e,t)=>{t.pattern??=I1,p0.init(e,t)}),D0=c$(`$ZodISOTime`,(e,t)=>{t.pattern??=R1(t),p0.init(e,t)}),O0=c$(`$ZodISODuration`,(e,t)=>{t.pattern??=x1,p0.init(e,t)}),k0=c$(`$ZodIPv4`,(e,t)=>{t.pattern??=D1,p0.init(e,t),e._zod.bag.format=`ipv4`}),A0=c$(`$ZodIPv6`,(e,t)=>{t.pattern??=O1,p0.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),j0=c$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=k1,p0.init(e,t)}),M0=c$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=A1,p0.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function N0(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var P0=c$(`$ZodBase64`,(e,t)=>{t.pattern??=j1,p0.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{N0(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function F0(e){if(!M1.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return N0(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var I0=c$(`$ZodBase64URL`,(e,t)=>{t.pattern??=M1,p0.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{F0(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),L0=c$(`$ZodE164`,(e,t)=>{t.pattern??=P1,p0.init(e,t)});function R0(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var z0=c$(`$ZodJWT`,(e,t)=>{p0.init(e,t),e._zod.check=n=>{R0(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),B0=c$(`$ZodNumber`,(e,t)=>{d0.init(e,t),e._zod.pattern=e._zod.bag.pattern??H1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),V0=c$(`$ZodNumberFormat`,(e,t)=>{Z1.init(e,t),B0.init(e,t)}),H0=c$(`$ZodBoolean`,(e,t)=>{d0.init(e,t),e._zod.pattern=U1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),U0=c$(`$ZodUnknown`,(e,t)=>{d0.init(e,t),e._zod.parse=e=>e}),W0=c$(`$ZodNever`,(e,t)=>{d0.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function G0(e,t,n){e.issues.length&&t.issues.push(...G$(n,e.issues)),t.value[n]=e.value}var K0=c$(`$ZodArray`,(e,t)=>{d0.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>G0(t,n,e))):G0(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function q0(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...G$(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function J0(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=P$(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Y0(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>q0(e,n,i,t,u,d))):q0(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var X0=c$(`$ZodObject`,(e,t)=>{if(d0.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=h$(()=>J0(t));b$(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=E$,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>q0(n,t,e,s,r,i))):q0(a,t,e,s,r,i)}return i?Y0(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Z0=c$(`$ZodObjectJIT`,(e,t)=>{X0.init(e,t);let n=e._zod.parse,r=h$(()=>J0(t)),i=e=>{let t=new l0([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=C$(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=C$(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
383
383
|
if (${n}.issues.length) {
|
|
384
384
|
if (${o} in input) {
|
|
385
385
|
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
@@ -438,7 +438,7 @@ html body {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=C$,s=!c$.jitless,c=s&&w$.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?K0([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Y0(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!B$(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>W$(e,r,l$())))}),t)}var X0=a$(`$ZodUnion`,(e,t)=>{c0.init(e,t),_$(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),_$(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),_$(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),_$(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>m$(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Y0(t,r,e,i)):Y0(o,r,e,i)}}),Z0=a$(`$ZodIntersection`,(e,t)=>{c0.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>$0(e,t,n)):$0(e,i,a)}});function Q0(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(T$(e)&&T$(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Q0(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Q0(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $0(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),B$(e))return e;let o=Q0(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var e2=a$(`$ZodEnum`,(e,t)=>{c0.init(e,t);let n=u$(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>D$.has(typeof e)).map(e=>typeof e==`string`?O$(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),t2=a$(`$ZodTransform`,(e,t)=>{c0.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s$(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new o$;return n.value=i,n.fallback=!0,n}});function n2(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var r2=a$(`$ZodOptional`,(e,t)=>{c0.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,_$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${m$(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>n2(e,r)):n2(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),i2=a$(`$ZodExactOptional`,(e,t)=>{r2.init(e,t),_$(e._zod,`values`,()=>t.innerType._zod.values),_$(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),a2=a$(`$ZodNullable`,(e,t)=>{c0.init(e,t),_$(e._zod,`optin`,()=>t.innerType._zod.optin),_$(e._zod,`optout`,()=>t.innerType._zod.optout),_$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${m$(e.source)}|null)$`):void 0}),_$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),o2=a$(`$ZodDefault`,(e,t)=>{c0.init(e,t),e._zod.optin=`optional`,_$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>s2(e,t)):s2(r,t)}});function s2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var c2=a$(`$ZodPrefault`,(e,t)=>{c0.init(e,t),e._zod.optin=`optional`,_$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),l2=a$(`$ZodNonOptional`,(e,t)=>{c0.init(e,t),_$(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>u2(t,e)):u2(i,e)}});function u2(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var d2=a$(`$ZodCatch`,(e,t)=>{c0.init(e,t),e._zod.optin=`optional`,_$(e._zod,`optout`,()=>t.innerType._zod.optout),_$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>W$(e,n,l$()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>W$(e,n,l$()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),f2=a$(`$ZodPipe`,(e,t)=>{c0.init(e,t),_$(e._zod,`values`,()=>t.in._zod.values),_$(e._zod,`optin`,()=>t.in._zod.optin),_$(e._zod,`optout`,()=>t.out._zod.optout),_$(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>p2(e,t.in,n)):p2(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>p2(e,t.out,n)):p2(r,t.out,n)}});function p2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var m2=a$(`$ZodPreprocess`,(e,t)=>{f2.init(e,t)}),h2=a$(`$ZodReadonly`,(e,t)=>{c0.init(e,t),_$(e._zod,`propValues`,()=>t.innerType._zod.propValues),_$(e._zod,`values`,()=>t.innerType._zod.values),_$(e._zod,`optin`,()=>t.innerType?._zod?.optin),_$(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(g2):g2(r)}});function g2(e){return e.value=Object.freeze(e.value),e}var _2=a$(`$ZodCustom`,(e,t)=>{U1.init(e,t),c0.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>v2(t,n,r,e));v2(i,n,r,e)}});function v2(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(K$(e))}}var y2,b2=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function x2(){return new b2}(y2=globalThis).__zod_globalRegistry??(y2.__zod_globalRegistry=x2());var S2=globalThis.__zod_globalRegistry;function C2(e,t){return new e({type:`string`,...A$(t)})}function w2(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...A$(t)})}function T2(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...A$(t)})}function E2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...A$(t)})}function D2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...A$(t)})}function O2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...A$(t)})}function k2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...A$(t)})}function A2(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...A$(t)})}function j2(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...A$(t)})}function M2(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...A$(t)})}function N2(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...A$(t)})}function P2(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...A$(t)})}function F2(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...A$(t)})}function I2(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...A$(t)})}function L2(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...A$(t)})}function R2(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...A$(t)})}function z2(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...A$(t)})}function B2(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...A$(t)})}function V2(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...A$(t)})}function H2(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...A$(t)})}function U2(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...A$(t)})}function W2(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...A$(t)})}function G2(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...A$(t)})}function K2(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...A$(t)})}function q2(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...A$(t)})}function J2(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...A$(t)})}function Y2(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...A$(t)})}function X2(e,t){return new e({type:`number`,checks:[],...A$(t)})}function Z2(e,t){return new e({type:`number`,coerce:!0,checks:[],...A$(t)})}function Q2(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...A$(t)})}function $2(e,t){return new e({type:`boolean`,...A$(t)})}function e4(e){return new e({type:`unknown`})}function t4(e,t){return new e({type:`never`,...A$(t)})}function n4(e,t){return new G1({check:`less_than`,...A$(t),value:e,inclusive:!1})}function r4(e,t){return new G1({check:`less_than`,...A$(t),value:e,inclusive:!0})}function i4(e,t){return new K1({check:`greater_than`,...A$(t),value:e,inclusive:!1})}function a4(e,t){return new K1({check:`greater_than`,...A$(t),value:e,inclusive:!0})}function o4(e,t){return new q1({check:`multiple_of`,...A$(t),value:e})}function s4(e,t){return new Y1({check:`max_length`,...A$(t),maximum:e})}function c4(e,t){return new X1({check:`min_length`,...A$(t),minimum:e})}function l4(e,t){return new Z1({check:`length_equals`,...A$(t),length:e})}function u4(e,t){return new $1({check:`string_format`,format:`regex`,...A$(t),pattern:e})}function d4(e){return new e0({check:`string_format`,format:`lowercase`,...A$(e)})}function f4(e){return new t0({check:`string_format`,format:`uppercase`,...A$(e)})}function p4(e,t){return new n0({check:`string_format`,format:`includes`,...A$(t),includes:e})}function m4(e,t){return new r0({check:`string_format`,format:`starts_with`,...A$(t),prefix:e})}function h4(e,t){return new i0({check:`string_format`,format:`ends_with`,...A$(t),suffix:e})}function g4(e){return new a0({check:`overwrite`,tx:e})}function _4(e){return g4(t=>t.normalize(e))}function v4(){return g4(e=>e.trim())}function y4(){return g4(e=>e.toLowerCase())}function b4(){return g4(e=>e.toUpperCase())}function x4(){return g4(e=>x$(e))}function S4(e,t,n){return new e({type:`array`,element:t,...A$(n)})}function C4(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...A$(n)})}function w4(e,t){let n=T4(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(K$(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(K$(r))}},e(t.value,t)),t);return n}function T4(e,t){let n=new U1({check:`custom`,...A$(t)});return n._zod.check=e,n}function E4(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??S2,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function D4(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,D4(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&A4(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function O4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
441
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=E$,s=!d$.jitless,c=s&&D$.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Y0([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Q0(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!U$(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>q$(e,r,f$())))}),t)}var $0=c$(`$ZodUnion`,(e,t)=>{d0.init(e,t),b$(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),b$(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),b$(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),b$(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>_$(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Q0(t,r,e,i)):Q0(o,r,e,i)}}),e2=c$(`$ZodIntersection`,(e,t)=>{d0.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>n2(e,t,n)):n2(e,i,a)}});function t2(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(O$(e)&&O$(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=t2(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=t2(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function n2(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),U$(e))return e;let o=t2(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var r2=c$(`$ZodEnum`,(e,t)=>{d0.init(e,t);let n=p$(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>A$.has(typeof e)).map(e=>typeof e==`string`?j$(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),i2=c$(`$ZodTransform`,(e,t)=>{d0.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u$(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new l$;return n.value=i,n.fallback=!0,n}});function a2(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var o2=c$(`$ZodOptional`,(e,t)=>{d0.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,b$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),b$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${_$(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>a2(e,r)):a2(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),s2=c$(`$ZodExactOptional`,(e,t)=>{o2.init(e,t),b$(e._zod,`values`,()=>t.innerType._zod.values),b$(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),c2=c$(`$ZodNullable`,(e,t)=>{d0.init(e,t),b$(e._zod,`optin`,()=>t.innerType._zod.optin),b$(e._zod,`optout`,()=>t.innerType._zod.optout),b$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${_$(e.source)}|null)$`):void 0}),b$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),l2=c$(`$ZodDefault`,(e,t)=>{d0.init(e,t),e._zod.optin=`optional`,b$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>u2(e,t)):u2(r,t)}});function u2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var d2=c$(`$ZodPrefault`,(e,t)=>{d0.init(e,t),e._zod.optin=`optional`,b$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),f2=c$(`$ZodNonOptional`,(e,t)=>{d0.init(e,t),b$(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>p2(t,e)):p2(i,e)}});function p2(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var m2=c$(`$ZodCatch`,(e,t)=>{d0.init(e,t),e._zod.optin=`optional`,b$(e._zod,`optout`,()=>t.innerType._zod.optout),b$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>q$(e,n,f$()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>q$(e,n,f$()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),h2=c$(`$ZodPipe`,(e,t)=>{d0.init(e,t),b$(e._zod,`values`,()=>t.in._zod.values),b$(e._zod,`optin`,()=>t.in._zod.optin),b$(e._zod,`optout`,()=>t.out._zod.optout),b$(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>g2(e,t.in,n)):g2(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>g2(e,t.out,n)):g2(r,t.out,n)}});function g2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var _2=c$(`$ZodPreprocess`,(e,t)=>{h2.init(e,t)}),v2=c$(`$ZodReadonly`,(e,t)=>{d0.init(e,t),b$(e._zod,`propValues`,()=>t.innerType._zod.propValues),b$(e._zod,`values`,()=>t.innerType._zod.values),b$(e._zod,`optin`,()=>t.innerType?._zod?.optin),b$(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(y2):y2(r)}});function y2(e){return e.value=Object.freeze(e.value),e}var b2=c$(`$ZodCustom`,(e,t)=>{K1.init(e,t),d0.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>x2(t,n,r,e));x2(i,n,r,e)}});function x2(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Y$(e))}}var S2,C2=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function w2(){return new C2}(S2=globalThis).__zod_globalRegistry??(S2.__zod_globalRegistry=w2());var T2=globalThis.__zod_globalRegistry;function E2(e,t){return new e({type:`string`,...N$(t)})}function D2(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...N$(t)})}function O2(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...N$(t)})}function k2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...N$(t)})}function A2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...N$(t)})}function j2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...N$(t)})}function M2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...N$(t)})}function N2(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...N$(t)})}function P2(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...N$(t)})}function F2(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...N$(t)})}function I2(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...N$(t)})}function L2(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...N$(t)})}function R2(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...N$(t)})}function z2(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...N$(t)})}function B2(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...N$(t)})}function V2(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...N$(t)})}function H2(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...N$(t)})}function U2(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...N$(t)})}function W2(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...N$(t)})}function G2(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...N$(t)})}function K2(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...N$(t)})}function q2(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...N$(t)})}function J2(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...N$(t)})}function Y2(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...N$(t)})}function X2(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...N$(t)})}function Z2(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...N$(t)})}function Q2(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...N$(t)})}function $2(e,t){return new e({type:`number`,checks:[],...N$(t)})}function e4(e,t){return new e({type:`number`,coerce:!0,checks:[],...N$(t)})}function t4(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...N$(t)})}function n4(e,t){return new e({type:`boolean`,...N$(t)})}function r4(e){return new e({type:`unknown`})}function i4(e,t){return new e({type:`never`,...N$(t)})}function a4(e,t){return new J1({check:`less_than`,...N$(t),value:e,inclusive:!1})}function o4(e,t){return new J1({check:`less_than`,...N$(t),value:e,inclusive:!0})}function s4(e,t){return new Y1({check:`greater_than`,...N$(t),value:e,inclusive:!1})}function c4(e,t){return new Y1({check:`greater_than`,...N$(t),value:e,inclusive:!0})}function l4(e,t){return new X1({check:`multiple_of`,...N$(t),value:e})}function u4(e,t){return new Q1({check:`max_length`,...N$(t),maximum:e})}function d4(e,t){return new $1({check:`min_length`,...N$(t),minimum:e})}function f4(e,t){return new e0({check:`length_equals`,...N$(t),length:e})}function p4(e,t){return new n0({check:`string_format`,format:`regex`,...N$(t),pattern:e})}function m4(e){return new r0({check:`string_format`,format:`lowercase`,...N$(e)})}function h4(e){return new i0({check:`string_format`,format:`uppercase`,...N$(e)})}function g4(e,t){return new a0({check:`string_format`,format:`includes`,...N$(t),includes:e})}function _4(e,t){return new o0({check:`string_format`,format:`starts_with`,...N$(t),prefix:e})}function v4(e,t){return new s0({check:`string_format`,format:`ends_with`,...N$(t),suffix:e})}function y4(e){return new c0({check:`overwrite`,tx:e})}function b4(e){return y4(t=>t.normalize(e))}function x4(){return y4(e=>e.trim())}function S4(){return y4(e=>e.toLowerCase())}function C4(){return y4(e=>e.toUpperCase())}function w4(){return y4(e=>w$(e))}function T4(e,t,n){return new e({type:`array`,element:t,...N$(n)})}function E4(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...N$(n)})}function D4(e,t){let n=O4(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Y$(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Y$(r))}},e(t.value,t)),t);return n}function O4(e,t){let n=new K1({check:`custom`,...N$(t)});return n._zod.check=e,n}function k4(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??T2,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function A4(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,A4(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&N4(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function j4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
442
442
|
|
|
443
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function k4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:M4(t,`input`,e.processors),output:M4(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function A4(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return A4(r.element,n);if(r.type===`set`)return A4(r.valueType,n);if(r.type===`lazy`)return A4(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return A4(r.innerType,n);if(r.type===`intersection`)return A4(r.left,n)||A4(r.right,n);if(r.type===`record`||r.type===`map`)return A4(r.keyType,n)||A4(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:A4(r.in,n)||A4(r.out,n);if(r.type===`object`){for(let e in r.shape)if(A4(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(A4(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(A4(e,n))return!0;return!!(r.rest&&A4(r.rest,n))}return!1}var j4=(e,t={})=>n=>{let r=E4({...n,processors:t});return D4(e,r),O4(r,e),k4(r,e)},M4=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=E4({...i??{},target:a,io:t,processors:n});return D4(e,o),O4(o,e),k4(o,e)},N4={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},P4=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=N4[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},F4=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},I4=(e,t,n,r)=>{n.type=`boolean`},L4=(e,t,n,r)=>{n.not={}},R4=(e,t,n,r)=>{let i=e._zod.def,a=u$(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},z4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},B4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},V4=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=D4(a.element,t,{...r,path:[...r.path,`items`]})},H4=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=D4(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=D4(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},U4=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>D4(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},W4=(e,t,n,r)=>{let i=e._zod.def,a=D4(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=D4(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},G4=(e,t,n,r)=>{let i=e._zod.def,a=D4(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},K4=(e,t,n,r)=>{let i=e._zod.def;D4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},q4=(e,t,n,r)=>{let i=e._zod.def;D4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},J4=(e,t,n,r)=>{let i=e._zod.def;D4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Y4=(e,t,n,r)=>{let i=e._zod.def;D4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},X4=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;D4(o,t,r);let s=t.seen.get(e);s.ref=o},Z4=(e,t,n,r)=>{let i=e._zod.def;D4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Q4=(e,t,n,r)=>{let i=e._zod.def;D4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$4=a$(`ZodISODateTime`,(e,t)=>{S0.init(e,t),E3.init(e,t)});function e3(e){return K2($4,e)}var t3=a$(`ZodISODate`,(e,t)=>{C0.init(e,t),E3.init(e,t)});function n3(e){return q2(t3,e)}var r3=a$(`ZodISOTime`,(e,t)=>{w0.init(e,t),E3.init(e,t)});function i3(e){return J2(r3,e)}var a3=a$(`ZodISODuration`,(e,t)=>{T0.init(e,t),E3.init(e,t)});function o3(e){return Y2(a3,e)}var s3=a$(`ZodError`,(e,t)=>{J$.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Z$(e,t)},flatten:{value:t=>X$(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,d$,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,d$,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),c3=Q$(s3),l3=$$(s3),u3=e1(s3),d3=n1(s3),f3=i1(s3),p3=a1(s3),m3=o1(s3),h3=s1(s3),g3=c1(s3),_3=l1(s3),v3=u1(s3),y3=d1(s3),b3=new WeakMap;function x3(e,t,n){let r=Object.getPrototypeOf(e),i=b3.get(r);if(i||(i=new Set,b3.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var S3=a$(`ZodType`,(e,t)=>(c0.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:M4(e,`input`),output:M4(e,`output`)}}),e.toJSONSchema=j4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>c3(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>u3(e,t,n),e.parseAsync=async(t,n)=>l3(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>d3(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>f3(e,t,n),e.decode=(t,n)=>p3(e,t,n),e.encodeAsync=async(t,n)=>m3(e,t,n),e.decodeAsync=async(t,n)=>h3(e,t,n),e.safeEncode=(t,n)=>g3(e,t,n),e.safeDecode=(t,n)=>_3(e,t,n),e.safeEncodeAsync=async(t,n)=>v3(e,t,n),e.safeDecodeAsync=async(t,n)=>y3(e,t,n),x3(e,`ZodType`,{check(...e){let t=this.def;return this.clone(y$(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return k$(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(F6(e,t))},superRefine(e,t){return this.check(I6(e,t))},overwrite(e){return this.check(g4(e))},optional(){return g6(this)},exactOptional(){return v6(this)},nullable(){return b6(this)},nullish(){return g6(b6(this))},nonoptional(e){return E6(this,e)},array(){return i6(this)},or(e){return c6([this,e])},and(e){return u6(this,e)},transform(e){return A6(this,m6(e))},default(e){return S6(this,e)},prefault(e){return w6(this,e)},catch(e){return O6(this,e)},pipe(e){return A6(this,e)},readonly(){return N6(this)},describe(e){let t=this.clone();return S2.add(t,{description:e}),t},meta(...e){if(e.length===0)return S2.get(this);let t=this.clone();return S2.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return S2.get(e)?.description},configurable:!0}),e)),C3=a$(`_ZodString`,(e,t)=>{l0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>P4(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,x3(e,`_ZodString`,{regex(...e){return this.check(u4(...e))},includes(...e){return this.check(p4(...e))},startsWith(...e){return this.check(m4(...e))},endsWith(...e){return this.check(h4(...e))},min(...e){return this.check(c4(...e))},max(...e){return this.check(s4(...e))},length(...e){return this.check(l4(...e))},nonempty(...e){return this.check(c4(1,...e))},lowercase(e){return this.check(d4(e))},uppercase(e){return this.check(f4(e))},trim(){return this.check(v4())},normalize(...e){return this.check(_4(...e))},toLowerCase(){return this.check(y4())},toUpperCase(){return this.check(b4())},slugify(){return this.check(x4())}})}),w3=a$(`ZodString`,(e,t)=>{l0.init(e,t),C3.init(e,t),e.email=t=>e.check(w2(D3,t)),e.url=t=>e.check(A2(j3,t)),e.jwt=t=>e.check(G2(K3,t)),e.emoji=t=>e.check(j2(M3,t)),e.guid=t=>e.check(T2(O3,t)),e.uuid=t=>e.check(E2(k3,t)),e.uuidv4=t=>e.check(D2(k3,t)),e.uuidv6=t=>e.check(O2(k3,t)),e.uuidv7=t=>e.check(k2(k3,t)),e.nanoid=t=>e.check(M2(N3,t)),e.guid=t=>e.check(T2(O3,t)),e.cuid=t=>e.check(N2(P3,t)),e.cuid2=t=>e.check(P2(F3,t)),e.ulid=t=>e.check(F2(I3,t)),e.base64=t=>e.check(H2(U3,t)),e.base64url=t=>e.check(U2(W3,t)),e.xid=t=>e.check(I2(L3,t)),e.ksuid=t=>e.check(L2(R3,t)),e.ipv4=t=>e.check(R2(z3,t)),e.ipv6=t=>e.check(z2(B3,t)),e.cidrv4=t=>e.check(B2(V3,t)),e.cidrv6=t=>e.check(V2(H3,t)),e.e164=t=>e.check(W2(G3,t)),e.datetime=t=>e.check(e3(t)),e.date=t=>e.check(n3(t)),e.time=t=>e.check(i3(t)),e.duration=t=>e.check(o3(t))});function T3(e){return C2(w3,e)}var E3=a$(`ZodStringFormat`,(e,t)=>{u0.init(e,t),C3.init(e,t)}),D3=a$(`ZodEmail`,(e,t)=>{p0.init(e,t),E3.init(e,t)}),O3=a$(`ZodGUID`,(e,t)=>{d0.init(e,t),E3.init(e,t)}),k3=a$(`ZodUUID`,(e,t)=>{f0.init(e,t),E3.init(e,t)});function A3(e){return E2(k3,e)}var j3=a$(`ZodURL`,(e,t)=>{m0.init(e,t),E3.init(e,t)}),M3=a$(`ZodEmoji`,(e,t)=>{h0.init(e,t),E3.init(e,t)}),N3=a$(`ZodNanoID`,(e,t)=>{g0.init(e,t),E3.init(e,t)}),P3=a$(`ZodCUID`,(e,t)=>{_0.init(e,t),E3.init(e,t)}),F3=a$(`ZodCUID2`,(e,t)=>{v0.init(e,t),E3.init(e,t)}),I3=a$(`ZodULID`,(e,t)=>{y0.init(e,t),E3.init(e,t)}),L3=a$(`ZodXID`,(e,t)=>{b0.init(e,t),E3.init(e,t)}),R3=a$(`ZodKSUID`,(e,t)=>{x0.init(e,t),E3.init(e,t)}),z3=a$(`ZodIPv4`,(e,t)=>{E0.init(e,t),E3.init(e,t)}),B3=a$(`ZodIPv6`,(e,t)=>{D0.init(e,t),E3.init(e,t)}),V3=a$(`ZodCIDRv4`,(e,t)=>{O0.init(e,t),E3.init(e,t)}),H3=a$(`ZodCIDRv6`,(e,t)=>{k0.init(e,t),E3.init(e,t)}),U3=a$(`ZodBase64`,(e,t)=>{j0.init(e,t),E3.init(e,t)}),W3=a$(`ZodBase64URL`,(e,t)=>{N0.init(e,t),E3.init(e,t)}),G3=a$(`ZodE164`,(e,t)=>{P0.init(e,t),E3.init(e,t)}),K3=a$(`ZodJWT`,(e,t)=>{I0.init(e,t),E3.init(e,t)}),q3=a$(`ZodNumber`,(e,t)=>{L0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>F4(e,t,n,r),x3(e,`ZodNumber`,{gt(e,t){return this.check(i4(e,t))},gte(e,t){return this.check(a4(e,t))},min(e,t){return this.check(a4(e,t))},lt(e,t){return this.check(n4(e,t))},lte(e,t){return this.check(r4(e,t))},max(e,t){return this.check(r4(e,t))},int(e){return this.check(X3(e))},safe(e){return this.check(X3(e))},positive(e){return this.check(i4(0,e))},nonnegative(e){return this.check(a4(0,e))},negative(e){return this.check(n4(0,e))},nonpositive(e){return this.check(r4(0,e))},multipleOf(e,t){return this.check(o4(e,t))},step(e,t){return this.check(o4(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function J3(e){return X2(q3,e)}var Y3=a$(`ZodNumberFormat`,(e,t)=>{R0.init(e,t),q3.init(e,t)});function X3(e){return Q2(Y3,e)}var Z3=a$(`ZodBoolean`,(e,t)=>{z0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I4(e,t,n,r)});function Q3(e){return $2(Z3,e)}var $3=a$(`ZodUnknown`,(e,t)=>{B0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function e6(){return e4($3)}var t6=a$(`ZodNever`,(e,t)=>{V0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>L4(e,t,n,r)});function n6(e){return t4(t6,e)}var r6=a$(`ZodArray`,(e,t)=>{U0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>V4(e,t,n,r),e.element=t.element,x3(e,`ZodArray`,{min(e,t){return this.check(c4(e,t))},nonempty(e){return this.check(c4(1,e))},max(e,t){return this.check(s4(e,t))},length(e,t){return this.check(l4(e,t))},unwrap(){return this.element}})});function i6(e,t){return S4(r6,e,t)}var a6=a$(`ZodObject`,(e,t)=>{J0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>H4(e,t,n,r),_$(e,`shape`,()=>t.shape),x3(e,`ZodObject`,{keyof(){return f6(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:e6()})},loose(){return this.clone({...this._zod.def,catchall:e6()})},strict(){return this.clone({...this._zod.def,catchall:n6()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return F$(this,e)},safeExtend(e){return I$(this,e)},merge(e){return L$(this,e)},pick(e){return N$(this,e)},omit(e){return P$(this,e)},partial(...e){return R$(h6,this,e[0])},required(...e){return z$(T6,this,e[0])}})});function o6(e,t){return new a6({type:`object`,shape:e??{},...A$(t)})}var s6=a$(`ZodUnion`,(e,t)=>{X0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>U4(e,t,n,r),e.options=t.options});function c6(e,t){return new s6({type:`union`,options:e,...A$(t)})}var l6=a$(`ZodIntersection`,(e,t)=>{Z0.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>W4(e,t,n,r)});function u6(e,t){return new l6({type:`intersection`,left:e,right:t})}var d6=a$(`ZodEnum`,(e,t)=>{e2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>R4(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new d6({...t,checks:[],...A$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new d6({...t,checks:[],...A$(r),entries:i})}});function f6(e,t){return new d6({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...A$(t)})}var p6=a$(`ZodTransform`,(e,t)=>{t2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>B4(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new s$(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(K$(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(K$(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function m6(e){return new p6({type:`transform`,transform:e})}var h6=a$(`ZodOptional`,(e,t)=>{r2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Q4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function g6(e){return new h6({type:`optional`,innerType:e})}var _6=a$(`ZodExactOptional`,(e,t)=>{i2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Q4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function v6(e){return new _6({type:`optional`,innerType:e})}var y6=a$(`ZodNullable`,(e,t)=>{a2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>G4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function b6(e){return new y6({type:`nullable`,innerType:e})}var x6=a$(`ZodDefault`,(e,t)=>{o2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>q4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function S6(e,t){return new x6({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():E$(t)}})}var C6=a$(`ZodPrefault`,(e,t)=>{c2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>J4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function w6(e,t){return new C6({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():E$(t)}})}var T6=a$(`ZodNonOptional`,(e,t)=>{l2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>K4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function E6(e,t){return new T6({type:`nonoptional`,innerType:e,...A$(t)})}var D6=a$(`ZodCatch`,(e,t)=>{d2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Y4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function O6(e,t){return new D6({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var k6=a$(`ZodPipe`,(e,t)=>{f2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>X4(e,t,n,r),e.in=t.in,e.out=t.out});function A6(e,t){return new k6({type:`pipe`,in:e,out:t})}var j6=a$(`ZodPreprocess`,(e,t)=>{k6.init(e,t),m2.init(e,t)}),M6=a$(`ZodReadonly`,(e,t)=>{h2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Z4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function N6(e){return new M6({type:`readonly`,innerType:e})}var P6=a$(`ZodCustom`,(e,t)=>{_2.init(e,t),S3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>z4(e,t,n,r)});function F6(e,t={}){return C4(P6,e,t)}function I6(e,t){return w4(e,t)}function L6(e,t){return new j6({type:`pipe`,in:m6(e),out:t})}function R6(e){return Z2(q3,e)}var z6=T3().regex(/^\d{4}-\d{2}-\d{2}$/,`Expected a YYYY-MM-DD date`),B6=e=>T3().trim().max(e).nullish().transform(e=>e==null||e===``?null:e),V6=f6(HQ),H6=f6(qQ),U6=f6(XQ),W6=f6(ZQ);f6(YQ);var G6=i6(T3().trim().min(1).max(60)).max(30);o6({companyName:T3().trim().min(1,`Company is required`).max(200),jobTitle:T3().trim().min(1,`Job title is required`).max(200),appliedOn:z6,status:V6.default(`applied`),jobUrl:B6(2e3),location:B6(200),workMode:H6.default(`unspecified`),sourceName:B6(120),salaryMin:J3().int().nonnegative().nullish().transform(e=>e??null),salaryMax:J3().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:B6(8),followUpOn:z6.nullish().transform(e=>e??null),tags:G6.default([]),notes:B6(2e4)}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),o6({companyName:T3().trim().min(1).max(200).optional(),jobTitle:T3().trim().min(1).max(200).optional(),appliedOn:z6.optional(),status:V6.optional(),statusComment:T3().trim().max(2e3).nullish(),jobUrl:B6(2e3).optional(),location:B6(200).optional(),workMode:H6.optional(),sourceName:B6(120).optional(),salaryMin:J3().int().nonnegative().nullish(),salaryMax:J3().int().nonnegative().nullish(),salaryCurrency:B6(8).optional(),followUpOn:z6.nullish(),archived:Q3().optional(),tags:G6.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),o6({status:V6,occurredOn:z6.optional(),comment:T3().trim().max(2e3).nullish().transform(e=>e??null)});var K6=e=>L6(e=>{if(e==null)return;let t=(Array.isArray(e)?e.map(String):String(e).split(`,`)).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0},i6(e).optional()),q6=o6({q:T3().trim().max(300).optional(),year:R6().int().min(1970).max(2200).optional(),month:R6().int().min(1).max(12).optional(),status:K6(V6),workMode:K6(H6),tags:K6(T3()),companyId:A3().optional(),source:T3().trim().max(120).optional(),from:z6.optional(),to:z6.optional(),archived:f6([`true`,`false`,`all`]).default(`false`).transform(e=>e===`all`?`all`:e===`true`),followUpDue:f6([`true`,`false`]).optional().transform(e=>e===`true`),sort:f6([`appliedOn`,`company`,`jobTitle`,`status`,`createdAt`]).default(`appliedOn`),direction:f6([`asc`,`desc`]).default(`desc`),limit:R6().int().min(1).max(200).default(50),cursor:T3().optional()});o6({company:T3().trim().min(1).max(200),title:T3().trim().max(200).optional().default(``),excludeId:A3().optional()}),o6({q:T3().trim().min(1).max(300),limit:R6().int().min(1).max(100).default(25),types:K6(f6([`application`,`company`,`note`]))}),q6.extend({format:f6([`csv`,`xlsx`]).default(`csv`)}),o6({name:T3().trim().min(1).max(200),website:B6(2e3),location:B6(200),tags:G6.default([])}),o6({name:T3().trim().min(1).max(200).optional(),website:B6(2e3).optional(),location:B6(200).optional(),archived:Q3().optional(),tags:G6.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),o6({title:T3().trim().min(1).max(200),body:T3().max(5e4).default(``),targetType:U6.default(`standalone`),targetId:A3().nullish().transform(e=>e??null),pinned:Q3().default(!1)}),o6({title:T3().trim().min(1).max(200).optional(),body:T3().max(5e4).optional(),targetType:U6.optional(),targetId:A3().nullish(),pinned:Q3().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),o6({name:T3().trim().min(1).max(60),color:B6(30),scope:W6.default(`both`)}),o6({companyName:T3().trim().min(1,`Company is required`).max(200),jobTitle:T3().trim().min(1,`Job title is required`).max(200),jobUrl:B6(2e3),location:B6(200),workMode:H6.default(`unspecified`),sourceName:B6(120),salaryMin:J3().int().nonnegative().nullish().transform(e=>e??null),salaryMax:J3().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:B6(8),notes:B6(2e4),savedOn:z6.optional()}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),o6({companyName:T3().trim().min(1).max(200).optional(),jobTitle:T3().trim().min(1).max(200).optional(),jobUrl:B6(2e3).optional(),location:B6(200).optional(),workMode:H6.optional(),sourceName:B6(120).optional(),salaryMin:J3().int().nonnegative().nullish(),salaryMax:J3().int().nonnegative().nullish(),salaryCurrency:B6(8).optional(),notes:B6(2e4).optional(),savedOn:z6.optional(),archived:Q3().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),o6({appliedOn:z6.optional(),status:V6.optional(),tags:G6.optional()}),o6({target:T3().min(1)});function J6(e){return e===`exact`}var Y6=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.details=r}get fieldErrors(){return Array.isArray(this.details)?this.details:[]}};async function X6(e,t){let n=await fetch(e,{...t,headers:{...t?.body?{"Content-Type":`application/json`}:{},...t?.headers}});if(n.status===204)return;let r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new Y6(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}function Z6(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null&&r!==``){if(Array.isArray(r)){if(r.length===0)continue;t.set(n,r.join(`,`))}else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}var Q6={csv:`text/csv`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`};async function $6(e,t,n){let r=await fetch(`/api/import${Z6({format:t,mode:n})}`,{method:`POST`,headers:{"Content-Type":Q6[t]},body:e}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok)throw new Y6(r.status,a?.error??`unknown`,a?.message??r.statusText,a?.details);return a}async function e8(e,t){let n=await fetch(`/api/backup/import${Z6({mode:t})}`,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e}),r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new Y6(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}var t8={listApplications:e=>X6(`/api/applications${Z6(e)}`),getApplication:e=>X6(`/api/applications/${e}`),periods:()=>X6(`/api/applications/periods`),checkDuplicates:e=>X6(`/api/applications/check${Z6(e)}`),createApplication:e=>X6(`/api/applications`,{method:`POST`,body:JSON.stringify(e)}),updateApplication:(e,t)=>X6(`/api/applications/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),changeStatus:(e,t)=>X6(`/api/applications/${e}/status`,{method:`POST`,body:JSON.stringify(t)}),deleteApplication:e=>X6(`/api/applications/${e}`,{method:`DELETE`}),listCompanies:(e={})=>X6(`/api/companies${Z6(e)}`),suggestCompanies:e=>X6(`/api/companies/suggest${Z6({q:e})}`),getCompany:e=>X6(`/api/companies/${e}`),updateCompany:(e,t)=>X6(`/api/companies/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),listTags:()=>X6(`/api/tags`),listNotes:(e={})=>X6(`/api/notes${Z6(e)}`),createNote:e=>X6(`/api/notes`,{method:`POST`,body:JSON.stringify(e)}),updateNote:(e,t)=>X6(`/api/notes/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteNote:e=>X6(`/api/notes/${e}`,{method:`DELETE`}),dashboard:()=>X6(`/api/dashboard`),search:(e,t)=>X6(`/api/search${Z6({q:e,types:t,limit:25})}`),exportUrl:(e,t)=>`/api/export${Z6({...e,format:t})}`,previewImport:(e,t)=>$6(e,t,`preview`),commitImport:(e,t)=>$6(e,t,`commit`),listOpenings:(e={})=>X6(`/api/openings${Z6(e)}`),getOpening:e=>X6(`/api/openings/${e}`),createOpening:e=>X6(`/api/openings`,{method:`POST`,body:JSON.stringify(e)}),updateOpening:(e,t)=>X6(`/api/openings/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteOpening:e=>X6(`/api/openings/${e}`,{method:`DELETE`}),convertOpening:(e,t)=>X6(`/api/openings/${e}/convert`,{method:`POST`,body:JSON.stringify(t)}),getDbTargets:()=>X6(`/api/db/targets`),switchDb:e=>X6(`/api/db/switch`,{method:`POST`,body:JSON.stringify({target:e})}),backupExportUrl:`/api/backup/export`,previewBackup:e=>e8(e,`preview`),commitBackup:e=>e8(e,`commit`),getDataStatus:()=>X6(`/api/backup/status`),clearDatabase:()=>X6(`/api/backup/clear`,{method:`POST`}),seedDatabase:()=>X6(`/api/backup/seed`,{method:`POST`})},n8=class extends Error{name=`RepoError`;cause;constructor(e,t){super(e),t?.cause!==void 0&&(this.cause=t.cause)}},r8=class extends n8{name=`SchemaError`},i8=new Set([`string`,`number`,`integer`,`boolean`,`date`,`json`]);function a8(e){let t=Object.keys(e);if(t.length===0)throw new r8(`A schema must define at least one field`);let n={},r={},i={},a;for(let o of t){let t=e[o];if(!i8.has(t.type))throw new r8(`Field "${o}" has unknown type ${JSON.stringify(t.type)}. Expected one of: ${[...i8].join(`, `)}`);let s=t.column??o;if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(s))throw new r8(`Field "${o}" maps to column ${JSON.stringify(s)}, which is not a plain identifier. Column names must match /^[A-Za-z_][A-Za-z0-9_]*$/ because repolayer never quotes-and-interpolates arbitrary text into SQL.`);if(s in r)throw new r8(`Fields "${r[s]}" and "${o}" both map to column "${s}"`);if(t.primaryKey){if(a!==void 0)throw new r8(`Schema declares two primary keys ("${a}" and "${o}"). repolayer supports single-column primary keys only.`);if(t.nullable)throw new r8(`Primary key "${o}" cannot be nullable`);a=o}n[o]=s,r[s]=o,i[o]=t.type}if(a===void 0)throw new r8("Schema has no primary key. Mark exactly one field with `primaryKey: true`.");return Object.freeze({fields:e,primaryKey:a,columns:Object.freeze(n),fieldsByColumn:Object.freeze(r),fieldNames:Object.freeze(t),types:Object.freeze(i)})}var o8={createdAt:{type:`date`,column:`created_at`},updatedAt:{type:`date`,column:`updated_at`}};a8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},website:{type:`string`,nullable:!0},location:{type:`string`,nullable:!0},archived:{type:`boolean`},...o8}),a8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},titleKey:{type:`string`,column:`title_key`},appliedOn:{type:`date`,column:`applied_on`},periodYear:{type:`integer`,column:`period_year`},periodMonth:{type:`integer`,column:`period_month`},status:{type:`string`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},followUpOn:{type:`date`,nullable:!0,column:`follow_up_on`},archived:{type:`boolean`},...o8}),a8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},color:{type:`string`,nullable:!0},scope:{type:`string`},...o8}),a8({id:{type:`string`,primaryKey:!0},tagId:{type:`string`,column:`tag_id`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},...o8}),a8({id:{type:`string`,primaryKey:!0},title:{type:`string`},body:{type:`string`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,nullable:!0,column:`target_id`},pinned:{type:`boolean`},...o8}),a8({id:{type:`string`,primaryKey:!0},applicationId:{type:`string`,column:`application_id`},fromStatus:{type:`string`,nullable:!0,column:`from_status`},toStatus:{type:`string`,column:`to_status`},occurredOn:{type:`date`,column:`occurred_on`},commentText:{type:`string`,nullable:!0,column:`comment_text`},...o8}),a8({id:{type:`string`,primaryKey:!0},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},model:{type:`string`},dim:{type:`integer`},embedding:{type:`json`},textHash:{type:`string`,column:`text_hash`},...o8}),a8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},notes:{type:`string`,nullable:!0},savedOn:{type:`date`,column:`saved_on`},archived:{type:`boolean`},convertedApplicationId:{type:`string`,nullable:!0,column:`converted_application_id`},...o8}),[{header:`Position`,value:e=>e.jobTitle,width:34},{header:`Company`,value:e=>e.company.name,width:28},{header:`Date`,value:e=>e.appliedOn,width:13},{header:`Status`,value:e=>KQ[e.status],width:13},{header:`Notes`,value:e=>e.notesText,width:70,wrap:!0}].map(e=>e.header),new Map(Object.entries(KQ).map(([e,t])=>[t.toLowerCase(),e]));var s8=t8,c8={applications:e=>[`applications`,e],application:e=>[`application`,e],periods:()=>[`periods`],companies:e=>[`companies`,e],company:e=>[`company`,e],companySuggest:e=>[`company-suggest`,e],tags:()=>[`tags`],notes:e=>[`notes`,e],dashboard:()=>[`dashboard`],duplicates:e=>[`duplicates`,e],search:e=>[`search`,e],openings:e=>[`openings`,e],opening:e=>[`opening`,e],dbTargets:()=>[`db-targets`],dataStatus:()=>[`data-status`]};function l8(e){e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`company`]}),e.invalidateQueries({queryKey:[`tags`]}),e.invalidateQueries({queryKey:[`duplicates`]}),e.invalidateQueries({queryKey:[`search`]})}function u8(e){return qr({queryKey:c8.applications(e),queryFn:()=>s8.listApplications(e),placeholderData:e=>e})}function d8(e){return qr({queryKey:c8.application(e??``),queryFn:()=>s8.getApplication(e),enabled:!!e})}function f8(){return qr({queryKey:c8.periods(),queryFn:()=>s8.periods()})}function p8(){return qr({queryKey:c8.dashboard(),queryFn:()=>s8.dashboard()})}function m8(){return qr({queryKey:c8.tags(),queryFn:()=>s8.listTags()})}function h8(e={}){return qr({queryKey:c8.companies(e),queryFn:()=>s8.listCompanies(e)})}function g8(e){return qr({queryKey:c8.company(e??``),queryFn:()=>s8.getCompany(e),enabled:!!e})}function _8(e={}){return qr({queryKey:c8.notes(e),queryFn:()=>s8.listNotes(e)})}function v8(e){let{enabled:t=!0,...n}=e;return qr({queryKey:c8.duplicates(n),queryFn:()=>s8.checkDuplicates(n),enabled:t&&n.company.trim().length>1,staleTime:5e3})}function y8(e){return qr({queryKey:c8.companySuggest(e),queryFn:()=>s8.suggestCompanies(e),enabled:e.trim().length>0,staleTime:3e4})}function b8(){let e=Tn();return Jr({mutationFn:e=>s8.createApplication(e),onSuccess:()=>l8(e)})}function x8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>s8.updateApplication(e,t),onSuccess:()=>l8(e)})}function S8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>s8.changeStatus(e,t),onSuccess:()=>l8(e)})}function C8(){let e=Tn();return Jr({mutationFn:e=>s8.deleteApplication(e),onSuccess:()=>l8(e)})}function w8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>s8.updateCompany(e,t),onSuccess:()=>l8(e)})}function T8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>e?s8.updateNote(e,t):s8.createNote(t),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`search`]})}})}function E8(){let e=Tn();return Jr({mutationFn:e=>s8.deleteNote(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]})}})}function D8(e={}){return qr({queryKey:c8.openings(e),queryFn:()=>s8.listOpenings(e)})}function O8(e){e.invalidateQueries({queryKey:[`openings`]}),e.invalidateQueries({queryKey:[`opening`]})}function k8(){let e=Tn();return Jr({mutationFn:e=>s8.createOpening(e),onSuccess:()=>O8(e)})}function A8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>s8.updateOpening(e,t),onSuccess:()=>O8(e)})}function j8(){let e=Tn();return Jr({mutationFn:e=>s8.deleteOpening(e),onSuccess:()=>O8(e)})}function M8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>s8.convertOpening(e,t),onSuccess:()=>{O8(e),e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`search`]})}})}function N8(){return qr({queryKey:c8.dbTargets(),queryFn:()=>s8.getDbTargets()})}function P8(){return Jr({mutationFn:e=>s8.switchDb(e)})}function F8(){return qr({queryKey:c8.dataStatus(),queryFn:()=>s8.getDataStatus()})}function I8(){let e=Tn();return Jr({mutationFn:()=>s8.clearDatabase(),onSuccess:()=>void e.invalidateQueries()})}function L8(){let e=Tn();return Jr({mutationFn:()=>s8.seedDatabase(),onSuccess:()=>void e.invalidateQueries()})}function R8({status:e}){return(0,Z.jsx)(OY,{color:GQ[e],children:KQ[e]})}function z8(e,t=300){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var B8={exact:`error`,similar:`warning`,company:`info`,none:`success`};function V8({check:e,loading:t}){if(t&&!e)return(0,Z.jsx)(jp,{type:`info`,showIcon:!0,message:`Checking your history…`,style:{marginBottom:16}});if(!e)return null;if(e.verdict===`none`)return(0,Z.jsx)(jp,{type:`success`,showIcon:!0,message:`No history with this company`,description:`This looks like a company you haven't applied to before.`,style:{marginBottom:16}});let n=e.company?.name??`this company`;return(0,Z.jsx)(jp,{type:B8[e.verdict],showIcon:!0,style:{marginBottom:16},message:H8(e.verdict,n,e.priorCount),description:(0,Z.jsxs)(Pz,{direction:`vertical`,size:6,style:{width:`100%`},children:[e.matches.length>0?e.matches.slice(0,5).map(e=>(0,Z.jsx)(U8,{match:e},e.id)):(0,Z.jsx)(YX.Text,{type:`secondary`,children:`None of them were for this role, but it is worth a look before you apply again.`}),!e.semanticUsed&&e.matches.length>0&&(0,Z.jsx)(YX.Text,{type:`secondary`,style:{fontSize:12},children:`Matched on wording only — semantic matching is still warming up.`})]})})}function H8(e,t,n){let r=n===1?`once`:`${n} times`;switch(e){case`exact`:return`You have already applied for this exact role at ${t}`;case`similar`:return`You have applied for a very similar role at ${t}`;default:return`You have applied to ${t} ${r} before`}}function U8({match:e}){let t=Math.round(Math.max(e.titleSimilarity,e.semanticSimilarity??0)*100);return(0,Z.jsxs)(Pz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:e.appliedOn}),(0,Z.jsx)(OY,{color:GQ[e.status],children:KQ[e.status]}),e.matchKind===`exact`?(0,Z.jsx)(OY,{color:`red`,children:`exact title`}):(0,Z.jsxs)(OY,{children:[t,`% similar`]})]})}function W8({onStartApplication:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),a=z8(t,350),{data:o,isFetching:s}=v8({company:a,title:z8(r,350)}),c=a.trim().length>1;return(0,Z.jsx)(bF,{title:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(EQ,{}),(0,Z.jsx)(`span`,{children:`Check before you apply`})]}),extra:e&&(0,Z.jsx)(Vk,{type:`link`,onClick:e,children:`New application`}),children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)(BU,{gutter:12,children:[(0,Z.jsx)(II,{xs:24,sm:12,children:(0,Z.jsx)(_V,{placeholder:`Company`,value:t,onChange:e=>n(e.target.value),allowClear:!0})}),(0,Z.jsx)(II,{xs:24,sm:12,children:(0,Z.jsx)(_V,{placeholder:`Job title (optional)`,value:r,onChange:e=>i(e.target.value),allowClear:!0})})]}),c?(0,Z.jsx)(V8,{check:o,loading:s}):(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Type a company name to see whether you have been here before.`})]})})}function G8({open:e,onClose:t,application:n}){let[r]=WB.useForm(),{message:i,modal:a}=NC.useApp(),o=!!n,s=b8(),c=x8(),{data:l}=m8(),u=WB.useWatch(`companyName`,r)??``,d=WB.useWatch(`jobTitle`,r)??``,f=z8(u,300),p=z8(d,300),{data:m}=y8(f),{data:h,isFetching:g}=v8({company:f,title:p,...n?{excludeId:n.id}:{},enabled:e});(0,_.useEffect)(()=>{e&&(n?r.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,appliedOn:(0,Yk.default)(n.appliedOn),status:n.status,jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,followUpOn:n.followUpOn?(0,Yk.default)(n.followUpOn):null,tags:n.tags.map(e=>e.name)}):(r.resetFields(),r.setFieldsValue({appliedOn:(0,Yk.default)(),status:`applied`,workMode:`unspecified`,tags:[]})))},[e,n,r]);let v=(0,_.useMemo)(()=>(m?.companies??[]).map(e=>({value:e.name,label:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(`span`,{children:e.name}),e.applicationCount>0&&(0,Z.jsxs)(YX.Text,{type:`secondary`,style:{fontSize:12},children:[e.applicationCount,` application`,e.applicationCount===1?``:`s`]})]})})),[m]),y=(0,_.useMemo)(()=>(l?.tags??[]).map(e=>({value:e.name,label:e.name})),[l]),[b,x]=(0,_.useState)(!1);async function S(e){if(h&&J6(h.verdict)&&!o&&!await new Promise(e=>{a.confirm({title:`You have applied for this exact role before`,content:(0,Z.jsxs)(Pz,{direction:`vertical`,children:[(0,Z.jsxs)(YX.Text,{children:[h.matches[0]?.jobTitle,` at `,h.company?.name,` on`,` `,h.matches[0]?.appliedOn,`.`]}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Save this as a new application anyway?`})]}),okText:`Save anyway`,cancelText:`Go back`,onOk:()=>e(!0),onCancel:()=>e(!1)})}))return;let l={companyName:e.companyName,jobTitle:e.jobTitle,appliedOn:e.appliedOn.format(`YYYY-MM-DD`),status:e.status,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,followUpOn:e.followUpOn?e.followUpOn.format(`YYYY-MM-DD`):null,tags:e.tags??[],...o?{}:{notes:e.notes??null}};x(!0);try{n?(await c.mutateAsync({id:n.id,body:l}),i.success(`Application updated`)):(await s.mutateAsync(l),i.success(`Application saved`)),t()}catch(e){e instanceof Y6&&e.fieldErrors.length>0?(r.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),i.error(`Please check the highlighted fields`)):i.error(e instanceof Error?e.message:`Could not save`)}finally{x(!1)}}return(0,Z.jsxs)(Tz,{title:o?`Edit application`:`New application`,open:e,onClose:t,width:640,destroyOnHidden:!0,extra:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Vk,{type:`primary`,loading:b,onClick:()=>r.submit(),children:o?`Save changes`:`Save application`})]}),children:[(0,Z.jsx)(V8,{check:h,loading:g}),(0,Z.jsxs)(WB,{form:r,layout:`vertical`,onFinish:S,requiredMark:`optional`,children:[(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(NE,{options:v,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(_V,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(EE,{options:HQ.map(e=>({value:e,label:KQ[e]}))})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`followUpOn`,label:`Follow up on`,children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`,allowClear:!0})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(EE,{options:qQ.map(e=>({value:e,label:JQ[e]}))})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(_V,{placeholder:`Stockholm`})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(_V,{placeholder:`LinkedIn, referral…`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(_V,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(WB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(_V,{placeholder:`https://…`})}),(0,Z.jsx)(WB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(EE,{mode:`tags`,options:y,placeholder:`fintech, remote-ok, dream-job…`,tokenSeparators:[`,`]})}),!o&&(0,Z.jsx)(WB.Item,{name:`notes`,label:`Notes`,help:`Saved as a note linked to this application. Searchable.`,children:(0,Z.jsx)(_V.TextArea,{rows:4,placeholder:`Anything worth remembering…`})})]})]})}var K8={dark:{bgBase:`#0d1117`,bgRaised:`#161b22`,bgSunken:`#010409`,border:`#30363d`,borderStrong:`#444c56`,textPrimary:`#e6edf3`,textMuted:`#8b949e`,textFaint:`#6e7681`,accent:`#58a6ff`,success:`#3fb950`,danger:`#f85149`,warning:`#d29922`},light:{bgBase:`#ffffff`,bgRaised:`#ffffff`,bgSunken:`#f6f8fa`,border:`#d0d7de`,borderStrong:`#afb8c1`,textPrimary:`#1f2328`,textMuted:`#656d76`,textFaint:`#8c959f`,accent:`#0969da`,success:`#1a7f37`,danger:`#d1242f`,warning:`#9a6700`}},q8={bgBase:`var(--jt-bg-base)`,bgRaised:`var(--jt-bg-raised)`,bgSunken:`var(--jt-bg-sunken)`,border:`var(--jt-border)`,borderStrong:`var(--jt-border-strong)`,textPrimary:`var(--jt-text-primary)`,textMuted:`var(--jt-text-muted)`,textFaint:`var(--jt-text-faint)`,accent:`var(--jt-accent)`,success:`var(--jt-success)`,danger:`var(--jt-danger)`,warning:`var(--jt-warning)`};function J8(e){let t=K8[e];return{algorithm:e===`dark`?RY.darkAlgorithm:RY.defaultAlgorithm,token:{colorBgBase:t.bgBase,colorBgContainer:t.bgRaised,colorBgElevated:t.bgRaised,colorBgLayout:t.bgBase,colorBorder:t.border,colorBorderSecondary:t.border,colorText:t.textPrimary,colorTextSecondary:t.textMuted,colorTextTertiary:t.textFaint,colorPrimary:t.accent,colorLink:t.accent,colorSuccess:t.success,colorError:t.danger,colorWarning:t.warning,borderRadius:8,fontSize:14},components:{Layout:{siderBg:t.bgSunken,headerBg:t.bgSunken,bodyBg:t.bgBase}}}}function Y8(){let{data:e,isLoading:t}=p8(),[n,r]=(0,_.useState)(!1),i=e$(t$());if(t||!e)return(0,Z.jsx)(CS,{active:!0,paragraph:{rows:8}});let{stats:a,followUps:o,recentActivity:s}=e;return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Total applications`,value:a.total})})}),(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Still active`,value:a.active,valueStyle:{color:q8.accent}})})}),(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`${r$(i.month)} ${i.year}`,value:a.thisMonth,suffix:a.thisMonth===1?`application`:`applications`})})}),(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Response rate`}),(0,Z.jsx)(bU,{percent:Math.round(a.responseRate*100),size:`small`,strokeColor:q8.accent}),(0,Z.jsx)(YX.Text,{type:`secondary`,style:{fontSize:12},children:`Anything past “applied” counts as a reply`})]})})})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:24,lg:14,children:(0,Z.jsx)(W8,{onStartApplication:()=>r(!0)})}),(0,Z.jsx)(II,{xs:24,lg:10,children:(0,Z.jsx)(bF,{title:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(LR,{}),(0,Z.jsx)(`span`,{children:`Needs a follow-up`})]}),styles:{body:{maxHeight:320,overflowY:`auto`}},children:o.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`Nothing due — all caught up`}):(0,Z.jsx)(NH,{size:`small`,dataSource:o,renderItem:e=>(0,Z.jsxs)(NH.Item,{children:[(0,Z.jsx)(NH.Item.Meta,{title:(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),description:(0,Z.jsxs)(Xz,{justify:`space-between`,wrap:!0,gap:8,children:[(0,Z.jsx)(`span`,{children:e.company.name}),(0,Z.jsxs)(YX.Text,{type:`danger`,children:[`due `,e.followUpOn]})]})}),(0,Z.jsx)(R8,{status:e.status})]})})})})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:24,lg:12,children:(0,Z.jsx)(bF,{title:`Pipeline`,children:(0,Z.jsx)(Pz,{direction:`vertical`,size:10,style:{width:`100%`},children:Object.entries(a.byStatus).sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,Z.jsxs)(Xz,{align:`center`,gap:12,children:[(0,Z.jsx)(`div`,{style:{width:100},children:(0,Z.jsx)(R8,{status:e})}),(0,Z.jsx)(bU,{percent:a.total>0?Math.round(t/a.total*100):0,format:()=>t,size:`small`,style:{flex:1,marginBottom:0}})]},e))})})}),(0,Z.jsx)(II,{xs:24,lg:12,children:(0,Z.jsx)(bF,{title:`Recent activity`,styles:{body:{maxHeight:360,overflowY:`auto`}},children:s.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No status changes yet`}):(0,Z.jsx)(KY,{items:s.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsxs)(YX.Text,{children:[(0,Z.jsx)(dn,{to:`/applications/${e.applicationId}`,children:e.jobTitle}),` at `,e.companyName]}),(0,Z.jsxs)(YX.Text,{type:`secondary`,style:{fontSize:12},children:[e.fromStatus?`${KQ[e.fromStatus]} → ${KQ[e.toStatus]}`:`Applied (${KQ[e.toStatus]})`,` `,`· `,e.occurredOn]})]})}))})})})]}),(0,Z.jsx)(G8,{open:n,onClose:()=>r(!1)})]})}function X8({periods:e,year:t,month:n,onSelect:r}){let i=(0,_.useMemo)(()=>e.map(e=>({key:`y:${e.year}`,title:(0,Z.jsx)(Z8,{label:String(e.year),count:e.count,strong:!0}),children:(e.months??[]).map(e=>({key:`m:${e.year}:${e.month}`,title:(0,Z.jsx)(Z8,{label:r$(e.month),count:e.count})}))})),[e]),a=(0,_.useMemo)(()=>t&&n?[`m:${t}:${n}`]:t?[`y:${t}`]:[],[t,n]),o=(0,_.useMemo)(()=>{let n=e[0],r=n?[`y:${n.year}`]:[];return t&&!r.includes(`y:${t}`)&&r.push(`y:${t}`),r},[e,t]);return e.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No applications yet`}):(0,Z.jsx)(rJ,{treeData:i,selectedKeys:a,defaultExpandedKeys:o,blockNode:!0,onSelect:e=>{let t=String(e[0]??``);if(t.startsWith(`m:`)){let[,e,n]=t.split(`:`);r({year:Number(e),month:Number(n)})}else t.startsWith(`y:`)?r({year:Number(t.slice(2))}):r({})}})}function Z8({label:e,count:t,strong:n}){return(0,Z.jsxs)(`span`,{style:{display:`flex`,justifyContent:`space-between`,gap:12},children:[(0,Z.jsx)(YX.Text,{strong:n,children:e}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:t})]})}var Q8={new:`green`,duplicate:`default`,error:`red`},$8={new:`New`,duplicate:`Duplicate — skipped`,error:`Error`};function e5({open:e,onClose:t}){let n=Tn(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(`csv`),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null);function h(){i(null),c(null),u(null),m(null)}function g(){h(),t()}let v=e=>{let t=e.name.toLowerCase().endsWith(`.xlsx`)?`xlsx`:`csv`;return i(e),o(t),m(null),f(!0),s8.previewImport(e,t).then(c).catch(e=>m(e instanceof Error?e.message:`Could not read that file`)).finally(()=>f(!1)),!1};async function y(){if(r){f(!0),m(null);try{let e=await s8.commitImport(r,a);if(u(e),e.created>0)for(let e of[`applications`,`application`,`periods`,`dashboard`,`companies`,`company`,`search`])n.invalidateQueries({queryKey:[e]})}catch(e){m(e instanceof Error?e.message:`Import failed`)}finally{f(!1)}}}return(0,Z.jsx)(LH,{title:`Import applications`,open:e,onCancel:g,width:800,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,children:`CSV or .xlsx with the same columns Export produces: Position, Company, Date, Status, Notes. Rows that exactly match an application you have already logged are skipped automatically.`}),(0,Z.jsxs)(VZ.Dragger,{accept:`.csv,.xlsx`,maxCount:1,showUploadList:!1,beforeUpload:v,disabled:d,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(cQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a CSV or Excel file here`})]})]}),p&&(0,Z.jsx)(jp,{type:`error`,showIcon:!0,message:p}),s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pz,{wrap:!0,children:[(0,Z.jsxs)(OY,{color:`green`,children:[s.totals.new,` new`]}),(0,Z.jsxs)(OY,{children:[s.totals.duplicate,` duplicate — will be skipped`]}),s.totals.error>0&&(0,Z.jsxs)(OY,{color:`red`,children:[s.totals.error,` error`]})]}),s.fileErrors.map(e=>(0,Z.jsx)(jp,{type:`warning`,showIcon:!0,message:e},e)),(0,Z.jsx)(hY,{size:`small`,rowKey:`rowNumber`,columns:[{title:`Row`,dataIndex:`rowNumber`,width:60},{title:`Position`,dataIndex:`jobTitle`,ellipsis:!0},{title:`Company`,dataIndex:`companyName`,ellipsis:!0},{title:`Date`,dataIndex:`appliedOn`,width:110},{title:`Status`,dataIndex:`status`,width:110,render:e=>e?KQ[e]:`—`},{title:`Result`,dataIndex:`verdict`,width:200,render:(e,t)=>(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(OY,{color:Q8[e],children:$8[e]}),t.errors.length>0&&(0,Z.jsx)(YX.Text,{type:`danger`,style:{fontSize:12},children:t.errors.join(`; `)})]})}],dataSource:s.rows,pagination:{pageSize:10},scroll:{y:320}}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:h,children:`Choose a different file`}),(0,Z.jsxs)(Vk,{type:`primary`,loading:d,disabled:s.totals.new===0,onClick:y,children:[`Import `,s.totals.new,` application`,s.totals.new===1?``:`s`]})]})]}),l&&(0,Z.jsx)(zU,{status:l.failed>0?`warning`:`success`,title:`Imported ${l.created} application${l.created===1?``:`s`}`,subTitle:`${l.skipped} duplicate row${l.skipped===1?``:`s`} skipped`+(l.failed>0?`, ${l.failed} row${l.failed===1?``:`s`} failed`:``),extra:(0,Z.jsx)(Vk,{type:`primary`,onClick:g,children:`Done`})})]})})}function t5(){let e=Xe(),[t,n]=_n(),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),s=(0,_.useMemo)(()=>{let e={};for(let n of[`q`,`source`,`sort`,`direction`,`cursor`,`from`,`to`]){let r=t.get(n);r&&(e[n]=r)}for(let n of[`year`,`month`]){let r=t.get(n);r&&(e[n]=Number(r))}for(let n of[`status`,`workMode`,`tags`]){let r=t.get(n);r&&(e[n]=r.split(`,`))}return e},[t]),{data:c,isLoading:l,isFetching:u}=u8(s),{data:d}=f8(),{data:f}=m8();function p(e){let r=new URLSearchParams(t);for(let[t,n]of Object.entries(e))n==null||n===``||Array.isArray(n)&&n.length===0?r.delete(t):r.set(t,Array.isArray(n)?n.join(`,`):String(n));r.delete(`cursor`),n(r,{replace:!0})}let m=[{title:`Applied`,dataIndex:`appliedOn`,width:118,sorter:!1,render:e=>(0,Z.jsx)(YX.Text,{children:e})},{title:`Company`,key:`company`,width:190,render:(t,n)=>(0,Z.jsx)(Vk,{type:`link`,style:{padding:0,height:`auto`},onClick:t=>{t.stopPropagation(),e(`/companies/${n.company.id}`)},children:n.company.name})},{title:`Job title`,dataIndex:`jobTitle`,render:(e,t)=>(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Text,{strong:!0,children:e}),t.location&&(0,Z.jsxs)(YX.Text,{type:`secondary`,style:{fontSize:12},children:[t.location,` · `,JQ[t.workMode]]})]})},{title:`Status`,dataIndex:`status`,width:116,render:(e,t)=>(0,Z.jsx)(R8,{status:t.status})},{title:`Tags`,key:`tags`,width:210,render:(e,t)=>(0,Z.jsx)(Pz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(OY,{color:e.color??void 0,style:{marginInlineEnd:0},children:e.name},e.id))})},{title:`Source`,dataIndex:`sourceName`,width:120,render:e=>e??(0,Z.jsx)(YX.Text,{type:`secondary`,children:`—`})}],h=t.get(`from`),g=t.get(`to`),v=h&&g?[(0,Yk.default)(h),(0,Yk.default)(g)]:null,y=(0,Yk.default)(),b=[{label:`Today`,value:[y,y]},{label:`Yesterday`,value:[y.subtract(1,`day`),y.subtract(1,`day`)]},{label:`This week`,value:[y.startOf(`week`),y.endOf(`week`)]},{label:`This month`,value:[y.startOf(`month`),y.endOf(`month`)]},{label:`Last 7 days`,value:[y.subtract(6,`day`),y]},{label:`Last 30 days`,value:[y.subtract(29,`day`),y]}];function x(e){if(!e||!e[0]||!e[1]){p({from:``,to:``});return}p({from:e[0].format(`YYYY-MM-DD`),to:e[1].format(`YYYY-MM-DD`)})}let S=t.get(`year`)?Number(t.get(`year`)):void 0,C=t.get(`month`)?Number(t.get(`month`)):void 0,w=S&&C?`${r$(C)} ${S}`:S?String(S):`All applications`;return(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{xs:24,md:6,lg:5,children:(0,Z.jsx)(bF,{size:`small`,title:`By period`,extra:(S||C)&&(0,Z.jsx)(Vk,{size:`small`,type:`link`,onClick:()=>p({year:``,month:``}),children:`Clear`}),styles:{body:{maxHeight:`calc(100vh - 220px)`,overflowY:`auto`}},children:(0,Z.jsx)(X8,{periods:d?.periods??[],year:S,month:C,onSelect:e=>p({year:e.year??``,month:e.month??``})})})}),(0,Z.jsx)(II,{xs:24,md:18,lg:19,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:w}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:c?`${c.total} application${c.total===1?``:`s`}`:`Loading…`})]}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Iz,{menu:{items:[{key:`csv`,label:`Export as CSV`},{key:`xlsx`,label:`Export as Excel (.xlsx)`}],onClick:({key:e})=>{window.location.href=s8.exportUrl(s,e)}},children:(0,Z.jsx)(Vk,{icon:(0,Z.jsx)(FZ,{}),children:`Export`})}),(0,Z.jsx)(Vk,{icon:(0,Z.jsx)(VQ,{}),onClick:()=>o(!0),children:`Import`}),(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(cP,{}),onClick:()=>i(!0),children:`New application`})]})]}),(0,Z.jsx)(bF,{size:`small`,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsx)(_V,{allowClear:!0,size:`large`,prefix:(0,Z.jsx)(xE,{}),placeholder:`Search by meaning — try “server-side developer” or “remote fintech”`,defaultValue:t.get(`q`)??``,onChange:e=>{e.target.value===``&&p({q:``})},onPressEnter:e=>p({q:e.target.value})}),(0,Z.jsxs)(Xz,{gap:8,wrap:!0,children:[(0,Z.jsx)(HR.RangePicker,{allowClear:!0,value:v,presets:b,format:`YYYY-MM-DD`,onChange:e=>x(e)}),(0,Z.jsx)(EE,{mode:`multiple`,allowClear:!0,placeholder:`Status`,style:{minWidth:180},suffixIcon:(0,Z.jsx)(aQ,{}),value:t.get(`status`)?.split(`,`)??[],onChange:e=>p({status:e}),options:HQ.map(e=>({value:e,label:KQ[e]}))}),(0,Z.jsx)(EE,{mode:`multiple`,allowClear:!0,placeholder:`Work mode`,style:{minWidth:160},value:t.get(`workMode`)?.split(`,`)??[],onChange:e=>p({workMode:e}),options:qQ.map(e=>({value:e,label:JQ[e]}))}),(0,Z.jsx)(EE,{mode:`multiple`,allowClear:!0,placeholder:`Tags`,style:{minWidth:200},value:t.get(`tags`)?.split(`,`)??[],onChange:e=>p({tags:e}),options:(f?.tags??[]).map(e=>({value:e.name,label:e.name}))}),(0,Z.jsx)(EE,{style:{minWidth:170},value:t.get(`sort`)??`appliedOn`,onChange:e=>p({sort:e}),options:[{value:`appliedOn`,label:`Sort: date applied`},{value:`company`,label:`Sort: company`},{value:`jobTitle`,label:`Sort: job title`},{value:`status`,label:`Sort: status`}]}),(0,Z.jsx)(EE,{style:{width:130},value:t.get(`direction`)??`desc`,onChange:e=>p({direction:e}),options:[{value:`desc`,label:`Newest first`},{value:`asc`,label:`Oldest first`}]})]}),c?.searched&&!c.semanticReady&&(0,Z.jsx)(jp,{type:`info`,showIcon:!0,icon:(0,Z.jsx)(RQ,{}),message:`Results will improve shortly — the semantic model is still loading.`})]})}),(0,Z.jsx)(hY,{rowKey:`id`,columns:m,dataSource:c?.items??[],loading:l||u,pagination:!1,onRow:t=>({onClick:()=>e(`/applications/${t.id}`),style:{cursor:`pointer`}}),locale:{emptyText:(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:t.get(`q`)?`Nothing matched “${t.get(`q`)}”`:`No applications for this filter`})},footer:c?.hasMore?()=>(0,Z.jsx)(Xz,{justify:`center`,children:(0,Z.jsx)(gD,{title:`Loads the next page`,children:(0,Z.jsx)(Vk,{onClick:()=>n5(t,n,c.cursor),children:`Load more`})})}):void 0})]})}),(0,Z.jsx)(G8,{open:r,onClose:()=>i(!1)}),(0,Z.jsx)(e5,{open:a,onClose:()=>o(!1)})]})}function n5(e,t,n){if(!n)return;let r=new URLSearchParams(e);r.set(`cursor`,n),t(r)}function r5(){let{id:e}=Qe(),t=Xe(),{message:n}=NC.useApp(),{data:r,isLoading:i}=d8(e),a=S8(),o=C8(),[s,c]=(0,_.useState)(!1);if(i||!r)return(0,Z.jsx)(CS,{active:!0,paragraph:{rows:10}});let l=WQ(r.status);async function u(t){e&&(await a.mutateAsync({id:e,body:{status:t,comment:null}}),n.success(`Moved to ${KQ[t]}`))}return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`flex-start`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Vk,{type:`link`,icon:(0,Z.jsx)(WZ,{}),style:{padding:0},onClick:()=>t(`/applications`),children:`Back to applications`}),(0,Z.jsx)(YX.Title,{level:3,style:{margin:0},children:r.jobTitle}),(0,Z.jsxs)(Pz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/companies/${r.company.id}`,children:r.company.name}),(0,Z.jsxs)(YX.Text,{type:`secondary`,children:[`applied `,r.appliedOn]}),(0,Z.jsx)(R8,{status:r.status})]})]}),(0,Z.jsxs)(Pz,{wrap:!0,children:[l&&(0,Z.jsxs)(Vk,{type:`primary`,onClick:()=>void u(l),children:[`Move to `,KQ[l]]}),(0,Z.jsx)(EE,{style:{width:150},value:r.status,onChange:e=>void u(e),options:HQ.map(e=>({value:e,label:KQ[e]}))}),(0,Z.jsx)(Vk,{icon:(0,Z.jsx)(QY,{}),onClick:()=>c(!0),children:`Edit`}),(0,Z.jsx)(VH,{title:`Delete this application?`,description:`Its notes and status history go too. This cannot be undone.`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{e&&(await o.mutateAsync(e),n.success(`Application deleted`),t(`/applications`))},children:(0,Z.jsx)(Vk,{danger:!0,icon:(0,Z.jsx)(YY,{})})})]})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:24,lg:14,children:(0,Z.jsx)(bF,{title:`Details`,children:(0,Z.jsxs)(nz,{column:{xs:1,sm:2},size:`small`,bordered:!0,children:[(0,Z.jsx)(nz.Item,{label:`Company`,children:r.company.name}),(0,Z.jsx)(nz.Item,{label:`Applied on`,children:r.appliedOn}),(0,Z.jsx)(nz.Item,{label:`Location`,children:r.location??`—`}),(0,Z.jsx)(nz.Item,{label:`Work mode`,children:JQ[r.workMode]}),(0,Z.jsx)(nz.Item,{label:`Source`,children:r.sourceName??`—`}),(0,Z.jsx)(nz.Item,{label:`Follow up`,children:r.followUpOn??`—`}),(0,Z.jsx)(nz.Item,{label:`Salary`,span:2,children:r.salaryMin||r.salaryMax?`${r.salaryMin?.toLocaleString()??`?`} – ${r.salaryMax?.toLocaleString()??`?`} ${r.salaryCurrency??``}`:`—`}),(0,Z.jsx)(nz.Item,{label:`Posting`,span:2,children:r.jobUrl?(0,Z.jsx)(`a`,{href:r.jobUrl,target:`_blank`,rel:`noreferrer`,children:(0,Z.jsxs)(Pz,{size:4,children:[(0,Z.jsx)(dQ,{}),r.jobUrl]})}):`—`}),(0,Z.jsx)(nz.Item,{label:`Tags`,span:2,children:r.tags.length>0?(0,Z.jsx)(Pz,{size:4,wrap:!0,children:r.tags.map(e=>(0,Z.jsx)(OY,{children:e.name},e.id))}):`—`})]})})}),(0,Z.jsx)(II,{xs:24,lg:10,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(bF,{title:`Status history`,children:r.statusEvents.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No changes recorded`}):(0,Z.jsx)(KY,{items:r.statusEvents.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Text,{strong:!0,children:e.fromStatus?`${KQ[e.fromStatus]} → ${KQ[e.toStatus]}`:`Applied`}),(0,Z.jsx)(YX.Text,{type:`secondary`,style:{fontSize:12},children:e.occurredOn}),e.comment&&(0,Z.jsx)(YX.Text,{children:e.comment})]})}))})}),(0,Z.jsx)(bF,{title:`Notes (${r.notes.length})`,children:r.notes.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No notes yet`}):(0,Z.jsx)(NH,{size:`small`,dataSource:r.notes,renderItem:e=>(0,Z.jsx)(NH.Item,{children:(0,Z.jsx)(NH.Item.Meta,{title:e.title,description:(0,Z.jsx)(YX.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:4,expandable:!0,symbol:`more`},children:e.body})})})})})]})})]}),(0,Z.jsx)(G8,{open:s,onClose:()=>c(!1),application:r})]})}function i5(){let e=Xe(),[t,n]=(0,_.useState)(``),r=z8(t,300),{data:i,isLoading:a}=h8(r?{q:r}:{});return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Companies`}),(0,Z.jsx)(_V,{allowClear:!0,prefix:(0,Z.jsx)(xE,{}),placeholder:`Find a company`,style:{maxWidth:320},value:t,onChange:e=>n(e.target.value)})]}),(0,Z.jsx)(bF,{size:`small`,children:(0,Z.jsx)(hY,{rowKey:`id`,size:`middle`,loading:a,columns:[{title:`Company`,dataIndex:`name`,render:(e,t)=>(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Text,{strong:!0,children:e}),t.website&&(0,Z.jsx)(YX.Link,{href:t.website,target:`_blank`,style:{fontSize:12},children:t.website.replace(/^https?:\/\//,``)})]}),sorter:(e,t)=>e.name.localeCompare(t.name)},{title:`Applications`,dataIndex:`applicationCount`,width:140,align:`right`,sorter:(e,t)=>e.applicationCount-t.applicationCount,defaultSortOrder:`descend`,render:e=>(0,Z.jsx)(YX.Text,{strong:e>2,type:e>2?`warning`:void 0,children:e})},{title:`Active`,dataIndex:`activeCount`,width:90,align:`right`},{title:`Last applied`,dataIndex:`lastAppliedOn`,width:130,sorter:(e,t)=>(e.lastAppliedOn??``).localeCompare(t.lastAppliedOn??``),render:e=>e??(0,Z.jsx)(YX.Text,{type:`secondary`,children:`—`})},{title:`Tags`,key:`tags`,width:260,render:(e,t)=>(0,Z.jsx)(Pz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(OY,{style:{marginInlineEnd:0},children:e.name},e.id))})}],dataSource:i?.companies??[],pagination:{pageSize:25,hideOnSinglePage:!0},onRow:t=>({onClick:()=>e(`/companies/${t.id}`),style:{cursor:`pointer`}})})})]})}function a5(){let{id:e}=Qe(),t=Xe(),{data:n,isLoading:r}=g8(e),{data:i}=_8(e?{targetType:`company`,targetId:e}:{}),{data:a}=m8(),o=w8();if(r||!n)return(0,Z.jsx)(CS,{active:!0,paragraph:{rows:8}});let{company:s,applications:c}=n,l=c.filter(e=>[`applied`,`screening`,`interview`].includes(e.status)).length;return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Vk,{type:`link`,icon:(0,Z.jsx)(WZ,{}),style:{padding:0},onClick:()=>t(`/companies`),children:`Back to companies`}),(0,Z.jsx)(YX.Title,{level:3,style:{margin:0},children:s.name}),s.website&&(0,Z.jsx)(YX.Link,{href:s.website,target:`_blank`,children:s.website})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Applications`,value:c.length})})}),(0,Z.jsx)(II,{xs:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Still active`,value:l,valueStyle:{color:q8.accent}})})}),(0,Z.jsx)(II,{xs:24,md:12,children:(0,Z.jsx)(bF,{children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Company tags`}),(0,Z.jsx)(EE,{mode:`tags`,style:{width:`100%`},placeholder:`fintech, remote-first…`,value:s.tags.map(e=>e.name),options:(a?.tags??[]).map(e=>({value:e.name,label:e.name})),onChange:t=>{e&&o.mutate({id:e,body:{tags:t}})}})]})})})]}),(0,Z.jsx)(bF,{title:`Application history`,children:(0,Z.jsx)(hY,{rowKey:`id`,size:`middle`,columns:[{title:`Applied`,dataIndex:`appliedOn`,width:120},{title:`Job title`,dataIndex:`jobTitle`,render:e=>(0,Z.jsx)(YX.Text,{strong:!0,children:e})},{title:`Status`,dataIndex:`status`,width:120,render:(e,t)=>(0,Z.jsx)(R8,{status:t.status})},{title:`Source`,dataIndex:`sourceName`,width:130}],dataSource:c,pagination:!1,onRow:e=>({onClick:()=>t(`/applications/${e.id}`),style:{cursor:`pointer`}})})}),(0,Z.jsx)(bF,{title:`Notes about ${s.name}`,children:(i?.notes??[]).length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No notes about this company`}):(0,Z.jsx)(NH,{dataSource:i?.notes??[],renderItem:e=>(0,Z.jsx)(NH.Item,{children:(0,Z.jsx)(NH.Item.Meta,{title:e.title,description:(0,Z.jsx)(YX.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},children:e.body})})})})})]})}function o5(){let{message:e}=NC.useApp(),[t,n]=(0,_.useState)(`all`),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),{data:l,isLoading:u}=_8(t===`all`?{}:{targetType:t}),d=E8(),f=l?.notes??[],p=(0,_.useMemo)(()=>{let e=r.trim().toLowerCase();return e?f.filter(t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||(t.targetLabel?.toLowerCase().includes(e)??!1)):f},[f,r]);return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Notes`}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(XI,{value:t,onChange:e=>n(e),options:[{label:`All`,value:`all`},{label:`Standalone`,value:`standalone`},{label:`Companies`,value:`company`},{label:`Applications`,value:`application`}]}),(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(cP,{}),onClick:()=>c(!0),children:`New note`})]})]}),(0,Z.jsx)(_V,{allowClear:!0,prefix:(0,Z.jsx)(xE,{}),placeholder:`Search notes by title, body, or what they're attached to`,value:r,onChange:e=>i(e.target.value)}),(0,Z.jsx)(bF,{size:`small`,loading:u,children:p.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:r?`Nothing matched “${r}”`:`No notes here yet`}):(0,Z.jsx)(NH,{dataSource:p,renderItem:t=>(0,Z.jsx)(NH.Item,{actions:[(0,Z.jsx)(Vk,{type:`text`,icon:(0,Z.jsx)(QY,{}),onClick:()=>o(t)},`edit`),(0,Z.jsx)(VH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await d.mutateAsync(t.id),e.success(`Note deleted`)},children:(0,Z.jsx)(Vk,{type:`text`,danger:!0,icon:(0,Z.jsx)(YY,{})})},`delete`)],children:(0,Z.jsx)(NH.Item.Meta,{title:(0,Z.jsxs)(Pz,{size:8,wrap:!0,children:[t.pinned&&(0,Z.jsx)(bQ,{style:{color:`#faad14`}}),(0,Z.jsx)(YX.Text,{strong:!0,children:t.title}),(0,Z.jsx)(s5,{note:t})]}),description:(0,Z.jsx)(YX.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:3,expandable:!0,symbol:`more`},children:t.body})})})})}),(0,Z.jsx)(c5,{open:s||a!==null,note:a,onClose:()=>{c(!1),o(null)}})]})}function s5({note:e}){if(e.targetType===`standalone`)return(0,Z.jsx)(OY,{children:`general`});if(!e.targetId)return(0,Z.jsx)(OY,{children:`unlinked`});let t=e.targetType===`company`?`/companies/${e.targetId}`:`/applications/${e.targetId}`;return(0,Z.jsx)(dn,{to:t,children:(0,Z.jsxs)(OY,{color:`blue`,children:[e.targetType,`: `,e.targetLabel??`view`]})})}function c5({open:e,note:t,onClose:n}){let[r]=WB.useForm(),{message:i}=NC.useApp(),a=T8(),o=WB.useWatch(`targetType`,r)??`standalone`,{data:s}=h8(),{data:c}=u8({limit:200}),l=(0,_.useMemo)(()=>o===`company`?(s?.companies??[]).map(e=>({value:e.id,label:e.name})):o===`application`?(c?.items??[]).map(e=>({value:e.id,label:`${e.jobTitle} — ${e.company.name}`})):[],[o,s,c]);return(0,Z.jsx)(LH,{open:e,title:t?`Edit note`:`New note`,okText:`Save`,destroyOnHidden:!0,onCancel:n,afterOpenChange:e=>{e&&(t?r.setFieldsValue({title:t.title,body:t.body,targetType:t.targetType,targetId:t.targetId,pinned:t.pinned}):(r.resetFields(),r.setFieldsValue({targetType:`standalone`,pinned:!1,body:``})))},onOk:async()=>{let e=await r.validateFields();await a.mutateAsync({...t?{id:t.id}:{},body:{title:e.title,body:e.body??``,targetType:e.targetType,targetId:e.targetType===`standalone`?null:e.targetId??null,pinned:e.pinned??!1}}),i.success(t?`Note updated`:`Note saved`),n()},children:(0,Z.jsxs)(WB,{form:r,layout:`vertical`,children:[(0,Z.jsx)(WB.Item,{name:`title`,label:`Title`,rules:[{required:!0,message:`Title is required`}],children:(0,Z.jsx)(_V,{placeholder:`Interview prep, salary research…`})}),(0,Z.jsx)(WB.Item,{name:`body`,label:`Note`,children:(0,Z.jsx)(_V.TextArea,{rows:8,placeholder:`Anything worth keeping`})}),(0,Z.jsxs)(Xz,{gap:12,children:[(0,Z.jsx)(WB.Item,{name:`targetType`,label:`Attach to`,style:{flex:1},children:(0,Z.jsx)(EE,{options:[{value:`standalone`,label:`Nothing in particular`},{value:`company`,label:`A company`},{value:`application`,label:`An application`}],onChange:()=>r.setFieldValue(`targetId`,null)})}),o!==`standalone`&&(0,Z.jsx)(WB.Item,{name:`targetId`,label:o===`company`?`Company`:`Application`,style:{flex:2},rules:[{required:!0,message:`Pick what this note is about`}],children:(0,Z.jsx)(EE,{showSearch:!0,optionFilterProp:`label`,options:l})})]}),(0,Z.jsx)(WB.Item,{name:`pinned`,label:`Pinned`,valuePropName:`checked`,children:(0,Z.jsx)(XW,{})})]})})}function l5({open:e,onClose:t,opening:n}){let[r]=WB.useForm(),{message:i}=NC.useApp(),a=!!n,o=k8(),s=A8(),{data:c}=y8(WB.useWatch(`companyName`,r)??``);(0,_.useEffect)(()=>{e&&(n?r.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,savedOn:(0,Yk.default)(n.savedOn),jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,notes:n.notes??void 0}):(r.resetFields(),r.setFieldsValue({savedOn:(0,Yk.default)(),workMode:`unspecified`})))},[e,n,r]);let l=(0,_.useMemo)(()=>(c?.companies??[]).map(e=>({value:e.name})),[c]);async function u(e){let c={companyName:e.companyName,jobTitle:e.jobTitle,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,notes:e.notes??null,...a?{}:{savedOn:e.savedOn.format(`YYYY-MM-DD`)}};try{n?(await s.mutateAsync({id:n.id,body:c}),i.success(`Opening updated`)):(await o.mutateAsync(c),i.success(`Opening saved`)),t()}catch(e){e instanceof Y6&&e.fieldErrors.length>0?(r.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),i.error(`Please check the highlighted fields`)):i.error(e instanceof Error?e.message:`Could not save`)}}return(0,Z.jsxs)(Tz,{title:a?`Edit opening`:`Save opening for later`,open:e,onClose:t,width:560,destroyOnHidden:!0,extra:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Vk,{type:`primary`,loading:o.isPending||s.isPending,onClick:()=>r.submit(),children:a?`Save changes`:`Save opening`})]}),children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,children:`For a role you found but are not ready to apply to yet — no status, no tags, just enough to find it again. Convert it into a real application when you are ready.`}),(0,Z.jsxs)(WB,{form:r,layout:`vertical`,onFinish:u,requiredMark:`optional`,children:[(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(NE,{options:l,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(_V,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`savedOn`,label:`Found on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`,disabled:a})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(EE,{options:qQ.map(e=>({value:e,label:JQ[e]}))})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(_V,{placeholder:`Stockholm`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(_V,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(WB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(_V,{placeholder:`LinkedIn, referral…`})}),(0,Z.jsx)(WB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(_V,{placeholder:`https://…`})}),(0,Z.jsx)(WB.Item,{name:`notes`,label:`Notes`,children:(0,Z.jsx)(_V.TextArea,{rows:4,placeholder:`Why this looked interesting, what you're missing to apply…`})})]})]})}function u5(){let e=Xe(),{message:t}=NC.useApp(),[n,r]=(0,_.useState)(`active`),{data:i,isLoading:a}=D8(n===`archived`?{archived:!0}:{}),{data:o}=m8(),s=j8(),c=M8(),l=A8(),u=(0,_.useMemo)(()=>{let e=i?.openings??[];return n===`archived`?e.filter(e=>e.archived):e},[i,n]),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(void 0),[h,g]=(0,_.useState)(null),[v]=WB.useForm();function y(e){g(e),v.setFieldsValue({appliedOn:(0,Yk.default)(),status:`applied`,tags:[]})}async function b(n){if(h)try{let r=await c.mutateAsync({id:h.id,body:{appliedOn:n.appliedOn.format(`YYYY-MM-DD`),status:n.status,tags:n.tags??[]}});t.success(`Converted to an application`),g(null),e(`/applications/${r.id}`)}catch(e){t.error(e instanceof Error?e.message:`Could not convert`)}}async function x(e){try{await l.mutateAsync({id:e.id,body:{archived:!1}}),t.success(`Opening restored`)}catch(e){t.error(e instanceof Error?e.message:`Could not restore`)}}let S=[{title:`Company`,dataIndex:[`company`,`name`]},{title:`Job title`,dataIndex:`jobTitle`},{title:`Found on`,dataIndex:`savedOn`,width:120},{title:`Location`,key:`location`,render:(e,t)=>[t.location,JQ[t.workMode]].filter(Boolean).join(` · `)||(0,Z.jsx)(YX.Text,{type:`secondary`,children:`—`})},{title:`Source`,dataIndex:`sourceName`,render:e=>e??`—`}],C=e=>e.jobUrl&&(0,Z.jsx)(gD,{title:`Open job posting`,children:(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(dQ,{}),href:e.jobUrl,target:`_blank`,rel:`noreferrer`})}),w=e=>(0,Z.jsx)(VH,{title:`Delete this opening?`,description:`This removes it for good and cannot be undone.`,onConfirm:()=>s.mutate(e.id),okText:`Delete`,okButtonProps:{danger:!0},children:(0,Z.jsx)(Vk,{size:`small`,danger:!0,children:`Delete`})}),T=[...S,{title:``,key:`actions`,width:260,render:(e,t)=>(0,Z.jsxs)(Pz,{onClick:e=>e.stopPropagation(),children:[C(t),(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(qB,{}),onClick:()=>y(t),children:`Convert`}),(0,Z.jsx)(Vk,{size:`small`,onClick:()=>{m(t),f(!0)},children:`Edit`}),w(t)]})}],E=[...S,{title:`Archived because`,key:`reason`,width:160,render:(e,t)=>t.convertedApplicationId?(0,Z.jsx)(dn,{to:`/applications/${t.convertedApplicationId}`,children:(0,Z.jsx)(OY,{color:`blue`,children:`Converted`})}):(0,Z.jsx)(OY,{children:`Archived by hand`})},{title:``,key:`actions`,width:220,render:(e,t)=>(0,Z.jsxs)(Pz,{onClick:e=>e.stopPropagation(),children:[C(t),(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(CQ,{}),loading:l.isPending,onClick:()=>x(t),children:`Restore`}),w(t)]})}];return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Job openings`}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:n===`active`?`Saved for later — convert one to a real application when you're ready to apply.`:`Openings that were converted into an application or archived by hand.`})]}),(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(cP,{}),onClick:()=>{m(void 0),f(!0)},children:`Save opening for later`})]}),(0,Z.jsx)(XI,{value:n,onChange:r,options:[{label:`Active`,value:`active`},{label:`Archived`,value:`archived`}]}),(0,Z.jsx)(bF,{size:`small`,children:(0,Z.jsx)(hY,{rowKey:`id`,columns:n===`archived`?E:T,dataSource:u,loading:a,pagination:!1,locale:{emptyText:(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:n===`active`?`Nothing saved yet — use “Save opening for later” for a role you're not ready to apply to.`:`No archived openings.`})}})}),(0,Z.jsx)(l5,{open:d,onClose:()=>f(!1),opening:p}),(0,Z.jsx)(LH,{title:h?`Convert "${h.jobTitle}" at ${h.company.name}`:``,open:!!h,onCancel:()=>g(null),onOk:()=>v.submit(),okText:`Create application`,confirmLoading:c.isPending,children:(0,Z.jsxs)(WB,{form:v,layout:`vertical`,onFinish:b,children:[(0,Z.jsx)(WB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0}],children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`})}),(0,Z.jsx)(WB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(EE,{options:HQ.map(e=>({value:e,label:KQ[e]}))})}),(0,Z.jsx)(WB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(EE,{mode:`tags`,options:(o?.tags??[]).map(e=>({value:e.name,label:e.name})),placeholder:`fintech, remote-ok…`,tokenSeparators:[`,`]})})]})})]})}var d5={companies:`Companies`,applications:`Applications`,tags:`Tags`,tagLinks:`Tag links`,notes:`Notes`,statusEvents:`Status events`,jobOpenings:`Job openings`};function f5({counts:e}){return(0,Z.jsx)(nz,{size:`small`,column:2,bordered:!0,children:Object.entries(e).map(([e,t])=>(0,Z.jsx)(nz.Item,{label:d5[e]??e,children:t},e))})}function p5(){let{message:e}=NC.useApp(),{data:t,isLoading:n}=N8(),r=P8(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current&&clearInterval(c.current)},[]);function l(t){LH.confirm({title:`Switch to "${t}"?`,content:"The server restarts to connect to the new target. This page will reconnect and reload automatically once it is back — under `npm run dev`, that may require restarting it by hand.",okText:`Switch and restart`,onOk:async()=>{try{await r.mutateAsync(t)}catch(t){e.error(t instanceof Error?t.message:`Could not switch database`);return}s(!0),c.current=setInterval(()=>{s8.getDbTargets().then(()=>{c.current&&clearInterval(c.current),window.location.reload()}).catch(()=>{})},500)}})}if(o)return(0,Z.jsx)(bF,{title:`Database`,children:(0,Z.jsx)(zU,{icon:(0,Z.jsx)(CU,{spin:!0}),title:`Reconnecting…`,subTitle:`Waiting for the server to come back up.`})});let u=t?.targets??[];return(0,Z.jsx)(bF,{title:`Database`,loading:n,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)(YX.Paragraph,{type:`secondary`,style:{marginBottom:0},children:[`Connection settings live in `,(0,Z.jsx)(`code`,{children:`.env`}),` and are never shown or editable here.`,u.length<=1&&` Only one target is configured, so there is nothing to switch between.`]}),(0,Z.jsx)(nz,{size:`small`,column:1,bordered:!0,children:(0,Z.jsx)(nz.Item,{label:`Active target`,children:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)($Z,{}),t?.active,` (`,u.find(e=>e.name===t?.active)?.driver,`)`]})})}),u.length>1&&(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(EE,{style:{width:220},value:i??t?.active,options:u.map(e=>({value:e.name,label:`${e.name} (${e.driver})`})),onChange:a}),(0,Z.jsx)(Vk,{type:`primary`,disabled:!i||i===t?.active,loading:r.isPending,onClick:()=>i&&l(i),children:`Switch`})]})]})})}function m5(){let{message:e}=NC.useApp(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1);function p(){n(null),i(null),o(null),u(null)}function m(){p(),f(!1)}let h=e=>(n(e),u(null),c(!0),s8.previewBackup(e).then(i).catch(e=>u(e instanceof Error?e.message:`Could not read that file`)).finally(()=>c(!1)),!1);function g(){t&&LH.confirm({title:`Replace all data in the active database?`,content:`Every table is wiped and recreated from this backup. This cannot be undone.`,okText:`Restore`,okButtonProps:{danger:!0},onOk:async()=>{c(!0),u(null);try{let e=await s8.commitBackup(t);o(e)}catch(t){e.error(t instanceof Error?t.message:`Restore failed`)}finally{c(!1)}}})}return(0,Z.jsxs)(bF,{title:`Backup & restore`,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`A full-fidelity snapshot of every table — every field, every relation, driver-agnostic. Not the same as the CSV/Excel export elsewhere in the app, which is a lossy report meant for people to read. This file is scrambled (gzip + obfuscation) so it isn't plain, readable JSON at rest — that's an obfuscation step, not encryption, and does not protect the personal data inside from anyone who actually wants it.`}),(0,Z.jsx)(Vk,{icon:(0,Z.jsx)($Z,{}),onClick:()=>{window.location.href=s8.backupExportUrl},children:`Export backup`}),(0,Z.jsx)(Vk,{onClick:()=>f(!0),children:`Restore from backup…`})]}),(0,Z.jsx)(LH,{title:`Restore from backup`,open:d,onCancel:m,width:600,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!r&&!a&&(0,Z.jsxs)(VZ.Dragger,{accept:`.jtbak`,maxCount:1,showUploadList:!1,beforeUpload:h,disabled:s,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(cQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a JobTrack backup file (.jtbak) here`})]}),l&&(0,Z.jsx)(jp,{type:`error`,showIcon:!0,message:l}),r&&!a&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(YX.Text,{type:`secondary`,children:[`Backup taken `,new Date(r.exportedAt).toLocaleString(),`. Restoring will replace everything currently in the active database with:`]}),(0,Z.jsx)(f5,{counts:r.counts}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:p,children:`Choose a different file`}),(0,Z.jsx)(Vk,{type:`primary`,danger:!0,loading:s,onClick:g,children:`Restore`})]})]}),a&&(0,Z.jsx)(zU,{status:`success`,title:`Restore complete`,extra:(0,Z.jsxs)(Pz,{direction:`vertical`,style:{width:`100%`},children:[(0,Z.jsx)(f5,{counts:a.counts}),(0,Z.jsx)(Vk,{type:`primary`,onClick:()=>window.location.reload(),children:`Reload`})]})})]})})]})}var h5=`CLEAR`;function g5(){let{message:e}=NC.useApp(),{data:t,isLoading:n}=F8(),r=I8(),i=L8(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``);function l(){o(!1),c(``)}function u(){r.mutate(void 0,{onSuccess:()=>{e.success(`Database cleared`),l()},onError:t=>e.error(t instanceof Error?t.message:`Could not clear the database`)})}function d(){i.mutate(void 0,{onSuccess:t=>e.success(`Seeded ${t.applications} applications and ${t.companies} companies`),onError:t=>e.error(t instanceof Error?t.message:`Could not seed the database`)})}let f=t?.counts??{};return(0,Z.jsxs)(bF,{title:`Reset & demo data`,loading:n,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`Wipe everything in the active database, or — only while it's empty — fill it with a realistic multi-year demo dataset to explore the app with.`}),!t?.empty&&(0,Z.jsx)(f5,{counts:f}),(0,Z.jsxs)(Pz,{wrap:!0,children:[t?.empty&&(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(nQ,{}),loading:i.isPending,onClick:d,children:`Seed with demo data`}),(0,Z.jsx)(Vk,{danger:!0,disabled:t?.empty,onClick:()=>o(!0),children:`Clear database…`})]})]}),(0,Z.jsx)(LH,{title:`Clear the active database?`,open:a,onCancel:l,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(jp,{type:`warning`,showIcon:!0,message:`This permanently deletes every row below. There is no undo — export a backup first if you might want this data again.`}),(0,Z.jsx)(f5,{counts:f}),(0,Z.jsxs)(YX.Text,{children:[`Type `,(0,Z.jsx)(YX.Text,{code:!0,children:h5}),` to confirm.`]}),(0,Z.jsx)(_V,{value:s,onChange:e=>c(e.target.value),placeholder:h5,onPressEnter:()=>s===h5&&u()}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:l,children:`Cancel`}),(0,Z.jsx)(Vk,{danger:!0,type:`primary`,disabled:s!==h5,loading:r.isPending,onClick:u,children:`Clear database`})]})]})})]})}function _5(){return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Settings`}),(0,Z.jsx)(p5,{}),(0,Z.jsx)(m5,{}),(0,Z.jsx)(g5,{})]})}var v5=`jobtrack.theme`,y5=[{key:`/dashboard`,icon:(0,Z.jsx)(XZ,{}),label:(0,Z.jsx)(dn,{to:`/dashboard`,children:`Dashboard`})},{key:`/applications`,icon:(0,Z.jsx)(_Q,{}),label:(0,Z.jsx)(dn,{to:`/applications`,children:`Applications`})},{key:`/openings`,icon:(0,Z.jsx)(qZ,{}),label:(0,Z.jsx)(dn,{to:`/openings`,children:`Openings`})},{key:`/companies`,icon:(0,Z.jsx)(MQ,{}),label:(0,Z.jsx)(dn,{to:`/companies`,children:`Companies`})},{key:`/notes`,icon:(0,Z.jsx)($z,{}),label:(0,Z.jsx)(dn,{to:`/notes`,children:`Notes`})},{key:`/settings`,icon:(0,Z.jsx)(kQ,{}),label:(0,Z.jsx)(dn,{to:`/settings`,children:`Settings`})}],b5=[{key:`light`,icon:(0,Z.jsx)(FQ,{}),label:`Light`},{key:`dark`,icon:(0,Z.jsx)(mQ,{}),label:`Dark`}];function x5(){let[e,t]=(0,_.useState)(()=>{try{let e=localStorage.getItem(v5);if(e)return e===`dark`}catch{}return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1});(0,_.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e?`dark`:`light`);try{localStorage.setItem(v5,e?`dark`:`light`)}catch{}},[e]);let n=qe(),r=(0,_.useMemo)(()=>{let e=y5.find(e=>n.pathname.startsWith(e.key));return e?[e.key]:[`/dashboard`]},[n.pathname]);return(0,Z.jsx)(Nh,{theme:J8(e?`dark`:`light`),children:(0,Z.jsx)(NC,{children:(0,Z.jsxs)(EV,{style:{minHeight:`100vh`},children:[(0,Z.jsxs)(EV.Header,{style:{display:`flex`,alignItems:`center`,gap:24,paddingInline:24,borderBottom:`1px solid ${q8.border}`,position:`sticky`,top:0,zIndex:10},children:[(0,Z.jsxs)(YX.Title,{level:4,style:{margin:0,whiteSpace:`nowrap`},children:[`Job`,(0,Z.jsx)(`span`,{style:{color:q8.accent},children:`Track`})]}),(0,Z.jsx)(Fk,{mode:`horizontal`,selectedKeys:r,items:y5,style:{flex:1,minWidth:0,borderBottom:`none`}}),(0,Z.jsx)(Iz,{trigger:[`click`],menu:{items:b5,selectable:!0,selectedKeys:[e?`dark`:`light`],onClick:({key:e})=>t(e===`dark`)},children:(0,Z.jsx)(Vk,{icon:e?(0,Z.jsx)(mQ,{}):(0,Z.jsx)(FQ,{}),"aria-label":`Theme settings`,children:`Theme`})})]}),(0,Z.jsx)(EV.Content,{style:{padding:24},children:(0,Z.jsxs)(Ct,{children:[(0,Z.jsx)(xt,{path:`/`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})}),(0,Z.jsx)(xt,{path:`/dashboard`,element:(0,Z.jsx)(Y8,{})}),(0,Z.jsx)(xt,{path:`/applications`,element:(0,Z.jsx)(t5,{})}),(0,Z.jsx)(xt,{path:`/applications/:id`,element:(0,Z.jsx)(r5,{})}),(0,Z.jsx)(xt,{path:`/openings`,element:(0,Z.jsx)(u5,{})}),(0,Z.jsx)(xt,{path:`/companies`,element:(0,Z.jsx)(i5,{})}),(0,Z.jsx)(xt,{path:`/companies/:id`,element:(0,Z.jsx)(a5,{})}),(0,Z.jsx)(xt,{path:`/notes`,element:(0,Z.jsx)(o5,{})}),(0,Z.jsx)(xt,{path:`/settings`,element:(0,Z.jsx)(_5,{})}),(0,Z.jsx)(xt,{path:`*`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})})]})})]})})})}var S5=new Pr({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}});(0,v.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(_.StrictMode,{children:(0,Z.jsx)(En,{client:S5,children:(0,Z.jsx)(un,{children:(0,Z.jsx)(x5,{})})})}));
|
|
444
|
-
//# sourceMappingURL=index-
|
|
443
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function M4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:F4(t,`input`,e.processors),output:F4(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function N4(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return N4(r.element,n);if(r.type===`set`)return N4(r.valueType,n);if(r.type===`lazy`)return N4(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return N4(r.innerType,n);if(r.type===`intersection`)return N4(r.left,n)||N4(r.right,n);if(r.type===`record`||r.type===`map`)return N4(r.keyType,n)||N4(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:N4(r.in,n)||N4(r.out,n);if(r.type===`object`){for(let e in r.shape)if(N4(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(N4(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(N4(e,n))return!0;return!!(r.rest&&N4(r.rest,n))}return!1}var P4=(e,t={})=>n=>{let r=k4({...n,processors:t});return A4(e,r),j4(r,e),M4(r,e)},F4=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=k4({...i??{},target:a,io:t,processors:n});return A4(e,o),j4(o,e),M4(o,e)},I4={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},L4=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=I4[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},R4=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},z4=(e,t,n,r)=>{n.type=`boolean`},B4=(e,t,n,r)=>{n.not={}},V4=(e,t,n,r)=>{let i=e._zod.def,a=p$(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},H4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},U4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},W4=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=A4(a.element,t,{...r,path:[...r.path,`items`]})},G4=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=A4(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=A4(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},K4=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>A4(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},q4=(e,t,n,r)=>{let i=e._zod.def,a=A4(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=A4(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},J4=(e,t,n,r)=>{let i=e._zod.def,a=A4(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Y4=(e,t,n,r)=>{let i=e._zod.def;A4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},X4=(e,t,n,r)=>{let i=e._zod.def;A4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Z4=(e,t,n,r)=>{let i=e._zod.def;A4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Q4=(e,t,n,r)=>{let i=e._zod.def;A4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},$4=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;A4(o,t,r);let s=t.seen.get(e);s.ref=o},e3=(e,t,n,r)=>{let i=e._zod.def;A4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},t3=(e,t,n,r)=>{let i=e._zod.def;A4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},n3=c$(`ZodISODateTime`,(e,t)=>{T0.init(e,t),k3.init(e,t)});function r3(e){return Y2(n3,e)}var i3=c$(`ZodISODate`,(e,t)=>{E0.init(e,t),k3.init(e,t)});function a3(e){return X2(i3,e)}var o3=c$(`ZodISOTime`,(e,t)=>{D0.init(e,t),k3.init(e,t)});function s3(e){return Z2(o3,e)}var c3=c$(`ZodISODuration`,(e,t)=>{O0.init(e,t),k3.init(e,t)});function l3(e){return Q2(c3,e)}var u3=c$(`ZodError`,(e,t)=>{Z$.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>e1(e,t)},flatten:{value:t=>$$(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,m$,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,m$,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),d3=t1(u3),f3=n1(u3),p3=r1(u3),m3=a1(u3),h3=s1(u3),g3=c1(u3),_3=l1(u3),v3=u1(u3),y3=d1(u3),b3=f1(u3),x3=p1(u3),S3=m1(u3),C3=new WeakMap;function w3(e,t,n){let r=Object.getPrototypeOf(e),i=C3.get(r);if(i||(i=new Set,C3.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var T3=c$(`ZodType`,(e,t)=>(d0.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:F4(e,`input`),output:F4(e,`output`)}}),e.toJSONSchema=P4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>d3(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>p3(e,t,n),e.parseAsync=async(t,n)=>f3(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>m3(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>h3(e,t,n),e.decode=(t,n)=>g3(e,t,n),e.encodeAsync=async(t,n)=>_3(e,t,n),e.decodeAsync=async(t,n)=>v3(e,t,n),e.safeEncode=(t,n)=>y3(e,t,n),e.safeDecode=(t,n)=>b3(e,t,n),e.safeEncodeAsync=async(t,n)=>x3(e,t,n),e.safeDecodeAsync=async(t,n)=>S3(e,t,n),w3(e,`ZodType`,{check(...e){let t=this.def;return this.clone(S$(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return M$(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(R6(e,t))},superRefine(e,t){return this.check(z6(e,t))},overwrite(e){return this.check(y4(e))},optional(){return y6(this)},exactOptional(){return x6(this)},nullable(){return C6(this)},nullish(){return y6(C6(this))},nonoptional(e){return k6(this,e)},array(){return s6(this)},or(e){return d6([this,e])},and(e){return p6(this,e)},transform(e){return N6(this,_6(e))},default(e){return T6(this,e)},prefault(e){return D6(this,e)},catch(e){return j6(this,e)},pipe(e){return N6(this,e)},readonly(){return I6(this)},describe(e){let t=this.clone();return T2.add(t,{description:e}),t},meta(...e){if(e.length===0)return T2.get(this);let t=this.clone();return T2.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return T2.get(e)?.description},configurable:!0}),e)),E3=c$(`_ZodString`,(e,t)=>{f0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>L4(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,w3(e,`_ZodString`,{regex(...e){return this.check(p4(...e))},includes(...e){return this.check(g4(...e))},startsWith(...e){return this.check(_4(...e))},endsWith(...e){return this.check(v4(...e))},min(...e){return this.check(d4(...e))},max(...e){return this.check(u4(...e))},length(...e){return this.check(f4(...e))},nonempty(...e){return this.check(d4(1,...e))},lowercase(e){return this.check(m4(e))},uppercase(e){return this.check(h4(e))},trim(){return this.check(x4())},normalize(...e){return this.check(b4(...e))},toLowerCase(){return this.check(S4())},toUpperCase(){return this.check(C4())},slugify(){return this.check(w4())}})}),D3=c$(`ZodString`,(e,t)=>{f0.init(e,t),E3.init(e,t),e.email=t=>e.check(D2(A3,t)),e.url=t=>e.check(N2(P3,t)),e.jwt=t=>e.check(J2(Y3,t)),e.emoji=t=>e.check(P2(F3,t)),e.guid=t=>e.check(O2(j3,t)),e.uuid=t=>e.check(k2(M3,t)),e.uuidv4=t=>e.check(A2(M3,t)),e.uuidv6=t=>e.check(j2(M3,t)),e.uuidv7=t=>e.check(M2(M3,t)),e.nanoid=t=>e.check(F2(I3,t)),e.guid=t=>e.check(O2(j3,t)),e.cuid=t=>e.check(I2(L3,t)),e.cuid2=t=>e.check(L2(R3,t)),e.ulid=t=>e.check(R2(z3,t)),e.base64=t=>e.check(G2(K3,t)),e.base64url=t=>e.check(K2(q3,t)),e.xid=t=>e.check(z2(B3,t)),e.ksuid=t=>e.check(B2(V3,t)),e.ipv4=t=>e.check(V2(H3,t)),e.ipv6=t=>e.check(H2(U3,t)),e.cidrv4=t=>e.check(U2(W3,t)),e.cidrv6=t=>e.check(W2(G3,t)),e.e164=t=>e.check(q2(J3,t)),e.datetime=t=>e.check(r3(t)),e.date=t=>e.check(a3(t)),e.time=t=>e.check(s3(t)),e.duration=t=>e.check(l3(t))});function O3(e){return E2(D3,e)}var k3=c$(`ZodStringFormat`,(e,t)=>{p0.init(e,t),E3.init(e,t)}),A3=c$(`ZodEmail`,(e,t)=>{g0.init(e,t),k3.init(e,t)}),j3=c$(`ZodGUID`,(e,t)=>{m0.init(e,t),k3.init(e,t)}),M3=c$(`ZodUUID`,(e,t)=>{h0.init(e,t),k3.init(e,t)});function N3(e){return k2(M3,e)}var P3=c$(`ZodURL`,(e,t)=>{_0.init(e,t),k3.init(e,t)}),F3=c$(`ZodEmoji`,(e,t)=>{v0.init(e,t),k3.init(e,t)}),I3=c$(`ZodNanoID`,(e,t)=>{y0.init(e,t),k3.init(e,t)}),L3=c$(`ZodCUID`,(e,t)=>{b0.init(e,t),k3.init(e,t)}),R3=c$(`ZodCUID2`,(e,t)=>{x0.init(e,t),k3.init(e,t)}),z3=c$(`ZodULID`,(e,t)=>{S0.init(e,t),k3.init(e,t)}),B3=c$(`ZodXID`,(e,t)=>{C0.init(e,t),k3.init(e,t)}),V3=c$(`ZodKSUID`,(e,t)=>{w0.init(e,t),k3.init(e,t)}),H3=c$(`ZodIPv4`,(e,t)=>{k0.init(e,t),k3.init(e,t)}),U3=c$(`ZodIPv6`,(e,t)=>{A0.init(e,t),k3.init(e,t)}),W3=c$(`ZodCIDRv4`,(e,t)=>{j0.init(e,t),k3.init(e,t)}),G3=c$(`ZodCIDRv6`,(e,t)=>{M0.init(e,t),k3.init(e,t)}),K3=c$(`ZodBase64`,(e,t)=>{P0.init(e,t),k3.init(e,t)}),q3=c$(`ZodBase64URL`,(e,t)=>{I0.init(e,t),k3.init(e,t)}),J3=c$(`ZodE164`,(e,t)=>{L0.init(e,t),k3.init(e,t)}),Y3=c$(`ZodJWT`,(e,t)=>{z0.init(e,t),k3.init(e,t)}),X3=c$(`ZodNumber`,(e,t)=>{B0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>R4(e,t,n,r),w3(e,`ZodNumber`,{gt(e,t){return this.check(s4(e,t))},gte(e,t){return this.check(c4(e,t))},min(e,t){return this.check(c4(e,t))},lt(e,t){return this.check(a4(e,t))},lte(e,t){return this.check(o4(e,t))},max(e,t){return this.check(o4(e,t))},int(e){return this.check($3(e))},safe(e){return this.check($3(e))},positive(e){return this.check(s4(0,e))},nonnegative(e){return this.check(c4(0,e))},negative(e){return this.check(a4(0,e))},nonpositive(e){return this.check(o4(0,e))},multipleOf(e,t){return this.check(l4(e,t))},step(e,t){return this.check(l4(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Z3(e){return $2(X3,e)}var Q3=c$(`ZodNumberFormat`,(e,t)=>{V0.init(e,t),X3.init(e,t)});function $3(e){return t4(Q3,e)}var e6=c$(`ZodBoolean`,(e,t)=>{H0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>z4(e,t,n,r)});function t6(e){return n4(e6,e)}var n6=c$(`ZodUnknown`,(e,t)=>{U0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function r6(){return r4(n6)}var i6=c$(`ZodNever`,(e,t)=>{W0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>B4(e,t,n,r)});function a6(e){return i4(i6,e)}var o6=c$(`ZodArray`,(e,t)=>{K0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>W4(e,t,n,r),e.element=t.element,w3(e,`ZodArray`,{min(e,t){return this.check(d4(e,t))},nonempty(e){return this.check(d4(1,e))},max(e,t){return this.check(u4(e,t))},length(e,t){return this.check(f4(e,t))},unwrap(){return this.element}})});function s6(e,t){return T4(o6,e,t)}var c6=c$(`ZodObject`,(e,t)=>{Z0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>G4(e,t,n,r),b$(e,`shape`,()=>t.shape),w3(e,`ZodObject`,{keyof(){return h6(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:r6()})},loose(){return this.clone({...this._zod.def,catchall:r6()})},strict(){return this.clone({...this._zod.def,catchall:a6()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return R$(this,e)},safeExtend(e){return z$(this,e)},merge(e){return B$(this,e)},pick(e){return I$(this,e)},omit(e){return L$(this,e)},partial(...e){return V$(v6,this,e[0])},required(...e){return H$(O6,this,e[0])}})});function l6(e,t){return new c6({type:`object`,shape:e??{},...N$(t)})}var u6=c$(`ZodUnion`,(e,t)=>{$0.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>K4(e,t,n,r),e.options=t.options});function d6(e,t){return new u6({type:`union`,options:e,...N$(t)})}var f6=c$(`ZodIntersection`,(e,t)=>{e2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>q4(e,t,n,r)});function p6(e,t){return new f6({type:`intersection`,left:e,right:t})}var m6=c$(`ZodEnum`,(e,t)=>{r2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>V4(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new m6({...t,checks:[],...N$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new m6({...t,checks:[],...N$(r),entries:i})}});function h6(e,t){return new m6({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...N$(t)})}var g6=c$(`ZodTransform`,(e,t)=>{i2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>U4(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u$(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Y$(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Y$(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function _6(e){return new g6({type:`transform`,transform:e})}var v6=c$(`ZodOptional`,(e,t)=>{o2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>t3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function y6(e){return new v6({type:`optional`,innerType:e})}var b6=c$(`ZodExactOptional`,(e,t)=>{s2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>t3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function x6(e){return new b6({type:`optional`,innerType:e})}var S6=c$(`ZodNullable`,(e,t)=>{c2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>J4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function C6(e){return new S6({type:`nullable`,innerType:e})}var w6=c$(`ZodDefault`,(e,t)=>{l2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>X4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function T6(e,t){return new w6({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():k$(t)}})}var E6=c$(`ZodPrefault`,(e,t)=>{d2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Z4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function D6(e,t){return new E6({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():k$(t)}})}var O6=c$(`ZodNonOptional`,(e,t)=>{f2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Y4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function k6(e,t){return new O6({type:`nonoptional`,innerType:e,...N$(t)})}var A6=c$(`ZodCatch`,(e,t)=>{m2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Q4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function j6(e,t){return new A6({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var M6=c$(`ZodPipe`,(e,t)=>{h2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$4(e,t,n,r),e.in=t.in,e.out=t.out});function N6(e,t){return new M6({type:`pipe`,in:e,out:t})}var P6=c$(`ZodPreprocess`,(e,t)=>{M6.init(e,t),_2.init(e,t)}),F6=c$(`ZodReadonly`,(e,t)=>{v2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>e3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function I6(e){return new F6({type:`readonly`,innerType:e})}var L6=c$(`ZodCustom`,(e,t)=>{b2.init(e,t),T3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>H4(e,t,n,r)});function R6(e,t={}){return E4(L6,e,t)}function z6(e,t){return D4(e,t)}function B6(e,t){return new P6({type:`pipe`,in:_6(e),out:t})}function V6(e){return e4(X3,e)}var H6=O3().regex(/^\d{4}-\d{2}-\d{2}$/,`Expected a YYYY-MM-DD date`),U6=e=>O3().trim().max(e).nullish().transform(e=>e==null||e===``?null:e),W6=h6(GQ),G6=h6(XQ),K6=h6($Q),q6=h6(e$);h6(QQ);var J6=s6(O3().trim().min(1).max(60)).max(30);l6({companyName:O3().trim().min(1,`Company is required`).max(200),jobTitle:O3().trim().min(1,`Job title is required`).max(200),appliedOn:H6,status:W6.default(`applied`),jobUrl:U6(2e3),location:U6(200),workMode:G6.default(`unspecified`),sourceName:U6(120),salaryMin:Z3().int().nonnegative().nullish().transform(e=>e??null),salaryMax:Z3().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:U6(8),followUpOn:H6.nullish().transform(e=>e??null),tags:J6.default([]),notes:U6(2e4)}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),l6({companyName:O3().trim().min(1).max(200).optional(),jobTitle:O3().trim().min(1).max(200).optional(),appliedOn:H6.optional(),status:W6.optional(),statusComment:O3().trim().max(2e3).nullish(),jobUrl:U6(2e3).optional(),location:U6(200).optional(),workMode:G6.optional(),sourceName:U6(120).optional(),salaryMin:Z3().int().nonnegative().nullish(),salaryMax:Z3().int().nonnegative().nullish(),salaryCurrency:U6(8).optional(),followUpOn:H6.nullish(),archived:t6().optional(),tags:J6.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),l6({status:W6,occurredOn:H6.optional(),comment:O3().trim().max(2e3).nullish().transform(e=>e??null)});var Y6=e=>B6(e=>{if(e==null)return;let t=(Array.isArray(e)?e.map(String):String(e).split(`,`)).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0},s6(e).optional()),X6=l6({q:O3().trim().max(300).optional(),year:V6().int().min(1970).max(2200).optional(),month:V6().int().min(1).max(12).optional(),status:Y6(W6),workMode:Y6(G6),tags:Y6(O3()),companyId:N3().optional(),source:O3().trim().max(120).optional(),from:H6.optional(),to:H6.optional(),archived:h6([`true`,`false`,`all`]).default(`false`).transform(e=>e===`all`?`all`:e===`true`),followUpDue:h6([`true`,`false`]).optional().transform(e=>e===`true`),sort:h6([`appliedOn`,`company`,`jobTitle`,`status`,`createdAt`]).default(`appliedOn`),direction:h6([`asc`,`desc`]).default(`desc`),limit:V6().int().min(1).max(200).default(50),cursor:O3().optional()});l6({company:O3().trim().min(1).max(200),title:O3().trim().max(200).optional().default(``),excludeId:N3().optional()}),l6({q:O3().trim().min(1).max(300),limit:V6().int().min(1).max(100).default(25),types:Y6(h6([`application`,`company`,`note`]))}),X6.extend({format:h6([`csv`,`xlsx`]).default(`csv`)}),l6({name:O3().trim().min(1).max(200),website:U6(2e3),location:U6(200),tags:J6.default([])}),l6({name:O3().trim().min(1).max(200).optional(),website:U6(2e3).optional(),location:U6(200).optional(),archived:t6().optional(),tags:J6.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),l6({title:O3().trim().min(1).max(200),body:O3().max(5e4).default(``),targetType:K6.default(`standalone`),targetId:N3().nullish().transform(e=>e??null),pinned:t6().default(!1)}),l6({title:O3().trim().min(1).max(200).optional(),body:O3().max(5e4).optional(),targetType:K6.optional(),targetId:N3().nullish(),pinned:t6().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),l6({name:O3().trim().min(1).max(60),color:U6(30),scope:q6.default(`both`)}),l6({companyName:O3().trim().min(1,`Company is required`).max(200),jobTitle:O3().trim().min(1,`Job title is required`).max(200),jobUrl:U6(2e3),location:U6(200),workMode:G6.default(`unspecified`),sourceName:U6(120),salaryMin:Z3().int().nonnegative().nullish().transform(e=>e??null),salaryMax:Z3().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:U6(8),notes:U6(2e4),savedOn:H6.optional()}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),l6({companyName:O3().trim().min(1).max(200).optional(),jobTitle:O3().trim().min(1).max(200).optional(),jobUrl:U6(2e3).optional(),location:U6(200).optional(),workMode:G6.optional(),sourceName:U6(120).optional(),salaryMin:Z3().int().nonnegative().nullish(),salaryMax:Z3().int().nonnegative().nullish(),salaryCurrency:U6(8).optional(),notes:U6(2e4).optional(),savedOn:H6.optional(),archived:t6().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),l6({appliedOn:H6.optional(),status:W6.optional(),tags:J6.optional()}),l6({target:O3().min(1)});function Z6(e){return e===`exact`}var Q6=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.details=r}get fieldErrors(){return Array.isArray(this.details)?this.details:[]}};async function $6(e,t){let n=await fetch(e,{...t,headers:{...t?.body?{"Content-Type":`application/json`}:{},...t?.headers}});if(n.status===204)return;let r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new Q6(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}function e8(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null&&r!==``){if(Array.isArray(r)){if(r.length===0)continue;t.set(n,r.join(`,`))}else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}var t8={csv:`text/csv`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`};async function n8(e,t,n){let r=await fetch(`/api/import${e8({format:t,mode:n})}`,{method:`POST`,headers:{"Content-Type":t8[t]},body:e}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok)throw new Q6(r.status,a?.error??`unknown`,a?.message??r.statusText,a?.details);return a}async function r8(e,t){let n=await fetch(`/api/backup/import${e8({mode:t})}`,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e}),r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new Q6(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}var i8={listApplications:e=>$6(`/api/applications${e8(e)}`),getApplication:e=>$6(`/api/applications/${e}`),periods:()=>$6(`/api/applications/periods`),checkDuplicates:e=>$6(`/api/applications/check${e8(e)}`),createApplication:e=>$6(`/api/applications`,{method:`POST`,body:JSON.stringify(e)}),updateApplication:(e,t)=>$6(`/api/applications/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),changeStatus:(e,t)=>$6(`/api/applications/${e}/status`,{method:`POST`,body:JSON.stringify(t)}),deleteApplication:e=>$6(`/api/applications/${e}`,{method:`DELETE`}),listCompanies:(e={})=>$6(`/api/companies${e8(e)}`),suggestCompanies:e=>$6(`/api/companies/suggest${e8({q:e})}`),getCompany:e=>$6(`/api/companies/${e}`),updateCompany:(e,t)=>$6(`/api/companies/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),listTags:()=>$6(`/api/tags`),listNotes:(e={})=>$6(`/api/notes${e8(e)}`),createNote:e=>$6(`/api/notes`,{method:`POST`,body:JSON.stringify(e)}),updateNote:(e,t)=>$6(`/api/notes/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteNote:e=>$6(`/api/notes/${e}`,{method:`DELETE`}),dashboard:()=>$6(`/api/dashboard`),search:(e,t)=>$6(`/api/search${e8({q:e,types:t,limit:25})}`),exportUrl:(e,t)=>`/api/export${e8({...e,format:t})}`,previewImport:(e,t)=>n8(e,t,`preview`),commitImport:(e,t)=>n8(e,t,`commit`),listOpenings:(e={})=>$6(`/api/openings${e8(e)}`),getOpening:e=>$6(`/api/openings/${e}`),createOpening:e=>$6(`/api/openings`,{method:`POST`,body:JSON.stringify(e)}),updateOpening:(e,t)=>$6(`/api/openings/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteOpening:e=>$6(`/api/openings/${e}`,{method:`DELETE`}),convertOpening:(e,t)=>$6(`/api/openings/${e}/convert`,{method:`POST`,body:JSON.stringify(t)}),getDbTargets:()=>$6(`/api/db/targets`),switchDb:e=>$6(`/api/db/switch`,{method:`POST`,body:JSON.stringify({target:e})}),backupExportUrl:`/api/backup/export`,previewBackup:e=>r8(e,`preview`),commitBackup:e=>r8(e,`commit`),getDataStatus:()=>$6(`/api/backup/status`),clearDatabase:()=>$6(`/api/backup/clear`,{method:`POST`}),seedDatabase:()=>$6(`/api/backup/seed`,{method:`POST`}),getMeta:()=>$6(`/api/meta`)},a8=class extends Error{name=`RepoError`;cause;constructor(e,t){super(e),t?.cause!==void 0&&(this.cause=t.cause)}},o8=class extends a8{name=`SchemaError`},s8=new Set([`string`,`number`,`integer`,`boolean`,`date`,`json`]);function c8(e){let t=Object.keys(e);if(t.length===0)throw new o8(`A schema must define at least one field`);let n={},r={},i={},a;for(let o of t){let t=e[o];if(!s8.has(t.type))throw new o8(`Field "${o}" has unknown type ${JSON.stringify(t.type)}. Expected one of: ${[...s8].join(`, `)}`);let s=t.column??o;if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(s))throw new o8(`Field "${o}" maps to column ${JSON.stringify(s)}, which is not a plain identifier. Column names must match /^[A-Za-z_][A-Za-z0-9_]*$/ because repolayer never quotes-and-interpolates arbitrary text into SQL.`);if(s in r)throw new o8(`Fields "${r[s]}" and "${o}" both map to column "${s}"`);if(t.primaryKey){if(a!==void 0)throw new o8(`Schema declares two primary keys ("${a}" and "${o}"). repolayer supports single-column primary keys only.`);if(t.nullable)throw new o8(`Primary key "${o}" cannot be nullable`);a=o}n[o]=s,r[s]=o,i[o]=t.type}if(a===void 0)throw new o8("Schema has no primary key. Mark exactly one field with `primaryKey: true`.");return Object.freeze({fields:e,primaryKey:a,columns:Object.freeze(n),fieldsByColumn:Object.freeze(r),fieldNames:Object.freeze(t),types:Object.freeze(i)})}var l8={createdAt:{type:`date`,column:`created_at`},updatedAt:{type:`date`,column:`updated_at`}};c8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},website:{type:`string`,nullable:!0},location:{type:`string`,nullable:!0},archived:{type:`boolean`},...l8}),c8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},titleKey:{type:`string`,column:`title_key`},appliedOn:{type:`date`,column:`applied_on`},periodYear:{type:`integer`,column:`period_year`},periodMonth:{type:`integer`,column:`period_month`},status:{type:`string`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},followUpOn:{type:`date`,nullable:!0,column:`follow_up_on`},archived:{type:`boolean`},...l8}),c8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},color:{type:`string`,nullable:!0},scope:{type:`string`},...l8}),c8({id:{type:`string`,primaryKey:!0},tagId:{type:`string`,column:`tag_id`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},...l8}),c8({id:{type:`string`,primaryKey:!0},title:{type:`string`},body:{type:`string`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,nullable:!0,column:`target_id`},pinned:{type:`boolean`},...l8}),c8({id:{type:`string`,primaryKey:!0},applicationId:{type:`string`,column:`application_id`},fromStatus:{type:`string`,nullable:!0,column:`from_status`},toStatus:{type:`string`,column:`to_status`},occurredOn:{type:`date`,column:`occurred_on`},commentText:{type:`string`,nullable:!0,column:`comment_text`},...l8}),c8({id:{type:`string`,primaryKey:!0},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},model:{type:`string`},dim:{type:`integer`},embedding:{type:`json`},textHash:{type:`string`,column:`text_hash`},...l8}),c8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},notes:{type:`string`,nullable:!0},savedOn:{type:`date`,column:`saved_on`},archived:{type:`boolean`},convertedApplicationId:{type:`string`,nullable:!0,column:`converted_application_id`},...l8}),[{header:`Position`,value:e=>e.jobTitle,width:34},{header:`Company`,value:e=>e.company.name,width:28},{header:`Date`,value:e=>e.appliedOn,width:13},{header:`Status`,value:e=>YQ[e.status],width:13},{header:`Notes`,value:e=>e.notesText,width:70,wrap:!0}].map(e=>e.header),new Map(Object.entries(YQ).map(([e,t])=>[t.toLowerCase(),e]));var u8=i8,d8={applications:e=>[`applications`,e],application:e=>[`application`,e],periods:()=>[`periods`],companies:e=>[`companies`,e],company:e=>[`company`,e],companySuggest:e=>[`company-suggest`,e],tags:()=>[`tags`],notes:e=>[`notes`,e],dashboard:()=>[`dashboard`],duplicates:e=>[`duplicates`,e],search:e=>[`search`,e],openings:e=>[`openings`,e],opening:e=>[`opening`,e],dbTargets:()=>[`db-targets`],dataStatus:()=>[`data-status`],meta:()=>[`meta`]};function f8(e){e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`company`]}),e.invalidateQueries({queryKey:[`tags`]}),e.invalidateQueries({queryKey:[`duplicates`]}),e.invalidateQueries({queryKey:[`search`]})}function p8(e){return qr({queryKey:d8.applications(e),queryFn:()=>u8.listApplications(e),placeholderData:e=>e})}function m8(e){return qr({queryKey:d8.application(e??``),queryFn:()=>u8.getApplication(e),enabled:!!e})}function h8(){return qr({queryKey:d8.periods(),queryFn:()=>u8.periods()})}function g8(){return qr({queryKey:d8.dashboard(),queryFn:()=>u8.dashboard()})}function _8(){return qr({queryKey:d8.tags(),queryFn:()=>u8.listTags()})}function v8(e={}){return qr({queryKey:d8.companies(e),queryFn:()=>u8.listCompanies(e)})}function y8(e){return qr({queryKey:d8.company(e??``),queryFn:()=>u8.getCompany(e),enabled:!!e})}function b8(e={}){return qr({queryKey:d8.notes(e),queryFn:()=>u8.listNotes(e)})}function x8(e){let{enabled:t=!0,...n}=e;return qr({queryKey:d8.duplicates(n),queryFn:()=>u8.checkDuplicates(n),enabled:t&&n.company.trim().length>1,staleTime:5e3})}function S8(e){return qr({queryKey:d8.companySuggest(e),queryFn:()=>u8.suggestCompanies(e),enabled:e.trim().length>0,staleTime:3e4})}function C8(){let e=Tn();return Jr({mutationFn:e=>u8.createApplication(e),onSuccess:()=>f8(e)})}function w8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>u8.updateApplication(e,t),onSuccess:()=>f8(e)})}function T8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>u8.changeStatus(e,t),onSuccess:()=>f8(e)})}function E8(){let e=Tn();return Jr({mutationFn:e=>u8.deleteApplication(e),onSuccess:()=>f8(e)})}function D8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>u8.updateCompany(e,t),onSuccess:()=>f8(e)})}function O8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>e?u8.updateNote(e,t):u8.createNote(t),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`search`]})}})}function k8(){let e=Tn();return Jr({mutationFn:e=>u8.deleteNote(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]})}})}function A8(e={}){return qr({queryKey:d8.openings(e),queryFn:()=>u8.listOpenings(e)})}function j8(e){e.invalidateQueries({queryKey:[`openings`]}),e.invalidateQueries({queryKey:[`opening`]})}function M8(){let e=Tn();return Jr({mutationFn:e=>u8.createOpening(e),onSuccess:()=>j8(e)})}function N8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>u8.updateOpening(e,t),onSuccess:()=>j8(e)})}function P8(){let e=Tn();return Jr({mutationFn:e=>u8.deleteOpening(e),onSuccess:()=>j8(e)})}function F8(){let e=Tn();return Jr({mutationFn:({id:e,body:t})=>u8.convertOpening(e,t),onSuccess:()=>{j8(e),e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`search`]})}})}function I8(){return qr({queryKey:d8.dbTargets(),queryFn:()=>u8.getDbTargets()})}function L8(){return Jr({mutationFn:e=>u8.switchDb(e)})}function R8(){return qr({queryKey:d8.dataStatus(),queryFn:()=>u8.getDataStatus()})}function z8(){let e=Tn();return Jr({mutationFn:()=>u8.clearDatabase(),onSuccess:()=>void e.invalidateQueries()})}function B8(){let e=Tn();return Jr({mutationFn:()=>u8.seedDatabase(),onSuccess:()=>void e.invalidateQueries()})}function V8(){return qr({queryKey:d8.meta(),queryFn:()=>u8.getMeta(),staleTime:1/0})}function H8({status:e}){return(0,Z.jsx)(OY,{color:JQ[e],children:YQ[e]})}function U8(e,t=300){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var W8={exact:`error`,similar:`warning`,company:`info`,none:`success`};function G8({check:e,loading:t}){if(t&&!e)return(0,Z.jsx)(jp,{type:`info`,showIcon:!0,message:`Checking your history…`,style:{marginBottom:16}});if(!e)return null;if(e.verdict===`none`)return(0,Z.jsx)(jp,{type:`success`,showIcon:!0,message:`No history with this company`,description:`This looks like a company you haven't applied to before.`,style:{marginBottom:16}});let n=e.company?.name??`this company`;return(0,Z.jsx)(jp,{type:W8[e.verdict],showIcon:!0,style:{marginBottom:16},message:K8(e.verdict,n,e.priorCount),description:(0,Z.jsxs)(Pz,{direction:`vertical`,size:6,style:{width:`100%`},children:[e.matches.length>0?e.matches.slice(0,5).map(e=>(0,Z.jsx)(q8,{match:e},e.id)):(0,Z.jsx)(YX.Text,{type:`secondary`,children:`None of them were for this role, but it is worth a look before you apply again.`}),!e.semanticUsed&&e.matches.length>0&&(0,Z.jsx)(YX.Text,{type:`secondary`,style:{fontSize:12},children:`Matched on wording only — semantic matching is still warming up.`})]})})}function K8(e,t,n){let r=n===1?`once`:`${n} times`;switch(e){case`exact`:return`You have already applied for this exact role at ${t}`;case`similar`:return`You have applied for a very similar role at ${t}`;default:return`You have applied to ${t} ${r} before`}}function q8({match:e}){let t=Math.round(Math.max(e.titleSimilarity,e.semanticSimilarity??0)*100);return(0,Z.jsxs)(Pz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:e.appliedOn}),(0,Z.jsx)(OY,{color:JQ[e.status],children:YQ[e.status]}),e.matchKind===`exact`?(0,Z.jsx)(OY,{color:`red`,children:`exact title`}):(0,Z.jsxs)(OY,{children:[t,`% similar`]})]})}function J8({onStartApplication:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),a=U8(t,350),{data:o,isFetching:s}=x8({company:a,title:U8(r,350)}),c=a.trim().length>1;return(0,Z.jsx)(bF,{title:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(kQ,{}),(0,Z.jsx)(`span`,{children:`Check before you apply`})]}),extra:e&&(0,Z.jsx)(Vk,{type:`link`,onClick:e,children:`New application`}),children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)(BU,{gutter:12,children:[(0,Z.jsx)(II,{xs:24,sm:12,children:(0,Z.jsx)(_V,{placeholder:`Company`,value:t,onChange:e=>n(e.target.value),allowClear:!0})}),(0,Z.jsx)(II,{xs:24,sm:12,children:(0,Z.jsx)(_V,{placeholder:`Job title (optional)`,value:r,onChange:e=>i(e.target.value),allowClear:!0})})]}),c?(0,Z.jsx)(G8,{check:o,loading:s}):(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Type a company name to see whether you have been here before.`})]})})}function Y8({open:e,onClose:t,application:n}){let[r]=WB.useForm(),{message:i,modal:a}=NC.useApp(),o=!!n,s=C8(),c=w8(),{data:l}=_8(),u=WB.useWatch(`companyName`,r)??``,d=WB.useWatch(`jobTitle`,r)??``,f=U8(u,300),p=U8(d,300),m=o&&u.trim()===(n?.company.name??``).trim()&&d.trim()===(n?.jobTitle??``).trim(),{data:h}=S8(f),{data:g,isFetching:v}=x8({company:f,title:p,...n?{excludeId:n.id}:{},enabled:e&&!m});(0,_.useEffect)(()=>{e&&(n?r.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,appliedOn:(0,Yk.default)(n.appliedOn),status:n.status,jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,followUpOn:n.followUpOn?(0,Yk.default)(n.followUpOn):null,tags:n.tags.map(e=>e.name)}):(r.resetFields(),r.setFieldsValue({appliedOn:(0,Yk.default)(),status:`applied`,workMode:`unspecified`,tags:[]})))},[e,n,r]);let y=(0,_.useMemo)(()=>(h?.companies??[]).map(e=>({value:e.name,label:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(`span`,{children:e.name}),e.applicationCount>0&&(0,Z.jsxs)(YX.Text,{type:`secondary`,style:{fontSize:12},children:[e.applicationCount,` application`,e.applicationCount===1?``:`s`]})]})})),[h]),b=(0,_.useMemo)(()=>(l?.tags??[]).map(e=>({value:e.name,label:e.name})),[l]),[x,S]=(0,_.useState)(!1);async function C(e){if(g&&Z6(g.verdict)&&!o&&!await new Promise(e=>{a.confirm({title:`You have applied for this exact role before`,content:(0,Z.jsxs)(Pz,{direction:`vertical`,children:[(0,Z.jsxs)(YX.Text,{children:[g.matches[0]?.jobTitle,` at `,g.company?.name,` on`,` `,g.matches[0]?.appliedOn,`.`]}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Save this as a new application anyway?`})]}),okText:`Save anyway`,cancelText:`Go back`,onOk:()=>e(!0),onCancel:()=>e(!1)})}))return;let l={companyName:e.companyName,jobTitle:e.jobTitle,appliedOn:e.appliedOn.format(`YYYY-MM-DD`),status:e.status,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,followUpOn:e.followUpOn?e.followUpOn.format(`YYYY-MM-DD`):null,tags:e.tags??[],...o?{}:{notes:e.notes??null}};S(!0);try{n?(await c.mutateAsync({id:n.id,body:l}),i.success(`Application updated`)):(await s.mutateAsync(l),i.success(`Application saved`)),t()}catch(e){e instanceof Q6&&e.fieldErrors.length>0?(r.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),i.error(`Please check the highlighted fields`)):i.error(e instanceof Error?e.message:`Could not save`)}finally{S(!1)}}return(0,Z.jsxs)(Tz,{title:o?`Edit application`:`New application`,open:e,onClose:t,width:640,destroyOnHidden:!0,extra:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Vk,{type:`primary`,loading:x,onClick:()=>r.submit(),children:o?`Save changes`:`Save application`})]}),children:[!m&&(0,Z.jsx)(G8,{check:g,loading:v}),(0,Z.jsxs)(WB,{form:r,layout:`vertical`,onFinish:C,requiredMark:`optional`,children:[(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(NE,{options:y,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(_V,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(EE,{options:GQ.map(e=>({value:e,label:YQ[e]}))})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`followUpOn`,label:`Follow up on`,children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`,allowClear:!0})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(EE,{options:XQ.map(e=>({value:e,label:ZQ[e]}))})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(_V,{placeholder:`Stockholm`})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(_V,{placeholder:`LinkedIn, referral…`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(_V,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(WB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(_V,{placeholder:`https://…`})}),(0,Z.jsx)(WB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(EE,{mode:`tags`,options:b,placeholder:`fintech, remote-ok, dream-job…`,tokenSeparators:[`,`]})}),!o&&(0,Z.jsx)(WB.Item,{name:`notes`,label:`Notes`,help:`Saved as a note linked to this application. Searchable.`,children:(0,Z.jsx)(_V.TextArea,{rows:4,placeholder:`Anything worth remembering…`})})]})]})}var X8={dark:{bgBase:`#0d1117`,bgRaised:`#161b22`,bgSunken:`#010409`,border:`#30363d`,borderStrong:`#444c56`,textPrimary:`#e6edf3`,textMuted:`#8b949e`,textFaint:`#6e7681`,accent:`#58a6ff`,success:`#3fb950`,danger:`#f85149`,warning:`#d29922`},light:{bgBase:`#ffffff`,bgRaised:`#ffffff`,bgSunken:`#f6f8fa`,border:`#d0d7de`,borderStrong:`#afb8c1`,textPrimary:`#1f2328`,textMuted:`#656d76`,textFaint:`#8c959f`,accent:`#0969da`,success:`#1a7f37`,danger:`#d1242f`,warning:`#9a6700`}},Z8={bgBase:`var(--jt-bg-base)`,bgRaised:`var(--jt-bg-raised)`,bgSunken:`var(--jt-bg-sunken)`,border:`var(--jt-border)`,borderStrong:`var(--jt-border-strong)`,textPrimary:`var(--jt-text-primary)`,textMuted:`var(--jt-text-muted)`,textFaint:`var(--jt-text-faint)`,accent:`var(--jt-accent)`,success:`var(--jt-success)`,danger:`var(--jt-danger)`,warning:`var(--jt-warning)`};function Q8(e){let t=X8[e];return{algorithm:e===`dark`?RY.darkAlgorithm:RY.defaultAlgorithm,token:{colorBgBase:t.bgBase,colorBgContainer:t.bgRaised,colorBgElevated:t.bgRaised,colorBgLayout:t.bgBase,colorBorder:t.border,colorBorderSecondary:t.border,colorText:t.textPrimary,colorTextSecondary:t.textMuted,colorTextTertiary:t.textFaint,colorPrimary:t.accent,colorLink:t.accent,colorSuccess:t.success,colorError:t.danger,colorWarning:t.warning,borderRadius:8,fontSize:14},components:{Layout:{siderBg:t.bgSunken,headerBg:t.bgSunken,bodyBg:t.bgBase}}}}function $8(){let{data:e,isLoading:t}=g8(),[n,r]=(0,_.useState)(!1),i=r$(i$());if(t||!e)return(0,Z.jsx)(CS,{active:!0,paragraph:{rows:8}});let{stats:a,followUps:o,recentActivity:s}=e;return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Total applications`,value:a.total})})}),(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Still active`,value:a.active,valueStyle:{color:Z8.accent}})})}),(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`${o$(i.month)} ${i.year}`,value:a.thisMonth,suffix:a.thisMonth===1?`application`:`applications`})})}),(0,Z.jsx)(II,{xs:12,sm:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Response rate`}),(0,Z.jsx)(bU,{percent:Math.round(a.responseRate*100),size:`small`,strokeColor:Z8.accent}),(0,Z.jsx)(YX.Text,{type:`secondary`,style:{fontSize:12},children:`Anything past “applied” counts as a reply`})]})})})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:24,lg:14,children:(0,Z.jsx)(J8,{onStartApplication:()=>r(!0)})}),(0,Z.jsx)(II,{xs:24,lg:10,children:(0,Z.jsx)(bF,{title:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(LR,{}),(0,Z.jsx)(`span`,{children:`Needs a follow-up`})]}),styles:{body:{maxHeight:320,overflowY:`auto`}},children:o.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`Nothing due — all caught up`}):(0,Z.jsx)(NH,{size:`small`,dataSource:o,renderItem:e=>(0,Z.jsxs)(NH.Item,{children:[(0,Z.jsx)(NH.Item.Meta,{title:(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),description:(0,Z.jsxs)(Xz,{justify:`space-between`,wrap:!0,gap:8,children:[(0,Z.jsx)(`span`,{children:e.company.name}),(0,Z.jsxs)(YX.Text,{type:`danger`,children:[`due `,e.followUpOn]})]})}),(0,Z.jsx)(H8,{status:e.status})]})})})})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:24,lg:12,children:(0,Z.jsx)(bF,{title:`Pipeline`,children:(0,Z.jsx)(Pz,{direction:`vertical`,size:10,style:{width:`100%`},children:Object.entries(a.byStatus).sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,Z.jsxs)(Xz,{align:`center`,gap:12,children:[(0,Z.jsx)(`div`,{style:{width:100},children:(0,Z.jsx)(H8,{status:e})}),(0,Z.jsx)(bU,{percent:a.total>0?Math.round(t/a.total*100):0,format:()=>t,size:`small`,style:{flex:1,marginBottom:0}})]},e))})})}),(0,Z.jsx)(II,{xs:24,lg:12,children:(0,Z.jsx)(bF,{title:`Recent activity`,styles:{body:{maxHeight:360,overflowY:`auto`}},children:s.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No status changes yet`}):(0,Z.jsx)(KY,{items:s.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsxs)(YX.Text,{children:[(0,Z.jsx)(dn,{to:`/applications/${e.applicationId}`,children:e.jobTitle}),` at `,e.companyName]}),(0,Z.jsxs)(YX.Text,{type:`secondary`,style:{fontSize:12},children:[e.fromStatus?`${YQ[e.fromStatus]} → ${YQ[e.toStatus]}`:`Applied (${YQ[e.toStatus]})`,` `,`· `,e.occurredOn]})]})}))})})})]}),(0,Z.jsx)(Y8,{open:n,onClose:()=>r(!1)})]})}function e5({periods:e,year:t,month:n,onSelect:r}){let i=(0,_.useMemo)(()=>e.map(e=>({key:`y:${e.year}`,title:(0,Z.jsx)(t5,{label:String(e.year),count:e.count,strong:!0}),children:(e.months??[]).map(e=>({key:`m:${e.year}:${e.month}`,title:(0,Z.jsx)(t5,{label:o$(e.month),count:e.count})}))})),[e]),a=(0,_.useMemo)(()=>t&&n?[`m:${t}:${n}`]:t?[`y:${t}`]:[],[t,n]),o=(0,_.useMemo)(()=>{let n=e[0],r=n?[`y:${n.year}`]:[];return t&&!r.includes(`y:${t}`)&&r.push(`y:${t}`),r},[e,t]);return e.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No applications yet`}):(0,Z.jsx)(rJ,{treeData:i,selectedKeys:a,defaultExpandedKeys:o,blockNode:!0,onSelect:e=>{let t=String(e[0]??``);if(t.startsWith(`m:`)){let[,e,n]=t.split(`:`);r({year:Number(e),month:Number(n)})}else t.startsWith(`y:`)?r({year:Number(t.slice(2))}):r({})}})}function t5({label:e,count:t,strong:n}){return(0,Z.jsxs)(`span`,{style:{display:`flex`,justifyContent:`space-between`,gap:12},children:[(0,Z.jsx)(YX.Text,{strong:n,children:e}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:t})]})}var n5={new:`green`,duplicate:`default`,error:`red`},r5={new:`New`,duplicate:`Duplicate — skipped`,error:`Error`};function i5({open:e,onClose:t}){let n=Tn(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(`csv`),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null);function h(){i(null),c(null),u(null),m(null)}function g(){h(),t()}let v=e=>{let t=e.name.toLowerCase().endsWith(`.xlsx`)?`xlsx`:`csv`;return i(e),o(t),m(null),f(!0),u8.previewImport(e,t).then(c).catch(e=>m(e instanceof Error?e.message:`Could not read that file`)).finally(()=>f(!1)),!1};async function y(){if(r){f(!0),m(null);try{let e=await u8.commitImport(r,a);if(u(e),e.created>0)for(let e of[`applications`,`application`,`periods`,`dashboard`,`companies`,`company`,`search`])n.invalidateQueries({queryKey:[e]})}catch(e){m(e instanceof Error?e.message:`Import failed`)}finally{f(!1)}}}return(0,Z.jsx)(LH,{title:`Import applications`,open:e,onCancel:g,width:800,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,children:`CSV or .xlsx with the same columns Export produces: Position, Company, Date, Status, Notes. Rows that exactly match an application you have already logged are skipped automatically.`}),(0,Z.jsxs)(VZ.Dragger,{accept:`.csv,.xlsx`,maxCount:1,showUploadList:!1,beforeUpload:v,disabled:d,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(cQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a CSV or Excel file here`})]})]}),p&&(0,Z.jsx)(jp,{type:`error`,showIcon:!0,message:p}),s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pz,{wrap:!0,children:[(0,Z.jsxs)(OY,{color:`green`,children:[s.totals.new,` new`]}),(0,Z.jsxs)(OY,{children:[s.totals.duplicate,` duplicate — will be skipped`]}),s.totals.error>0&&(0,Z.jsxs)(OY,{color:`red`,children:[s.totals.error,` error`]})]}),s.fileErrors.map(e=>(0,Z.jsx)(jp,{type:`warning`,showIcon:!0,message:e},e)),(0,Z.jsx)(hY,{size:`small`,rowKey:`rowNumber`,columns:[{title:`Row`,dataIndex:`rowNumber`,width:60},{title:`Position`,dataIndex:`jobTitle`,ellipsis:!0},{title:`Company`,dataIndex:`companyName`,ellipsis:!0},{title:`Date`,dataIndex:`appliedOn`,width:110},{title:`Status`,dataIndex:`status`,width:110,render:e=>e?YQ[e]:`—`},{title:`Result`,dataIndex:`verdict`,width:200,render:(e,t)=>(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(OY,{color:n5[e],children:r5[e]}),t.errors.length>0&&(0,Z.jsx)(YX.Text,{type:`danger`,style:{fontSize:12},children:t.errors.join(`; `)})]})}],dataSource:s.rows,pagination:{pageSize:10},scroll:{y:320}}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:h,children:`Choose a different file`}),(0,Z.jsxs)(Vk,{type:`primary`,loading:d,disabled:s.totals.new===0,onClick:y,children:[`Import `,s.totals.new,` application`,s.totals.new===1?``:`s`]})]})]}),l&&(0,Z.jsx)(zU,{status:l.failed>0?`warning`:`success`,title:`Imported ${l.created} application${l.created===1?``:`s`}`,subTitle:`${l.skipped} duplicate row${l.skipped===1?``:`s`} skipped`+(l.failed>0?`, ${l.failed} row${l.failed===1?``:`s`} failed`:``),extra:(0,Z.jsx)(Vk,{type:`primary`,onClick:g,children:`Done`})})]})})}function a5(){let e=Xe(),[t,n]=_n(),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),s=(0,_.useMemo)(()=>{let e={};for(let n of[`q`,`source`,`sort`,`direction`,`cursor`,`from`,`to`]){let r=t.get(n);r&&(e[n]=r)}for(let n of[`year`,`month`]){let r=t.get(n);r&&(e[n]=Number(r))}for(let n of[`status`,`workMode`,`tags`]){let r=t.get(n);r&&(e[n]=r.split(`,`))}return e},[t]),{data:c,isLoading:l,isFetching:u}=p8(s),{data:d}=h8(),{data:f}=_8();function p(e){let r=new URLSearchParams(t);for(let[t,n]of Object.entries(e))n==null||n===``||Array.isArray(n)&&n.length===0?r.delete(t):r.set(t,Array.isArray(n)?n.join(`,`):String(n));r.delete(`cursor`),n(r,{replace:!0})}let m=[{title:`Applied`,dataIndex:`appliedOn`,width:118,sorter:!1,render:e=>(0,Z.jsx)(YX.Text,{children:e})},{title:`Company`,key:`company`,width:190,render:(t,n)=>(0,Z.jsx)(Vk,{type:`link`,style:{padding:0,height:`auto`},onClick:t=>{t.stopPropagation(),e(`/companies/${n.company.id}`)},children:n.company.name})},{title:`Job title`,dataIndex:`jobTitle`,render:(e,t)=>(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Text,{strong:!0,children:e}),t.location&&(0,Z.jsxs)(YX.Text,{type:`secondary`,style:{fontSize:12},children:[t.location,` · `,ZQ[t.workMode]]})]})},{title:`Status`,dataIndex:`status`,width:116,render:(e,t)=>(0,Z.jsx)(H8,{status:t.status})},{title:`Tags`,key:`tags`,width:210,render:(e,t)=>(0,Z.jsx)(Pz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(OY,{color:e.color??void 0,style:{marginInlineEnd:0},children:e.name},e.id))})},{title:`Source`,dataIndex:`sourceName`,width:120,render:e=>e??(0,Z.jsx)(YX.Text,{type:`secondary`,children:`—`})}],h=t.get(`from`),g=t.get(`to`),v=h&&g?[(0,Yk.default)(h),(0,Yk.default)(g)]:null,y=(0,Yk.default)(),b=[{label:`Today`,value:[y,y]},{label:`Yesterday`,value:[y.subtract(1,`day`),y.subtract(1,`day`)]},{label:`This week`,value:[y.startOf(`week`),y.endOf(`week`)]},{label:`This month`,value:[y.startOf(`month`),y.endOf(`month`)]},{label:`Last 7 days`,value:[y.subtract(6,`day`),y]},{label:`Last 30 days`,value:[y.subtract(29,`day`),y]}];function x(e){if(!e||!e[0]||!e[1]){p({from:``,to:``});return}p({from:e[0].format(`YYYY-MM-DD`),to:e[1].format(`YYYY-MM-DD`)})}let S=t.get(`year`)?Number(t.get(`year`)):void 0,C=t.get(`month`)?Number(t.get(`month`)):void 0,w=S&&C?`${o$(C)} ${S}`:S?String(S):`All applications`;return(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{xs:24,md:6,lg:5,children:(0,Z.jsx)(bF,{size:`small`,title:`By period`,extra:(S||C)&&(0,Z.jsx)(Vk,{size:`small`,type:`link`,onClick:()=>p({year:``,month:``}),children:`Clear`}),styles:{body:{maxHeight:`calc(100vh - 220px)`,overflowY:`auto`}},children:(0,Z.jsx)(e5,{periods:d?.periods??[],year:S,month:C,onSelect:e=>p({year:e.year??``,month:e.month??``})})})}),(0,Z.jsx)(II,{xs:24,md:18,lg:19,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:w}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:c?`${c.total} application${c.total===1?``:`s`}`:`Loading…`})]}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Iz,{menu:{items:[{key:`csv`,label:`Export as CSV`},{key:`xlsx`,label:`Export as Excel (.xlsx)`}],onClick:({key:e})=>{window.location.href=u8.exportUrl(s,e)}},children:(0,Z.jsx)(Vk,{icon:(0,Z.jsx)(FZ,{}),children:`Export`})}),(0,Z.jsx)(Vk,{icon:(0,Z.jsx)(WQ,{}),onClick:()=>o(!0),children:`Import`}),(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(cP,{}),onClick:()=>i(!0),children:`New application`})]})]}),(0,Z.jsx)(bF,{size:`small`,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsx)(_V,{allowClear:!0,size:`large`,prefix:(0,Z.jsx)(xE,{}),placeholder:`Search by meaning — try “server-side developer” or “remote fintech”`,defaultValue:t.get(`q`)??``,onChange:e=>{e.target.value===``&&p({q:``})},onPressEnter:e=>p({q:e.target.value})}),(0,Z.jsxs)(Xz,{gap:8,wrap:!0,children:[(0,Z.jsx)(HR.RangePicker,{allowClear:!0,value:v,presets:b,format:`YYYY-MM-DD`,onChange:e=>x(e)}),(0,Z.jsx)(EE,{mode:`multiple`,allowClear:!0,placeholder:`Status`,style:{minWidth:180},suffixIcon:(0,Z.jsx)(aQ,{}),value:t.get(`status`)?.split(`,`)??[],onChange:e=>p({status:e}),options:GQ.map(e=>({value:e,label:YQ[e]}))}),(0,Z.jsx)(EE,{mode:`multiple`,allowClear:!0,placeholder:`Work mode`,style:{minWidth:160},value:t.get(`workMode`)?.split(`,`)??[],onChange:e=>p({workMode:e}),options:XQ.map(e=>({value:e,label:ZQ[e]}))}),(0,Z.jsx)(EE,{mode:`multiple`,allowClear:!0,placeholder:`Tags`,style:{minWidth:200},value:t.get(`tags`)?.split(`,`)??[],onChange:e=>p({tags:e}),options:(f?.tags??[]).map(e=>({value:e.name,label:e.name}))}),(0,Z.jsx)(EE,{style:{minWidth:170},value:t.get(`sort`)??`appliedOn`,onChange:e=>p({sort:e}),options:[{value:`appliedOn`,label:`Sort: date applied`},{value:`company`,label:`Sort: company`},{value:`jobTitle`,label:`Sort: job title`},{value:`status`,label:`Sort: status`}]}),(0,Z.jsx)(EE,{style:{width:130},value:t.get(`direction`)??`desc`,onChange:e=>p({direction:e}),options:[{value:`desc`,label:`Newest first`},{value:`asc`,label:`Oldest first`}]})]}),c?.searched&&!c.semanticReady&&(0,Z.jsx)(jp,{type:`info`,showIcon:!0,icon:(0,Z.jsx)(VQ,{}),message:`Results will improve shortly — the semantic model is still loading.`})]})}),(0,Z.jsx)(hY,{rowKey:`id`,columns:m,dataSource:c?.items??[],loading:l||u,pagination:!1,onRow:t=>({onClick:()=>e(`/applications/${t.id}`),style:{cursor:`pointer`}}),locale:{emptyText:(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:t.get(`q`)?`Nothing matched “${t.get(`q`)}”`:`No applications for this filter`})},footer:c?.hasMore?()=>(0,Z.jsx)(Xz,{justify:`center`,children:(0,Z.jsx)(gD,{title:`Loads the next page`,children:(0,Z.jsx)(Vk,{onClick:()=>o5(t,n,c.cursor),children:`Load more`})})}):void 0})]})}),(0,Z.jsx)(Y8,{open:r,onClose:()=>i(!1)}),(0,Z.jsx)(i5,{open:a,onClose:()=>o(!1)})]})}function o5(e,t,n){if(!n)return;let r=new URLSearchParams(e);r.set(`cursor`,n),t(r)}function s5({open:e,note:t,onClose:n,target:r}){let[i]=WB.useForm(),{message:a}=NC.useApp(),o=O8();return(0,Z.jsx)(LH,{open:e,title:t?`Edit note`:`New note`,okText:`Save`,destroyOnHidden:!0,onCancel:n,afterOpenChange:e=>{e&&(t?i.setFieldsValue({title:t.title,body:t.body,targetType:t.targetType,targetId:t.targetId,pinned:t.pinned}):(i.resetFields(),i.setFieldsValue({targetType:r?r.type:`standalone`,targetId:r?r.id:null,pinned:!1,body:``})))},onOk:async()=>{let e=await i.validateFields();await o.mutateAsync({...t?{id:t.id}:{},body:{title:e.title,body:e.body??``,targetType:e.targetType,targetId:e.targetType===`standalone`?null:e.targetId??null,pinned:e.pinned??!1}}),a.success(t?`Note updated`:`Note saved`),n()},children:(0,Z.jsxs)(WB,{form:i,layout:`vertical`,children:[(0,Z.jsx)(WB.Item,{name:`title`,label:`Title`,rules:[{required:!0,message:`Title is required`}],children:(0,Z.jsx)(_V,{placeholder:`Interview prep, salary research…`})}),(0,Z.jsx)(WB.Item,{name:`body`,label:`Note`,children:(0,Z.jsx)(_V.TextArea,{rows:8,placeholder:`Anything worth keeping`})}),r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(WB.Item,{name:`targetType`,hidden:!0,children:(0,Z.jsx)(_V,{})}),(0,Z.jsx)(WB.Item,{name:`targetId`,hidden:!0,children:(0,Z.jsx)(_V,{})}),(0,Z.jsxs)(YX.Paragraph,{type:`secondary`,style:{marginBottom:16},children:[`Attached to `,r.label]})]}):(0,Z.jsx)(c5,{form:i}),(0,Z.jsx)(WB.Item,{name:`pinned`,label:`Pinned`,valuePropName:`checked`,children:(0,Z.jsx)(XW,{})})]})})}function c5({form:e}){let t=WB.useWatch(`targetType`,e)??`standalone`,{data:n}=v8(),{data:r}=p8({limit:200}),i=(0,_.useMemo)(()=>t===`company`?(n?.companies??[]).map(e=>({value:e.id,label:e.name})):t===`application`?(r?.items??[]).map(e=>({value:e.id,label:`${e.jobTitle} — ${e.company.name}`})):[],[t,n,r]);return(0,Z.jsxs)(Xz,{gap:12,children:[(0,Z.jsx)(WB.Item,{name:`targetType`,label:`Attach to`,style:{flex:1},children:(0,Z.jsx)(EE,{options:[{value:`standalone`,label:`Nothing in particular`},{value:`company`,label:`A company`},{value:`application`,label:`An application`}],onChange:()=>e.setFieldValue(`targetId`,null)})}),t!==`standalone`&&(0,Z.jsx)(WB.Item,{name:`targetId`,label:t===`company`?`Company`:`Application`,style:{flex:2},rules:[{required:!0,message:`Pick what this note is about`}],children:(0,Z.jsx)(EE,{showSearch:!0,optionFilterProp:`label`,options:i})})]})}function l5(){let{id:e}=Qe(),t=Xe(),{message:n}=NC.useApp(),{data:r,isLoading:i}=m8(e),a=T8(),o=E8(),s=k8(),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(!1);if(i||!r)return(0,Z.jsx)(CS,{active:!0,paragraph:{rows:10}});let m=qQ(r.status);async function h(t){e&&(await a.mutateAsync({id:e,body:{status:t,comment:null}}),n.success(`Moved to ${YQ[t]}`))}return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`flex-start`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Vk,{type:`link`,icon:(0,Z.jsx)(WZ,{}),style:{padding:0},onClick:()=>t(`/applications`),children:`Back to applications`}),(0,Z.jsx)(YX.Title,{level:3,style:{margin:0},children:r.jobTitle}),(0,Z.jsxs)(Pz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/companies/${r.company.id}`,children:r.company.name}),(0,Z.jsxs)(YX.Text,{type:`secondary`,children:[`applied `,r.appliedOn]}),(0,Z.jsx)(H8,{status:r.status})]})]}),(0,Z.jsxs)(Pz,{wrap:!0,children:[m&&(0,Z.jsxs)(Vk,{type:`primary`,onClick:()=>void h(m),children:[`Move to `,YQ[m]]}),(0,Z.jsx)(EE,{style:{width:150},value:r.status,onChange:e=>void h(e),options:GQ.map(e=>({value:e,label:YQ[e]}))}),(0,Z.jsx)(Vk,{icon:(0,Z.jsx)(QY,{}),onClick:()=>l(!0),children:`Edit`}),(0,Z.jsx)(VH,{title:`Delete this application?`,description:`Its notes and status history go too. This cannot be undone.`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{e&&(await o.mutateAsync(e),n.success(`Application deleted`),t(`/applications`))},children:(0,Z.jsx)(Vk,{danger:!0,icon:(0,Z.jsx)(YY,{})})})]})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:24,lg:14,children:(0,Z.jsx)(bF,{title:`Details`,children:(0,Z.jsxs)(nz,{column:{xs:1,sm:2},size:`small`,bordered:!0,children:[(0,Z.jsx)(nz.Item,{label:`Company`,children:r.company.name}),(0,Z.jsx)(nz.Item,{label:`Applied on`,children:r.appliedOn}),(0,Z.jsx)(nz.Item,{label:`Location`,children:r.location??`—`}),(0,Z.jsx)(nz.Item,{label:`Work mode`,children:ZQ[r.workMode]}),(0,Z.jsx)(nz.Item,{label:`Source`,children:r.sourceName??`—`}),(0,Z.jsx)(nz.Item,{label:`Follow up`,children:r.followUpOn??`—`}),(0,Z.jsx)(nz.Item,{label:`Salary`,span:2,children:r.salaryMin||r.salaryMax?`${r.salaryMin?.toLocaleString()??`?`} – ${r.salaryMax?.toLocaleString()??`?`} ${r.salaryCurrency??``}`:`—`}),(0,Z.jsx)(nz.Item,{label:`Posting`,span:2,children:r.jobUrl?(0,Z.jsx)(`a`,{href:r.jobUrl,target:`_blank`,rel:`noreferrer`,children:(0,Z.jsxs)(Pz,{size:4,children:[(0,Z.jsx)(mQ,{}),r.jobUrl]})}):`—`}),(0,Z.jsx)(nz.Item,{label:`Tags`,span:2,children:r.tags.length>0?(0,Z.jsx)(Pz,{size:4,wrap:!0,children:r.tags.map(e=>(0,Z.jsx)(OY,{children:e.name},e.id))}):`—`})]})})}),(0,Z.jsx)(II,{xs:24,lg:10,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(bF,{title:`Status history`,children:r.statusEvents.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No changes recorded`}):(0,Z.jsx)(KY,{items:r.statusEvents.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Text,{strong:!0,children:e.fromStatus?`${YQ[e.fromStatus]} → ${YQ[e.toStatus]}`:`Applied`}),(0,Z.jsx)(YX.Text,{type:`secondary`,style:{fontSize:12},children:e.occurredOn}),e.comment&&(0,Z.jsx)(YX.Text,{children:e.comment})]})}))})}),(0,Z.jsx)(bF,{title:`Notes (${r.notes.length})`,extra:(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(cP,{}),onClick:()=>p(!0),children:`Add note`}),children:r.notes.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No notes yet`}):(0,Z.jsx)(NH,{size:`small`,dataSource:r.notes,renderItem:e=>(0,Z.jsx)(NH.Item,{actions:[(0,Z.jsx)(Vk,{type:`text`,icon:(0,Z.jsx)(QY,{}),onClick:()=>d(e)},`edit`),(0,Z.jsx)(VH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await s.mutateAsync(e.id),n.success(`Note deleted`)},children:(0,Z.jsx)(Vk,{type:`text`,danger:!0,icon:(0,Z.jsx)(YY,{})})},`delete`)],children:(0,Z.jsx)(NH.Item.Meta,{title:(0,Z.jsxs)(Pz,{size:8,children:[e.pinned&&(0,Z.jsx)(CQ,{style:{color:`#faad14`}}),(0,Z.jsx)(YX.Text,{strong:!0,children:e.title})]}),description:(0,Z.jsx)(YX.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:4,expandable:!0,symbol:`more`},children:e.body})})})})})]})})]}),(0,Z.jsx)(Y8,{open:c,onClose:()=>l(!1),application:r}),(0,Z.jsx)(s5,{open:f||u!==null,note:u,target:{type:`application`,id:r.id,label:r.jobTitle},onClose:()=>{p(!1),d(null)}})]})}function u5(){let e=Xe(),[t,n]=(0,_.useState)(``),r=U8(t,300),{data:i,isLoading:a}=v8(r?{q:r}:{});return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Companies`}),(0,Z.jsx)(_V,{allowClear:!0,prefix:(0,Z.jsx)(xE,{}),placeholder:`Find a company`,style:{maxWidth:320},value:t,onChange:e=>n(e.target.value)})]}),(0,Z.jsx)(bF,{size:`small`,children:(0,Z.jsx)(hY,{rowKey:`id`,size:`middle`,loading:a,columns:[{title:`Company`,dataIndex:`name`,render:(e,t)=>(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Text,{strong:!0,children:e}),t.website&&(0,Z.jsx)(YX.Link,{href:t.website,target:`_blank`,style:{fontSize:12},children:t.website.replace(/^https?:\/\//,``)})]}),sorter:(e,t)=>e.name.localeCompare(t.name)},{title:`Applications`,dataIndex:`applicationCount`,width:140,align:`right`,sorter:(e,t)=>e.applicationCount-t.applicationCount,defaultSortOrder:`descend`,render:e=>(0,Z.jsx)(YX.Text,{strong:e>2,type:e>2?`warning`:void 0,children:e})},{title:`Active`,dataIndex:`activeCount`,width:90,align:`right`},{title:`Last applied`,dataIndex:`lastAppliedOn`,width:130,sorter:(e,t)=>(e.lastAppliedOn??``).localeCompare(t.lastAppliedOn??``),render:e=>e??(0,Z.jsx)(YX.Text,{type:`secondary`,children:`—`})},{title:`Tags`,key:`tags`,width:260,render:(e,t)=>(0,Z.jsx)(Pz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(OY,{style:{marginInlineEnd:0},children:e.name},e.id))})}],dataSource:i?.companies??[],pagination:{pageSize:25,hideOnSinglePage:!0},onRow:t=>({onClick:()=>e(`/companies/${t.id}`),style:{cursor:`pointer`}})})})]})}function d5(){let{id:e}=Qe(),t=Xe(),{message:n}=NC.useApp(),{data:r,isLoading:i}=y8(e),{data:a}=b8(e?{targetType:`company`,targetId:e}:{}),{data:o}=_8(),s=D8(),c=k8(),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1);if(i||!r)return(0,Z.jsx)(CS,{active:!0,paragraph:{rows:8}});let{company:p,applications:m}=r,h=m.filter(e=>[`applied`,`screening`,`interview`].includes(e.status)).length;return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Vk,{type:`link`,icon:(0,Z.jsx)(WZ,{}),style:{padding:0},onClick:()=>t(`/companies`),children:`Back to companies`}),(0,Z.jsx)(YX.Title,{level:3,style:{margin:0},children:p.name}),p.website&&(0,Z.jsx)(YX.Link,{href:p.website,target:`_blank`,children:p.website})]}),(0,Z.jsxs)(BU,{gutter:[16,16],children:[(0,Z.jsx)(II,{xs:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Applications`,value:m.length})})}),(0,Z.jsx)(II,{xs:12,md:6,children:(0,Z.jsx)(bF,{children:(0,Z.jsx)(QU,{title:`Still active`,value:h,valueStyle:{color:Z8.accent}})})}),(0,Z.jsx)(II,{xs:24,md:12,children:(0,Z.jsx)(bF,{children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)(YX.Text,{type:`secondary`,children:`Company tags`}),(0,Z.jsx)(EE,{mode:`tags`,style:{width:`100%`},placeholder:`fintech, remote-first…`,value:p.tags.map(e=>e.name),options:(o?.tags??[]).map(e=>({value:e.name,label:e.name})),onChange:t=>{e&&s.mutate({id:e,body:{tags:t}})}})]})})})]}),(0,Z.jsx)(bF,{title:`Application history`,children:(0,Z.jsx)(hY,{rowKey:`id`,size:`middle`,columns:[{title:`Applied`,dataIndex:`appliedOn`,width:120},{title:`Job title`,dataIndex:`jobTitle`,render:e=>(0,Z.jsx)(YX.Text,{strong:!0,children:e})},{title:`Status`,dataIndex:`status`,width:120,render:(e,t)=>(0,Z.jsx)(H8,{status:t.status})},{title:`Source`,dataIndex:`sourceName`,width:130}],dataSource:m,pagination:!1,onRow:e=>({onClick:()=>t(`/applications/${e.id}`),style:{cursor:`pointer`}})})}),(0,Z.jsx)(bF,{title:`Notes about ${p.name}`,extra:(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(cP,{}),onClick:()=>f(!0),children:`Add note`}),children:(a?.notes??[]).length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:`No notes about this company`}):(0,Z.jsx)(NH,{dataSource:a?.notes??[],renderItem:e=>(0,Z.jsx)(NH.Item,{actions:[(0,Z.jsx)(Vk,{type:`text`,icon:(0,Z.jsx)(QY,{}),onClick:()=>u(e)},`edit`),(0,Z.jsx)(VH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await c.mutateAsync(e.id),n.success(`Note deleted`)},children:(0,Z.jsx)(Vk,{type:`text`,danger:!0,icon:(0,Z.jsx)(YY,{})})},`delete`)],children:(0,Z.jsx)(NH.Item.Meta,{title:(0,Z.jsxs)(Pz,{size:8,children:[e.pinned&&(0,Z.jsx)(CQ,{style:{color:`#faad14`}}),(0,Z.jsx)(YX.Text,{strong:!0,children:e.title})]}),description:(0,Z.jsx)(YX.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},children:e.body})})})})}),(0,Z.jsx)(s5,{open:d||l!==null,note:l,target:{type:`company`,id:p.id,label:p.name},onClose:()=>{f(!1),u(null)}})]})}function f5(){let{message:e}=NC.useApp(),[t,n]=(0,_.useState)(`all`),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),{data:l,isLoading:u}=b8(t===`all`?{}:{targetType:t}),d=k8(),f=l?.notes??[],p=(0,_.useMemo)(()=>{let e=r.trim().toLowerCase();return e?f.filter(t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||(t.targetLabel?.toLowerCase().includes(e)??!1)):f},[f,r]);return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Notes`}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(XI,{value:t,onChange:e=>n(e),options:[{label:`All`,value:`all`},{label:`Standalone`,value:`standalone`},{label:`Companies`,value:`company`},{label:`Applications`,value:`application`}]}),(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(cP,{}),onClick:()=>c(!0),children:`New note`})]})]}),(0,Z.jsx)(_V,{allowClear:!0,prefix:(0,Z.jsx)(xE,{}),placeholder:`Search notes by title, body, or what they're attached to`,value:r,onChange:e=>i(e.target.value)}),(0,Z.jsx)(bF,{size:`small`,loading:u,children:p.length===0?(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:r?`Nothing matched “${r}”`:`No notes here yet`}):(0,Z.jsx)(NH,{dataSource:p,renderItem:t=>(0,Z.jsx)(NH.Item,{actions:[(0,Z.jsx)(Vk,{type:`text`,icon:(0,Z.jsx)(QY,{}),onClick:()=>o(t)},`edit`),(0,Z.jsx)(VH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await d.mutateAsync(t.id),e.success(`Note deleted`)},children:(0,Z.jsx)(Vk,{type:`text`,danger:!0,icon:(0,Z.jsx)(YY,{})})},`delete`)],children:(0,Z.jsx)(NH.Item.Meta,{title:(0,Z.jsxs)(Pz,{size:8,wrap:!0,children:[t.pinned&&(0,Z.jsx)(CQ,{style:{color:`#faad14`}}),(0,Z.jsx)(YX.Text,{strong:!0,children:t.title}),(0,Z.jsx)(p5,{note:t})]}),description:(0,Z.jsx)(YX.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:3,expandable:!0,symbol:`more`},children:t.body})})})})}),(0,Z.jsx)(s5,{open:s||a!==null,note:a,onClose:()=>{c(!1),o(null)}})]})}function p5({note:e}){if(e.targetType===`standalone`)return(0,Z.jsx)(OY,{children:`general`});if(!e.targetId)return(0,Z.jsx)(OY,{children:`unlinked`});let t=e.targetType===`company`?`/companies/${e.targetId}`:`/applications/${e.targetId}`;return(0,Z.jsx)(dn,{to:t,children:(0,Z.jsxs)(OY,{color:`blue`,children:[e.targetType,`: `,e.targetLabel??`view`]})})}function m5({open:e,onClose:t,opening:n}){let[r]=WB.useForm(),{message:i}=NC.useApp(),a=!!n,o=M8(),s=N8(),{data:c}=S8(WB.useWatch(`companyName`,r)??``);(0,_.useEffect)(()=>{e&&(n?r.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,savedOn:(0,Yk.default)(n.savedOn),jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,notes:n.notes??void 0}):(r.resetFields(),r.setFieldsValue({savedOn:(0,Yk.default)(),workMode:`unspecified`})))},[e,n,r]);let l=(0,_.useMemo)(()=>(c?.companies??[]).map(e=>({value:e.name})),[c]);async function u(e){let c={companyName:e.companyName,jobTitle:e.jobTitle,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,notes:e.notes??null,...a?{}:{savedOn:e.savedOn.format(`YYYY-MM-DD`)}};try{n?(await s.mutateAsync({id:n.id,body:c}),i.success(`Opening updated`)):(await o.mutateAsync(c),i.success(`Opening saved`)),t()}catch(e){e instanceof Q6&&e.fieldErrors.length>0?(r.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),i.error(`Please check the highlighted fields`)):i.error(e instanceof Error?e.message:`Could not save`)}}return(0,Z.jsxs)(Tz,{title:a?`Edit opening`:`Save opening for later`,open:e,onClose:t,width:560,destroyOnHidden:!0,extra:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Vk,{type:`primary`,loading:o.isPending||s.isPending,onClick:()=>r.submit(),children:a?`Save changes`:`Save opening`})]}),children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,children:`For a role you found but are not ready to apply to yet — no status, no tags, just enough to find it again. Convert it into a real application when you are ready.`}),(0,Z.jsxs)(WB,{form:r,layout:`vertical`,onFinish:u,requiredMark:`optional`,children:[(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(NE,{options:l,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(II,{span:12,children:(0,Z.jsx)(WB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(_V,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`savedOn`,label:`Found on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`,disabled:a})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(EE,{options:XQ.map(e=>({value:e,label:ZQ[e]}))})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(_V,{placeholder:`Stockholm`})})})]}),(0,Z.jsxs)(BU,{gutter:16,children:[(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(LL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(II,{span:8,children:(0,Z.jsx)(WB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(_V,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(WB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(_V,{placeholder:`LinkedIn, referral…`})}),(0,Z.jsx)(WB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(_V,{placeholder:`https://…`})}),(0,Z.jsx)(WB.Item,{name:`notes`,label:`Notes`,children:(0,Z.jsx)(_V.TextArea,{rows:4,placeholder:`Why this looked interesting, what you're missing to apply…`})})]})]})}function h5(){let e=Xe(),{message:t}=NC.useApp(),[n,r]=(0,_.useState)(`active`),{data:i,isLoading:a}=A8(n===`archived`?{archived:!0}:{}),{data:o}=_8(),s=P8(),c=F8(),l=N8(),u=(0,_.useMemo)(()=>{let e=i?.openings??[];return n===`archived`?e.filter(e=>e.archived):e},[i,n]),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(void 0),[h,g]=(0,_.useState)(null),[v]=WB.useForm();function y(e){g(e),v.setFieldsValue({appliedOn:(0,Yk.default)(),status:`applied`,tags:[]})}async function b(n){if(h)try{let r=await c.mutateAsync({id:h.id,body:{appliedOn:n.appliedOn.format(`YYYY-MM-DD`),status:n.status,tags:n.tags??[]}});t.success(`Converted to an application`),g(null),e(`/applications/${r.id}`)}catch(e){t.error(e instanceof Error?e.message:`Could not convert`)}}async function x(e){try{await l.mutateAsync({id:e.id,body:{archived:!1}}),t.success(`Opening restored`)}catch(e){t.error(e instanceof Error?e.message:`Could not restore`)}}let S=[{title:`Company`,dataIndex:[`company`,`name`]},{title:`Job title`,dataIndex:`jobTitle`},{title:`Found on`,dataIndex:`savedOn`,width:120},{title:`Location`,key:`location`,render:(e,t)=>[t.location,ZQ[t.workMode]].filter(Boolean).join(` · `)||(0,Z.jsx)(YX.Text,{type:`secondary`,children:`—`})},{title:`Source`,dataIndex:`sourceName`,render:e=>e??`—`}],C=e=>e.jobUrl&&(0,Z.jsx)(gD,{title:`Open job posting`,children:(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(mQ,{}),href:e.jobUrl,target:`_blank`,rel:`noreferrer`})}),w=e=>(0,Z.jsx)(VH,{title:`Delete this opening?`,description:`This removes it for good and cannot be undone.`,onConfirm:()=>s.mutate(e.id),okText:`Delete`,okButtonProps:{danger:!0},children:(0,Z.jsx)(Vk,{size:`small`,danger:!0,children:`Delete`})}),T=[...S,{title:``,key:`actions`,width:260,render:(e,t)=>(0,Z.jsxs)(Pz,{onClick:e=>e.stopPropagation(),children:[C(t),(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(qB,{}),onClick:()=>y(t),children:`Convert`}),(0,Z.jsx)(Vk,{size:`small`,onClick:()=>{m(t),f(!0)},children:`Edit`}),w(t)]})}],E=[...S,{title:`Archived because`,key:`reason`,width:160,render:(e,t)=>t.convertedApplicationId?(0,Z.jsx)(dn,{to:`/applications/${t.convertedApplicationId}`,children:(0,Z.jsx)(OY,{color:`blue`,children:`Converted`})}):(0,Z.jsx)(OY,{children:`Archived by hand`})},{title:``,key:`actions`,width:220,render:(e,t)=>(0,Z.jsxs)(Pz,{onClick:e=>e.stopPropagation(),children:[C(t),(0,Z.jsx)(Vk,{size:`small`,icon:(0,Z.jsx)(EQ,{}),loading:l.isPending,onClick:()=>x(t),children:`Restore`}),w(t)]})}];return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Xz,{justify:`space-between`,align:`center`,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Job openings`}),(0,Z.jsx)(YX.Text,{type:`secondary`,children:n===`active`?`Saved for later — convert one to a real application when you're ready to apply.`:`Openings that were converted into an application or archived by hand.`})]}),(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(cP,{}),onClick:()=>{m(void 0),f(!0)},children:`Save opening for later`})]}),(0,Z.jsx)(XI,{value:n,onChange:r,options:[{label:`Active`,value:`active`},{label:`Archived`,value:`archived`}]}),(0,Z.jsx)(bF,{size:`small`,children:(0,Z.jsx)(hY,{rowKey:`id`,columns:n===`archived`?E:T,dataSource:u,loading:a,pagination:!1,locale:{emptyText:(0,Z.jsx)(YT,{image:YT.PRESENTED_IMAGE_SIMPLE,description:n===`active`?`Nothing saved yet — use “Save opening for later” for a role you're not ready to apply to.`:`No archived openings.`})}})}),(0,Z.jsx)(m5,{open:d,onClose:()=>f(!1),opening:p}),(0,Z.jsx)(LH,{title:h?`Convert "${h.jobTitle}" at ${h.company.name}`:``,open:!!h,onCancel:()=>g(null),onOk:()=>v.submit(),okText:`Create application`,confirmLoading:c.isPending,children:(0,Z.jsxs)(WB,{form:v,layout:`vertical`,onFinish:b,children:[(0,Z.jsx)(WB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0}],children:(0,Z.jsx)(HR,{style:{width:`100%`},format:`YYYY-MM-DD`})}),(0,Z.jsx)(WB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(EE,{options:GQ.map(e=>({value:e,label:YQ[e]}))})}),(0,Z.jsx)(WB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(EE,{mode:`tags`,options:(o?.tags??[]).map(e=>({value:e.name,label:e.name})),placeholder:`fintech, remote-ok…`,tokenSeparators:[`,`]})})]})})]})}var g5={companies:`Companies`,applications:`Applications`,tags:`Tags`,tagLinks:`Tag links`,notes:`Notes`,statusEvents:`Status events`,jobOpenings:`Job openings`};function _5({counts:e}){return(0,Z.jsx)(nz,{size:`small`,column:2,bordered:!0,children:Object.entries(e).map(([e,t])=>(0,Z.jsx)(nz.Item,{label:g5[e]??e,children:t},e))})}function v5(){let{message:e}=NC.useApp(),{data:t,isLoading:n}=I8(),r=L8(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current&&clearInterval(c.current)},[]);function l(t){LH.confirm({title:`Switch to "${t}"?`,content:"The server restarts to connect to the new target. This page will reconnect and reload automatically once it is back — under `npm run dev`, that may require restarting it by hand.",okText:`Switch and restart`,onOk:async()=>{try{await r.mutateAsync(t)}catch(t){e.error(t instanceof Error?t.message:`Could not switch database`);return}s(!0),c.current=setInterval(()=>{u8.getDbTargets().then(()=>{c.current&&clearInterval(c.current),window.location.reload()}).catch(()=>{})},500)}})}if(o)return(0,Z.jsx)(bF,{title:`Database`,children:(0,Z.jsx)(zU,{icon:(0,Z.jsx)(CU,{spin:!0}),title:`Reconnecting…`,subTitle:`Waiting for the server to come back up.`})});let u=t?.targets??[];return(0,Z.jsx)(bF,{title:`Database`,loading:n,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)(YX.Paragraph,{type:`secondary`,style:{marginBottom:0},children:[`Connection settings live in `,(0,Z.jsx)(`code`,{children:`.env`}),` and are never shown or editable here.`,u.length<=1&&` Only one target is configured, so there is nothing to switch between.`]}),(0,Z.jsx)(nz,{size:`small`,column:1,bordered:!0,children:(0,Z.jsx)(nz.Item,{label:`Active target`,children:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)($Z,{}),t?.active,` (`,u.find(e=>e.name===t?.active)?.driver,`)`]})})}),u.length>1&&(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(EE,{style:{width:220},value:i??t?.active,options:u.map(e=>({value:e.name,label:`${e.name} (${e.driver})`})),onChange:a}),(0,Z.jsx)(Vk,{type:`primary`,disabled:!i||i===t?.active,loading:r.isPending,onClick:()=>i&&l(i),children:`Switch`})]})]})})}function y5(){let{message:e}=NC.useApp(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1);function p(){n(null),i(null),o(null),u(null)}function m(){p(),f(!1)}let h=e=>(n(e),u(null),c(!0),u8.previewBackup(e).then(i).catch(e=>u(e instanceof Error?e.message:`Could not read that file`)).finally(()=>c(!1)),!1);function g(){t&&LH.confirm({title:`Replace all data in the active database?`,content:`Every table is wiped and recreated from this backup. This cannot be undone.`,okText:`Restore`,okButtonProps:{danger:!0},onOk:async()=>{c(!0),u(null);try{let e=await u8.commitBackup(t);o(e)}catch(t){e.error(t instanceof Error?t.message:`Restore failed`)}finally{c(!1)}}})}return(0,Z.jsxs)(bF,{title:`Backup & restore`,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`A full-fidelity snapshot of every table — every field, every relation, driver-agnostic. Not the same as the CSV/Excel export elsewhere in the app, which is a lossy report meant for people to read. This file is scrambled (gzip + obfuscation) so it isn't plain, readable JSON at rest — that's an obfuscation step, not encryption, and does not protect the personal data inside from anyone who actually wants it.`}),(0,Z.jsx)(Vk,{icon:(0,Z.jsx)($Z,{}),onClick:()=>{window.location.href=u8.backupExportUrl},children:`Export backup`}),(0,Z.jsx)(Vk,{onClick:()=>f(!0),children:`Restore from backup…`})]}),(0,Z.jsx)(LH,{title:`Restore from backup`,open:d,onCancel:m,width:600,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!r&&!a&&(0,Z.jsxs)(VZ.Dragger,{accept:`.jtbak`,maxCount:1,showUploadList:!1,beforeUpload:h,disabled:s,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(cQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a JobTrack backup file (.jtbak) here`})]}),l&&(0,Z.jsx)(jp,{type:`error`,showIcon:!0,message:l}),r&&!a&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(YX.Text,{type:`secondary`,children:[`Backup taken `,new Date(r.exportedAt).toLocaleString(),`. Restoring will replace everything currently in the active database with:`]}),(0,Z.jsx)(_5,{counts:r.counts}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:p,children:`Choose a different file`}),(0,Z.jsx)(Vk,{type:`primary`,danger:!0,loading:s,onClick:g,children:`Restore`})]})]}),a&&(0,Z.jsx)(zU,{status:`success`,title:`Restore complete`,extra:(0,Z.jsxs)(Pz,{direction:`vertical`,style:{width:`100%`},children:[(0,Z.jsx)(_5,{counts:a.counts}),(0,Z.jsx)(Vk,{type:`primary`,onClick:()=>window.location.reload(),children:`Reload`})]})})]})})]})}var b5=`CLEAR`;function x5(){let{message:e}=NC.useApp(),{data:t,isLoading:n}=R8(),r=z8(),i=B8(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``);function l(){o(!1),c(``)}function u(){r.mutate(void 0,{onSuccess:()=>{e.success(`Database cleared`),l()},onError:t=>e.error(t instanceof Error?t.message:`Could not clear the database`)})}function d(){i.mutate(void 0,{onSuccess:t=>e.success(`Seeded ${t.applications} applications and ${t.companies} companies`),onError:t=>e.error(t instanceof Error?t.message:`Could not seed the database`)})}let f=t?.counts??{};return(0,Z.jsxs)(bF,{title:`Reset & demo data`,loading:n,children:[(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(YX.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`Wipe everything in the active database, or — only while it's empty — fill it with a realistic multi-year demo dataset to explore the app with.`}),!t?.empty&&(0,Z.jsx)(_5,{counts:f}),(0,Z.jsxs)(Pz,{wrap:!0,children:[t?.empty&&(0,Z.jsx)(Vk,{type:`primary`,icon:(0,Z.jsx)(nQ,{}),loading:i.isPending,onClick:d,children:`Seed with demo data`}),(0,Z.jsx)(Vk,{danger:!0,disabled:t?.empty,onClick:()=>o(!0),children:`Clear database…`})]})]}),(0,Z.jsx)(LH,{title:`Clear the active database?`,open:a,onCancel:l,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(jp,{type:`warning`,showIcon:!0,message:`This permanently deletes every row below. There is no undo — export a backup first if you might want this data again.`}),(0,Z.jsx)(_5,{counts:f}),(0,Z.jsxs)(YX.Text,{children:[`Type `,(0,Z.jsx)(YX.Text,{code:!0,children:b5}),` to confirm.`]}),(0,Z.jsx)(_V,{value:s,onChange:e=>c(e.target.value),placeholder:b5,onPressEnter:()=>s===b5&&u()}),(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(Vk,{onClick:l,children:`Cancel`}),(0,Z.jsx)(Vk,{danger:!0,type:`primary`,disabled:s!==b5,loading:r.isPending,onClick:u,children:`Clear database`})]})]})})]})}function S5(){let{data:e,isLoading:t}=V8(),n=e?`${e.name} ${e.version}`:``;return(0,Z.jsx)(bF,{title:`About`,loading:t,children:(0,Z.jsxs)(nz,{size:`small`,column:1,bordered:!0,children:[(0,Z.jsx)(nz.Item,{label:`Running`,children:(0,Z.jsxs)(Pz,{children:[(0,Z.jsx)(dQ,{}),(0,Z.jsxs)(YX.Text,{copyable:{text:n},children:[(0,Z.jsx)(`code`,{children:e?.name}),` `,e?.version]})]})}),(0,Z.jsx)(nz.Item,{label:`Database driver`,children:e?.driver})]})})}function C5(){return(0,Z.jsxs)(Pz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(YX.Title,{level:4,style:{margin:0},children:`Settings`}),(0,Z.jsx)(v5,{}),(0,Z.jsx)(y5,{}),(0,Z.jsx)(x5,{}),(0,Z.jsx)(S5,{})]})}var w5=`jobtrack.theme`,T5=[{key:`/dashboard`,icon:(0,Z.jsx)(XZ,{}),label:(0,Z.jsx)(dn,{to:`/dashboard`,children:`Dashboard`})},{key:`/applications`,icon:(0,Z.jsx)(bQ,{}),label:(0,Z.jsx)(dn,{to:`/applications`,children:`Applications`})},{key:`/openings`,icon:(0,Z.jsx)(qZ,{}),label:(0,Z.jsx)(dn,{to:`/openings`,children:`Openings`})},{key:`/companies`,icon:(0,Z.jsx)(FQ,{}),label:(0,Z.jsx)(dn,{to:`/companies`,children:`Companies`})},{key:`/notes`,icon:(0,Z.jsx)($z,{}),label:(0,Z.jsx)(dn,{to:`/notes`,children:`Notes`})},{key:`/settings`,icon:(0,Z.jsx)(MQ,{}),label:(0,Z.jsx)(dn,{to:`/settings`,children:`Settings`})}],E5=[{key:`light`,icon:(0,Z.jsx)(RQ,{}),label:`Light`},{key:`dark`,icon:(0,Z.jsx)(_Q,{}),label:`Dark`}];function D5(){let[e,t]=(0,_.useState)(()=>{try{let e=localStorage.getItem(w5);if(e)return e===`dark`}catch{}return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1});(0,_.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e?`dark`:`light`);try{localStorage.setItem(w5,e?`dark`:`light`)}catch{}},[e]);let n=qe(),r=(0,_.useMemo)(()=>{let e=T5.find(e=>n.pathname.startsWith(e.key));return e?[e.key]:[`/dashboard`]},[n.pathname]);return(0,Z.jsx)(Nh,{theme:Q8(e?`dark`:`light`),children:(0,Z.jsx)(NC,{children:(0,Z.jsxs)(EV,{style:{minHeight:`100vh`},children:[(0,Z.jsxs)(EV.Header,{style:{display:`flex`,alignItems:`center`,gap:24,paddingInline:24,borderBottom:`1px solid ${Z8.border}`,position:`sticky`,top:0,zIndex:10},children:[(0,Z.jsxs)(YX.Title,{level:4,style:{margin:0,whiteSpace:`nowrap`},children:[`Job`,(0,Z.jsx)(`span`,{style:{color:Z8.accent},children:`Track`})]}),(0,Z.jsx)(Fk,{mode:`horizontal`,selectedKeys:r,items:T5,style:{flex:1,minWidth:0,borderBottom:`none`}}),(0,Z.jsx)(Iz,{trigger:[`click`],menu:{items:E5,selectable:!0,selectedKeys:[e?`dark`:`light`],onClick:({key:e})=>t(e===`dark`)},children:(0,Z.jsx)(Vk,{icon:e?(0,Z.jsx)(_Q,{}):(0,Z.jsx)(RQ,{}),"aria-label":`Theme settings`,children:`Theme`})})]}),(0,Z.jsx)(EV.Content,{style:{padding:24},children:(0,Z.jsxs)(Ct,{children:[(0,Z.jsx)(xt,{path:`/`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})}),(0,Z.jsx)(xt,{path:`/dashboard`,element:(0,Z.jsx)($8,{})}),(0,Z.jsx)(xt,{path:`/applications`,element:(0,Z.jsx)(a5,{})}),(0,Z.jsx)(xt,{path:`/applications/:id`,element:(0,Z.jsx)(l5,{})}),(0,Z.jsx)(xt,{path:`/openings`,element:(0,Z.jsx)(h5,{})}),(0,Z.jsx)(xt,{path:`/companies`,element:(0,Z.jsx)(u5,{})}),(0,Z.jsx)(xt,{path:`/companies/:id`,element:(0,Z.jsx)(d5,{})}),(0,Z.jsx)(xt,{path:`/notes`,element:(0,Z.jsx)(f5,{})}),(0,Z.jsx)(xt,{path:`/settings`,element:(0,Z.jsx)(C5,{})}),(0,Z.jsx)(xt,{path:`*`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})})]})})]})})})}var O5=new Pr({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}});(0,v.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(_.StrictMode,{children:(0,Z.jsx)(En,{client:O5,children:(0,Z.jsx)(un,{children:(0,Z.jsx)(D5,{})})})}));
|
|
444
|
+
//# sourceMappingURL=index-Bqi0Bj8-.js.map
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" role="img" aria-label="JobTrack">
|
|
2
|
-
<title>JobTrack</title>
|
|
3
|
-
|
|
4
|
-
<!--
|
|
5
|
-
A track of waypoints climbing toward a goal.
|
|
6
|
-
|
|
7
|
-
"Track" is both what the app does and the shape of the mark: three stages on a path,
|
|
8
|
-
each more prominent than the last, ending in a highlighted node. It reads as progress
|
|
9
|
-
through a pipeline without resorting to a briefcase, a checkmark, or a bar chart —
|
|
10
|
-
the last of which would misrepresent an app that is deliberately a list, not a report.
|
|
11
|
-
|
|
12
|
-
Geometry is tuned for 16px: a 3px stroke on a 32 grid is ~9% of the width, which
|
|
13
|
-
survives downsampling, and the terminal node is nearly twice the radius of the first
|
|
14
|
-
so the direction of travel stays legible when the detail collapses.
|
|
15
|
-
-->
|
|
16
|
-
|
|
17
|
-
<defs>
|
|
18
|
-
<linearGradient id="tile" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
|
19
|
-
<!-- Indigo 500 → 700, straddling the #4f46e5 primary used in the app theme. -->
|
|
20
|
-
<stop offset="0" stop-color="#6366f1" />
|
|
21
|
-
<stop offset="1" stop-color="#4338ca" />
|
|
22
|
-
</linearGradient>
|
|
23
|
-
</defs>
|
|
24
|
-
|
|
25
|
-
<rect width="32" height="32" rx="7.5" fill="url(#tile)" />
|
|
26
|
-
|
|
27
|
-
<!-- The path already traveled, held back so the nodes carry the emphasis. -->
|
|
28
|
-
<path
|
|
29
|
-
d="M8 23 L14.5 16.5 L23.5 9.5"
|
|
30
|
-
fill="none"
|
|
31
|
-
stroke="#ffffff"
|
|
32
|
-
stroke-width="3"
|
|
33
|
-
stroke-linecap="round"
|
|
34
|
-
stroke-linejoin="round"
|
|
35
|
-
opacity="0.45"
|
|
36
|
-
/>
|
|
37
|
-
|
|
38
|
-
<!-- Earlier stages: present, but clearly behind. -->
|
|
39
|
-
<circle cx="8" cy="23" r="3" fill="#ffffff" opacity="0.6" />
|
|
40
|
-
<circle cx="14.5" cy="16.5" r="3" fill="#ffffff" opacity="0.8" />
|
|
41
|
-
|
|
42
|
-
<!-- The current stage: solid, ringed, and the only fully opaque element. -->
|
|
43
|
-
<circle cx="23.5" cy="9.5" r="4.5" fill="#ffffff" />
|
|
44
|
-
<circle cx="23.5" cy="9.5" r="1.75" fill="#4338ca" />
|
|
45
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" role="img" aria-label="JobTrack">
|
|
2
|
+
<title>JobTrack</title>
|
|
3
|
+
|
|
4
|
+
<!--
|
|
5
|
+
A track of waypoints climbing toward a goal.
|
|
6
|
+
|
|
7
|
+
"Track" is both what the app does and the shape of the mark: three stages on a path,
|
|
8
|
+
each more prominent than the last, ending in a highlighted node. It reads as progress
|
|
9
|
+
through a pipeline without resorting to a briefcase, a checkmark, or a bar chart —
|
|
10
|
+
the last of which would misrepresent an app that is deliberately a list, not a report.
|
|
11
|
+
|
|
12
|
+
Geometry is tuned for 16px: a 3px stroke on a 32 grid is ~9% of the width, which
|
|
13
|
+
survives downsampling, and the terminal node is nearly twice the radius of the first
|
|
14
|
+
so the direction of travel stays legible when the detail collapses.
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
<defs>
|
|
18
|
+
<linearGradient id="tile" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
|
19
|
+
<!-- Indigo 500 → 700, straddling the #4f46e5 primary used in the app theme. -->
|
|
20
|
+
<stop offset="0" stop-color="#6366f1" />
|
|
21
|
+
<stop offset="1" stop-color="#4338ca" />
|
|
22
|
+
</linearGradient>
|
|
23
|
+
</defs>
|
|
24
|
+
|
|
25
|
+
<rect width="32" height="32" rx="7.5" fill="url(#tile)" />
|
|
26
|
+
|
|
27
|
+
<!-- The path already traveled, held back so the nodes carry the emphasis. -->
|
|
28
|
+
<path
|
|
29
|
+
d="M8 23 L14.5 16.5 L23.5 9.5"
|
|
30
|
+
fill="none"
|
|
31
|
+
stroke="#ffffff"
|
|
32
|
+
stroke-width="3"
|
|
33
|
+
stroke-linecap="round"
|
|
34
|
+
stroke-linejoin="round"
|
|
35
|
+
opacity="0.45"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<!-- Earlier stages: present, but clearly behind. -->
|
|
39
|
+
<circle cx="8" cy="23" r="3" fill="#ffffff" opacity="0.6" />
|
|
40
|
+
<circle cx="14.5" cy="16.5" r="3" fill="#ffffff" opacity="0.8" />
|
|
41
|
+
|
|
42
|
+
<!-- The current stage: solid, ringed, and the only fully opaque element. -->
|
|
43
|
+
<circle cx="23.5" cy="9.5" r="4.5" fill="#ffffff" />
|
|
44
|
+
<circle cx="23.5" cy="9.5" r="1.75" fill="#4338ca" />
|
|
45
|
+
</svg>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<meta name="description" content="Track job applications, spot the ones you have already applied for, and search them by meaning." />
|
|
20
20
|
<title>JobTrack</title>
|
|
21
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
+
<script type="module" crossorigin src="/assets/index-Bqi0Bj8-.js"></script>
|
|
22
22
|
<link rel="stylesheet" crossorigin href="/assets/index-CRnClsEb.css">
|
|
23
23
|
</head>
|
|
24
24
|
<body>
|