From 22701536253645a59c70a09db94c44906d898e9e Mon Sep 17 00:00:00 2001 From: Azarattum Date: Sun, 7 Jan 2024 16:47:05 +0000 Subject: [PATCH] deploy: e20a785bd47adf0a85f8181f932de45eb5b827c8 --- ...nner.Gammt8NE.css => Spinner.y9ukOJz4.css} | 2 +- ...ion.NWTCPfm4.js => Collection.skwpo2VZ.js} | 2 +- .../{Input.hoDY5QId.js => Input.UuPw_Vot.js} | 2 +- ...rview.T1RnAS_v.js => Overview.bs2WCKrP.js} | 2 +- ...{Player.J8CE-V80.js => Player.4gabUvVV.js} | 2 +- ...svelte_svelte_type_style_lang.NQN6mtec.js} | 2 +- .../{Track.LR7rfYB8.js => Track.oiOqwbPY.js} | 16 ++--- ...oll.ckBVSgbF.js => autoscroll.sHJkSdr1.js} | 2 +- _app/immutable/chunks/paths.G112lh3q.js | 1 + _app/immutable/chunks/paths.k6rcf9P1.js | 1 - ...ons.SU60C52I.js => singletons.jOGqwJDW.js} | 2 +- ...{stores.jWdOIcrH.js => stores.iu7Qu9dF.js} | 2 +- ...{stream.M_jKrRc6.js => stream.ZDy3xr7S.js} | 2 +- .../{util.VvTXxVpP.js => util.2xyf67Ew.js} | 2 +- .../{app.bQ640Oms.js => app.6ArcEPHP.js} | 4 +- .../{start.iOjyZDAK.js => start.E31lhqZi.js} | 2 +- .../nodes/{0.PbakYmpN.js => 0.ow-t_F9E.js} | 2 +- .../nodes/{1.hmCh84a7.js => 1.THNaTtoM.js} | 2 +- .../nodes/{10.E6IsHE3D.js => 10.rMwDKcDJ.js} | 2 +- .../nodes/{11.RfDk6xuo.js => 11.wOQFq_L3.js} | 2 +- .../nodes/{3.8QmKai-d.js => 3.JaftQo5l.js} | 2 +- .../nodes/{4.VR3ziamF.js => 4.zI7EMXNC.js} | 2 +- .../nodes/{5.IMsjhbl6.js => 5.6E1Dv1RD.js} | 2 +- .../nodes/{6.M-At1isD.js => 6.w3KI7Lna.js} | 2 +- .../nodes/{7.YHXThGsn.js => 7.FeXnvpF2.js} | 2 +- .../nodes/{8.Ow38-iKz.js => 8.UPr0t3xw.js} | 2 +- .../nodes/{9.oqKgscox.js => 9.py_ynymV.js} | 2 +- _app/version.json | 2 +- explore.html | 62 +++++++++---------- explore/album.html | 62 +++++++++---------- explore/artist.html | 62 +++++++++---------- home.html | 62 +++++++++---------- home/playlist.html | 60 +++++++++--------- library.html | 60 +++++++++--------- library/artist.html | 60 +++++++++--------- library/playlist.html | 60 +++++++++--------- service-worker.js | 2 +- settings.html | 50 +++++++-------- 38 files changed, 305 insertions(+), 305 deletions(-) rename _app/immutable/assets/{Spinner.Gammt8NE.css => Spinner.y9ukOJz4.css} (99%) rename _app/immutable/chunks/{Collection.NWTCPfm4.js => Collection.skwpo2VZ.js} (96%) rename _app/immutable/chunks/{Input.hoDY5QId.js => Input.UuPw_Vot.js} (97%) rename _app/immutable/chunks/{Overview.T1RnAS_v.js => Overview.bs2WCKrP.js} (97%) rename _app/immutable/chunks/{Player.J8CE-V80.js => Player.4gabUvVV.js} (99%) rename _app/immutable/chunks/{Spinner.svelte_svelte_type_style_lang.azhq3UA4.js => Spinner.svelte_svelte_type_style_lang.NQN6mtec.js} (99%) rename _app/immutable/chunks/{Track.LR7rfYB8.js => Track.oiOqwbPY.js} (56%) rename _app/immutable/chunks/{autoscroll.ckBVSgbF.js => autoscroll.sHJkSdr1.js} (89%) create mode 100644 _app/immutable/chunks/paths.G112lh3q.js delete mode 100644 _app/immutable/chunks/paths.k6rcf9P1.js rename _app/immutable/chunks/{singletons.SU60C52I.js => singletons.jOGqwJDW.js} (94%) rename _app/immutable/chunks/{stores.jWdOIcrH.js => stores.iu7Qu9dF.js} (78%) rename _app/immutable/chunks/{stream.M_jKrRc6.js => stream.ZDy3xr7S.js} (86%) rename _app/immutable/chunks/{util.VvTXxVpP.js => util.2xyf67Ew.js} (98%) rename _app/immutable/entry/{app.bQ640Oms.js => app.6ArcEPHP.js} (79%) rename _app/immutable/entry/{start.iOjyZDAK.js => start.E31lhqZi.js} (99%) rename _app/immutable/nodes/{0.PbakYmpN.js => 0.ow-t_F9E.js} (98%) rename _app/immutable/nodes/{1.hmCh84a7.js => 1.THNaTtoM.js} (91%) rename _app/immutable/nodes/{10.E6IsHE3D.js => 10.rMwDKcDJ.js} (89%) rename _app/immutable/nodes/{11.RfDk6xuo.js => 11.wOQFq_L3.js} (94%) rename _app/immutable/nodes/{3.8QmKai-d.js => 3.JaftQo5l.js} (97%) rename _app/immutable/nodes/{4.VR3ziamF.js => 4.zI7EMXNC.js} (79%) rename _app/immutable/nodes/{5.IMsjhbl6.js => 5.6E1Dv1RD.js} (79%) rename _app/immutable/nodes/{6.M-At1isD.js => 6.w3KI7Lna.js} (95%) rename _app/immutable/nodes/{7.YHXThGsn.js => 7.FeXnvpF2.js} (89%) rename _app/immutable/nodes/{8.Ow38-iKz.js => 8.UPr0t3xw.js} (96%) rename _app/immutable/nodes/{9.oqKgscox.js => 9.py_ynymV.js} (79%) diff --git a/_app/immutable/assets/Spinner.Gammt8NE.css b/_app/immutable/assets/Spinner.y9ukOJz4.css similarity index 99% rename from _app/immutable/assets/Spinner.Gammt8NE.css rename to _app/immutable/assets/Spinner.y9ukOJz4.css index 37f4f97d..3ec0e8fb 100644 --- a/_app/immutable/assets/Spinner.Gammt8NE.css +++ b/_app/immutable/assets/Spinner.y9ukOJz4.css @@ -1 +1 @@ -/*! tailwindcss v3.4.0 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}body,html{height:100%;overflow:hidden}body{background-color:hsl(var(--color-surface));color:hsl(var(--color-content));font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1.0625rem;line-height:1.3125rem;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;--color-primary-100:350 100% 95%;--color-primary-200:350 100% 91%;--color-primary-300:349 100% 83%;--color-primary-400:345 99% 72%;--color-primary-500:342 88% 61%;--color-primary-600:336 84% 48%;--color-primary-700:338 79% 42%;--color-primary-800:338 76% 35%;--color-primary-900:340 70% 30%;--color-highlight:0 0% 0%/6.5%;--color-highlight-100:0 0% 0%/10%;--color-highlight-200:0 0% 0%/25%;--color-surface:0 0% 100%;--color-surface-100:0 0% 100%;--color-surface-200:0 0% 97%/.773;--color-surface-300:0 0% 97%;--color-content:240 3% 12%;--color-content-100:0 0% 35%;--color-content-200:240 2% 55%}@media (prefers-color-scheme:dark){body:has(#light-switch:not(:checked)){--color-primary-100:345 50% 9%;--color-primary-200:345 48% 20%;--color-primary-300:342 58% 27%;--color-primary-400:342 57% 37%;--color-primary-500:342 57% 45%;--color-primary-600:341 68% 53%;--color-primary-700:344 75% 62%;--color-primary-800:346 79% 71%;--color-primary-900:349 84% 83%;--color-highlight:0 0% 100%/11%;--color-highlight-100:0 0% 100%/18%;--color-highlight-200:0 0% 100%/50%;--color-surface:0 0% 0%;--color-surface-100:0 0% 11%;--color-surface-200:0 0% 9%/.769;--color-surface-300:0 0% 7%;--color-content:240 11% 96%;--color-content-100:0 0% 58%;--color-content-200:0 0% 38%}}@media (prefers-color-scheme:light){body:has(#light-switch:checked){--color-primary-100:345 50% 9%;--color-primary-200:345 48% 20%;--color-primary-300:342 58% 27%;--color-primary-400:342 57% 37%;--color-primary-500:342 57% 45%;--color-primary-600:341 68% 53%;--color-primary-700:344 75% 62%;--color-primary-800:346 79% 71%;--color-primary-900:349 84% 83%;--color-highlight:0 0% 100%/11%;--color-highlight-100:0 0% 100%/18%;--color-highlight-200:0 0% 100%/50%;--color-surface:0 0% 0%;--color-surface-100:0 0% 11%;--color-surface-200:0 0% 9%/.769;--color-surface-300:0 0% 7%;--color-content:240 11% 96%;--color-content-100:0 0% 58%;--color-content-200:0 0% 38%}}::-webkit-scrollbar{width:16px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:hsl(var(--color-highlight-100));background-clip:padding-box;border:4px solid transparent;border-radius:10px}::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--color-highlight-200))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-inset-\[1px\]{inset:-1px}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.left-0\.5{left:.125rem}.left-1\/2{left:50%}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1\/2{top:50%}.top-11{top:2.75rem}.top-2{top:.5rem}.-z-10{z-index:-10}.-z-20{z-index:-20}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.m-auto{margin:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.mb-2{margin-bottom:.5rem}.ml-4{margin-left:1rem}.mt-11{margin-top:2.75rem}.mt-4{margin-top:1rem}.box-content{box-sizing:content-box}.line-clamp-3{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.\!hidden{display:none!important}.hidden{display:none}.aspect-square{aspect-ratio:1/1}.h-0{height:0}.h-0\.5{height:.125rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-\[1\.3px\]{height:1.3px}.h-\[100dvh\]{height:100dvh}.h-\[104px\]{height:104px}.h-\[1px\]{height:1px}.h-\[48px\]{height:48px}.h-full{height:100%}.h-screen{height:100vh}.max-h-11{max-height:2.75rem}.max-h-\[100dvh\]{max-height:100dvh}.max-h-max{max-height:-moz-max-content;max-height:max-content}.min-h-\[1px\]{min-height:1px}.w-0{width:0}.w-0\.5{width:.125rem}.w-1\/2{width:50%}.w-16{width:4rem}.w-2{width:.5rem}.w-32{width:8rem}.w-\[104px\]{width:104px}.w-\[48px\]{width:48px}.w-\[51px\]{width:51px}.w-\[calc\(100\%-1rem\)\]{width:calc(100% - 1rem)}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-\[15rem\]{min-width:15rem}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-\[100dvw\]{max-width:100dvw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-xl{max-width:36rem}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.origin-left{transform-origin:left}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.translate-y-\[calc\(-100\%-0\.75rem\)\]{--tw-translate-y: calc(-100% - .75rem) }.scale-0,.translate-y-\[calc\(-100\%-0\.75rem\)\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.scale-100,.scale-y-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-0{--tw-scale-y:0}.scale-y-100{--tw-scale-y:1}.scale-y-100,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-\[dash-wiggle_var\(--duration\)_ease-in-out_infinite\]{animation:dash-wiggle var(--duration) ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.touch-manipulation{touch-action:manipulation}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.snap-always{scroll-snap-stop:always}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.auto-rows-max{grid-auto-rows:max-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(min\(100\%\,40rem\)\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(min(100%,40rem),1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.place-items-baseline{place-items:baseline}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.justify-items-center{justify-items:center}.gap-0{gap:0}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-16{gap:4rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-\[0\.625rem\]{gap:.625rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-highlight{border-color:hsl(var(--color-highlight))}.border-b-highlight{border-bottom-color:hsl(var(--color-highlight))}.bg-content{--tw-bg-opacity:1;background-color:hsl(var(--color-content)/var(--tw-bg-opacity))}.bg-content-100{--tw-bg-opacity:1;background-color:hsl(var(--color-content-100)/var(--tw-bg-opacity))}.bg-content-200{--tw-bg-opacity:1;background-color:hsl(var(--color-content-200)/var(--tw-bg-opacity))}.bg-content\/10{background-color:hsl(var(--color-content)/.1)}.bg-highlight{background-color:hsl(var(--color-highlight))}.bg-highlight-100{background-color:hsl(var(--color-highlight-100))}.bg-highlight-200{background-color:hsl(var(--color-highlight-200))}.bg-primary-100{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-100)/var(--tw-bg-opacity))}.bg-primary-200{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-200)/var(--tw-bg-opacity))}.bg-primary-200\/30{background-color:hsl(var(--color-primary-200)/.3)}.bg-primary-300{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-300)/var(--tw-bg-opacity))}.bg-primary-400{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-400)/var(--tw-bg-opacity))}.bg-primary-500{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-500)/var(--tw-bg-opacity))}.bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}.bg-primary-700{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-700)/var(--tw-bg-opacity))}.bg-primary-800{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-800)/var(--tw-bg-opacity))}.bg-primary-900{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-900)/var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-surface{--tw-bg-opacity:1;background-color:hsl(var(--color-surface)/var(--tw-bg-opacity))}.bg-surface-100{--tw-bg-opacity:1;background-color:hsl(var(--color-surface-100)/var(--tw-bg-opacity))}.bg-surface-200{background-color:hsl(var(--color-surface-200))}.bg-surface\/70{background-color:hsl(var(--color-surface)/.7)}.bg-transparent{background-color:transparent}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-cyan-500{--tw-gradient-from:#06b6d4 var(--tw-gradient-from-position);--tw-gradient-to:rgba(6,182,212,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-emerald-500{--tw-gradient-from:#10b981 var(--tw-gradient-from-position);--tw-gradient-to:rgba(16,185,129,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-green-500{--tw-gradient-from:#22c55e var(--tw-gradient-from-position);--tw-gradient-to:rgba(34,197,94,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from:#a855f7 var(--tw-gradient-from-position);--tw-gradient-to:rgba(168,85,247,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-rose-400{--tw-gradient-from:#fb7185 var(--tw-gradient-from-position);--tw-gradient-to:rgba(251,113,133,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-rose-500{--tw-gradient-from:#f43f5e var(--tw-gradient-from-position);--tw-gradient-to:rgba(244,63,94,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-surface\/70{--tw-gradient-from:hsl(var(--color-surface)/.7) var(--tw-gradient-from-position);--tw-gradient-to:hsl(var(--color-surface)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-yellow-500{--tw-gradient-from:#eab308 var(--tw-gradient-from-position);--tw-gradient-to:rgba(234,179,8,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-amber-500{--tw-gradient-to:#f59e0b var(--tw-gradient-to-position)}.to-blue-500{--tw-gradient-to:#3b82f6 var(--tw-gradient-to-position)}.to-fuchsia-500{--tw-gradient-to:#d946ef var(--tw-gradient-to-position)}.to-lime-500{--tw-gradient-to:#84cc16 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to:#ec4899 var(--tw-gradient-to-position)}.to-red-400{--tw-gradient-to:#f87171 var(--tw-gradient-to-position)}.to-surface{--tw-gradient-to:hsl(var(--color-surface)/1) var(--tw-gradient-to-position)}.to-teal-500{--tw-gradient-to:#14b8a6 var(--tw-gradient-to-position)}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.p-\[21px\]{padding:21px}.p-\[6px\]{padding:6px}.px-11{padding-left:2.75rem;padding-right:2.75rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-\[0\.625rem\]{padding-left:.625rem;padding-right:.625rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-11{padding-bottom:2.75rem;padding-top:2.75rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-0{padding-bottom:0}.pl-20{padding-left:5rem}.pl-24{padding-left:6rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.indent-4{text-indent:1rem}.text-2xl{font-size:2.125rem;font-weight:700;letter-spacing:.01em;line-height:3rem}.text-2xs{font-size:.625rem;font-weight:500;letter-spacing:.03em;line-height:1rem}.text-lg{font-size:1.375rem;font-weight:600;line-height:1.55rem}.text-md{font-size:1.0625rem;line-height:1.3125rem}.text-sm{font-size:.9375rem;line-height:1.125rem}.text-xl{font-size:1.5rem;font-weight:600;line-height:1.6875rem}.text-xs{font-size:.8125rem;line-height:1rem}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.text-content{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}.text-content-100{--tw-text-opacity:1;color:hsl(var(--color-content-100)/var(--tw-text-opacity))}.text-content-200{--tw-text-opacity:1;color:hsl(var(--color-content-200)/var(--tw-text-opacity))}.text-highlight{color:hsl(var(--color-highlight))}.text-primary-600{--tw-text-opacity:1;color:hsl(var(--color-primary-600)/var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-\[0_0_20px_-4px\]{--tw-shadow:0 0 20px -4px;--tw-shadow-colored:0 0 20px -4px var(--tw-shadow-color)}.shadow-\[0_0_20px_-4px\],.shadow-inner{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 rgba(0,0,0,.05);--tw-shadow-colored:inset 0 2px 4px 0 var(--tw-shadow-color)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-black\/20{--tw-shadow-color:rgba(0,0,0,.2);--tw-shadow:var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-0{outline-width:0}.outline-1{outline-width:1px}.outline-2{outline-width:2px}.-outline-offset-2{outline-offset:-2px}.outline-offset-2{outline-offset:2px}.outline-offset-8{outline-offset:8px}.outline-highlight{outline-color:hsl(var(--color-highlight))}.outline-highlight-100{outline-color:hsl(var(--color-highlight-100))}.outline-primary-600{outline-color:hsl(var(--color-primary-600)/1)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-1,.ring-4{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-4{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-inset{--tw-ring-inset:inset}.ring-highlight{--tw-ring-color:hsl(var(--color-highlight))}.\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px)}.backdrop-blur,.backdrop-blur-md{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[opacity\]{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[outline_transform\]{transition-duration:.15s;transition-property:outline transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-composite{transition-duration:.15s;transition-property:transform,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-paint{transition-duration:.15s;transition-property:transform,opacity,color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-1000{transition-duration:1s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.will-change-transform{will-change:transform}.contain-\[size_layout\]{contain:size layout}.contain-strict{contain:strict}.contain-inline-size{contain:inline-size}.contain-layout{contain:layout}.contain-paint{contain:paint}.placeholder\:text-content-200::-moz-placeholder{--tw-text-opacity:1;color:hsl(var(--color-content-200)/var(--tw-text-opacity))}.placeholder\:text-content-200::placeholder{--tw-text-opacity:1;color:hsl(var(--color-content-200)/var(--tw-text-opacity))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-0:after{content:var(--tw-content);inset:0}.after\:-z-10:after{content:var(--tw-content);z-index:-10}.after\:block:after{content:var(--tw-content);display:block}.after\:h-7:after{content:var(--tw-content);height:1.75rem}.after\:w-7:after{content:var(--tw-content);width:1.75rem}.after\:origin-left:after{content:var(--tw-content);transform-origin:left}.after\:rounded-full:after{border-radius:9999px;content:var(--tw-content)}.after\:bg-surface-100:after{content:var(--tw-content);--tw-bg-opacity:1;background-color:hsl(var(--color-surface-100)/var(--tw-bg-opacity))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.after\:shadow-sm:after{content:var(--tw-content);--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.after\:transition-transform:after{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.target\:text-primary-600:target{--tw-text-opacity:1;color:hsl(var(--color-primary-600)/var(--tw-text-opacity))}.focus-within\:bg-content\/5:focus-within{background-color:hsl(var(--color-content)/.05)}.focus-within\:bg-highlight-100:focus-within{background-color:hsl(var(--color-highlight-100))}.focus-visible\:z-50:focus-visible{z-index:50}.focus-visible\:bg-highlight:focus-visible{background-color:hsl(var(--color-highlight))}.focus-visible\:underline:focus-visible{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:outline:focus-visible{outline-style:solid}.focus-visible\:ring-primary-600:focus-visible{--tw-ring-opacity:1;--tw-ring-color:hsl(var(--color-primary-600)/var(--tw-ring-opacity))}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:last-of-type .group-last-of-type\:opacity-0{opacity:0}.group:focus-visible .group-focus-visible\:opacity-100{opacity:1}.group:active .group-active\:after\:scale-x-110:after{content:var(--tw-content);--tw-scale-x:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:opacity-100{opacity:1}.peer:checked~.peer-checked\:after\:origin-right:after{content:var(--tw-content);transform-origin:right}.peer:checked~.peer-checked\:after\:translate-x-2\/3:after{--tw-translate-x:66.666667%}.peer:active~.peer-active\:after\:scale-x-110:after,.peer:checked~.peer-checked\:after\:translate-x-2\/3:after{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:active~.peer-active\:after\:scale-x-110:after{--tw-scale-x:1.1}:where(#light-switch:focus-visible~*) .dark-focus\:outline{outline-style:solid}@media (prefers-color-scheme:dark){:where(#light-switch:not(:checked)~*) .dark\:bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}:where(#light-switch:not(:checked)~*) .dark\:bg-slate-500{--tw-bg-opacity:1;background-color:rgb(100 116 139/var(--tw-bg-opacity))}:where(#light-switch:not(:checked)~*) .dark\:text-content{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}:where(#light-switch:not(:checked)~*) .dark\:shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:where(#light-switch:not(:checked)~*) .dark\:after\:origin-right:after{content:var(--tw-content);transform-origin:right}:where(#light-switch:not(:checked)~*) .dark\:after\:translate-x-2\/3:after{content:var(--tw-content);--tw-translate-x:66.666667%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}@media (prefers-color-scheme:light){:where(#light-switch:checked~*) .dark\:bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}:where(#light-switch:checked~*) .dark\:bg-slate-500{--tw-bg-opacity:1;background-color:rgb(100 116 139/var(--tw-bg-opacity))}:where(#light-switch:checked~*) .dark\:text-content{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}:where(#light-switch:checked~*) .dark\:shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:where(#light-switch:checked~*) .dark\:after\:origin-right:after{content:var(--tw-content);transform-origin:right}:where(#light-switch:checked~*) .dark\:after\:translate-x-2\/3:after{content:var(--tw-content);--tw-translate-x:66.666667%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}@media (hover:hover) and (pointer:fine){.hover\:bg-content\/5:hover{background-color:hsl(var(--color-content)/.05)}.hover\:bg-highlight:hover{background-color:hsl(var(--color-highlight))}.hover\:bg-highlight-100:hover{background-color:hsl(var(--color-highlight-100))}.hover\:bg-primary-700:hover{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-700)/var(--tw-bg-opacity))}.hover\:text-content:hover{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}.hover\:text-content-100:hover{--tw-text-opacity:1;color:hsl(var(--color-content-100)/var(--tw-text-opacity))}.hover\:text-primary-700:hover{--tw-text-opacity:1;color:hsl(var(--color-primary-700)/var(--tw-text-opacity))}.hover\:outline-8:hover{outline-width:8px}}@media (pointer:coarse){.hover\:bg-content\/5:active{background-color:hsl(var(--color-content)/.05)}.hover\:bg-highlight:active{background-color:hsl(var(--color-highlight))}.hover\:bg-highlight-100:active{background-color:hsl(var(--color-highlight-100))}.hover\:bg-primary-700:active{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-700)/var(--tw-bg-opacity))}.hover\:text-content:active{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}.hover\:text-content-100:active{--tw-text-opacity:1;color:hsl(var(--color-content-100)/var(--tw-text-opacity))}.hover\:text-primary-700:active{--tw-text-opacity:1;color:hsl(var(--color-primary-700)/var(--tw-text-opacity))}.hover\:outline-8:active{outline-width:8px}}@media (hover:hover) and (pointer:fine){.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-30{opacity:.3}}@media (prefers-color-scheme:dark){@media (hover:hover) and (pointer:fine){.group:hover .dark\:group-hover\:opacity-10{opacity:.1}.group:hover .dark\:group-hover\:opacity-50{opacity:.5}}}@media (prefers-color-scheme:light){@media (hover:hover) and (pointer:fine){.group:hover .dark\:group-hover\:opacity-10{opacity:.1}.group:hover .dark\:group-hover\:opacity-50{opacity:.5}}}@media (pointer:coarse){.group:active .group-hover\:opacity-100{opacity:1}.group:active .group-hover\:opacity-30{opacity:.3}}@media (prefers-color-scheme:dark){@media (pointer:coarse){.group:active .dark\:group-hover\:opacity-10{opacity:.1}.group:active .dark\:group-hover\:opacity-50{opacity:.5}}}@media (prefers-color-scheme:light){@media (pointer:coarse){.group:active .dark\:group-hover\:opacity-10{opacity:.1}.group:active .dark\:group-hover\:opacity-50{opacity:.5}}}@media (min-width:640px){.sm\:flex{display:flex}.sm\:contents{display:contents}.sm\:hidden{display:none}.sm\:bg-inherit{background-color:inherit}}@media (min-width:768px){.md\:contents{display:contents}.md\:hidden{display:none}}@media (min-width:1024px){.lg\:contents{display:contents}.lg\:hidden{display:none}.lg\:auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.lg\:grid-flow-col{grid-auto-flow:column}.lg\:gap-4{gap:1rem}}@media (min-width:1280px){.xl\:block{display:block}.xl\:flex{display:flex}.xl\:contents{display:contents}.xl\:hidden{display:none}}@media (min-height:30rem){.tall\:flex{display:flex}}.\[\&\:has\(input\:checked\)\]\:bg-transparent:has(input:checked){background-color:transparent}.\[\&\:has\(input\:checked\)\]\:text-white:has(input:checked){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.\[\&\:has\(input\:focus-visible\)\]\:outline:has(input:focus-visible){outline-style:solid}.\[\&\>\*\:first-child\]\:opacity-50>:first-child{opacity:.5}.\[\&\>\*\]\:col-start-1>*{grid-column-start:1}.\[\&\>\*\]\:row-start-1>*{grid-row-start:1}.\[\&\>\*\]\:bg-surface-100>*{--tw-bg-opacity:1;background-color:hsl(var(--color-surface-100)/var(--tw-bg-opacity))}.\[\&\>\*\]\:align-bottom>*{vertical-align:bottom}.\[\&_hr\]\:\!opacity-100 hr{opacity:1!important}.\[\&\~nav_div\]\:opacity-0~nav div{opacity:0}.\[\&\~nav_div_a\]\:pointer-events-none~nav div a{pointer-events:none}.\[\&\~nav_div_a\]\:-translate-y-full~nav div a{--tw-translate-y:-100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:has(>.\[\*\:has\(\>\&\)\:last-of-type_hr\]\:\!opacity-0):last-of-type hr{opacity:0!important}:has(>div>.\[\*\:has\(\>div\>\&\)\]\:pointer-events-none){pointer-events:none}main.svelte-1ucfubu::-webkit-scrollbar{display:none}main.svelte-1ucfubu{scrollbar-width:none}div.svelte-1ucfubu:after{content:attr(aria-label);display:block;font-weight:700;height:0;visibility:hidden}.svelte-1ucfubu:where(div){pointer-events:auto}.grid.svelte-qtbr7a::-webkit-scrollbar{display:none}.grid.svelte-qtbr7a{scrollbar-width:none}input.svelte-sruga5:after{content:"";display:block;inset:-4px;position:absolute}input.svelte-sruga5::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;background:linear-gradient(to right,hsl(var(--color-primary-600)),hsl(var(--color-primary-600))) 0 /var(--progress) 100% no-repeat,hsl(var(--color-primary-200));border-radius:4px;height:4px}input.svelte-sruga5::-webkit-slider-thumb{-webkit-appearance:none;background:radial-gradient(circle,hsl(var(--color-primary-600)),hsl(var(--color-primary-600)) 20%,transparent 22%,transparent 100%) 50% 50%;background-size:100%;border-radius:100%;box-shadow:none;height:32px;margin-top:-14px;pointer-events:auto;position:relative;transform:translate(calc(var(--progress) - 50%));-webkit-transition:background-size .3s ease;transition:background-size .3s ease;width:32px;z-index:100}@media (hover:hover) and (pointer:fine){input.svelte-sruga5::-webkit-slider-thumb:hover{background-size:500%}}@media (pointer:coarse){input.svelte-sruga5{pointer-events:none}input.svelte-sruga5::-webkit-slider-thumb:active{background-size:500%}}@media (pointer:coarse){@supports (-webkit-touch-callout:none){aside.svelte-1x44efv:focus-within{animation:svelte-1x44efv-elevate 1ms 1}}}@keyframes svelte-1x44efv-elevate{0%{transform:translate3d(0,-100vh,0)}}@supports (-webkit-appearance:none) and (stroke-color:transparent){@media not all and (-webkit-min-device-pixel-ratio:0),not all and (min-resolution:.001dpcm){.fixed.svelte-1vqfn9j{left:0}}}div.svelte-1xrekkf:after{inset-block-end:-.5rem;-webkit-mask:conic-gradient(from -30deg at bottom,#0000,#000 1deg 60deg,#0000 61deg) bottom /100% 50% no-repeat;mask:conic-gradient(from -30deg at bottom,#0000,#000 1deg 60deg,#0000 61deg) bottom /100% 50% no-repeat}@media (hover:hover) and (pointer:fine){:hover>div.svelte-1xrekkf{--tw-translate-y: calc(-100% - .5rem) ;opacity:1;transition-delay:.2s}}@keyframes svelte-1gcb6dg-dash-wiggle{0%,to{stroke-dashoffset:var(--back)}50%{stroke-dashoffset:var(--forth)}} +/*! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}body,html{height:100%;overflow:hidden}body{background-color:hsl(var(--color-surface));color:hsl(var(--color-content));font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;font-size:1.0625rem;line-height:1.3125rem;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;--color-primary-100:350 100% 95%;--color-primary-200:350 100% 91%;--color-primary-300:349 100% 83%;--color-primary-400:345 99% 72%;--color-primary-500:342 88% 61%;--color-primary-600:336 84% 48%;--color-primary-700:338 79% 42%;--color-primary-800:338 76% 35%;--color-primary-900:340 70% 30%;--color-highlight:0 0% 0%/6.5%;--color-highlight-100:0 0% 0%/10%;--color-highlight-200:0 0% 0%/25%;--color-surface:0 0% 100%;--color-surface-100:0 0% 100%;--color-surface-200:0 0% 97%/.773;--color-surface-300:0 0% 97%;--color-content:240 3% 12%;--color-content-100:0 0% 35%;--color-content-200:240 2% 55%}@media (prefers-color-scheme:dark){body:has(#light-switch:not(:checked)){--color-primary-100:345 50% 9%;--color-primary-200:345 48% 20%;--color-primary-300:342 58% 27%;--color-primary-400:342 57% 37%;--color-primary-500:342 57% 45%;--color-primary-600:341 68% 53%;--color-primary-700:344 75% 62%;--color-primary-800:346 79% 71%;--color-primary-900:349 84% 83%;--color-highlight:0 0% 100%/11%;--color-highlight-100:0 0% 100%/18%;--color-highlight-200:0 0% 100%/50%;--color-surface:0 0% 0%;--color-surface-100:0 0% 11%;--color-surface-200:0 0% 9%/.769;--color-surface-300:0 0% 7%;--color-content:240 11% 96%;--color-content-100:0 0% 58%;--color-content-200:0 0% 38%}}@media (prefers-color-scheme:light){body:has(#light-switch:checked){--color-primary-100:345 50% 9%;--color-primary-200:345 48% 20%;--color-primary-300:342 58% 27%;--color-primary-400:342 57% 37%;--color-primary-500:342 57% 45%;--color-primary-600:341 68% 53%;--color-primary-700:344 75% 62%;--color-primary-800:346 79% 71%;--color-primary-900:349 84% 83%;--color-highlight:0 0% 100%/11%;--color-highlight-100:0 0% 100%/18%;--color-highlight-200:0 0% 100%/50%;--color-surface:0 0% 0%;--color-surface-100:0 0% 11%;--color-surface-200:0 0% 9%/.769;--color-surface-300:0 0% 7%;--color-content:240 11% 96%;--color-content-100:0 0% 58%;--color-content-200:0 0% 38%}}::-webkit-scrollbar{width:16px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:hsl(var(--color-highlight-100));background-clip:padding-box;border:4px solid transparent;border-radius:10px}::-webkit-scrollbar-thumb:hover{background-color:hsl(var(--color-highlight-200))}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-inset-\[1px\]{inset:-1px}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.left-0\.5{left:.125rem}.left-1\/2{left:50%}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1\/2{top:50%}.top-11{top:2.75rem}.top-2{top:.5rem}.-z-10{z-index:-10}.-z-20{z-index:-20}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.m-auto{margin:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.mb-2{margin-bottom:.5rem}.ml-4{margin-left:1rem}.mt-11{margin-top:2.75rem}.mt-4{margin-top:1rem}.box-content{box-sizing:content-box}.line-clamp-3{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.\!hidden{display:none!important}.hidden{display:none}.aspect-square{aspect-ratio:1/1}.h-0{height:0}.h-0\.5{height:.125rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-\[1\.3px\]{height:1.3px}.h-\[100dvh\]{height:100dvh}.h-\[104px\]{height:104px}.h-\[1px\]{height:1px}.h-\[48px\]{height:48px}.h-full{height:100%}.h-screen{height:100vh}.max-h-11{max-height:2.75rem}.max-h-\[100dvh\]{max-height:100dvh}.max-h-max{max-height:-moz-max-content;max-height:max-content}.min-h-\[1px\]{min-height:1px}.w-0{width:0}.w-0\.5{width:.125rem}.w-1\/2{width:50%}.w-16{width:4rem}.w-2{width:.5rem}.w-32{width:8rem}.w-\[104px\]{width:104px}.w-\[48px\]{width:48px}.w-\[51px\]{width:51px}.w-\[calc\(100\%-1rem\)\]{width:calc(100% - 1rem)}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-\[15rem\]{min-width:15rem}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-\[100dvw\]{max-width:100dvw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-xl{max-width:36rem}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.origin-left{transform-origin:left}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.translate-y-\[calc\(-100\%-0\.75rem\)\]{--tw-translate-y: calc(-100% - .75rem) }.scale-0,.translate-y-\[calc\(-100\%-0\.75rem\)\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.scale-100,.scale-y-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-0{--tw-scale-y:0}.scale-y-100{--tw-scale-y:1}.scale-y-100,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-\[dash-wiggle_var\(--duration\)_ease-in-out_infinite\]{animation:dash-wiggle var(--duration) ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.touch-manipulation{touch-action:manipulation}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness:mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.snap-always{scroll-snap-stop:always}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.auto-rows-max{grid-auto-rows:max-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[repeat\(auto-fill\,minmax\(min\(100\%\,40rem\)\,1fr\)\)\]{grid-template-columns:repeat(auto-fill,minmax(min(100%,40rem),1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.place-items-baseline{place-items:baseline}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.justify-items-center{justify-items:center}.gap-0{gap:0}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-16{gap:4rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-\[0\.625rem\]{gap:.625rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-hidden{overflow-y:hidden}.overflow-x-scroll{overflow-x:scroll}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-highlight{border-color:hsl(var(--color-highlight))}.border-b-highlight{border-bottom-color:hsl(var(--color-highlight))}.bg-content{--tw-bg-opacity:1;background-color:hsl(var(--color-content)/var(--tw-bg-opacity))}.bg-content-100{--tw-bg-opacity:1;background-color:hsl(var(--color-content-100)/var(--tw-bg-opacity))}.bg-content-200{--tw-bg-opacity:1;background-color:hsl(var(--color-content-200)/var(--tw-bg-opacity))}.bg-content\/10{background-color:hsl(var(--color-content)/.1)}.bg-highlight{background-color:hsl(var(--color-highlight))}.bg-highlight-100{background-color:hsl(var(--color-highlight-100))}.bg-highlight-200{background-color:hsl(var(--color-highlight-200))}.bg-primary-100{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-100)/var(--tw-bg-opacity))}.bg-primary-200{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-200)/var(--tw-bg-opacity))}.bg-primary-200\/30{background-color:hsl(var(--color-primary-200)/.3)}.bg-primary-300{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-300)/var(--tw-bg-opacity))}.bg-primary-400{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-400)/var(--tw-bg-opacity))}.bg-primary-500{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-500)/var(--tw-bg-opacity))}.bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}.bg-primary-700{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-700)/var(--tw-bg-opacity))}.bg-primary-800{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-800)/var(--tw-bg-opacity))}.bg-primary-900{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-900)/var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity))}.bg-surface{--tw-bg-opacity:1;background-color:hsl(var(--color-surface)/var(--tw-bg-opacity))}.bg-surface-100{--tw-bg-opacity:1;background-color:hsl(var(--color-surface-100)/var(--tw-bg-opacity))}.bg-surface-200{background-color:hsl(var(--color-surface-200))}.bg-surface\/70{background-color:hsl(var(--color-surface)/.7)}.bg-transparent{background-color:transparent}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-cyan-500{--tw-gradient-from:#06b6d4 var(--tw-gradient-from-position);--tw-gradient-to:rgba(6,182,212,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-emerald-500{--tw-gradient-from:#10b981 var(--tw-gradient-from-position);--tw-gradient-to:rgba(16,185,129,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-green-500{--tw-gradient-from:#22c55e var(--tw-gradient-from-position);--tw-gradient-to:rgba(34,197,94,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from:#a855f7 var(--tw-gradient-from-position);--tw-gradient-to:rgba(168,85,247,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-rose-400{--tw-gradient-from:#fb7185 var(--tw-gradient-from-position);--tw-gradient-to:rgba(251,113,133,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-rose-500{--tw-gradient-from:#f43f5e var(--tw-gradient-from-position);--tw-gradient-to:rgba(244,63,94,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-surface\/70{--tw-gradient-from:hsl(var(--color-surface)/.7) var(--tw-gradient-from-position);--tw-gradient-to:hsl(var(--color-surface)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-yellow-500{--tw-gradient-from:#eab308 var(--tw-gradient-from-position);--tw-gradient-to:rgba(234,179,8,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-amber-500{--tw-gradient-to:#f59e0b var(--tw-gradient-to-position)}.to-blue-500{--tw-gradient-to:#3b82f6 var(--tw-gradient-to-position)}.to-fuchsia-500{--tw-gradient-to:#d946ef var(--tw-gradient-to-position)}.to-lime-500{--tw-gradient-to:#84cc16 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to:#ec4899 var(--tw-gradient-to-position)}.to-red-400{--tw-gradient-to:#f87171 var(--tw-gradient-to-position)}.to-surface{--tw-gradient-to:hsl(var(--color-surface)/1) var(--tw-gradient-to-position)}.to-teal-500{--tw-gradient-to:#14b8a6 var(--tw-gradient-to-position)}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.p-\[21px\]{padding:21px}.p-\[6px\]{padding:6px}.px-11{padding-left:2.75rem;padding-right:2.75rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-\[0\.625rem\]{padding-left:.625rem;padding-right:.625rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-11{padding-bottom:2.75rem;padding-top:2.75rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.pb-0{padding-bottom:0}.pl-20{padding-left:5rem}.pl-24{padding-left:6rem}.pl-4{padding-left:1rem}.pr-10{padding-right:2.5rem}.pt-4{padding-top:1rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.indent-4{text-indent:1rem}.text-2xl{font-size:2.125rem;font-weight:700;letter-spacing:.01em;line-height:3rem}.text-2xs{font-size:.625rem;font-weight:500;letter-spacing:.03em;line-height:1rem}.text-lg{font-size:1.375rem;font-weight:600;line-height:1.55rem}.text-md{font-size:1.0625rem;line-height:1.3125rem}.text-sm{font-size:.9375rem;line-height:1.125rem}.text-xl{font-size:1.5rem;font-weight:600;line-height:1.6875rem}.text-xs{font-size:.8125rem;line-height:1rem}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.text-content{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}.text-content-100{--tw-text-opacity:1;color:hsl(var(--color-content-100)/var(--tw-text-opacity))}.text-content-200{--tw-text-opacity:1;color:hsl(var(--color-content-200)/var(--tw-text-opacity))}.text-highlight{color:hsl(var(--color-highlight))}.text-primary-600{--tw-text-opacity:1;color:hsl(var(--color-primary-600)/var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-\[0_0_20px_-4px\]{--tw-shadow:0 0 20px -4px;--tw-shadow-colored:0 0 20px -4px var(--tw-shadow-color)}.shadow-\[0_0_20px_-4px\],.shadow-inner{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 rgba(0,0,0,.05);--tw-shadow-colored:inset 0 2px 4px 0 var(--tw-shadow-color)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-black\/20{--tw-shadow-color:rgba(0,0,0,.2);--tw-shadow:var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-0{outline-width:0}.outline-1{outline-width:1px}.outline-2{outline-width:2px}.-outline-offset-2{outline-offset:-2px}.outline-offset-2{outline-offset:2px}.outline-offset-8{outline-offset:8px}.outline-highlight{outline-color:hsl(var(--color-highlight))}.outline-highlight-100{outline-color:hsl(var(--color-highlight-100))}.outline-primary-600{outline-color:hsl(var(--color-primary-600)/1)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-1,.ring-4{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-4{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-inset{--tw-ring-inset:inset}.ring-highlight{--tw-ring-color:hsl(var(--color-highlight))}.\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px)}.backdrop-blur,.backdrop-blur-md{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[opacity\]{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\[outline_transform\]{transition-duration:.15s;transition-property:outline transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-composite{transition-duration:.15s;transition-property:transform,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-paint{transition-duration:.15s;transition-property:transform,opacity,color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-1000{transition-duration:1s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.will-change-transform{will-change:transform}.contain-\[size_layout\]{contain:size layout}.contain-strict{contain:strict}.contain-inline-size{contain:inline-size}.contain-layout{contain:layout}.contain-paint{contain:paint}.placeholder\:text-content-200::-moz-placeholder{--tw-text-opacity:1;color:hsl(var(--color-content-200)/var(--tw-text-opacity))}.placeholder\:text-content-200::placeholder{--tw-text-opacity:1;color:hsl(var(--color-content-200)/var(--tw-text-opacity))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-0:after{content:var(--tw-content);inset:0}.after\:-z-10:after{content:var(--tw-content);z-index:-10}.after\:block:after{content:var(--tw-content);display:block}.after\:h-7:after{content:var(--tw-content);height:1.75rem}.after\:w-7:after{content:var(--tw-content);width:1.75rem}.after\:origin-left:after{content:var(--tw-content);transform-origin:left}.after\:rounded-full:after{border-radius:9999px;content:var(--tw-content)}.after\:bg-surface-100:after{content:var(--tw-content);--tw-bg-opacity:1;background-color:hsl(var(--color-surface-100)/var(--tw-bg-opacity))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.after\:shadow-sm:after{content:var(--tw-content);--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.after\:transition-transform:after{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.target\:text-primary-600:target{--tw-text-opacity:1;color:hsl(var(--color-primary-600)/var(--tw-text-opacity))}.focus-within\:bg-content\/5:focus-within{background-color:hsl(var(--color-content)/.05)}.focus-within\:bg-highlight-100:focus-within{background-color:hsl(var(--color-highlight-100))}.focus-visible\:z-50:focus-visible{z-index:50}.focus-visible\:bg-highlight:focus-visible{background-color:hsl(var(--color-highlight))}.focus-visible\:underline:focus-visible{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:outline:focus-visible{outline-style:solid}.focus-visible\:ring-primary-600:focus-visible{--tw-ring-opacity:1;--tw-ring-color:hsl(var(--color-primary-600)/var(--tw-ring-opacity))}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:last-of-type .group-last-of-type\:opacity-0{opacity:0}.group:focus-visible .group-focus-visible\:opacity-100{opacity:1}.group:active .group-active\:after\:scale-x-110:after{content:var(--tw-content);--tw-scale-x:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}.peer:checked~.peer-checked\:opacity-100{opacity:1}.peer:checked~.peer-checked\:after\:origin-right:after{content:var(--tw-content);transform-origin:right}.peer:checked~.peer-checked\:after\:translate-x-2\/3:after{--tw-translate-x:66.666667%}.peer:active~.peer-active\:after\:scale-x-110:after,.peer:checked~.peer-checked\:after\:translate-x-2\/3:after{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:active~.peer-active\:after\:scale-x-110:after{--tw-scale-x:1.1}:where(#light-switch:focus-visible~*) .dark-focus\:outline{outline-style:solid}@media (prefers-color-scheme:dark){:where(#light-switch:not(:checked)~*) .dark\:bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}:where(#light-switch:not(:checked)~*) .dark\:bg-slate-500{--tw-bg-opacity:1;background-color:rgb(100 116 139/var(--tw-bg-opacity))}:where(#light-switch:not(:checked)~*) .dark\:text-content{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}:where(#light-switch:not(:checked)~*) .dark\:shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:where(#light-switch:not(:checked)~*) .dark\:after\:origin-right:after{content:var(--tw-content);transform-origin:right}:where(#light-switch:not(:checked)~*) .dark\:after\:translate-x-2\/3:after{content:var(--tw-content);--tw-translate-x:66.666667%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}@media (prefers-color-scheme:light){:where(#light-switch:checked~*) .dark\:bg-primary-600{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-600)/var(--tw-bg-opacity))}:where(#light-switch:checked~*) .dark\:bg-slate-500{--tw-bg-opacity:1;background-color:rgb(100 116 139/var(--tw-bg-opacity))}:where(#light-switch:checked~*) .dark\:text-content{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}:where(#light-switch:checked~*) .dark\:shadow-none{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}:where(#light-switch:checked~*) .dark\:after\:origin-right:after{content:var(--tw-content);transform-origin:right}:where(#light-switch:checked~*) .dark\:after\:translate-x-2\/3:after{content:var(--tw-content);--tw-translate-x:66.666667%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}}@media (hover:hover) and (pointer:fine){.hover\:bg-content\/5:hover{background-color:hsl(var(--color-content)/.05)}.hover\:bg-highlight:hover{background-color:hsl(var(--color-highlight))}.hover\:bg-highlight-100:hover{background-color:hsl(var(--color-highlight-100))}.hover\:bg-primary-700:hover{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-700)/var(--tw-bg-opacity))}.hover\:text-content:hover{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}.hover\:text-content-100:hover{--tw-text-opacity:1;color:hsl(var(--color-content-100)/var(--tw-text-opacity))}.hover\:text-primary-700:hover{--tw-text-opacity:1;color:hsl(var(--color-primary-700)/var(--tw-text-opacity))}.hover\:outline-8:hover{outline-width:8px}}@media (pointer:coarse){.hover\:bg-content\/5:active{background-color:hsl(var(--color-content)/.05)}.hover\:bg-highlight:active{background-color:hsl(var(--color-highlight))}.hover\:bg-highlight-100:active{background-color:hsl(var(--color-highlight-100))}.hover\:bg-primary-700:active{--tw-bg-opacity:1;background-color:hsl(var(--color-primary-700)/var(--tw-bg-opacity))}.hover\:text-content:active{--tw-text-opacity:1;color:hsl(var(--color-content)/var(--tw-text-opacity))}.hover\:text-content-100:active{--tw-text-opacity:1;color:hsl(var(--color-content-100)/var(--tw-text-opacity))}.hover\:text-primary-700:active{--tw-text-opacity:1;color:hsl(var(--color-primary-700)/var(--tw-text-opacity))}.hover\:outline-8:active{outline-width:8px}}@media (hover:hover) and (pointer:fine){.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-30{opacity:.3}}@media (prefers-color-scheme:dark){@media (hover:hover) and (pointer:fine){.group:hover .dark\:group-hover\:opacity-10{opacity:.1}.group:hover .dark\:group-hover\:opacity-50{opacity:.5}}}@media (prefers-color-scheme:light){@media (hover:hover) and (pointer:fine){.group:hover .dark\:group-hover\:opacity-10{opacity:.1}.group:hover .dark\:group-hover\:opacity-50{opacity:.5}}}@media (pointer:coarse){.group:active .group-hover\:opacity-100{opacity:1}.group:active .group-hover\:opacity-30{opacity:.3}}@media (prefers-color-scheme:dark){@media (pointer:coarse){.group:active .dark\:group-hover\:opacity-10{opacity:.1}.group:active .dark\:group-hover\:opacity-50{opacity:.5}}}@media (prefers-color-scheme:light){@media (pointer:coarse){.group:active .dark\:group-hover\:opacity-10{opacity:.1}.group:active .dark\:group-hover\:opacity-50{opacity:.5}}}@media (min-width:640px){.sm\:flex{display:flex}.sm\:contents{display:contents}.sm\:hidden{display:none}.sm\:bg-inherit{background-color:inherit}}@media (min-width:768px){.md\:contents{display:contents}.md\:hidden{display:none}}@media (min-width:1024px){.lg\:contents{display:contents}.lg\:hidden{display:none}.lg\:auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.lg\:grid-flow-col{grid-auto-flow:column}.lg\:gap-4{gap:1rem}}@media (min-width:1280px){.xl\:block{display:block}.xl\:flex{display:flex}.xl\:contents{display:contents}.xl\:hidden{display:none}}@media (min-height:30rem){.tall\:flex{display:flex}}.\[\&\:has\(input\:checked\)\]\:bg-transparent:has(input:checked){background-color:transparent}.\[\&\:has\(input\:checked\)\]\:text-white:has(input:checked){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.\[\&\:has\(input\:focus-visible\)\]\:outline:has(input:focus-visible){outline-style:solid}.\[\&\>\*\:first-child\]\:opacity-50>:first-child{opacity:.5}.\[\&\>\*\]\:col-start-1>*{grid-column-start:1}.\[\&\>\*\]\:row-start-1>*{grid-row-start:1}.\[\&\>\*\]\:bg-surface-100>*{--tw-bg-opacity:1;background-color:hsl(var(--color-surface-100)/var(--tw-bg-opacity))}.\[\&\>\*\]\:align-bottom>*{vertical-align:bottom}.\[\&_hr\]\:\!opacity-100 hr{opacity:1!important}.\[\&\~nav_div\]\:opacity-0~nav div{opacity:0}.\[\&\~nav_div_a\]\:pointer-events-none~nav div a{pointer-events:none}.\[\&\~nav_div_a\]\:-translate-y-full~nav div a{--tw-translate-y:-100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:has(>.\[\*\:has\(\>\&\)\:last-of-type_hr\]\:\!opacity-0):last-of-type hr{opacity:0!important}:has(>div>.\[\*\:has\(\>div\>\&\)\]\:pointer-events-none){pointer-events:none}main.svelte-1ucfubu::-webkit-scrollbar{display:none}main.svelte-1ucfubu{scrollbar-width:none}div.svelte-1ucfubu:after{content:attr(aria-label);display:block;font-weight:700;height:0;visibility:hidden}.svelte-1ucfubu:where(div){pointer-events:auto}.grid.svelte-qtbr7a::-webkit-scrollbar{display:none}.grid.svelte-qtbr7a{scrollbar-width:none}input.svelte-sruga5:after{content:"";display:block;inset:-4px;position:absolute}input.svelte-sruga5::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;background:linear-gradient(to right,hsl(var(--color-primary-600)),hsl(var(--color-primary-600))) 0 /var(--progress) 100% no-repeat,hsl(var(--color-primary-200));border-radius:4px;height:4px}input.svelte-sruga5::-webkit-slider-thumb{-webkit-appearance:none;background:radial-gradient(circle,hsl(var(--color-primary-600)),hsl(var(--color-primary-600)) 20%,transparent 22%,transparent 100%) 50% 50%;background-size:100%;border-radius:100%;box-shadow:none;height:32px;margin-top:-14px;pointer-events:auto;position:relative;transform:translate(calc(var(--progress) - 50%));-webkit-transition:background-size .3s ease;transition:background-size .3s ease;width:32px;z-index:100}@media (hover:hover) and (pointer:fine){input.svelte-sruga5::-webkit-slider-thumb:hover{background-size:500%}}@media (pointer:coarse){input.svelte-sruga5{pointer-events:none}input.svelte-sruga5::-webkit-slider-thumb:active{background-size:500%}}@media (pointer:coarse){@supports (-webkit-touch-callout:none){aside.svelte-1x44efv:focus-within{animation:svelte-1x44efv-elevate 1ms 1}}}@keyframes svelte-1x44efv-elevate{0%{transform:translate3d(0,-100vh,0)}}@supports (-webkit-appearance:none) and (stroke-color:transparent){@media not all and (-webkit-min-device-pixel-ratio:0),not all and (min-resolution:.001dpcm){.fixed.svelte-1vqfn9j{left:0}}}div.svelte-1xrekkf:after{inset-block-end:-.5rem;-webkit-mask:conic-gradient(from -30deg at bottom,#0000,#000 1deg 60deg,#0000 61deg) bottom /100% 50% no-repeat;mask:conic-gradient(from -30deg at bottom,#0000,#000 1deg 60deg,#0000 61deg) bottom /100% 50% no-repeat}@media (hover:hover) and (pointer:fine){:hover>div.svelte-1xrekkf{--tw-translate-y: calc(-100% - .5rem) ;opacity:1;transition-delay:.2s}}@keyframes svelte-1gcb6dg-dash-wiggle{0%,to{stroke-dashoffset:var(--back)}50%{stroke-dashoffset:var(--forth)}} diff --git a/_app/immutable/chunks/Collection.NWTCPfm4.js b/_app/immutable/chunks/Collection.skwpo2VZ.js similarity index 96% rename from _app/immutable/chunks/Collection.NWTCPfm4.js rename to _app/immutable/chunks/Collection.skwpo2VZ.js index 2d996763..1c4ecd09 100644 --- a/_app/immutable/chunks/Collection.NWTCPfm4.js +++ b/_app/immutable/chunks/Collection.skwpo2VZ.js @@ -1 +1 @@ -import{s as X,v as Y,p as Z,a as T,c as v,i as m,K as x,d as _,M as C,w as F,x as G,y as J,z as O,l as z,m as N,n as q,e as y}from"./scheduler.yhBzS9E6.js";import{S as ee,i as te,b as p,d as g,m as d,a as c,t as $,e as k,f as le,g as H,c as I}from"./index.f7836kWu.js";import{S as h,H as ne,I as j}from"./Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import{S as se}from"./Spacer.tcMPZ3eG.js";import"./paths.k6rcf9P1.js";import{s as fe,c as re,n as A,q as L}from"./Track.LR7rfYB8.js";import{m as ae,T as ie,A as oe}from"./util.VvTXxVpP.js";import{T as ue}from"./Player.J8CE-V80.js";const ce=r=>({}),M=r=>({slot:"action"});function B(r){let t,s;return t=new oe({props:{href:r[6],round:r[2]==="artist",of:r[3]}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,l){const n={};l&64&&(n.href=e[6]),l&4&&(n.round=e[2]==="artist"),l&8&&(n.of=e[3]),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function $e(r){let t=r[3]?.title+"",s;return{c(){s=z(t)},l(e){s=N(e,t)},m(e,l){m(e,s,l)},p(e,l){l&8&&t!==(t=e[3]?.title+"")&&q(s,t)},d(e){e&&_(s)}}}function me(r){let t,s;return t=new A({props:{secondary:!0,loading:!r[3],indent:r[2]==="playlist",$$slots:{default:[pe]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,l){const n={};l&8&&(n.loading=!e[3]),l&4&&(n.indent=e[2]==="playlist"),l&32804&&(n.$$scope={dirty:l,ctx:e}),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function _e(r){let t,s,e,l,n,f;t=new A({props:{secondary:!0,indent:r[2]==="playlist",$$slots:{default:[ge]},$$scope:{ctx:r}}}),e=new A({props:{secondary:!0,indent:r[2]==="playlist",$$slots:{default:[de]},$$scope:{ctx:r}}});let i="remote"in r[3]&&r[3].remote&&E(r);return{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment),l=T(),i&&i.c(),n=y()},l(a){g(t.$$.fragment,a),s=v(a),g(e.$$.fragment,a),l=v(a),i&&i.l(a),n=y()},m(a,o){d(t,a,o),m(a,s,o),d(e,a,o),m(a,l,o),i&&i.m(a,o),m(a,n,o),f=!0},p(a,o){const b={};o&4&&(b.indent=a[2]==="playlist"),o&32776&&(b.$$scope={dirty:o,ctx:a}),t.$set(b);const w={};o&4&&(w.indent=a[2]==="playlist"),o&32776&&(w.$$scope={dirty:o,ctx:a}),e.$set(w),"remote"in a[3]&&a[3].remote?i?(i.p(a,o),o&8&&c(i,1)):(i=E(a),i.c(),c(i,1),i.m(n.parentNode,n)):i&&(H(),$(i,1,1,()=>{i=null}),I())},i(a){f||(c(t.$$.fragment,a),c(e.$$.fragment,a),c(i),f=!0)},o(a){$(t.$$.fragment,a),$(e.$$.fragment,a),$(i),f=!1},d(a){a&&(_(s),_(l),_(n)),k(t,a),k(e,a),i&&i.d(a)}}}function D(r){let t,s;return t=new j({props:{name:"globe",sm:!0}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function pe(r){let t,s,e,l=r[2]==="artist"&&D();return{c(){l&&l.c(),t=T(),s=z(r[5])},l(n){l&&l.l(n),t=v(n),s=N(n,r[5])},m(n,f){l&&l.m(n,f),m(n,t,f),m(n,s,f),e=!0},p(n,f){n[2]==="artist"?l?f&4&&c(l,1):(l=D(),l.c(),c(l,1),l.m(t.parentNode,t)):l&&(H(),$(l,1,1,()=>{l=null}),I()),(!e||f&32)&&q(s,n[5])},i(n){e||(c(l),e=!0)},o(n){$(l),e=!1},d(n){n&&(_(t),_(s)),l&&l.d(n)}}}function ge(r){let t,s,e=r[3].collection.size+"",l,n;return t=new j({props:{name:"note",sm:!0}}),{c(){p(t.$$.fragment),s=T(),l=z(e)},l(f){g(t.$$.fragment,f),s=v(f),l=N(f,e)},m(f,i){d(t,f,i),m(f,s,i),m(f,l,i),n=!0},p(f,i){(!n||i&8)&&e!==(e=f[3].collection.size+"")&&q(l,e)},i(f){n||(c(t.$$.fragment,f),n=!0)},o(f){$(t.$$.fragment,f),n=!1},d(f){f&&(_(s),_(l)),k(t,f)}}}function de(r){let t,s,e=L(r[3].collection.duration)+"",l,n;return t=new j({props:{name:"clock",sm:!0}}),{c(){p(t.$$.fragment),s=T(),l=z(e)},l(f){g(t.$$.fragment,f),s=v(f),l=N(f,e)},m(f,i){d(t,f,i),m(f,s,i),m(f,l,i),n=!0},p(f,i){(!n||i&8)&&e!==(e=L(f[3].collection.duration)+"")&&q(l,e)},i(f){n||(c(t.$$.fragment,f),n=!0)},o(f){$(t.$$.fragment,f),n=!1},d(f){f&&(_(s),_(l)),k(t,f)}}}function E(r){let t,s,e,l;return t=new se({}),e=new A({props:{secondary:!0,$$slots:{default:[ke]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment)},l(n){g(t.$$.fragment,n),s=v(n),g(e.$$.fragment,n)},m(n,f){d(t,n,f),m(n,s,f),d(e,n,f),l=!0},p(n,f){const i={};f&32776&&(i.$$scope={dirty:f,ctx:n}),e.$set(i)},i(n){l||(c(t.$$.fragment,n),c(e.$$.fragment,n),l=!0)},o(n){$(t.$$.fragment,n),$(e.$$.fragment,n),l=!1},d(n){n&&_(s),k(t,n),k(e,n)}}}function ke(r){let t,s,e=r[3].remote+"",l,n;return t=new j({props:{name:"share",sm:!0}}),{c(){p(t.$$.fragment),s=T(),l=z(e)},l(f){g(t.$$.fragment,f),s=v(f),l=N(f,e)},m(f,i){d(t,f,i),m(f,s,i),m(f,l,i),n=!0},p(f,i){(!n||i&8)&&e!==(e=f[3].remote+"")&&q(l,e)},i(f){n||(c(t.$$.fragment,f),n=!0)},o(f){$(t.$$.fragment,f),n=!1},d(f){f&&(_(s),_(l)),k(t,f)}}}function be(r){let t,s,e,l;const n=[_e,me],f=[];function i(a,o){return a[3]?.collection?0:1}return t=i(r),s=f[t]=n[t](r),{c(){s.c(),e=y()},l(a){s.l(a),e=y()},m(a,o){f[t].m(a,o),m(a,e,o),l=!0},p(a,o){let b=t;t=i(a),t===b?f[t].p(a,o):(H(),$(f[b],1,1,()=>{f[b]=null}),I(),s=f[t],s?s.p(a,o):(s=f[t]=n[t](a),s.c()),c(s,1),s.m(e.parentNode,e))},i(a){l||(c(s),l=!0)},o(a){$(s),l=!1},d(a){a&&_(e),f[t].d(a)}}}function we(r){let t,s,e,l;return t=new ne({props:{xl:r[2]==="playlist",indent:r[2]==="playlist",loading:!r[3],$$slots:{default:[$e]},$$scope:{ctx:r}}}),e=new h({props:{x:!0,class:"gap-4",$$slots:{default:[be]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment)},l(n){g(t.$$.fragment,n),s=v(n),g(e.$$.fragment,n)},m(n,f){d(t,n,f),m(n,s,f),d(e,n,f),l=!0},p(n,f){const i={};f&4&&(i.xl=n[2]==="playlist"),f&4&&(i.indent=n[2]==="playlist"),f&8&&(i.loading=!n[3]),f&32776&&(i.$$scope={dirty:f,ctx:n}),t.$set(i);const a={};f&32812&&(a.$$scope={dirty:f,ctx:n}),e.$set(a)},i(n){l||(c(t.$$.fragment,n),c(e.$$.fragment,n),l=!0)},o(n){$(t.$$.fragment,n),$(e.$$.fragment,n),l=!1},d(n){n&&_(s),k(t,n),k(e,n)}}}function Se(r){let t,s,e,l=r[2]!=="playlist"&&B(r);return s=new h({props:{class:"gap-2",$$slots:{default:[we]},$$scope:{ctx:r}}}),{c(){l&&l.c(),t=T(),p(s.$$.fragment)},l(n){l&&l.l(n),t=v(n),g(s.$$.fragment,n)},m(n,f){l&&l.m(n,f),m(n,t,f),d(s,n,f),e=!0},p(n,f){n[2]!=="playlist"?l?(l.p(n,f),f&4&&c(l,1)):(l=B(n),l.c(),c(l,1),l.m(t.parentNode,t)):l&&(H(),$(l,1,1,()=>{l=null}),I());const i={};f&32812&&(i.$$scope={dirty:f,ctx:n}),s.$set(i)},i(n){e||(c(l),c(s.$$.fragment,n),e=!0)},o(n){$(l),$(s.$$.fragment,n),e=!1},d(n){n&&_(t),l&&l.d(n),k(s,n)}}}function Te(r){let t,s;return t=new h({props:{x:!0,class:`place-items-center gap-4 ${r[2]!=="playlist"?"p-4":""}`,$$slots:{default:[Se]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,l){const n={};l&4&&(n.class=`place-items-center gap-4 ${e[2]!=="playlist"?"p-4":""}`),l&32876&&(n.$$scope={dirty:l,ctx:e}),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function ve(r){let t;const s=r[9].default,e=F(s,r,r[15],null);return{c(){e&&e.c()},l(l){e&&e.l(l)},m(l,n){e&&e.m(l,n),t=!0},p(l,n){e&&e.p&&(!t||n&32768)&&G(e,s,l,l[15],t?O(s,l[15],n,null):J(l[15]),null)},i(l){t||(c(e,l),t=!0)},o(l){$(e,l),t=!1},d(l){e&&e.d(l)}}}function ze(r){let t;const s=r[9].action,e=F(s,r,r[15],M);return{c(){e&&e.c()},l(l){e&&e.l(l)},m(l,n){e&&e.m(l,n),t=!0},p(l,n){e&&e.p&&(!t||n&32768)&&G(e,s,l,l[15],t?O(s,l[15],n,ce):J(l[15]),M)},i(l){t||(c(e,l),t=!0)},o(l){$(e,l),t=!1},d(l){e&&e.d(l)}}}function Ne(r){let t,s,e,l,n;t=new ie({props:{title:r[3]?.title||"",$$slots:{default:[Te]},$$scope:{ctx:r}}});function f(a){r[10](a)}let i={fixed:r[1]||(r[2]==="playlist"?!!r[4]:!0),tracks:r[7],$$slots:{action:[ze],default:[ve]},$$scope:{ctx:r}};return r[0]!==void 0&&(i.selected=r[0]),e=new ue({props:i}),Z.push(()=>le(e,"selected",f)),e.$on("edit",r[11]),e.$on("click",r[12]),e.$on("action",r[13]),e.$on("end",r[14]),{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment)},l(a){g(t.$$.fragment,a),s=v(a),g(e.$$.fragment,a)},m(a,o){d(t,a,o),m(a,s,o),d(e,a,o),n=!0},p(a,o){const b={};o&8&&(b.title=a[3]?.title||""),o&32876&&(b.$$scope={dirty:o,ctx:a}),t.$set(b);const w={};o&22&&(w.fixed=a[1]||(a[2]==="playlist"?!!a[4]:!0)),o&128&&(w.tracks=a[7]),o&32768&&(w.$$scope={dirty:o,ctx:a}),!l&&o&1&&(l=!0,w.selected=a[0],x(()=>l=!1)),e.$set(w)},i(a){n||(c(t.$$.fragment,a),c(e.$$.fragment,a),n=!0)},o(a){$(t.$$.fragment,a),$(e.$$.fragment,a),n=!1},d(a){a&&_(s),k(t,a),k(e,a)}}}function qe(r){let t,s;return t=new h({props:{class:r[2]==="playlist"?"gap-4":"",$$slots:{default:[Ne]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,[l]){const n={};l&4&&(n.class=e[2]==="playlist"?"gap-4":""),l&33023&&(n.$$scope={dirty:l,ctx:e}),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function Ce(r,t,s){let e,l,n,f;Y(r,fe,u=>s(4,f=u));let{$$slots:i={},$$scope:a}=t,{fixed:o=!1}=t,{style:b}=t,{selected:w=new Set}=t,{of:S=void 0}=t,{tracks:K=void 0}=t;const P=u=>[...new Set(u)];function Q(u){w=u,s(0,w)}function R(u){C.call(this,r,u)}function U(u){C.call(this,r,u)}function V(u){C.call(this,r,u)}function W(u){C.call(this,r,u)}return r.$$set=u=>{"fixed"in u&&s(1,o=u.fixed),"style"in u&&s(2,b=u.style),"selected"in u&&s(0,w=u.selected),"of"in u&&s(3,S=u.of),"tracks"in u&&s(8,K=u.tracks),"$$scope"in u&&s(15,a=u.$$scope)},r.$$.update=()=>{r.$$.dirty&280&&s(7,e=(K||S?.collection?.tracks)?.filter(ae(f))),r.$$.dirty&12&&s(6,l=S?.collection&&b!=="playlist"?`/explore/${b}#${S?.id}`:void 0),r.$$.dirty&8&&s(5,n=S?P("artists"in S?S.artists.map(u=>u.title):"sources"in S?S?.sources.map(u=>re(u.split("/")[0])).filter(u=>!!u):[]).join(", "):"Loading")},[w,o,b,S,f,n,l,e,K,i,Q,R,U,V,W,a]}class Me extends ee{constructor(t){super(),te(this,t,Ce,qe,X,{fixed:1,style:2,selected:0,of:3,tracks:8})}}export{Me as C}; +import{s as X,v as Y,p as Z,a as T,c as v,i as m,K as x,d as _,M as C,w as F,x as G,y as J,z as O,l as z,m as N,n as q,e as y}from"./scheduler.yhBzS9E6.js";import{S as ee,i as te,b as p,d as g,m as d,a as c,t as $,e as k,f as le,g as H,c as I}from"./index.f7836kWu.js";import{S as h,H as ne,I as j}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import{S as se}from"./Spacer.tcMPZ3eG.js";import"./paths.G112lh3q.js";import{s as fe,c as re,n as A,q as L}from"./Track.oiOqwbPY.js";import{m as ae,T as ie,A as oe}from"./util.2xyf67Ew.js";import{T as ue}from"./Player.4gabUvVV.js";const ce=r=>({}),M=r=>({slot:"action"});function B(r){let t,s;return t=new oe({props:{href:r[6],round:r[2]==="artist",of:r[3]}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,l){const n={};l&64&&(n.href=e[6]),l&4&&(n.round=e[2]==="artist"),l&8&&(n.of=e[3]),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function $e(r){let t=r[3]?.title+"",s;return{c(){s=z(t)},l(e){s=N(e,t)},m(e,l){m(e,s,l)},p(e,l){l&8&&t!==(t=e[3]?.title+"")&&q(s,t)},d(e){e&&_(s)}}}function me(r){let t,s;return t=new A({props:{secondary:!0,loading:!r[3],indent:r[2]==="playlist",$$slots:{default:[pe]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,l){const n={};l&8&&(n.loading=!e[3]),l&4&&(n.indent=e[2]==="playlist"),l&32804&&(n.$$scope={dirty:l,ctx:e}),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function _e(r){let t,s,e,l,n,f;t=new A({props:{secondary:!0,indent:r[2]==="playlist",$$slots:{default:[ge]},$$scope:{ctx:r}}}),e=new A({props:{secondary:!0,indent:r[2]==="playlist",$$slots:{default:[de]},$$scope:{ctx:r}}});let i="remote"in r[3]&&r[3].remote&&E(r);return{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment),l=T(),i&&i.c(),n=y()},l(a){g(t.$$.fragment,a),s=v(a),g(e.$$.fragment,a),l=v(a),i&&i.l(a),n=y()},m(a,o){d(t,a,o),m(a,s,o),d(e,a,o),m(a,l,o),i&&i.m(a,o),m(a,n,o),f=!0},p(a,o){const b={};o&4&&(b.indent=a[2]==="playlist"),o&32776&&(b.$$scope={dirty:o,ctx:a}),t.$set(b);const w={};o&4&&(w.indent=a[2]==="playlist"),o&32776&&(w.$$scope={dirty:o,ctx:a}),e.$set(w),"remote"in a[3]&&a[3].remote?i?(i.p(a,o),o&8&&c(i,1)):(i=E(a),i.c(),c(i,1),i.m(n.parentNode,n)):i&&(H(),$(i,1,1,()=>{i=null}),I())},i(a){f||(c(t.$$.fragment,a),c(e.$$.fragment,a),c(i),f=!0)},o(a){$(t.$$.fragment,a),$(e.$$.fragment,a),$(i),f=!1},d(a){a&&(_(s),_(l),_(n)),k(t,a),k(e,a),i&&i.d(a)}}}function D(r){let t,s;return t=new j({props:{name:"globe",sm:!0}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function pe(r){let t,s,e,l=r[2]==="artist"&&D();return{c(){l&&l.c(),t=T(),s=z(r[5])},l(n){l&&l.l(n),t=v(n),s=N(n,r[5])},m(n,f){l&&l.m(n,f),m(n,t,f),m(n,s,f),e=!0},p(n,f){n[2]==="artist"?l?f&4&&c(l,1):(l=D(),l.c(),c(l,1),l.m(t.parentNode,t)):l&&(H(),$(l,1,1,()=>{l=null}),I()),(!e||f&32)&&q(s,n[5])},i(n){e||(c(l),e=!0)},o(n){$(l),e=!1},d(n){n&&(_(t),_(s)),l&&l.d(n)}}}function ge(r){let t,s,e=r[3].collection.size+"",l,n;return t=new j({props:{name:"note",sm:!0}}),{c(){p(t.$$.fragment),s=T(),l=z(e)},l(f){g(t.$$.fragment,f),s=v(f),l=N(f,e)},m(f,i){d(t,f,i),m(f,s,i),m(f,l,i),n=!0},p(f,i){(!n||i&8)&&e!==(e=f[3].collection.size+"")&&q(l,e)},i(f){n||(c(t.$$.fragment,f),n=!0)},o(f){$(t.$$.fragment,f),n=!1},d(f){f&&(_(s),_(l)),k(t,f)}}}function de(r){let t,s,e=L(r[3].collection.duration)+"",l,n;return t=new j({props:{name:"clock",sm:!0}}),{c(){p(t.$$.fragment),s=T(),l=z(e)},l(f){g(t.$$.fragment,f),s=v(f),l=N(f,e)},m(f,i){d(t,f,i),m(f,s,i),m(f,l,i),n=!0},p(f,i){(!n||i&8)&&e!==(e=L(f[3].collection.duration)+"")&&q(l,e)},i(f){n||(c(t.$$.fragment,f),n=!0)},o(f){$(t.$$.fragment,f),n=!1},d(f){f&&(_(s),_(l)),k(t,f)}}}function E(r){let t,s,e,l;return t=new se({}),e=new A({props:{secondary:!0,$$slots:{default:[ke]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment)},l(n){g(t.$$.fragment,n),s=v(n),g(e.$$.fragment,n)},m(n,f){d(t,n,f),m(n,s,f),d(e,n,f),l=!0},p(n,f){const i={};f&32776&&(i.$$scope={dirty:f,ctx:n}),e.$set(i)},i(n){l||(c(t.$$.fragment,n),c(e.$$.fragment,n),l=!0)},o(n){$(t.$$.fragment,n),$(e.$$.fragment,n),l=!1},d(n){n&&_(s),k(t,n),k(e,n)}}}function ke(r){let t,s,e=r[3].remote+"",l,n;return t=new j({props:{name:"share",sm:!0}}),{c(){p(t.$$.fragment),s=T(),l=z(e)},l(f){g(t.$$.fragment,f),s=v(f),l=N(f,e)},m(f,i){d(t,f,i),m(f,s,i),m(f,l,i),n=!0},p(f,i){(!n||i&8)&&e!==(e=f[3].remote+"")&&q(l,e)},i(f){n||(c(t.$$.fragment,f),n=!0)},o(f){$(t.$$.fragment,f),n=!1},d(f){f&&(_(s),_(l)),k(t,f)}}}function be(r){let t,s,e,l;const n=[_e,me],f=[];function i(a,o){return a[3]?.collection?0:1}return t=i(r),s=f[t]=n[t](r),{c(){s.c(),e=y()},l(a){s.l(a),e=y()},m(a,o){f[t].m(a,o),m(a,e,o),l=!0},p(a,o){let b=t;t=i(a),t===b?f[t].p(a,o):(H(),$(f[b],1,1,()=>{f[b]=null}),I(),s=f[t],s?s.p(a,o):(s=f[t]=n[t](a),s.c()),c(s,1),s.m(e.parentNode,e))},i(a){l||(c(s),l=!0)},o(a){$(s),l=!1},d(a){a&&_(e),f[t].d(a)}}}function we(r){let t,s,e,l;return t=new ne({props:{xl:r[2]==="playlist",indent:r[2]==="playlist",loading:!r[3],$$slots:{default:[$e]},$$scope:{ctx:r}}}),e=new h({props:{x:!0,class:"gap-4",$$slots:{default:[be]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment)},l(n){g(t.$$.fragment,n),s=v(n),g(e.$$.fragment,n)},m(n,f){d(t,n,f),m(n,s,f),d(e,n,f),l=!0},p(n,f){const i={};f&4&&(i.xl=n[2]==="playlist"),f&4&&(i.indent=n[2]==="playlist"),f&8&&(i.loading=!n[3]),f&32776&&(i.$$scope={dirty:f,ctx:n}),t.$set(i);const a={};f&32812&&(a.$$scope={dirty:f,ctx:n}),e.$set(a)},i(n){l||(c(t.$$.fragment,n),c(e.$$.fragment,n),l=!0)},o(n){$(t.$$.fragment,n),$(e.$$.fragment,n),l=!1},d(n){n&&_(s),k(t,n),k(e,n)}}}function Se(r){let t,s,e,l=r[2]!=="playlist"&&B(r);return s=new h({props:{class:"gap-2",$$slots:{default:[we]},$$scope:{ctx:r}}}),{c(){l&&l.c(),t=T(),p(s.$$.fragment)},l(n){l&&l.l(n),t=v(n),g(s.$$.fragment,n)},m(n,f){l&&l.m(n,f),m(n,t,f),d(s,n,f),e=!0},p(n,f){n[2]!=="playlist"?l?(l.p(n,f),f&4&&c(l,1)):(l=B(n),l.c(),c(l,1),l.m(t.parentNode,t)):l&&(H(),$(l,1,1,()=>{l=null}),I());const i={};f&32812&&(i.$$scope={dirty:f,ctx:n}),s.$set(i)},i(n){e||(c(l),c(s.$$.fragment,n),e=!0)},o(n){$(l),$(s.$$.fragment,n),e=!1},d(n){n&&_(t),l&&l.d(n),k(s,n)}}}function Te(r){let t,s;return t=new h({props:{x:!0,class:`place-items-center gap-4 ${r[2]!=="playlist"?"p-4":""}`,$$slots:{default:[Se]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,l){const n={};l&4&&(n.class=`place-items-center gap-4 ${e[2]!=="playlist"?"p-4":""}`),l&32876&&(n.$$scope={dirty:l,ctx:e}),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function ve(r){let t;const s=r[9].default,e=F(s,r,r[15],null);return{c(){e&&e.c()},l(l){e&&e.l(l)},m(l,n){e&&e.m(l,n),t=!0},p(l,n){e&&e.p&&(!t||n&32768)&&G(e,s,l,l[15],t?O(s,l[15],n,null):J(l[15]),null)},i(l){t||(c(e,l),t=!0)},o(l){$(e,l),t=!1},d(l){e&&e.d(l)}}}function ze(r){let t;const s=r[9].action,e=F(s,r,r[15],M);return{c(){e&&e.c()},l(l){e&&e.l(l)},m(l,n){e&&e.m(l,n),t=!0},p(l,n){e&&e.p&&(!t||n&32768)&&G(e,s,l,l[15],t?O(s,l[15],n,ce):J(l[15]),M)},i(l){t||(c(e,l),t=!0)},o(l){$(e,l),t=!1},d(l){e&&e.d(l)}}}function Ne(r){let t,s,e,l,n;t=new ie({props:{title:r[3]?.title||"",$$slots:{default:[Te]},$$scope:{ctx:r}}});function f(a){r[10](a)}let i={fixed:r[1]||(r[2]==="playlist"?!!r[4]:!0),tracks:r[7],$$slots:{action:[ze],default:[ve]},$$scope:{ctx:r}};return r[0]!==void 0&&(i.selected=r[0]),e=new ue({props:i}),Z.push(()=>le(e,"selected",f)),e.$on("edit",r[11]),e.$on("click",r[12]),e.$on("action",r[13]),e.$on("end",r[14]),{c(){p(t.$$.fragment),s=T(),p(e.$$.fragment)},l(a){g(t.$$.fragment,a),s=v(a),g(e.$$.fragment,a)},m(a,o){d(t,a,o),m(a,s,o),d(e,a,o),n=!0},p(a,o){const b={};o&8&&(b.title=a[3]?.title||""),o&32876&&(b.$$scope={dirty:o,ctx:a}),t.$set(b);const w={};o&22&&(w.fixed=a[1]||(a[2]==="playlist"?!!a[4]:!0)),o&128&&(w.tracks=a[7]),o&32768&&(w.$$scope={dirty:o,ctx:a}),!l&&o&1&&(l=!0,w.selected=a[0],x(()=>l=!1)),e.$set(w)},i(a){n||(c(t.$$.fragment,a),c(e.$$.fragment,a),n=!0)},o(a){$(t.$$.fragment,a),$(e.$$.fragment,a),n=!1},d(a){a&&_(s),k(t,a),k(e,a)}}}function qe(r){let t,s;return t=new h({props:{class:r[2]==="playlist"?"gap-4":"",$$slots:{default:[Ne]},$$scope:{ctx:r}}}),{c(){p(t.$$.fragment)},l(e){g(t.$$.fragment,e)},m(e,l){d(t,e,l),s=!0},p(e,[l]){const n={};l&4&&(n.class=e[2]==="playlist"?"gap-4":""),l&33023&&(n.$$scope={dirty:l,ctx:e}),t.$set(n)},i(e){s||(c(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){k(t,e)}}}function Ce(r,t,s){let e,l,n,f;Y(r,fe,u=>s(4,f=u));let{$$slots:i={},$$scope:a}=t,{fixed:o=!1}=t,{style:b}=t,{selected:w=new Set}=t,{of:S=void 0}=t,{tracks:K=void 0}=t;const P=u=>[...new Set(u)];function Q(u){w=u,s(0,w)}function R(u){C.call(this,r,u)}function U(u){C.call(this,r,u)}function V(u){C.call(this,r,u)}function W(u){C.call(this,r,u)}return r.$$set=u=>{"fixed"in u&&s(1,o=u.fixed),"style"in u&&s(2,b=u.style),"selected"in u&&s(0,w=u.selected),"of"in u&&s(3,S=u.of),"tracks"in u&&s(8,K=u.tracks),"$$scope"in u&&s(15,a=u.$$scope)},r.$$.update=()=>{r.$$.dirty&280&&s(7,e=(K||S?.collection?.tracks)?.filter(ae(f))),r.$$.dirty&12&&s(6,l=S?.collection&&b!=="playlist"?`/explore/${b}#${S?.id}`:void 0),r.$$.dirty&8&&s(5,n=S?P("artists"in S?S.artists.map(u=>u.title):"sources"in S?S?.sources.map(u=>re(u.split("/")[0])).filter(u=>!!u):[]).join(", "):"Loading")},[w,o,b,S,f,n,l,e,K,i,Q,R,U,V,W,a]}class Me extends ee{constructor(t){super(),te(this,t,Ce,qe,X,{fixed:1,style:2,selected:0,of:3,tracks:8})}}export{Me as C}; diff --git a/_app/immutable/chunks/Input.hoDY5QId.js b/_app/immutable/chunks/Input.UuPw_Vot.js similarity index 97% rename from _app/immutable/chunks/Input.hoDY5QId.js rename to _app/immutable/chunks/Input.UuPw_Vot.js index d6323bd0..7c3f6e34 100644 --- a/_app/immutable/chunks/Input.hoDY5QId.js +++ b/_app/immutable/chunks/Input.UuPw_Vot.js @@ -1 +1 @@ -import{s as q,w as z,f as v,a as I,g as w,h as C,c as k,d,j as h,E as m,i as y,u as b,Y as E,C as D,x as G,y as N,z as P,A as T,G as U}from"./scheduler.yhBzS9E6.js";import{S as V,i as Y,a as _,g as F,t as g,c as H,b as A,d as L,m as S,e as j}from"./index.f7836kWu.js";import{B as J,I as K}from"./Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"./paths.k6rcf9P1.js";function B(r){let e,n,t;return n=new J({props:{disabled:!r[0],air:!0,$$slots:{default:[M]},$$scope:{ctx:r}}}),n.$on("click",r[7]),{c(){e=v("div"),A(n.$$.fragment),this.h()},l(s){e=w(s,"DIV",{class:!0});var o=C(e);L(n.$$.fragment,o),o.forEach(d),this.h()},h(){h(e,"class","opacity-0 transition-opacity"),m(e,"pointer-events-none",!r[0]),m(e,"opacity-100",r[0])},m(s,o){y(s,e,o),S(n,e,null),t=!0},p(s,o){const f={};o&1&&(f.disabled=!s[0]),o&256&&(f.$$scope={dirty:o,ctx:s}),n.$set(f),(!t||o&1)&&m(e,"pointer-events-none",!s[0]),(!t||o&1)&&m(e,"opacity-100",s[0])},i(s){t||(_(n.$$.fragment,s),t=!0)},o(s){g(n.$$.fragment,s),t=!1},d(s){s&&d(e),j(n)}}}function M(r){let e,n;return e=new K({props:{sm:!0,name:"close"}}),{c(){A(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,s){S(e,t,s),n=!0},p:U,i(t){n||(_(e.$$.fragment,t),n=!0)},o(t){g(e.$$.fragment,t),n=!1},d(t){j(e,t)}}}function O(r){let e,n,t,s,o,f,p;const c=r[5].default,u=z(c,r,r[8],null);let i=r[1]&&B(r);return{c(){e=v("label"),u&&u.c(),n=I(),t=v("input"),s=I(),i&&i.c(),this.h()},l(a){e=w(a,"LABEL",{class:!0});var l=C(e);u&&u.l(l),n=k(l),t=w(l,"INPUT",{type:!0,class:!0,placeholder:!0}),s=k(l),i&&i.l(l),l.forEach(d),this.h()},h(){h(t,"type","text"),h(t,"class","h-11 w-full touch-manipulation bg-transparent py-3 text-md text-content outline-none placeholder:text-content-200"),h(t,"placeholder",r[2]),h(e,"class","relative flex cursor-text touch-manipulation items-center gap-3 px-3 text-content-200 "+(r[4]?"rounded-lg focus-within:bg-content/5 hover:bg-content/5":"rounded-xl bg-highlight focus-within:bg-highlight-100 hover:bg-highlight-100")),m(e,"w-full",r[3])},m(a,l){y(a,e,l),u&&u.m(e,null),b(e,n),b(e,t),E(t,r[0]),b(e,s),i&&i.m(e,null),o=!0,f||(p=D(t,"input",r[6]),f=!0)},p(a,[l]){u&&u.p&&(!o||l&256)&&G(u,c,a,a[8],o?P(c,a[8],l,null):N(a[8]),null),(!o||l&4)&&h(t,"placeholder",a[2]),l&1&&t.value!==a[0]&&E(t,a[0]),a[1]?i?(i.p(a,l),l&2&&_(i,1)):(i=B(a),i.c(),_(i,1),i.m(e,null)):i&&(F(),g(i,1,1,()=>{i=null}),H()),(!o||l&8)&&m(e,"w-full",a[3])},i(a){o||(_(u,a),_(i),o=!0)},o(a){g(u,a),g(i),o=!1},d(a){a&&d(e),u&&u.d(a),i&&i.d(),f=!1,p()}}}function Q(r,e,n){let{$$slots:t={},$$scope:s}=e,{resettable:o=!1}=e,{placeholder:f=""}=e,{stretch:p=!1}=e,{value:c=""}=e;const u=!!T("panel");function i(){c=this.value,n(0,c)}const a=()=>n(0,c="");return r.$$set=l=>{"resettable"in l&&n(1,o=l.resettable),"placeholder"in l&&n(2,f=l.placeholder),"stretch"in l&&n(3,p=l.stretch),"value"in l&&n(0,c=l.value),"$$scope"in l&&n(8,s=l.$$scope)},[c,o,f,p,u,t,i,a,s]}class $ extends V{constructor(e){super(),Y(this,e,Q,O,q,{resettable:1,placeholder:2,stretch:3,value:0})}}export{$ as I}; +import{s as q,w as z,f as v,a as I,g as w,h as C,c as k,d,j as h,E as m,i as y,u as b,Y as E,C as D,x as G,y as N,z as P,A as T,G as U}from"./scheduler.yhBzS9E6.js";import{S as V,i as Y,a as _,g as F,t as g,c as H,b as A,d as L,m as S,e as j}from"./index.f7836kWu.js";import{B as J,I as K}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"./paths.G112lh3q.js";function B(r){let e,n,t;return n=new J({props:{disabled:!r[0],air:!0,$$slots:{default:[M]},$$scope:{ctx:r}}}),n.$on("click",r[7]),{c(){e=v("div"),A(n.$$.fragment),this.h()},l(s){e=w(s,"DIV",{class:!0});var o=C(e);L(n.$$.fragment,o),o.forEach(d),this.h()},h(){h(e,"class","opacity-0 transition-opacity"),m(e,"pointer-events-none",!r[0]),m(e,"opacity-100",r[0])},m(s,o){y(s,e,o),S(n,e,null),t=!0},p(s,o){const f={};o&1&&(f.disabled=!s[0]),o&256&&(f.$$scope={dirty:o,ctx:s}),n.$set(f),(!t||o&1)&&m(e,"pointer-events-none",!s[0]),(!t||o&1)&&m(e,"opacity-100",s[0])},i(s){t||(_(n.$$.fragment,s),t=!0)},o(s){g(n.$$.fragment,s),t=!1},d(s){s&&d(e),j(n)}}}function M(r){let e,n;return e=new K({props:{sm:!0,name:"close"}}),{c(){A(e.$$.fragment)},l(t){L(e.$$.fragment,t)},m(t,s){S(e,t,s),n=!0},p:U,i(t){n||(_(e.$$.fragment,t),n=!0)},o(t){g(e.$$.fragment,t),n=!1},d(t){j(e,t)}}}function O(r){let e,n,t,s,o,f,p;const c=r[5].default,u=z(c,r,r[8],null);let i=r[1]&&B(r);return{c(){e=v("label"),u&&u.c(),n=I(),t=v("input"),s=I(),i&&i.c(),this.h()},l(a){e=w(a,"LABEL",{class:!0});var l=C(e);u&&u.l(l),n=k(l),t=w(l,"INPUT",{type:!0,class:!0,placeholder:!0}),s=k(l),i&&i.l(l),l.forEach(d),this.h()},h(){h(t,"type","text"),h(t,"class","h-11 w-full touch-manipulation bg-transparent py-3 text-md text-content outline-none placeholder:text-content-200"),h(t,"placeholder",r[2]),h(e,"class","relative flex cursor-text touch-manipulation items-center gap-3 px-3 text-content-200 "+(r[4]?"rounded-lg focus-within:bg-content/5 hover:bg-content/5":"rounded-xl bg-highlight focus-within:bg-highlight-100 hover:bg-highlight-100")),m(e,"w-full",r[3])},m(a,l){y(a,e,l),u&&u.m(e,null),b(e,n),b(e,t),E(t,r[0]),b(e,s),i&&i.m(e,null),o=!0,f||(p=D(t,"input",r[6]),f=!0)},p(a,[l]){u&&u.p&&(!o||l&256)&&G(u,c,a,a[8],o?P(c,a[8],l,null):N(a[8]),null),(!o||l&4)&&h(t,"placeholder",a[2]),l&1&&t.value!==a[0]&&E(t,a[0]),a[1]?i?(i.p(a,l),l&2&&_(i,1)):(i=B(a),i.c(),_(i,1),i.m(e,null)):i&&(F(),g(i,1,1,()=>{i=null}),H()),(!o||l&8)&&m(e,"w-full",a[3])},i(a){o||(_(u,a),_(i),o=!0)},o(a){g(u,a),g(i),o=!1},d(a){a&&d(e),u&&u.d(a),i&&i.d(),f=!1,p()}}}function Q(r,e,n){let{$$slots:t={},$$scope:s}=e,{resettable:o=!1}=e,{placeholder:f=""}=e,{stretch:p=!1}=e,{value:c=""}=e;const u=!!T("panel");function i(){c=this.value,n(0,c)}const a=()=>n(0,c="");return r.$$set=l=>{"resettable"in l&&n(1,o=l.resettable),"placeholder"in l&&n(2,f=l.placeholder),"stretch"in l&&n(3,p=l.stretch),"value"in l&&n(0,c=l.value),"$$scope"in l&&n(8,s=l.$$scope)},[c,o,f,p,u,t,i,a,s]}class $ extends V{constructor(e){super(),Y(this,e,Q,O,q,{resettable:1,placeholder:2,stretch:3,value:0})}}export{$ as I}; diff --git a/_app/immutable/chunks/Overview.T1RnAS_v.js b/_app/immutable/chunks/Overview.bs2WCKrP.js similarity index 97% rename from _app/immutable/chunks/Overview.T1RnAS_v.js rename to _app/immutable/chunks/Overview.bs2WCKrP.js index 587b01b0..f39441d0 100644 --- a/_app/immutable/chunks/Overview.T1RnAS_v.js +++ b/_app/immutable/chunks/Overview.bs2WCKrP.js @@ -1 +1 @@ -import{s as E,a as L,e as S,c as N,i as w,d as k,l as j,m as C,n as O,W as U,M as W,X as H,f as X,g as F,h as J,j as K,C as P,G as Q}from"./scheduler.yhBzS9E6.js";import{S as I,i as V,b as d,d as p,m as b,a as m,t as _,e as h,g as B,c as D}from"./index.f7836kWu.js";import{H as R,S as Y,I as T,g as G}from"./Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"./paths.k6rcf9P1.js";import{C as Z,n as A,q,V as x,r as ee}from"./Track.LR7rfYB8.js";import{A as te,m as re}from"./util.VvTXxVpP.js";function ne(f){let e;return{c(){e=j(f[5])},l(n){e=C(n,f[5])},m(n,t){w(n,e,t)},p(n,t){t&32&&O(e,n[5])},d(n){n&&k(e)}}}function le(f){let e,n;return e=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[ie]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&64&&(r.loading=t[6]),a&512&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function ae(f){let e,n;return e=new Y({props:{x:!0,class:"justify-center gap-4",$$slots:{default:[ue]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&584&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function fe(f){let e,n;return e=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[ce]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&64&&(r.loading=t[6]),a&520&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function ie(f){let e;return{c(){e=j("Loading...")},l(n){e=C(n,"Loading...")},m(n,t){w(n,e,t)},d(n){n&&k(e)}}}function se(f){let e,n,t=f[3].collection.size+"",a,r;return e=new T({props:{name:"note",sm:!0}}),{c(){d(e.$$.fragment),n=L(),a=j(t)},l(l){p(e.$$.fragment,l),n=N(l),a=C(l,t)},m(l,s){b(e,l,s),w(l,n,s),w(l,a,s),r=!0},p(l,s){(!r||s&8)&&t!==(t=l[3].collection.size+"")&&O(a,t)},i(l){r||(m(e.$$.fragment,l),r=!0)},o(l){_(e.$$.fragment,l),r=!1},d(l){l&&(k(n),k(a)),h(e,l)}}}function oe(f){let e,n,t=q(f[3].collection.duration)+"",a,r;return e=new T({props:{name:"clock",sm:!0}}),{c(){d(e.$$.fragment),n=L(),a=j(t)},l(l){p(e.$$.fragment,l),n=N(l),a=C(l,t)},m(l,s){b(e,l,s),w(l,n,s),w(l,a,s),r=!0},p(l,s){(!r||s&8)&&t!==(t=q(l[3].collection.duration)+"")&&O(a,t)},i(l){r||(m(e.$$.fragment,l),r=!0)},o(l){_(e.$$.fragment,l),r=!1},d(l){l&&(k(n),k(a)),h(e,l)}}}function ue(f){let e,n,t,a;return e=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[se]},$$scope:{ctx:f}}}),t=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[oe]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment),n=L(),d(t.$$.fragment)},l(r){p(e.$$.fragment,r),n=N(r),p(t.$$.fragment,r)},m(r,l){b(e,r,l),w(r,n,l),b(t,r,l),a=!0},p(r,l){const s={};l&64&&(s.loading=r[6]),l&520&&(s.$$scope={dirty:l,ctx:r}),e.$set(s);const o={};l&64&&(o.loading=r[6]),l&520&&(o.$$scope={dirty:l,ctx:r}),t.$set(o)},i(r){a||(m(e.$$.fragment,r),m(t.$$.fragment,r),a=!0)},o(r){_(e.$$.fragment,r),_(t.$$.fragment,r),a=!1},d(r){r&&k(n),h(e,r),h(t,r)}}}function ce(f){let e=f[3].artists.map(z).join(", ")+"",n;return{c(){n=j(e)},l(t){n=C(t,e)},m(t,a){w(t,n,a)},p(t,a){a&8&&e!==(e=t[3].artists.map(z).join(", ")+"")&&O(n,e)},d(t){t&&k(n)}}}function me(f){let e,n,t,a,r,l,s,o;e=new R({props:{center:!0,loading:f[6],$$slots:{default:[ne]},$$scope:{ctx:f}}});const $=[fe,ae,le],c=[];function v(i,g){return g&10&&(t=null),g&8&&(a=null),t==null&&(t=!!(i[1]&&i[7](i[3])&&"artists"in i[3])),t?0:(a==null&&(a=!!(i[7](i[3])&&i[3].collection)),a?1:i[0]?-1:2)}return~(r=v(f,-1))&&(l=c[r]=$[r](f)),{c(){d(e.$$.fragment),n=L(),l&&l.c(),s=S()},l(i){p(e.$$.fragment,i),n=N(i),l&&l.l(i),s=S()},m(i,g){b(e,i,g),w(i,n,g),~r&&c[r].m(i,g),w(i,s,g),o=!0},p(i,g){const y={};g&64&&(y.loading=i[6]),g&544&&(y.$$scope={dirty:g,ctx:i}),e.$set(y);let u=r;r=v(i,g),r===u?~r&&c[r].p(i,g):(l&&(B(),_(c[u],1,1,()=>{c[u]=null}),D()),~r?(l=c[r],l?l.p(i,g):(l=c[r]=$[r](i),l.c()),m(l,1),l.m(s.parentNode,s)):l=null)},i(i){o||(m(e.$$.fragment,i),m(l),o=!0)},o(i){_(e.$$.fragment,i),_(l),o=!1},d(i){i&&(k(n),k(s)),h(e,i),~r&&c[r].d(i)}}}function _e(f){let e,n;return e=new te({props:{round:!!f[0],of:f[4],slot:"after"}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&1&&(r.round=!!t[0]),a&16&&(r.of=t[4]),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function $e(f){let e,n;return e=new Z({props:{interactive:!!f[2]&&!f[6],href:f[2],$$slots:{after:[_e],default:[me]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,[a]){const r={};a&68&&(r.interactive=!!t[2]&&!t[6]),a&4&&(r.href=t[2]),a&635&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}const z=f=>f.title;function ge(f,e,n){let t,a,r,l,{playlist:s=void 0}=e,{artist:o=void 0}=e,{album:$=void 0}=e,{href:c=void 0}=e;const v=i=>typeof i=="object";return f.$$set=i=>{"playlist"in i&&n(8,s=i.playlist),"artist"in i&&n(0,o=i.artist),"album"in i&&n(1,$=i.album),"href"in i&&n(2,c=i.href)},f.$$.update=()=>{f.$$.dirty&259&&n(3,t=s||o||$),f.$$.dirty&8&&n(6,a=t===!0),f.$$.dirty&8&&n(5,r=v(t)?t.title:"Loading..."),f.$$.dirty&8&&n(4,l=v(t)?t:void 0)},[o,$,c,t,l,r,a,v,s]}class M extends I{constructor(e){super(),V(this,e,ge,$e,E,{playlist:8,artist:0,album:1,href:2})}}function de(f){let e,n;const t=[{[f[0]]:!0}];let a={};for(let r=0;r{l[c]=null}),D(),n=l[e],n?n.p(o,$):(n=l[e]=r[e](o),n.c()),m(n,1),n.m(t.parentNode,t))},i(o){a||(m(n),a=!0)},o(o){_(n),a=!1},d(o){o&&k(t),l[e].d(o)}}}function ke(f){let e,n;return e=new x({props:{sortable:f[2]&&!f[4],key:we,columns:"20rem",prerender:f[3],gap:16,animate:!0,items:f[5],$$slots:{default:[he,({item:t})=>({12:t}),({item:t})=>t?4096:0]},$$scope:{ctx:f}}}),e.$on("edit",f[7]),e.$on("end",f[11]),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,[a]){const r={};a&20&&(r.sortable=t[2]&&!t[4]),a&8&&(r.prerender=t[3]),a&32&&(r.items=t[5]),a&12291&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}const we=f=>f?.id;function ve(f,e,n){let t;const a=U();let{of:r=void 0}=e,{style:l}=e,{expandable:s=!1}=e,{href:o="/library"}=e,{editable:$=!1}=e,{prerender:c=3}=e,{filter:v=""}=e;function i({detail:u}){!u.item||u.action!=="rearrange"||a("rearrange",{id:u.item.id,after:u.after?.id})}const g=()=>a("create");function y(u){W.call(this,f,u)}return f.$$set=u=>{"of"in u&&n(8,r=u.of),"style"in u&&n(0,l=u.style),"expandable"in u&&n(9,s=u.expandable),"href"in u&&n(1,o=u.href),"editable"in u&&n(2,$=u.editable),"prerender"in u&&n(3,c=u.prerender),"filter"in u&&n(4,v=u.filter)},f.$$.update=()=>{f.$$.dirty&792&&n(5,t=r&&ee(r)?(s?[...r,null]:r).filter(re(v)):Array.from({length:c}))},[l,o,$,c,v,t,a,i,r,s,g,y]}class Ne extends I{constructor(e){super(),V(this,e,ve,ke,E,{of:8,style:0,expandable:9,href:1,editable:2,prerender:3,filter:4})}}export{Ne as O}; +import{s as E,a as L,e as S,c as N,i as w,d as k,l as j,m as C,n as O,W as U,M as W,X as H,f as X,g as F,h as J,j as K,C as P,G as Q}from"./scheduler.yhBzS9E6.js";import{S as I,i as V,b as d,d as p,m as b,a as m,t as _,e as h,g as B,c as D}from"./index.f7836kWu.js";import{H as R,S as Y,I as T,g as G}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"./paths.G112lh3q.js";import{C as Z,n as A,q,V as x,r as ee}from"./Track.oiOqwbPY.js";import{A as te,m as re}from"./util.2xyf67Ew.js";function ne(f){let e;return{c(){e=j(f[5])},l(n){e=C(n,f[5])},m(n,t){w(n,e,t)},p(n,t){t&32&&O(e,n[5])},d(n){n&&k(e)}}}function le(f){let e,n;return e=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[ie]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&64&&(r.loading=t[6]),a&512&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function ae(f){let e,n;return e=new Y({props:{x:!0,class:"justify-center gap-4",$$slots:{default:[ue]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&584&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function fe(f){let e,n;return e=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[ce]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&64&&(r.loading=t[6]),a&520&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function ie(f){let e;return{c(){e=j("Loading...")},l(n){e=C(n,"Loading...")},m(n,t){w(n,e,t)},d(n){n&&k(e)}}}function se(f){let e,n,t=f[3].collection.size+"",a,r;return e=new T({props:{name:"note",sm:!0}}),{c(){d(e.$$.fragment),n=L(),a=j(t)},l(l){p(e.$$.fragment,l),n=N(l),a=C(l,t)},m(l,s){b(e,l,s),w(l,n,s),w(l,a,s),r=!0},p(l,s){(!r||s&8)&&t!==(t=l[3].collection.size+"")&&O(a,t)},i(l){r||(m(e.$$.fragment,l),r=!0)},o(l){_(e.$$.fragment,l),r=!1},d(l){l&&(k(n),k(a)),h(e,l)}}}function oe(f){let e,n,t=q(f[3].collection.duration)+"",a,r;return e=new T({props:{name:"clock",sm:!0}}),{c(){d(e.$$.fragment),n=L(),a=j(t)},l(l){p(e.$$.fragment,l),n=N(l),a=C(l,t)},m(l,s){b(e,l,s),w(l,n,s),w(l,a,s),r=!0},p(l,s){(!r||s&8)&&t!==(t=q(l[3].collection.duration)+"")&&O(a,t)},i(l){r||(m(e.$$.fragment,l),r=!0)},o(l){_(e.$$.fragment,l),r=!1},d(l){l&&(k(n),k(a)),h(e,l)}}}function ue(f){let e,n,t,a;return e=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[se]},$$scope:{ctx:f}}}),t=new A({props:{secondary:!0,loading:f[6],$$slots:{default:[oe]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment),n=L(),d(t.$$.fragment)},l(r){p(e.$$.fragment,r),n=N(r),p(t.$$.fragment,r)},m(r,l){b(e,r,l),w(r,n,l),b(t,r,l),a=!0},p(r,l){const s={};l&64&&(s.loading=r[6]),l&520&&(s.$$scope={dirty:l,ctx:r}),e.$set(s);const o={};l&64&&(o.loading=r[6]),l&520&&(o.$$scope={dirty:l,ctx:r}),t.$set(o)},i(r){a||(m(e.$$.fragment,r),m(t.$$.fragment,r),a=!0)},o(r){_(e.$$.fragment,r),_(t.$$.fragment,r),a=!1},d(r){r&&k(n),h(e,r),h(t,r)}}}function ce(f){let e=f[3].artists.map(z).join(", ")+"",n;return{c(){n=j(e)},l(t){n=C(t,e)},m(t,a){w(t,n,a)},p(t,a){a&8&&e!==(e=t[3].artists.map(z).join(", ")+"")&&O(n,e)},d(t){t&&k(n)}}}function me(f){let e,n,t,a,r,l,s,o;e=new R({props:{center:!0,loading:f[6],$$slots:{default:[ne]},$$scope:{ctx:f}}});const $=[fe,ae,le],c=[];function v(i,g){return g&10&&(t=null),g&8&&(a=null),t==null&&(t=!!(i[1]&&i[7](i[3])&&"artists"in i[3])),t?0:(a==null&&(a=!!(i[7](i[3])&&i[3].collection)),a?1:i[0]?-1:2)}return~(r=v(f,-1))&&(l=c[r]=$[r](f)),{c(){d(e.$$.fragment),n=L(),l&&l.c(),s=S()},l(i){p(e.$$.fragment,i),n=N(i),l&&l.l(i),s=S()},m(i,g){b(e,i,g),w(i,n,g),~r&&c[r].m(i,g),w(i,s,g),o=!0},p(i,g){const y={};g&64&&(y.loading=i[6]),g&544&&(y.$$scope={dirty:g,ctx:i}),e.$set(y);let u=r;r=v(i,g),r===u?~r&&c[r].p(i,g):(l&&(B(),_(c[u],1,1,()=>{c[u]=null}),D()),~r?(l=c[r],l?l.p(i,g):(l=c[r]=$[r](i),l.c()),m(l,1),l.m(s.parentNode,s)):l=null)},i(i){o||(m(e.$$.fragment,i),m(l),o=!0)},o(i){_(e.$$.fragment,i),_(l),o=!1},d(i){i&&(k(n),k(s)),h(e,i),~r&&c[r].d(i)}}}function _e(f){let e,n;return e=new te({props:{round:!!f[0],of:f[4],slot:"after"}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,a){const r={};a&1&&(r.round=!!t[0]),a&16&&(r.of=t[4]),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}function $e(f){let e,n;return e=new Z({props:{interactive:!!f[2]&&!f[6],href:f[2],$$slots:{after:[_e],default:[me]},$$scope:{ctx:f}}}),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,[a]){const r={};a&68&&(r.interactive=!!t[2]&&!t[6]),a&4&&(r.href=t[2]),a&635&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}const z=f=>f.title;function ge(f,e,n){let t,a,r,l,{playlist:s=void 0}=e,{artist:o=void 0}=e,{album:$=void 0}=e,{href:c=void 0}=e;const v=i=>typeof i=="object";return f.$$set=i=>{"playlist"in i&&n(8,s=i.playlist),"artist"in i&&n(0,o=i.artist),"album"in i&&n(1,$=i.album),"href"in i&&n(2,c=i.href)},f.$$.update=()=>{f.$$.dirty&259&&n(3,t=s||o||$),f.$$.dirty&8&&n(6,a=t===!0),f.$$.dirty&8&&n(5,r=v(t)?t.title:"Loading..."),f.$$.dirty&8&&n(4,l=v(t)?t:void 0)},[o,$,c,t,l,r,a,v,s]}class M extends I{constructor(e){super(),V(this,e,ge,$e,E,{playlist:8,artist:0,album:1,href:2})}}function de(f){let e,n;const t=[{[f[0]]:!0}];let a={};for(let r=0;r{l[c]=null}),D(),n=l[e],n?n.p(o,$):(n=l[e]=r[e](o),n.c()),m(n,1),n.m(t.parentNode,t))},i(o){a||(m(n),a=!0)},o(o){_(n),a=!1},d(o){o&&k(t),l[e].d(o)}}}function ke(f){let e,n;return e=new x({props:{sortable:f[2]&&!f[4],key:we,columns:"20rem",prerender:f[3],gap:16,animate:!0,items:f[5],$$slots:{default:[he,({item:t})=>({12:t}),({item:t})=>t?4096:0]},$$scope:{ctx:f}}}),e.$on("edit",f[7]),e.$on("end",f[11]),{c(){d(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,a){b(e,t,a),n=!0},p(t,[a]){const r={};a&20&&(r.sortable=t[2]&&!t[4]),a&8&&(r.prerender=t[3]),a&32&&(r.items=t[5]),a&12291&&(r.$$scope={dirty:a,ctx:t}),e.$set(r)},i(t){n||(m(e.$$.fragment,t),n=!0)},o(t){_(e.$$.fragment,t),n=!1},d(t){h(e,t)}}}const we=f=>f?.id;function ve(f,e,n){let t;const a=U();let{of:r=void 0}=e,{style:l}=e,{expandable:s=!1}=e,{href:o="/library"}=e,{editable:$=!1}=e,{prerender:c=3}=e,{filter:v=""}=e;function i({detail:u}){!u.item||u.action!=="rearrange"||a("rearrange",{id:u.item.id,after:u.after?.id})}const g=()=>a("create");function y(u){W.call(this,f,u)}return f.$$set=u=>{"of"in u&&n(8,r=u.of),"style"in u&&n(0,l=u.style),"expandable"in u&&n(9,s=u.expandable),"href"in u&&n(1,o=u.href),"editable"in u&&n(2,$=u.editable),"prerender"in u&&n(3,c=u.prerender),"filter"in u&&n(4,v=u.filter)},f.$$.update=()=>{f.$$.dirty&792&&n(5,t=r&&ee(r)?(s?[...r,null]:r).filter(re(v)):Array.from({length:c}))},[l,o,$,c,v,t,a,i,r,s,g,y]}class Ne extends I{constructor(e){super(),V(this,e,ve,ke,E,{of:8,style:0,expandable:9,href:1,editable:2,prerender:3,filter:4})}}export{Ne as O}; diff --git a/_app/immutable/chunks/Player.J8CE-V80.js b/_app/immutable/chunks/Player.4gabUvVV.js similarity index 99% rename from _app/immutable/chunks/Player.J8CE-V80.js rename to _app/immutable/chunks/Player.4gabUvVV.js index 7406e6fa..f3e851be 100644 --- a/_app/immutable/chunks/Player.J8CE-V80.js +++ b/_app/immutable/chunks/Player.4gabUvVV.js @@ -1,4 +1,4 @@ -import{s as ee,f as T,g as D,j as m,i as y,G as J,d as h,A as rt,w as le,a as H,h as M,c as F,k as W,E as U,u as I,C as A,x as ie,y as ae,z as oe,T as fe,H as Je,W as Ee,J as ge,Y as Ce,l as K,m as Y,D as Ve,n as de,Z as st,U as ve,L as lt,o as it,p as ue,_ as Ne,$ as Le,K as me,M as ce,e as re,a0 as Se,v as ze,t as at}from"./scheduler.yhBzS9E6.js";import{S as te,i as ne,a as p,g as X,t as g,c as x,h as se,f as he,b as C,d as V,m as N,e as L,r as ot}from"./index.f7836kWu.js";import{i as ft,S as Ke,B as Ie,I as ke,H as pe,t as ut}from"./Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import{v as Me,I as ct,q as dt,n as _t,V as mt,W as Ye,P as Qe,w as ht,k as Z,T as Te,x as pt,y as gt}from"./Track.LR7rfYB8.js";import"./paths.k6rcf9P1.js";const _e=new Map,$t=r=>r.forEach(e=>{e.target?.dispatchEvent(new CustomEvent("intersect",{detail:e})),e.target?.dispatchEvent(new CustomEvent(e.isIntersecting?"viewenter":"viewleave",{detail:e}))});function Xe(r,e){const t=e?.toString()||"",n=_e.get(t)||[new IntersectionObserver($t,{threshold:e}),0];return _e.has(t)||_e.set(t,n),n[0].observe(r),n[1]+=1,{destroy(){n[0].unobserve(r),n[1]-=1,n[1]<=0&&(n[0].disconnect(),_e.delete(t))}}}function bt(r){let e,t;return{c(){e=T("hr"),this.h()},l(n){e=D(n,"HR",{class:!0,"aria-hidden":!0}),this.h()},h(){m(e,"class",t="border-highlight "+(r[0]?"h-full w-0 border-r":"w-full")),m(e,"aria-hidden","true")},m(n,s){y(n,e,s)},p(n,[s]){s&1&&t!==(t="border-highlight "+(n[0]?"h-full w-0 border-r":"w-full"))&&m(e,"class",t)},i:J,o:J,d(n){n&&h(e)}}}function vt(r,e,t){let{vertical:n=rt("stack")==="x"}=e;return r.$$set=s=>{"vertical"in s&&t(0,n=s.vertical)},[n]}class xe extends te{constructor(e){super(),ne(this,e,vt,bt,ee,{vertical:0})}}const kt=r=>({}),Pe=r=>({}),wt=r=>({}),Ae=r=>({});function Be(r){let e,t,n,s;const l=r[6].before,a=le(l,r,r[5],Ae);return{c(){e=T("div"),a&&a.c(),this.h()},l(o){e=D(o,"DIV",{class:!0,style:!0});var i=M(e);a&&a.l(i),i.forEach(h),this.h()},h(){m(e,"class","flex items-center px-4 text-content-200 transition-colors"),W(e,"scroll-snap-align","none"),U(e,"text-white",r[0][0])},m(o,i){y(o,e,i),a&&a.m(e,null),t=!0,n||(s=[ge(Xe.call(null,e,.5)),A(e,"intersect",r[3](0))],n=!0)},p(o,i){a&&a.p&&(!t||i&32)&&ie(a,l,o,o[5],t?oe(l,o[5],i,wt):ae(o[5]),Ae),(!t||i&1)&&U(e,"text-white",o[0][0])},i(o){t||(p(a,o),t=!0)},o(o){g(a,o),t=!1},d(o){o&&h(e),a&&a.d(o),n=!1,fe(s)}}}function He(r){let e,t,n,s;const l=r[6].after,a=le(l,r,r[5],Pe);return{c(){e=T("div"),a&&a.c(),this.h()},l(o){e=D(o,"DIV",{class:!0});var i=M(e);a&&a.l(i),i.forEach(h),this.h()},h(){m(e,"class","flex items-center px-4 text-content-200 transition-colors"),U(e,"text-white",r[0][1])},m(o,i){y(o,e,i),a&&a.m(e,null),t=!0,n||(s=[ge(Xe.call(null,e,.5)),A(e,"intersect",r[3](1))],n=!0)},p(o,i){a&&a.p&&(!t||i&32)&&ie(a,l,o,o[5],t?oe(l,o[5],i,kt):ae(o[5]),Pe),(!t||i&1)&&U(e,"text-white",o[0][1])},i(o){t||(p(a,o),t=!0)},o(o){g(a,o),t=!1},d(o){o&&h(e),a&&a.d(o),n=!1,fe(s)}}}function yt(r){let e,t,n,s,l,a,o,i=r[4].before&&Be(r);const f=r[6].default,u=le(f,r,r[5],null);let d=r[4].after&&He(r);return{c(){e=T("div"),i&&i.c(),t=H(),n=T("div"),u&&u.c(),s=H(),d&&d.c(),this.h()},l(c){e=D(c,"DIV",{class:!0,style:!0});var _=M(e);i&&i.l(_),t=F(_),n=D(_,"DIV",{class:!0});var S=M(n);u&&u.l(S),S.forEach(h),s=F(_),d&&d.l(_),_.forEach(h),this.h()},h(){m(n,"class","snap-center snap-always"),m(e,"class","grid w-full snap-x snap-mandatory overflow-y-hidden overflow-x-scroll rounded-lg transition-colors duration-300 ease-linear will-change-transform svelte-qtbr7a"),W(e,"grid","auto / auto-flow "+(r[4].before?"1fr ":"")+"100%"+(r[4].after?" 1fr":"")),U(e,"bg-primary-600",r[0][0]||r[0][1])},m(c,_){y(c,e,_),i&&i.m(e,null),I(e,t),I(e,n),u&&u.m(n,null),I(e,s),d&&d.m(e,null),l=!0,a||(o=[A(e,"wheel",r[7],{passive:!0}),A(e,"touchend",r[2],{passive:!0})],a=!0)},p(c,[_]){c[4].before?i?(i.p(c,_),_&16&&p(i,1)):(i=Be(c),i.c(),p(i,1),i.m(e,t)):i&&(X(),g(i,1,1,()=>{i=null}),x()),u&&u.p&&(!l||_&32)&&ie(u,f,c,c[5],l?oe(f,c[5],_,null):ae(c[5]),null),c[4].after?d?(d.p(c,_),_&16&&p(d,1)):(d=He(c),d.c(),p(d,1),d.m(e,null)):d&&(X(),g(d,1,1,()=>{d=null}),x()),(!l||_&16)&&W(e,"grid","auto / auto-flow "+(c[4].before?"1fr ":"")+"100%"+(c[4].after?" 1fr":"")),(!l||_&1)&&U(e,"bg-primary-600",c[0][0]||c[0][1])},i(c){l||(p(i),p(u,c),p(d),l=!0)},o(c){g(i),g(u,c),g(d),l=!1},d(c){c&&h(e),i&&i.d(),u&&u.d(c),d&&d.d(),a=!1,fe(o)}}}function Et(r,e,t){let{$$slots:n={},$$scope:s}=e;const l=Je(n),a=[!1,!1],o=Ee();let i=0;function f(){a[0]&&o("before"),a[1]&&o("after")}function u(c){return({detail:_})=>{a[c]&&(!c&&i<0||c&&i>0)&&f(),t(0,a[c]=_.isIntersecting,a)}}const d=({deltaX:c})=>t(1,i=c);return r.$$set=c=>{"$$scope"in c&&t(5,s=c.$$scope)},[a,i,f,u,l,s,n,d]}class It extends te{constructor(e){super(),ne(this,e,Et,yt,ee,{})}}function Fe(r){let e,t,n=r[1](r[0])+"",s,l,a,o='
',i,f,u=r[1](r[6]-r[0])+"",d,c,_,S='
',B,R;return{c(){e=T("div"),t=T("button"),s=K(n),l=H(),a=T("div"),a.innerHTML=o,i=H(),f=T("button"),d=K(u),c=H(),_=T("div"),_.innerHTML=S,this.h()},l(k){e=D(k,"DIV",{class:!0});var w=M(e);t=D(w,"BUTTON",{class:!0});var j=M(t);s=Y(j,n),l=F(j),a=D(j,"DIV",{class:!0,"data-svelte-h":!0}),Ve(a)!=="svelte-ivt2iy"&&(a.innerHTML=o),j.forEach(h),i=F(w),f=D(w,"BUTTON",{class:!0});var v=M(f);d=Y(v,u),c=F(v),_=D(v,"DIV",{class:!0,"data-svelte-h":!0}),Ve(_)!=="svelte-1drb34i"&&(_.innerHTML=S),v.forEach(h),w.forEach(h),this.h()},h(){m(a,"class","flex items-center opacity-0 transition-opacity group-focus-visible:opacity-100 group-hover:opacity-100"),m(t,"class","group rounded-lg p-2 text-content-200 outline-2 outline-primary-600 transition-paint focus-visible:bg-highlight focus-visible:outline active:scale-95 hover:bg-highlight"),m(_,"class","flex items-center opacity-0 transition-opacity group-focus-visible:opacity-100 group-hover:opacity-100"),m(f,"class","group rounded-lg p-2 text-content-200 outline-2 outline-primary-600 transition-paint focus-visible:bg-highlight focus-visible:outline active:scale-95 hover:bg-highlight"),m(e,"class","flex w-full justify-between text-sm"),U(e,"pointer-events-none",!r[2])},m(k,w){y(k,e,w),I(e,t),I(t,s),I(t,l),I(t,a),I(e,i),I(e,f),I(f,d),I(f,c),I(f,_),B||(R=[ge(Me.call(null,t,{mouse:!0})),A(t,"hold",r[11]),A(t,"click",r[12]),ge(Me.call(null,f,{mouse:!0})),A(f,"hold",r[13]),A(f,"click",r[14])],B=!0)},p(k,w){w&3&&n!==(n=k[1](k[0])+"")&&de(s,n),w&67&&u!==(u=k[1](k[6]-k[0])+"")&&de(d,u),w&4&&U(e,"pointer-events-none",!k[2])},d(k){k&&h(e),B=!1,fe(R)}}}function Tt(r){let e,t,n,s,l,a,o,i=r[3]&&Fe(r);return{c(){e=T("div"),t=T("div"),n=T("input"),s=H(),i&&i.c(),this.h()},l(f){e=D(f,"DIV",{class:!0});var u=M(e);t=D(u,"DIV",{class:!0});var d=M(t);n=D(d,"INPUT",{class:!0,style:!0,type:!0,min:!0,max:!0}),d.forEach(h),s=F(u),i&&i.l(u),u.forEach(h),this.h()},h(){m(n,"class","relative w-full cursor-pointer appearance-none rounded bg-transparent outline-2 outline-offset-2 outline-primary-600 focus-visible:outline svelte-sruga5"),W(n,"--progress",(r[0]-r[7])/(r[6]-r[7])*100+"%"),m(n,"type","range"),m(n,"min",r[7]),m(n,"max",r[6]),m(t,"class","px-2"),m(e,"class",l=r[4]?"px-4 pt-8":"")},m(f,u){y(f,e,u),I(e,t),I(t,n),Ce(n,r[0]),I(e,s),i&&i.m(e,null),a||(o=[A(n,"change",r[10]),A(n,"input",r[10])],a=!0)},p(f,[u]){u&193&&W(n,"--progress",(f[0]-f[7])/(f[6]-f[7])*100+"%"),u&128&&m(n,"min",f[7]),u&64&&m(n,"max",f[6]),u&1&&Ce(n,f[0]),f[3]?i?i.p(f,u):(i=Fe(f),i.c(),i.m(e,null)):i&&(i.d(1),i=null),u&16&&l!==(l=f[4]?"px-4 pt-8":"")&&m(e,"class",l)},i:J,o:J,d(f){f&&h(e),i&&i.d(),a=!1,fe(o)}}}function Dt(r,e,t){const n=Ee();let{format:s=w=>w.toString()}=e,{controls:l=!1}=e,{hints:a=!1}=e,{p:o=!1}=e,{value:i=0}=e,{skip:f=10}=e,{max:u=100}=e,{min:d=0}=e,c=!1;function _(){i=st(this.value),t(0,i)}const S=()=>(t(8,c=!0),n("rewind")),B=()=>c?(t(8,c=!1),n("reset")):t(0,i=Math.max(i-f,d)),R=()=>(t(8,c=!0),n("forward")),k=()=>c?(t(8,c=!1),n("reset")):t(0,i=Math.min(i+f,u));return r.$$set=w=>{"format"in w&&t(1,s=w.format),"controls"in w&&t(2,l=w.controls),"hints"in w&&t(3,a=w.hints),"p"in w&&t(4,o=w.p),"value"in w&&t(0,i=w.value),"skip"in w&&t(5,f=w.skip),"max"in w&&t(6,u=w.max),"min"in w&&t(7,d=w.min)},[i,s,l,a,o,f,u,d,c,n,_,S,B,R,k]}class Ct extends te{constructor(e){super(),ne(this,e,Dt,Tt,ee,{format:1,controls:2,hints:3,p:4,value:0,skip:5,max:6,min:7})}}function et(r){const e=r-1;return e*e*e+1}function je(r,{delay:e=0,duration:t=400,easing:n=et,axis:s="y"}={}){const l=getComputedStyle(r),a=+l.opacity,o=s==="y"?"height":"width",i=parseFloat(l[o]),f=s==="y"?["top","bottom"]:["left","right"],u=f.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${u[0]}`]),c=parseFloat(l[`padding${u[1]}`]),_=parseFloat(l[`margin${u[0]}`]),S=parseFloat(l[`margin${u[1]}`]),B=parseFloat(l[`border${u[0]}Width`]),R=parseFloat(l[`border${u[1]}Width`]);return{delay:e,duration:t,easing:n,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*a};${o}: ${k*i}px;padding-${f[0]}: ${k*d}px;padding-${f[1]}: ${k*c}px;margin-${f[0]}: ${k*_}px;margin-${f[1]}: ${k*S}px;border-${f[0]}-width: ${k*B}px;border-${f[1]}-width: ${k*R}px;`}}function $e(r,{delay:e=0,duration:t=400,easing:n=et,start:s=0,opacity:l=0}={}){const a=getComputedStyle(r),o=+a.opacity,i=a.transform==="none"?"":a.transform,f=1-s,u=o*(1-l);return{delay:e,duration:t,easing:n,css:(d,c)=>` +import{s as ee,f as T,g as D,j as m,i as y,G as J,d as h,A as rt,w as le,a as H,h as M,c as F,k as W,E as U,u as I,C as A,x as ie,y as ae,z as oe,T as fe,H as Je,W as Ee,J as ge,Y as Ce,l as K,m as Y,D as Ve,n as de,Z as st,U as ve,L as lt,o as it,p as ue,_ as Ne,$ as Le,K as me,M as ce,e as re,a0 as Se,v as ze,t as at}from"./scheduler.yhBzS9E6.js";import{S as te,i as ne,a as p,g as X,t as g,c as x,h as se,f as he,b as C,d as V,m as N,e as L,r as ot}from"./index.f7836kWu.js";import{i as ft,S as Ke,B as Ie,I as ke,H as pe,t as ut}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import{v as Me,I as ct,q as dt,n as _t,V as mt,W as Ye,P as Qe,w as ht,k as Z,T as Te,x as pt,y as gt}from"./Track.oiOqwbPY.js";import"./paths.G112lh3q.js";const _e=new Map,$t=r=>r.forEach(e=>{e.target?.dispatchEvent(new CustomEvent("intersect",{detail:e})),e.target?.dispatchEvent(new CustomEvent(e.isIntersecting?"viewenter":"viewleave",{detail:e}))});function Xe(r,e){const t=e?.toString()||"",n=_e.get(t)||[new IntersectionObserver($t,{threshold:e}),0];return _e.has(t)||_e.set(t,n),n[0].observe(r),n[1]+=1,{destroy(){n[0].unobserve(r),n[1]-=1,n[1]<=0&&(n[0].disconnect(),_e.delete(t))}}}function bt(r){let e,t;return{c(){e=T("hr"),this.h()},l(n){e=D(n,"HR",{class:!0,"aria-hidden":!0}),this.h()},h(){m(e,"class",t="border-highlight "+(r[0]?"h-full w-0 border-r":"w-full")),m(e,"aria-hidden","true")},m(n,s){y(n,e,s)},p(n,[s]){s&1&&t!==(t="border-highlight "+(n[0]?"h-full w-0 border-r":"w-full"))&&m(e,"class",t)},i:J,o:J,d(n){n&&h(e)}}}function vt(r,e,t){let{vertical:n=rt("stack")==="x"}=e;return r.$$set=s=>{"vertical"in s&&t(0,n=s.vertical)},[n]}class xe extends te{constructor(e){super(),ne(this,e,vt,bt,ee,{vertical:0})}}const kt=r=>({}),Pe=r=>({}),wt=r=>({}),Ae=r=>({});function Be(r){let e,t,n,s;const l=r[6].before,a=le(l,r,r[5],Ae);return{c(){e=T("div"),a&&a.c(),this.h()},l(o){e=D(o,"DIV",{class:!0,style:!0});var i=M(e);a&&a.l(i),i.forEach(h),this.h()},h(){m(e,"class","flex items-center px-4 text-content-200 transition-colors"),W(e,"scroll-snap-align","none"),U(e,"text-white",r[0][0])},m(o,i){y(o,e,i),a&&a.m(e,null),t=!0,n||(s=[ge(Xe.call(null,e,.5)),A(e,"intersect",r[3](0))],n=!0)},p(o,i){a&&a.p&&(!t||i&32)&&ie(a,l,o,o[5],t?oe(l,o[5],i,wt):ae(o[5]),Ae),(!t||i&1)&&U(e,"text-white",o[0][0])},i(o){t||(p(a,o),t=!0)},o(o){g(a,o),t=!1},d(o){o&&h(e),a&&a.d(o),n=!1,fe(s)}}}function He(r){let e,t,n,s;const l=r[6].after,a=le(l,r,r[5],Pe);return{c(){e=T("div"),a&&a.c(),this.h()},l(o){e=D(o,"DIV",{class:!0});var i=M(e);a&&a.l(i),i.forEach(h),this.h()},h(){m(e,"class","flex items-center px-4 text-content-200 transition-colors"),U(e,"text-white",r[0][1])},m(o,i){y(o,e,i),a&&a.m(e,null),t=!0,n||(s=[ge(Xe.call(null,e,.5)),A(e,"intersect",r[3](1))],n=!0)},p(o,i){a&&a.p&&(!t||i&32)&&ie(a,l,o,o[5],t?oe(l,o[5],i,kt):ae(o[5]),Pe),(!t||i&1)&&U(e,"text-white",o[0][1])},i(o){t||(p(a,o),t=!0)},o(o){g(a,o),t=!1},d(o){o&&h(e),a&&a.d(o),n=!1,fe(s)}}}function yt(r){let e,t,n,s,l,a,o,i=r[4].before&&Be(r);const f=r[6].default,u=le(f,r,r[5],null);let d=r[4].after&&He(r);return{c(){e=T("div"),i&&i.c(),t=H(),n=T("div"),u&&u.c(),s=H(),d&&d.c(),this.h()},l(c){e=D(c,"DIV",{class:!0,style:!0});var _=M(e);i&&i.l(_),t=F(_),n=D(_,"DIV",{class:!0});var S=M(n);u&&u.l(S),S.forEach(h),s=F(_),d&&d.l(_),_.forEach(h),this.h()},h(){m(n,"class","snap-center snap-always"),m(e,"class","grid w-full snap-x snap-mandatory overflow-y-hidden overflow-x-scroll rounded-lg transition-colors duration-300 ease-linear will-change-transform svelte-qtbr7a"),W(e,"grid","auto / auto-flow "+(r[4].before?"1fr ":"")+"100%"+(r[4].after?" 1fr":"")),U(e,"bg-primary-600",r[0][0]||r[0][1])},m(c,_){y(c,e,_),i&&i.m(e,null),I(e,t),I(e,n),u&&u.m(n,null),I(e,s),d&&d.m(e,null),l=!0,a||(o=[A(e,"wheel",r[7],{passive:!0}),A(e,"touchend",r[2],{passive:!0})],a=!0)},p(c,[_]){c[4].before?i?(i.p(c,_),_&16&&p(i,1)):(i=Be(c),i.c(),p(i,1),i.m(e,t)):i&&(X(),g(i,1,1,()=>{i=null}),x()),u&&u.p&&(!l||_&32)&&ie(u,f,c,c[5],l?oe(f,c[5],_,null):ae(c[5]),null),c[4].after?d?(d.p(c,_),_&16&&p(d,1)):(d=He(c),d.c(),p(d,1),d.m(e,null)):d&&(X(),g(d,1,1,()=>{d=null}),x()),(!l||_&16)&&W(e,"grid","auto / auto-flow "+(c[4].before?"1fr ":"")+"100%"+(c[4].after?" 1fr":"")),(!l||_&1)&&U(e,"bg-primary-600",c[0][0]||c[0][1])},i(c){l||(p(i),p(u,c),p(d),l=!0)},o(c){g(i),g(u,c),g(d),l=!1},d(c){c&&h(e),i&&i.d(),u&&u.d(c),d&&d.d(),a=!1,fe(o)}}}function Et(r,e,t){let{$$slots:n={},$$scope:s}=e;const l=Je(n),a=[!1,!1],o=Ee();let i=0;function f(){a[0]&&o("before"),a[1]&&o("after")}function u(c){return({detail:_})=>{a[c]&&(!c&&i<0||c&&i>0)&&f(),t(0,a[c]=_.isIntersecting,a)}}const d=({deltaX:c})=>t(1,i=c);return r.$$set=c=>{"$$scope"in c&&t(5,s=c.$$scope)},[a,i,f,u,l,s,n,d]}class It extends te{constructor(e){super(),ne(this,e,Et,yt,ee,{})}}function Fe(r){let e,t,n=r[1](r[0])+"",s,l,a,o='
',i,f,u=r[1](r[6]-r[0])+"",d,c,_,S='
',B,R;return{c(){e=T("div"),t=T("button"),s=K(n),l=H(),a=T("div"),a.innerHTML=o,i=H(),f=T("button"),d=K(u),c=H(),_=T("div"),_.innerHTML=S,this.h()},l(k){e=D(k,"DIV",{class:!0});var w=M(e);t=D(w,"BUTTON",{class:!0});var j=M(t);s=Y(j,n),l=F(j),a=D(j,"DIV",{class:!0,"data-svelte-h":!0}),Ve(a)!=="svelte-ivt2iy"&&(a.innerHTML=o),j.forEach(h),i=F(w),f=D(w,"BUTTON",{class:!0});var v=M(f);d=Y(v,u),c=F(v),_=D(v,"DIV",{class:!0,"data-svelte-h":!0}),Ve(_)!=="svelte-1drb34i"&&(_.innerHTML=S),v.forEach(h),w.forEach(h),this.h()},h(){m(a,"class","flex items-center opacity-0 transition-opacity group-focus-visible:opacity-100 group-hover:opacity-100"),m(t,"class","group rounded-lg p-2 text-content-200 outline-2 outline-primary-600 transition-paint focus-visible:bg-highlight focus-visible:outline active:scale-95 hover:bg-highlight"),m(_,"class","flex items-center opacity-0 transition-opacity group-focus-visible:opacity-100 group-hover:opacity-100"),m(f,"class","group rounded-lg p-2 text-content-200 outline-2 outline-primary-600 transition-paint focus-visible:bg-highlight focus-visible:outline active:scale-95 hover:bg-highlight"),m(e,"class","flex w-full justify-between text-sm"),U(e,"pointer-events-none",!r[2])},m(k,w){y(k,e,w),I(e,t),I(t,s),I(t,l),I(t,a),I(e,i),I(e,f),I(f,d),I(f,c),I(f,_),B||(R=[ge(Me.call(null,t,{mouse:!0})),A(t,"hold",r[11]),A(t,"click",r[12]),ge(Me.call(null,f,{mouse:!0})),A(f,"hold",r[13]),A(f,"click",r[14])],B=!0)},p(k,w){w&3&&n!==(n=k[1](k[0])+"")&&de(s,n),w&67&&u!==(u=k[1](k[6]-k[0])+"")&&de(d,u),w&4&&U(e,"pointer-events-none",!k[2])},d(k){k&&h(e),B=!1,fe(R)}}}function Tt(r){let e,t,n,s,l,a,o,i=r[3]&&Fe(r);return{c(){e=T("div"),t=T("div"),n=T("input"),s=H(),i&&i.c(),this.h()},l(f){e=D(f,"DIV",{class:!0});var u=M(e);t=D(u,"DIV",{class:!0});var d=M(t);n=D(d,"INPUT",{class:!0,style:!0,type:!0,min:!0,max:!0}),d.forEach(h),s=F(u),i&&i.l(u),u.forEach(h),this.h()},h(){m(n,"class","relative w-full cursor-pointer appearance-none rounded bg-transparent outline-2 outline-offset-2 outline-primary-600 focus-visible:outline svelte-sruga5"),W(n,"--progress",(r[0]-r[7])/(r[6]-r[7])*100+"%"),m(n,"type","range"),m(n,"min",r[7]),m(n,"max",r[6]),m(t,"class","px-2"),m(e,"class",l=r[4]?"px-4 pt-8":"")},m(f,u){y(f,e,u),I(e,t),I(t,n),Ce(n,r[0]),I(e,s),i&&i.m(e,null),a||(o=[A(n,"change",r[10]),A(n,"input",r[10])],a=!0)},p(f,[u]){u&193&&W(n,"--progress",(f[0]-f[7])/(f[6]-f[7])*100+"%"),u&128&&m(n,"min",f[7]),u&64&&m(n,"max",f[6]),u&1&&Ce(n,f[0]),f[3]?i?i.p(f,u):(i=Fe(f),i.c(),i.m(e,null)):i&&(i.d(1),i=null),u&16&&l!==(l=f[4]?"px-4 pt-8":"")&&m(e,"class",l)},i:J,o:J,d(f){f&&h(e),i&&i.d(),a=!1,fe(o)}}}function Dt(r,e,t){const n=Ee();let{format:s=w=>w.toString()}=e,{controls:l=!1}=e,{hints:a=!1}=e,{p:o=!1}=e,{value:i=0}=e,{skip:f=10}=e,{max:u=100}=e,{min:d=0}=e,c=!1;function _(){i=st(this.value),t(0,i)}const S=()=>(t(8,c=!0),n("rewind")),B=()=>c?(t(8,c=!1),n("reset")):t(0,i=Math.max(i-f,d)),R=()=>(t(8,c=!0),n("forward")),k=()=>c?(t(8,c=!1),n("reset")):t(0,i=Math.min(i+f,u));return r.$$set=w=>{"format"in w&&t(1,s=w.format),"controls"in w&&t(2,l=w.controls),"hints"in w&&t(3,a=w.hints),"p"in w&&t(4,o=w.p),"value"in w&&t(0,i=w.value),"skip"in w&&t(5,f=w.skip),"max"in w&&t(6,u=w.max),"min"in w&&t(7,d=w.min)},[i,s,l,a,o,f,u,d,c,n,_,S,B,R,k]}class Ct extends te{constructor(e){super(),ne(this,e,Dt,Tt,ee,{format:1,controls:2,hints:3,p:4,value:0,skip:5,max:6,min:7})}}function et(r){const e=r-1;return e*e*e+1}function je(r,{delay:e=0,duration:t=400,easing:n=et,axis:s="y"}={}){const l=getComputedStyle(r),a=+l.opacity,o=s==="y"?"height":"width",i=parseFloat(l[o]),f=s==="y"?["top","bottom"]:["left","right"],u=f.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${u[0]}`]),c=parseFloat(l[`padding${u[1]}`]),_=parseFloat(l[`margin${u[0]}`]),S=parseFloat(l[`margin${u[1]}`]),B=parseFloat(l[`border${u[0]}Width`]),R=parseFloat(l[`border${u[1]}Width`]);return{delay:e,duration:t,easing:n,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*a};${o}: ${k*i}px;padding-${f[0]}: ${k*d}px;padding-${f[1]}: ${k*c}px;margin-${f[0]}: ${k*_}px;margin-${f[1]}: ${k*S}px;border-${f[0]}-width: ${k*B}px;border-${f[1]}-width: ${k*R}px;`}}function $e(r,{delay:e=0,duration:t=400,easing:n=et,start:s=0,opacity:l=0}={}){const a=getComputedStyle(r),o=+a.opacity,i=a.transform==="none"?"":a.transform,f=1-s,u=o*(1-l);return{delay:e,duration:t,easing:n,css:(d,c)=>` transform: ${i} scale(${1-f*c}); opacity: ${o-u*c} `}}function Vt(r){let e,t,n;const s=r[2].default,l=le(s,r,r[1],null);return{c(){e=T("aside"),l&&l.c(),this.h()},l(a){e=D(a,"ASIDE",{class:!0});var o=M(e);l&&l.l(o),o.forEach(h),this.h()},h(){m(e,"class","-z-20 mx-2 mb-2 flex min-h-[1px] w-[calc(100%-1rem)] max-w-xl flex-wrap rounded-lg bg-surface-200 ring-1 ring-highlight backdrop-blur-md will-change-transform svelte-1x44efv")},m(a,o){y(a,e,o),l&&l.m(e,null),r[3](e),n=!0},p(a,[o]){l&&l.p&&(!n||o&2)&&ie(l,s,a,a[1],n?oe(s,a[1],o,null):ae(a[1]),null)},i(a){n||(p(l,a),a&&ve(()=>{n&&(t||(t=se(e,je,{},!0)),t.run(1))}),n=!0)},o(a){g(l,a),a&&(t||(t=se(e,je,{},!1)),t.run(0)),n=!1},d(a){a&&h(e),l&&l.d(a),r[3](null),a&&t&&t.end()}}}const Nt=8;function Lt(r,e,t){let{$$slots:n={},$$scope:s}=e;lt("panel",!0);let l;async function a(){const i=(visualViewport?.height||innerHeight)-innerHeight,f=l?.contains(document.activeElement),u=l?.getAnimations()||[];if(!i||!f)return u.forEach(_=>{_.reverse(),_.addEventListener("finish",()=>_.cancel(),{once:!0})});u.forEach(_=>_.cancel()),await new Promise(_=>requestAnimationFrame(_));const d=l?.getBoundingClientRect().bottom||0,c=i-d+innerHeight-Nt;l?.animate([{transform:"translate3d(0,0,0)"},{transform:`translate3d(0,${c}px,0)`}],{delay:1,duration:150,fill:"forwards",composite:"replace",easing:"ease-in-out"})}it(()=>{if(ft())return visualViewport?.addEventListener("resize",a),()=>visualViewport?.removeEventListener("resize",a)});function o(i){ue[i?"unshift":"push"](()=>{l=i,t(0,l)})}return r.$$set=i=>{"$$scope"in i&&t(1,s=i.$$scope)},[l,s,n,o]}class St extends te{constructor(e){super(),ne(this,e,Lt,Vt,ee,{})}}function zt(r){let e,t,n,s,l,a,o=`${r[3]}ms`,i,f,u;return{c(){e=Ne("svg"),t=Ne("circle"),this.h()},l(d){e=Le(d,"svg",{class:!0,width:!0,height:!0,viewBox:!0,xmlns:!0,role:!0});var c=M(e);t=Le(c,"circle",{class:!0,fill:!0,stroke:!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,"stroke-width":!0,"stroke-linecap":!0,cx:!0,cy:!0,r:!0}),M(t).forEach(h),c.forEach(h),this.h()},h(){m(t,"class","animate-[dash-wiggle_var(--duration)_ease-in-out_infinite]"),m(t,"fill","none"),m(t,"stroke",r[5]),m(t,"stroke-dasharray",r[6]),m(t,"stroke-dashoffset",n=r[6]*r[1]),m(t,"stroke-width",r[4]),m(t,"stroke-linecap","round"),m(t,"cx",s=r[0]/2),m(t,"cy",l=r[0]/2),m(t,"r",a=r[0]/2-r[4]/2),W(t,"--back",r[6]*(r[1]-r[2])),W(t,"--forth",r[6]*(r[1]+r[2])),W(t,"--duration",o),m(e,"class","inline-block animate-spin"),m(e,"width",i=r[0]+"px"),m(e,"height",f=r[0]+"px"),m(e,"viewBox",u="0 0 "+r[0]+" "+r[0]),m(e,"xmlns","http://www.w3.org/2000/svg"),m(e,"role","status")},m(d,c){y(d,e,c),I(e,t)},p(d,[c]){c&32&&m(t,"stroke",d[5]),c&64&&m(t,"stroke-dasharray",d[6]),c&66&&n!==(n=d[6]*d[1])&&m(t,"stroke-dashoffset",n),c&16&&m(t,"stroke-width",d[4]),c&1&&s!==(s=d[0]/2)&&m(t,"cx",s),c&1&&l!==(l=d[0]/2)&&m(t,"cy",l),c&17&&a!==(a=d[0]/2-d[4]/2)&&m(t,"r",a),c&70&&W(t,"--back",d[6]*(d[1]-d[2])),c&70&&W(t,"--forth",d[6]*(d[1]+d[2])),c&8&&o!==(o=`${d[3]}ms`)&&W(t,"--duration",o),c&1&&i!==(i=d[0]+"px")&&m(e,"width",i),c&1&&f!==(f=d[0]+"px")&&m(e,"height",f),c&1&&u!==(u="0 0 "+d[0]+" "+d[0])&&m(e,"viewBox",u)},i:J,o:J,d(d){d&&h(e)}}}function Mt(r,e,t){let n,{size:s=64}=e,{cutoff:l=.3}=e,{wiggle:a=.15}=e,{duration:o=2e3}=e,{thickness:i=Math.sqrt(s)}=e,{color:f="hsl(var(--color-highlight))"}=e;return r.$$set=u=>{"size"in u&&t(0,s=u.size),"cutoff"in u&&t(1,l=u.cutoff),"wiggle"in u&&t(2,a=u.wiggle),"duration"in u&&t(3,o=u.duration),"thickness"in u&&t(4,i=u.thickness),"color"in u&&t(5,f=u.color)},r.$$.update=()=>{r.$$.dirty&17&&t(6,n=Math.PI*(s-i))},[s,l,a,o,i,f,n]}class Pt extends te{constructor(e){super(),ne(this,e,Mt,zt,ee,{size:0,cutoff:1,wiggle:2,duration:3,thickness:4,color:5})}}function At(r){let e=(r[2]?.title||"Not Playing")+"",t;return{c(){t=K(e)},l(n){t=Y(n,e)},m(n,s){y(n,t,s)},p(n,s){s&4&&e!==(e=(n[2]?.title||"Not Playing")+"")&&de(t,e)},d(n){n&&h(t)}}}function Bt(r){let e=(r[2]?.artists.map(qe).join(", ")||" ")+"",t;return{c(){t=K(e)},l(n){t=Y(n,e)},m(n,s){y(n,t,s)},p(n,s){s&4&&e!==(e=(n[2]?.artists.map(qe).join(", ")||" ")+"")&&de(t,e)},d(n){n&&h(t)}}}function Ht(r){let e,t,n,s;return e=new _t({props:{accent:!0,$$slots:{default:[At]},$$scope:{ctx:r}}}),n=new Ie({props:{air:!0,primary:!0,slim:!0,disabled:!r[2],href:r[2]?.artists.length===1?`/explore/artist#${r[2].artists[0].id}`:void 0,$$slots:{default:[Bt]},$$scope:{ctx:r}}}),{c(){C(e.$$.fragment),t=H(),C(n.$$.fragment)},l(l){V(e.$$.fragment,l),t=F(l),V(n.$$.fragment,l)},m(l,a){N(e,l,a),y(l,t,a),N(n,l,a),s=!0},p(l,a){const o={};a&516&&(o.$$scope={dirty:a,ctx:l}),e.$set(o);const i={};a&4&&(i.disabled=!l[2]),a&4&&(i.href=l[2]?.artists.length===1?`/explore/artist#${l[2].artists[0].id}`:void 0),a&516&&(i.$$scope={dirty:a,ctx:l}),n.$set(i)},i(l){s||(p(e.$$.fragment,l),p(n.$$.fragment,l),s=!0)},o(l){g(e.$$.fragment,l),g(n.$$.fragment,l),s=!1},d(l){l&&h(t),L(e,l),L(n,l)}}}function Ft(r){let e,t,n=`hue-rotate(${r[2]?.id||0}deg)`,s;return t=new ke({props:{name:"note"}}),{c(){e=T("div"),C(t.$$.fragment),this.h()},l(l){e=D(l,"DIV",{class:!0});var a=M(e);V(t.$$.fragment,a),a.forEach(h),this.h()},h(){m(e,"class","flex h-full w-full items-center justify-center bg-gradient-to-r from-rose-400 to-red-400 text-white"),W(e,"filter",n)},m(l,a){y(l,e,a),N(t,e,null),s=!0},p(l,a){a&4&&n!==(n=`hue-rotate(${l[2]?.id||0}deg)`)&&W(e,"filter",n)},i(l){s||(p(t.$$.fragment,l),s=!0)},o(l){g(t.$$.fragment,l),s=!1},d(l){l&&h(e),L(t)}}}function jt(r){let e,t,n;return{c(){e=T("div"),this.h()},l(s){e=D(s,"DIV",{class:!0}),M(e).forEach(h),this.h()},h(){m(e,"class","pause absolute svelte-1jkcbkw")},m(s,l){y(s,e,l),n=!0},i(s){n||(s&&ve(()=>{n&&(t||(t=se(e,$e,{},!0)),t.run(1))}),n=!0)},o(s){s&&(t||(t=se(e,$e,{},!1)),t.run(0)),n=!1},d(s){s&&h(e),s&&t&&t.end()}}}function qt(r){let e,t,n,s;return t=new Pt({props:{color:"hsl(var(--color-content))"}}),{c(){e=T("div"),C(t.$$.fragment),this.h()},l(l){e=D(l,"DIV",{class:!0});var a=M(e);V(t.$$.fragment,a),a.forEach(h),this.h()},h(){m(e,"class","absolute")},m(l,a){y(l,e,a),N(t,e,null),s=!0},i(l){s||(p(t.$$.fragment,l),l&&ve(()=>{s&&(n||(n=se(e,$e,{},!0)),n.run(1))}),s=!0)},o(l){g(t.$$.fragment,l),l&&(n||(n=se(e,$e,{},!1)),n.run(0)),s=!1},d(l){l&&h(e),L(t),l&&n&&n.end()}}}function Ot(r){let e,t,n,s,l,a,o,i,f,u,d,c,_,S,B,R,k;e=new Ke({props:{class:"place-items-center gap-1 p-4",$$slots:{default:[Ht]},$$scope:{ctx:r}}}),o=new ct({props:{src:r[2]?.album.arts?.[0],size:324,$$slots:{default:[Ft]},$$scope:{ctx:r}}});const w=[qt,jt],j=[];function v(b,z){return b[3]?0:1}u=v(r),d=j[u]=w[u](r);function P(b){r[5](b)}let q={format:dt,max:r[2]?.duration||0,controls:!0,hints:!0,p:!0};return r[0]!==void 0&&(q.value=r[0]),_=new Ct({props:q}),ue.push(()=>he(_,"value",P)),_.$on("forward",r[6]),_.$on("rewind",r[7]),_.$on("reset",r[8]),{c(){C(e.$$.fragment),t=H(),n=T("div"),s=T("label"),l=T("input"),a=H(),C(o.$$.fragment),i=H(),f=T("div"),d.c(),c=H(),C(_.$$.fragment),this.h()},l(b){V(e.$$.fragment,b),t=F(b),n=D(b,"DIV",{class:!0});var z=M(n);s=D(z,"LABEL",{class:!0});var $=M(s);l=D($,"INPUT",{type:!0,class:!0}),a=F($),V(o.$$.fragment,$),i=F($),f=D($,"DIV",{class:!0});var O=M(f);d.l(O),O.forEach(h),$.forEach(h),z.forEach(h),c=F(b),V(_.$$.fragment,b),this.h()},h(){m(l,"type","checkbox"),m(l,"class","peer absolute inset-0 appearance-none rounded-2xl outline-2 outline-offset-8 outline-primary-600 focus-visible:outline svelte-1jkcbkw"),m(f,"class","absolute -inset-[1px] flex items-center justify-center rounded-2xl bg-surface-200 opacity-0 backdrop-blur transition-[opacity] duration-300 peer-checked:opacity-100 svelte-1jkcbkw"),U(f,"opacity-100",r[3]),m(s,"class","relative block cursor-pointer rounded-2xl shadow-xl"),m(n,"class","px-11")},m(b,z){N(e,b,z),y(b,t,z),y(b,n,z),I(n,s),I(s,l),l.checked=r[1],I(s,a),N(o,s,null),I(s,i),I(s,f),j[u].m(f,null),y(b,c,z),N(_,b,z),B=!0,R||(k=A(l,"change",r[4]),R=!0)},p(b,[z]){const $={};z&516&&($.$$scope={dirty:z,ctx:b}),e.$set($),z&2&&(l.checked=b[1]);const O={};z&4&&(O.src=b[2]?.album.arts?.[0]),z&516&&(O.$$scope={dirty:z,ctx:b}),o.$set(O);let Q=u;u=v(b),u!==Q&&(X(),g(j[Q],1,1,()=>{j[Q]=null}),x(),d=j[u],d||(d=j[u]=w[u](b),d.c()),p(d,1),d.m(f,null)),(!B||z&8)&&U(f,"opacity-100",b[3]);const G={};z&4&&(G.max=b[2]?.duration||0),!S&&z&1&&(S=!0,G.value=b[0],me(()=>S=!1)),_.$set(G)},i(b){B||(p(e.$$.fragment,b),p(o.$$.fragment,b),p(d),p(_.$$.fragment,b),B=!0)},o(b){g(e.$$.fragment,b),g(o.$$.fragment,b),g(d),g(_.$$.fragment,b),B=!1},d(b){b&&(h(t),h(n),h(c)),L(e,b),L(o),j[u].d(),L(_,b),R=!1,k()}}}const qe=r=>r.title;function Rt(r,e,t){let{track:n=void 0}=e,{currentTime:s=0}=e,{loading:l=!1}=e,{paused:a=!0}=e;function o(){a=this.checked,t(1,a)}function i(c){s=c,t(0,s)}function f(c){ce.call(this,r,c)}function u(c){ce.call(this,r,c)}function d(c){ce.call(this,r,c)}return r.$$set=c=>{"track"in c&&t(2,n=c.track),"currentTime"in c&&t(0,s=c.currentTime),"loading"in c&&t(3,l=c.loading),"paused"in c&&t(1,a=c.paused)},[s,a,n,l,o,i,f,u,d]}class Ut extends te{constructor(e){super(),ne(this,e,Rt,Ot,ee,{track:2,currentTime:0,loading:3,paused:1})}}const Wt=r=>({}),Oe=r=>({slot:"before"});function Re(r){let e,t;return e=new Ye({props:{lg:!0,$$slots:{default:[Kt]},$$scope:{ctx:r}}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p(n,s){const l={};s&1048592&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function Zt(r){let e;return{c(){e=K("Title")},l(t){e=Y(t,"Title")},m(t,n){y(t,e,n)},d(t){t&&h(e)}}}function Gt(r){let e;return{c(){e=K("Artist")},l(t){e=Y(t,"Artist")},m(t,n){y(t,e,n)},d(t){t&&h(e)}}}function Jt(r){let e;return{c(){e=K("Album")},l(t){e=Y(t,"Album")},m(t,n){y(t,e,n)},d(t){t&&h(e)}}}function Kt(r){let e,t,n,s,l,a,o;return t=new pe({props:{sm:!0,$$slots:{default:[Zt]},$$scope:{ctx:r}}}),s=new pe({props:{sm:!0,$$slots:{default:[Gt]},$$scope:{ctx:r}}}),a=new pe({props:{sm:!0,$$slots:{default:[Jt]},$$scope:{ctx:r}}}),{c(){e=T("div"),C(t.$$.fragment),n=H(),C(s.$$.fragment),l=H(),C(a.$$.fragment),this.h()},l(i){e=D(i,"DIV",{class:!0});var f=M(e);V(t.$$.fragment,f),n=F(f),V(s.$$.fragment,f),l=F(f),V(a.$$.fragment,f),f.forEach(h),this.h()},h(){m(e,"class","sticky top-11 z-10 grid auto-cols-fr grid-flow-col border-b border-b-highlight bg-surface/70 pl-20 pr-10 backdrop-blur-md"),U(e,"pl-24",r[4])},m(i,f){y(i,e,f),N(t,e,null),I(e,n),N(s,e,null),I(e,l),N(a,e,null),o=!0},p(i,f){const u={};f&1048576&&(u.$$scope={dirty:f,ctx:i}),t.$set(u);const d={};f&1048576&&(d.$$scope={dirty:f,ctx:i}),s.$set(d);const c={};f&1048576&&(c.$$scope={dirty:f,ctx:i}),a.$set(c),(!o||f&16)&&U(e,"pl-24",i[4])},i(i){o||(p(t.$$.fragment,i),p(s.$$.fragment,i),p(a.$$.fragment,i),o=!0)},o(i){g(t.$$.fragment,i),g(s.$$.fragment,i),g(a.$$.fragment,i),o=!1},d(i){i&&h(e),L(t),L(s),L(a)}}}function Ue(r){let e,t=typeof r[22]=="string"&&We();return{c(){e=T("div"),t&&t.c(),this.h()},l(n){e=D(n,"DIV",{class:!0});var s=M(e);t&&t.l(s),s.forEach(h),this.h()},h(){m(e,"class","visible ml-4 flex h-14 w-0.5 items-center justify-center bg-highlight-100"),U(e,"opacity-0",Number.isNaN(r[23]))},m(n,s){y(n,e,s),t&&t.m(e,null)},p(n,s){typeof n[22]=="string"?t||(t=We(),t.c(),t.m(e,null)):t&&(t.d(1),t=null),s&8388608&&U(e,"opacity-0",Number.isNaN(n[23]))},d(n){n&&h(e),t&&t.d()}}}function We(r){let e;return{c(){e=T("div"),this.h()},l(t){e=D(t,"DIV",{class:!0}),M(e).forEach(h),this.h()},h(){m(e,"class","absolute mt-4 h-2 w-2 rounded-full bg-content")},m(t,n){y(t,e,n)},d(t){t&&h(e)}}}function Yt(r){let e,t;return e=new Te({props:{sm:r[2]}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p(n,s){const l={};s&4&&(l.sm=n[2]),e.$set(l)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function Qt(r){let e,t,n,s;const l=[en,xt],a=[];function o(i,f){return i[10].default||i[10].action?0:1}return e=o(r),t=a[e]=l[e](r),{c(){t.c(),n=re()},l(i){t.l(i),n=re()},m(i,f){a[e].m(i,f),y(i,n,f),s=!0},p(i,f){let u=e;e=o(i),e===u?a[e].p(i,f):(X(),g(a[u],1,1,()=>{a[u]=null}),x(),t=a[e],t?t.p(i,f):(t=a[e]=l[e](i),t.c()),p(t,1),t.m(n.parentNode,n))},i(i){s||(p(t),s=!0)},o(i){g(t),s=!1},d(i){i&&h(n),a[e].d(i)}}}function Xt(r){let e,t=r[22]+"",n;return{c(){e=T("h2"),n=K(t),this.h()},l(s){e=D(s,"H2",{draggable:!0,class:!0});var l=M(e);n=Y(l,t),l.forEach(h),this.h()},h(){m(e,"draggable","false"),m(e,"class","relative top-2 flex h-14 items-center indent-4 text-lg [*:has(>div>&)]:pointer-events-none")},m(s,l){y(s,e,l),I(e,n)},p(s,l){l&4194304&&t!==(t=s[22]+"")&&de(n,t)},i:J,o:J,d(s){s&&h(e)}}}function xt(r){let e,t;function n(){return r[17](r[22])}return e=new Te({props:{sm:r[2],track:r[22],selected:be(r[22],r[0])}}),e.$on("click",n),{c(){C(e.$$.fragment)},l(s){V(e.$$.fragment,s)},m(s,l){N(e,s,l),t=!0},p(s,l){r=s;const a={};l&4&&(a.sm=r[2]),l&4194304&&(a.track=r[22]),l&4194305&&(a.selected=be(r[22],r[0])),e.$set(a)},i(s){t||(p(e.$$.fragment,s),t=!0)},o(s){g(e.$$.fragment,s),t=!1},d(s){L(e,s)}}}function en(r){let e,t;function n(){return r[15](r[22])}function s(){return r[16](r[22])}return e=new It({props:{$$slots:{after:[rn],before:[nn],default:[tn]},$$scope:{ctx:r}}}),e.$on("before",n),e.$on("after",s),{c(){C(e.$$.fragment)},l(l){V(e.$$.fragment,l)},m(l,a){N(e,l,a),t=!0},p(l,a){r=l;const o={};a&5242885&&(o.$$scope={dirty:a,ctx:r}),e.$set(o)},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){g(e.$$.fragment,l),t=!1},d(l){L(e,l)}}}function tn(r){let e,t;function n(){return r[13](r[22])}function s(...l){return r[14](r[22],...l)}return e=new Te({props:{sm:r[2],track:r[22],selected:be(r[22],r[0])}}),e.$on("click",n),e.$on("contextmenu",s),{c(){C(e.$$.fragment)},l(l){V(e.$$.fragment,l)},m(l,a){N(e,l,a),t=!0},p(l,a){r=l;const o={};a&4&&(o.sm=r[2]),a&4194304&&(o.track=r[22]),a&4194305&&(o.selected=be(r[22],r[0])),e.$set(o)},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){g(e.$$.fragment,l),t=!1},d(l){L(e,l)}}}function nn(r){let e;const t=r[12].action,n=le(t,r,r[20],Oe);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,l){n&&n.m(s,l),e=!0},p(s,l){n&&n.p&&(!e||l&1048576)&&ie(n,t,s,s[20],e?oe(t,s[20],l,Wt):ae(s[20]),Oe)},i(s){e||(p(n,s),e=!0)},o(s){g(n,s),e=!1},d(s){n&&n.d(s)}}}function rn(r){let e,t;return e=new ke({props:{name:"list",slot:"after"}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p:J,i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function sn(r){let e,t,n,s,l,a=r[4]&&Ue(r);const o=[Xt,Qt,Yt],i=[];function f(u,d){return typeof u[22]=="string"?0:u[22]?1:2}return n=f(r),s=i[n]=o[n](r),{c(){e=T("div"),a&&a.c(),t=H(),s.c(),this.h()},l(u){e=D(u,"DIV",{class:!0});var d=M(e);a&&a.l(d),t=F(d),s.l(d),d.forEach(h),this.h()},h(){m(e,"class","relative flex [&_hr]:!opacity-100 [*:has(>&):last-of-type_hr]:!opacity-0")},m(u,d){y(u,e,d),a&&a.m(e,null),I(e,t),i[n].m(e,null),l=!0},p(u,d){u[4]?a?a.p(u,d):(a=Ue(u),a.c(),a.m(e,t)):a&&(a.d(1),a=null);let c=n;n=f(u),n===c?i[n].p(u,d):(X(),g(i[c],1,1,()=>{i[c]=null}),x(),s=i[n],s?s.p(u,d):(s=i[n]=o[n](u),s.c()),p(s,1),s.m(e,null))},i(u){l||(p(s),l=!0)},o(u){g(s),l=!1},d(u){u&&h(e),a&&a.d(),i[n].d()}}}function Ze(r){let e,t;return e=new Qe({props:{to:"bottom",$$slots:{default:[fn]},$$scope:{ctx:r}}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p(n,s){const l={};s&1048577&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function Ge(r){let e,t;return e=new St({props:{$$slots:{default:[on]},$$scope:{ctx:r}}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p(n,s){const l={};s&1048576&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function ln(r){let e,t;return e=new ke({props:{name:"close"}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p:J,i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function an(r){let e,t,n,s,l;const a=r[12].default,o=le(a,r,r[20],null);return t=new xe({}),s=new Ie({props:{air:!0,square:!0,$$slots:{default:[ln]},$$scope:{ctx:r}}}),s.$on("click",r[8]),{c(){o&&o.c(),e=H(),C(t.$$.fragment),n=H(),C(s.$$.fragment)},l(i){o&&o.l(i),e=F(i),V(t.$$.fragment,i),n=F(i),V(s.$$.fragment,i)},m(i,f){o&&o.m(i,f),y(i,e,f),N(t,i,f),y(i,n,f),N(s,i,f),l=!0},p(i,f){o&&o.p&&(!l||f&1048576)&&ie(o,a,i,i[20],l?oe(a,i[20],f,null):ae(i[20]),null);const u={};f&1048576&&(u.$$scope={dirty:f,ctx:i}),s.$set(u)},i(i){l||(p(o,i),p(t.$$.fragment,i),p(s.$$.fragment,i),l=!0)},o(i){g(o,i),g(t.$$.fragment,i),g(s.$$.fragment,i),l=!1},d(i){i&&(h(e),h(n)),o&&o.d(i),L(t,i),L(s,i)}}}function on(r){let e,t;return e=new Ke({props:{x:!0,$$slots:{default:[an]},$$scope:{ctx:r}}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p(n,s){const l={};s&1048576&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function fn(r){let e,t,n=r[0].size&&Ge(r);return{c(){n&&n.c(),e=re()},l(s){n&&n.l(s),e=re()},m(s,l){n&&n.m(s,l),y(s,e,l),t=!0},p(s,l){s[0].size?n?(n.p(s,l),l&1&&p(n,1)):(n=Ge(s),n.c(),p(n,1),n.m(e.parentNode,e)):n&&(X(),g(n,1,1,()=>{n=null}),x())},i(s){t||(p(n),t=!0)},o(s){g(n),t=!1},d(s){s&&h(e),n&&n.d(s)}}}function un(r){let e,t,n,s,l,a,o=!r[2]&&Re(r);n=new mt({props:{key:cn,sortable:"tracks",prerender:tt,fixed:r[3],items:r[5],animate:!0,$$slots:{default:[sn,({item:f,index:u})=>({22:f,23:u}),({item:f,index:u})=>(f?4194304:0)|(u?8388608:0)]},$$scope:{ctx:r}}}),n.$on("edit",r[18]),n.$on("end",r[19]);let i=(r[10].default||r[10].action)&&Ze(r);return{c(){e=T("div"),o&&o.c(),t=H(),C(n.$$.fragment),s=H(),i&&i.c(),l=re(),this.h()},l(f){e=D(f,"DIV",{class:!0});var u=M(e);o&&o.l(u),t=F(u),V(n.$$.fragment,u),u.forEach(h),s=F(f),i&&i.l(f),l=re(),this.h()},h(){m(e,"class",r[1])},m(f,u){y(f,e,u),o&&o.m(e,null),I(e,t),N(n,e,null),y(f,s,u),i&&i.m(f,u),y(f,l,u),a=!0},p(f,[u]){f[2]?o&&(X(),g(o,1,1,()=>{o=null}),x()):o?(o.p(f,u),u&4&&p(o,1)):(o=Re(f),o.c(),p(o,1),o.m(e,t));const d={};u&8&&(d.fixed=f[3]),u&32&&(d.items=f[5]),u&13632533&&(d.$$scope={dirty:u,ctx:f}),n.$set(d),(!a||u&2)&&m(e,"class",f[1]),f[10].default||f[10].action?i?(i.p(f,u),u&1024&&p(i,1)):(i=Ze(f),i.c(),p(i,1),i.m(l.parentNode,l)):i&&(X(),g(i,1,1,()=>{i=null}),x())},i(f){a||(p(o),p(n.$$.fragment,f),p(i),a=!0)},o(f){g(o),g(n.$$.fragment,f),g(i),a=!1},d(f){f&&(h(e),h(s),h(l)),o&&o.d(),L(n),i&&i.d(f)}}}const tt=10;function be(r,e){return e.size?e.has(r)?!0:"passive":!1}const cn=r=>typeof r=="string"?r:r?.entry||r?.id;function dn(r,e,t){let n,{$$slots:s={},$$scope:l}=e;const a=Je(s),o=Ee();let{class:i=""}=e,{sm:f=!1}=e,{fixed:u=!1}=e,{timeline:d=!1}=e,{selected:c=new Set}=e,{tracks:_=void 0}=e;function S($){if(!$)return Array.from({length:tt});if(!d)return $;const O=[];let Q="";for(const G of $){if(!G||!("date"in G)||typeof G.date!="number")continue;const we=new Date(G.date*1e3),E=ht(we);E!==Q&&(O.push(E),Q=E),O.push(G)}return O}function B($){c.has($)?c.delete($):c.add($),t(0,c)}function R(){c.clear(),t(0,c)}async function k($){if(!o("click",$,{cancelable:!0}))return;const O=_?.indexOf($);!_||!_[0]||O==null||O===-1||(Z.clear(),Z.push(_.slice(O)),await Z.push(_.slice(0,O),"first"),nt())}const w=$=>c.size?B($):k($),j=($,O)=>(O.preventDefault(),B($)),v=$=>o("action",$),P=$=>B($),q=$=>k($);function b($){ce.call(this,r,$)}function z($){ce.call(this,r,$)}return r.$$set=$=>{"class"in $&&t(1,i=$.class),"sm"in $&&t(2,f=$.sm),"fixed"in $&&t(3,u=$.fixed),"timeline"in $&&t(4,d=$.timeline),"selected"in $&&t(0,c=$.selected),"tracks"in $&&t(11,_=$.tracks),"$$scope"in $&&t(20,l=$.$$scope)},r.$$.update=()=>{r.$$.dirty&2048&&t(5,n=S(_)),r.$$.dirty&2048&&(_?.length||R())},[c,i,f,u,d,n,o,B,R,k,a,_,s,w,j,v,P,q,b,z,l]}class _n extends te{constructor(e){super(),ne(this,e,dn,un,ee,{class:1,sm:2,fixed:3,timeline:4,selected:0,tracks:11})}}function mn(r){let e;return{c(){e=K("Playing Next")},l(t){e=Y(t,"Playing Next")},m(t,n){y(t,e,n)},d(t){t&&h(e)}}}function hn(r){let e,t;return e=new ke({props:{name:"trash"}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p:J,i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function pn(r){let e,t;return e=new Ie({props:{air:!0,stretch:!0,$$slots:{default:[hn]},$$scope:{ctx:r}}}),e.$on("click",r[9]),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p(n,s){const l={};s&134217728&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function gn(r){let e,t,n,s,l,a,o,i,f,u,d,c,_,S;function B(v){r[18](v)}function R(v){r[19](v)}let k={track:r[0],loading:r[3]<=2&&!!r[6]};r[1]!==void 0&&(k.currentTime=r[1]),r[4]!==void 0&&(k.paused=r[4]),n=new Ut({props:k}),ue.push(()=>he(n,"currentTime",B)),ue.push(()=>he(n,"paused",R)),n.$on("forward",r[20]),n.$on("rewind",r[21]),n.$on("reset",r[22]),o=new pe({props:{indent:!0,sm:!0,$$slots:{default:[mn]},$$scope:{ctx:r}}}),f=new xe({});function w(v){r[23](v)}let j={tracks:r[8],sm:!0,$$slots:{default:[pn]},$$scope:{ctx:r}};return r[7]!==void 0&&(j.selected=r[7]),c=new _n({props:j}),ue.push(()=>he(c,"selected",w)),c.$on("click",r[24]),{c(){e=T("div"),t=T("div"),C(n.$$.fragment),a=H(),C(o.$$.fragment),i=H(),C(f.$$.fragment),u=H(),d=T("div"),C(c.$$.fragment),this.h()},l(v){e=D(v,"DIV",{class:!0});var P=M(e);t=D(P,"DIV",{});var q=M(t);V(n.$$.fragment,q),a=F(q),V(o.$$.fragment,q),i=F(q),V(f.$$.fragment,q),q.forEach(h),u=F(P),d=D(P,"DIV",{class:!0});var b=M(d);V(c.$$.fragment,b),b.forEach(h),P.forEach(h),this.h()},h(){m(d,"class","grow overflow-y-scroll contain-strict"),m(e,"class","flex h-screen flex-col border-l border-highlight")},m(v,P){y(v,e,P),I(e,t),N(n,t,null),I(t,a),N(o,t,null),I(t,i),N(f,t,null),I(e,u),I(e,d),N(c,d,null),S=!0},p(v,P){const q={};P&1&&(q.track=v[0]),P&72&&(q.loading=v[3]<=2&&!!v[6]),!s&&P&2&&(s=!0,q.currentTime=v[1],me(()=>s=!1)),!l&&P&16&&(l=!0,q.paused=v[4],me(()=>l=!1)),n.$set(q);const b={};P&134217728&&(b.$$scope={dirty:P,ctx:v}),o.$set(b);const z={};P&256&&(z.tracks=v[8]),P&134217728&&(z.$$scope={dirty:P,ctx:v}),!_&&P&128&&(_=!0,z.selected=v[7],me(()=>_=!1)),c.$set(z)},i(v){S||(p(n.$$.fragment,v),p(o.$$.fragment,v),p(f.$$.fragment,v),p(c.$$.fragment,v),S=!0)},o(v){g(n.$$.fragment,v),g(o.$$.fragment,v),g(f.$$.fragment,v),g(c.$$.fragment,v),S=!1},d(v){v&&h(e),L(n),L(o),L(f),L(c)}}}function $n(r){let e,t;return e=new Ye({props:{lg:!0,$$slots:{default:[gn]},$$scope:{ctx:r}}}),{c(){C(e.$$.fragment)},l(n){V(e.$$.fragment,n)},m(n,s){N(e,n,s),t=!0},p(n,s){const l={};s&134218207&&(l.$$scope={dirty:s,ctx:n}),e.$set(l)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){g(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function bn(r){let e,t,n=!0,s=!1,l,a,o,i,f,u;function d(){cancelAnimationFrame(l),e.paused||(l=ot(d),s=!0),r[15].call(e)}return o=new Qe({props:{to:"right",$$slots:{default:[$n]},$$scope:{ctx:r}}}),{c(){e=T("audio"),a=H(),C(o.$$.fragment),this.h()},l(c){e=D(c,"AUDIO",{src:!0,preload:!0}),M(e).forEach(h),a=F(c),V(o.$$.fragment,c),this.h()},h(){Se(e.src,t=r[6])||m(e,"src",t),m(e,"preload","auto"),r[3]===void 0&&ve(()=>r[14].call(e))},m(c,_){y(c,e,_),isNaN(r[2])||(e.playbackRate=r[2]),y(c,a,_),N(o,c,_),i=!0,f||(u=[A(e,"play",r[13]),A(e,"pause",r[13]),A(e,"loadedmetadata",r[14]),A(e,"loadeddata",r[14]),A(e,"canplay",r[14]),A(e,"canplaythrough",r[14]),A(e,"playing",r[14]),A(e,"waiting",r[14]),A(e,"emptied",r[14]),A(e,"timeupdate",d),A(e,"ratechange",r[16]),A(e,"ended",r[17])],f=!0)},p(c,[_]){(!i||_&64&&!Se(e.src,t=c[6]))&&m(e,"src",t),_&16&&n!==(n=c[4])&&e[n?"pause":"play"](),!s&&_&2&&!isNaN(c[1])&&(e.currentTime=c[1]),s=!1,_&4&&!isNaN(c[2])&&(e.playbackRate=c[2]);const S={};_&134218207&&(S.$$scope={dirty:_,ctx:c}),o.$set(S)},i(c){i||(p(o.$$.fragment,c),i=!0)},o(c){g(o.$$.fragment,c),i=!1},d(c){c&&(h(e),h(a)),L(o,c),f=!1,fe(u)}}}let ye=!1;function nt(){ye=!0}function vn(r,e,t){let n,s,l;ze(r,Z,E=>t(12,s=E)),ze(r,pt,E=>t(8,l=E));const a=ut(async()=>{if(!o)return;const E=f/o.duration;E<1&&Z.sync(E)},3e3);let o,i=1,f=0,u=0,d=!0,c=!1,_="",S=new Set;async function B(E){if(E?.id===o?.id)return;if(t(0,o=E),!o)return t(4,d=!0),t(1,f=0);t(3,u=0);const De=await gt.query(o);De!==_&&(t(6,_=De),ye&&(ye=!1,t(4,d=!0),await at(),t(4,d=!1)))}function R(){Z.purge([...S].map(E=>E.entry).filter(E=>!!E)),S.clear(),t(7,S)}async function k(E){E?.entry&&Z.rearrange(E.entry,o?.entry),n?.repeat===1?(Z.repeat("none"),Z.sync(1),await Z.repeat("single")):await Z.sync(1),nt()}function w(){d=this.paused,t(4,d)}function j(){u=this.readyState,t(3,u)}function v(){f=this.currentTime,t(1,f),t(11,n),t(0,o),t(12,s)}function P(){i=this.playbackRate,t(2,i)}const q=()=>c||(Z.sync(1),t(5,c=!0));function b(E){f=E,t(1,f),t(11,n),t(0,o),t(12,s)}function z(E){d=E,t(4,d)}const $=()=>t(2,i=5),O=()=>t(2,i=-5),Q=()=>t(2,i=1);function G(E){S=E,t(7,S)}const we=E=>(E.preventDefault(),k(E.detail));return r.$$.update=()=>{r.$$.dirty&4096&&t(11,n=s.find(E=>E.local)),r.$$.dirty&2048&&B(n?.track),r.$$.dirty&2051&&n&&o&&!f&&t(1,f=n.progress*o.duration),r.$$.dirty&2&&(a(),t(5,c=!1))},[o,f,i,u,d,c,_,S,l,R,k,n,s,w,j,v,P,q,b,z,$,O,Q,G,we]}class Tn extends te{constructor(e){super(),ne(this,e,vn,bn,ee,{})}}export{Tn as P,xe as S,_n as T,St as a,Xe as i}; diff --git a/_app/immutable/chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js b/_app/immutable/chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js similarity index 99% rename from _app/immutable/chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js rename to _app/immutable/chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js index e43f0846..92ac1c7d 100644 --- a/_app/immutable/chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js +++ b/_app/immutable/chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js @@ -1,4 +1,4 @@ -import{r as U1}from"./paths.k6rcf9P1.js";import{s as $,w as e1,X as K,f as H,g as B,h as P,d as y,a2 as L1,i as E,x as t1,y as r1,z as o1,a3 as M1,L as q1,a4 as W1,a as m1,e as c1,c as b1,r as D1,u as Q,A as V1,v as F1,a1 as d1,E as k,C as G1,l as J1,m as X1,n as Y1,M as K1,a5 as Q1,j as L,Y as $1,G as z1,a6 as ee,a7 as te,k as s1}from"./scheduler.yhBzS9E6.js";import{S as u1,i as f1,a as Z,t as S,g as re,c as oe}from"./index.f7836kWu.js";function v1(t,e){const r={},o={},l={$$scope:1};let n=t.length;for(;n--;){const i=t[n],s=e[n];if(s){for(const a in i)a in s||(o[a]=1);for(const a in s)l[a]||(r[a]=s[a],l[a]=1);t[n]=s}else for(const a in i)l[a]=1}for(const i in o)i in r||(r[i]=void 0);return r}const A=globalThis;"DOMRect"in A||(A.DOMRect=class{constructor(t=0,e=0,r=0,o=0){this.x=t,this.y=e,this.width=r,this.height=o,this.top=e,this.bottom=e+o,this.left=t,this.right=t+r}bottom;right;left;top;toJSON(){return JSON.stringify(this)}});"ResizeObserver"in A||(A.ResizeObserver=function(){return{disconnect(){},observe(){},unobserve(){}}});"DragEvent"in A||(A.DragEvent=globalThis.MouseEvent);"TouchEvent"in A||(A.TouchEvent=function(){});globalThis.addEventListener?.("touchstart",()=>{},!1);const w1="-";function ne(t){const e=le(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=t;function l(i){const s=i.split(w1);return s[0]===""&&s.length!==1&&s.shift(),I1(s,e)||ie(i)}function n(i,s){const a=r[i]||[];return s&&o[i]?[...a,...o[i]]:a}return{getClassGroupId:l,getConflictingClassGroupIds:n}}function I1(t,e){if(t.length===0)return e.classGroupId;const r=t[0],o=e.nextPart.get(r),l=o?I1(t.slice(1),o):void 0;if(l)return l;if(e.validators.length===0)return;const n=t.join(w1);return e.validators.find(({validator:i})=>i(n))?.classGroupId}const Z1=/^\[(.+)\]$/;function ie(t){if(Z1.test(t)){const e=Z1.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}}function le(t){const{theme:e,prefix:r}=t,o={nextPart:new Map,validators:[]};return ae(Object.entries(t.classGroups),r).forEach(([n,i])=>{p1(i,o,n,e)}),o}function p1(t,e,r,o){t.forEach(l=>{if(typeof l=="string"){const n=l===""?e:S1(e,l);n.classGroupId=r;return}if(typeof l=="function"){if(se(l)){p1(l(o),e,r,o);return}e.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([n,i])=>{p1(i,S1(e,n),r,o)})})}function S1(t,e){let r=t;return e.split(w1).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r}function se(t){return t.isThemeGetter}function ae(t,e){return e?t.map(([r,o])=>{const l=o.map(n=>typeof n=="string"?e+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,s])=>[e+i,s])):n);return[r,l]}):t}function ce(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,o=new Map;function l(n,i){r.set(n,i),e++,e>t&&(e=0,o=r,r=new Map)}return{get(n){let i=r.get(n);if(i!==void 0)return i;if((i=o.get(n))!==void 0)return l(n,i),i},set(n,i){r.has(n)?r.set(n,i):l(n,i)}}}const P1="!";function de(t){const e=t.separator,r=e.length===1,o=e[0],l=e.length;return function(i){const s=[];let a=0,f=0,u;for(let d=0;df?u-f:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:c,maybePostfixModifierPosition:b}}}function ue(t){if(t.length<=1)return t;const e=[];let r=[];return t.forEach(o=>{o[0]==="["?(e.push(...r.sort(),o),r=[]):r.push(o)}),e.push(...r.sort()),e}function fe(t){return{cache:ce(t.cacheSize),splitModifiers:de(t),...ne(t)}}const he=/\s+/;function ge(t,e){const{splitModifiers:r,getClassGroupId:o,getConflictingClassGroupIds:l}=e,n=new Set;return t.trim().split(he).map(i=>{const{modifiers:s,hasImportantModifier:a,baseClassName:f,maybePostfixModifierPosition:u}=r(i);let p=o(u?f.substring(0,u):f),h=!!u;if(!p){if(!u)return{isTailwindClass:!1,originalClassName:i};if(p=o(f),!p)return{isTailwindClass:!1,originalClassName:i};h=!1}const c=ue(s).join(":");return{isTailwindClass:!0,modifierId:a?c+P1:c,classGroupId:p,originalClassName:i,hasPostfixModifier:h}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:s,classGroupId:a,hasPostfixModifier:f}=i,u=s+a;return n.has(u)?!1:(n.add(u),l(a,f).forEach(p=>n.add(s+p)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function pe(){let t=0,e,r,o="";for(;tp(u),t());return r=fe(f),o=r.cache.get,l=r.cache.set,n=s,s(a)}function s(a){const f=o(a);if(f)return f;const u=ge(a,r);return l(a,u),u}return function(){return n(pe.apply(null,arguments))}}function w(t){const e=r=>r[t]||[];return e.isThemeGetter=!0,e}const N1=/^\[(?:([a-z-]+):)?(.+)\]$/i,me=/^\d+\/\d+$/,be=new Set(["px","full","screen"]),ve=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,we=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_e=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function z(t){return I(t)||be.has(t)||me.test(t)}function j(t){return R(t,"length",Se)}function I(t){return!!t&&!Number.isNaN(Number(t))}function a1(t){return R(t,"number",I)}function X(t){return!!t&&Number.isInteger(Number(t))}function xe(t){return t.endsWith("%")&&I(t.slice(0,-1))}function g(t){return N1.test(t)}function T(t){return ve.test(t)}const ke=new Set(["length","size","percentage"]);function Le(t){return R(t,ke,O1)}function Me(t){return R(t,"position",O1)}const Ve=new Set(["image","url"]);function ze(t){return R(t,Ve,je)}function Ze(t){return R(t,"",Ee)}function Y(){return!0}function R(t,e,r){const o=N1.exec(t);return o?o[1]?typeof e=="string"?o[1]===e:e.has(o[1]):r(o[2]):!1}function Se(t){return we.test(t)}function O1(){return!1}function Ee(t){return _e.test(t)}function je(t){return ye.test(t)}function Te(){const t=w("colors"),e=w("spacing"),r=w("blur"),o=w("brightness"),l=w("borderColor"),n=w("borderRadius"),i=w("borderSpacing"),s=w("borderWidth"),a=w("contrast"),f=w("grayscale"),u=w("hueRotate"),p=w("invert"),h=w("gap"),c=w("gradientColorStops"),b=w("gradientColorStopPositions"),d=w("inset"),C=w("margin"),_=w("opacity"),x=w("padding"),N=w("saturate"),V=w("scale"),O=w("sepia"),U=w("skew"),q=w("space"),W=w("translate"),M=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",g,e],v=()=>[g,e],n1=()=>["",z,j],m=()=>["auto",I,g],y1=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],i1=()=>["solid","dashed","dotted","double","none"],x1=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],h1=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",g],k1=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>[I,a1],l1=()=>[I,g];return{cacheSize:500,separator:":",theme:{colors:[Y],spacing:[z,j],blur:["none","",T,g],brightness:J(),borderColor:[t],borderRadius:["none","","full",T,g],borderSpacing:v(),borderWidth:n1(),contrast:J(),grayscale:F(),hueRotate:l1(),invert:F(),gap:v(),gradientColorStops:[t],gradientColorStopPositions:[xe,j],inset:D(),margin:D(),opacity:J(),padding:v(),saturate:J(),scale:J(),sepia:F(),skew:l1(),space:v(),translate:v()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[T]}],"break-after":[{"break-after":k1()}],"break-before":[{"break-before":k1()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...y1(),g]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[d]}],"inset-x":[{"inset-x":[d]}],"inset-y":[{"inset-y":[d]}],start:[{start:[d]}],end:[{end:[d]}],top:[{top:[d]}],right:[{right:[d]}],bottom:[{bottom:[d]}],left:[{left:[d]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",X,g]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",X,g]}],"grid-cols":[{"grid-cols":[Y]}],"col-start-end":[{col:["auto",{span:["full",X,g]},g]}],"col-start":[{"col-start":m()}],"col-end":[{"col-end":m()}],"grid-rows":[{"grid-rows":[Y]}],"row-start-end":[{row:["auto",{span:[X,g]},g]}],"row-start":[{"row-start":m()}],"row-end":[{"row-end":m()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...h1()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...h1(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...h1(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,e]}],"min-w":[{"min-w":[g,e,"min","max","fit"]}],"max-w":[{"max-w":[g,e,"none","full","min","max","fit","prose",{screen:[T]},T]}],h:[{h:[g,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,e,"auto","min","max","fit"]}],"font-size":[{text:["base",T,j]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",a1]}],"font-family":[{font:[Y]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",g]}],"line-clamp":[{"line-clamp":["none",I,a1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",z,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...i1(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",z,j]}],"underline-offset":[{"underline-offset":["auto",z,g]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...y1(),Me]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Le]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ze]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[c]}],"gradient-via":[{via:[c]}],"gradient-to":[{to:[c]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...i1(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:i1()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...i1()]}],"outline-offset":[{"outline-offset":[z,g]}],"outline-w":[{outline:[z,j]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:n1()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[z,j]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",T,Ze]}],"shadow-color":[{shadow:[Y]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":x1()}],"bg-blend":[{"bg-blend":x1()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",T,g]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",g]}],duration:[{duration:l1()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:l1()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[V]}],"scale-x":[{"scale-x":[V]}],"scale-y":[{"scale-y":[V]}],rotate:[{rotate:[X,g]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[z,j,a1]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const He=Ce(Te);function E1(t,...e){return t.length===1&&!e.length?t[0]:He(t.reduce((r,o,l)=>(r.push(o,e[l]),r),[]))}const Be=globalThis.requestAnimationFrame||(t=>setTimeout(t,16.66));function Ae(t,e){let r,o,l,n=Date.now()-(e||1);function i(){t.apply(o,l),r=0}function s(){t.apply(o,l),n=Date.now()}return e===void 0?function(...a){o=this,l=a,!r&&(r=Be(i))}:function(...a){o=this,l=a,clearTimeout(r),r=+setTimeout(s,e-(Date.now()-n))}}function zt(t,e=300){let r;return function(...o){clearTimeout(r),r=+setTimeout(()=>{t.apply(this,o)},e)}}const Zt=U1({x:NaN,y:NaN},t=>{const e=Ae(({x:r,y:o})=>t({x:r,y:o}));return globalThis.addEventListener?.("pointermove",e),globalThis.addEventListener?.("pointerdown",e),function(){globalThis.removeEventListener?.("pointermove",e),globalThis.removeEventListener?.("pointerdown",e)}});let _1=!1;const C1=t=>{_1&&t.preventDefault()},Ge=({target:t})=>{if(!t)return;const e=()=>{t.removeEventListener("touchend",e),t.removeEventListener("touchmove",C1),t.removeEventListener("touchcancel",e)};t.addEventListener("touchmove",C1,{passive:!1}),t.addEventListener("touchcancel",e,{once:!0}),t.addEventListener("touchend",e,{once:!0})};globalThis.addEventListener?.("touchmove",C1,{passive:!1});globalThis.addEventListener?.("touchstart",Ge,{passive:!0});function St(){_1=!0}function Et(){_1=!1}function Ie(t){let e,r,o;const l=t[5].default,n=e1(l,t,t[4],null);let i=[t[3],{class:r=E1`flex grow flex-col +import{r as U1}from"./paths.G112lh3q.js";import{s as $,w as e1,X as K,f as H,g as B,h as P,d as y,a2 as L1,i as E,x as t1,y as r1,z as o1,a3 as M1,L as q1,a4 as W1,a as m1,e as c1,c as b1,r as D1,u as Q,A as V1,v as F1,a1 as d1,E as k,C as G1,l as J1,m as X1,n as Y1,M as K1,a5 as Q1,j as L,Y as $1,G as z1,a6 as ee,a7 as te,k as s1}from"./scheduler.yhBzS9E6.js";import{S as u1,i as f1,a as Z,t as S,g as re,c as oe}from"./index.f7836kWu.js";function v1(t,e){const r={},o={},l={$$scope:1};let n=t.length;for(;n--;){const i=t[n],s=e[n];if(s){for(const a in i)a in s||(o[a]=1);for(const a in s)l[a]||(r[a]=s[a],l[a]=1);t[n]=s}else for(const a in i)l[a]=1}for(const i in o)i in r||(r[i]=void 0);return r}const A=globalThis;"DOMRect"in A||(A.DOMRect=class{constructor(t=0,e=0,r=0,o=0){this.x=t,this.y=e,this.width=r,this.height=o,this.top=e,this.bottom=e+o,this.left=t,this.right=t+r}bottom;right;left;top;toJSON(){return JSON.stringify(this)}});"ResizeObserver"in A||(A.ResizeObserver=function(){return{disconnect(){},observe(){},unobserve(){}}});"DragEvent"in A||(A.DragEvent=globalThis.MouseEvent);"TouchEvent"in A||(A.TouchEvent=function(){});globalThis.addEventListener?.("touchstart",()=>{},!1);const w1="-";function ne(t){const e=le(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=t;function l(i){const s=i.split(w1);return s[0]===""&&s.length!==1&&s.shift(),I1(s,e)||ie(i)}function n(i,s){const a=r[i]||[];return s&&o[i]?[...a,...o[i]]:a}return{getClassGroupId:l,getConflictingClassGroupIds:n}}function I1(t,e){if(t.length===0)return e.classGroupId;const r=t[0],o=e.nextPart.get(r),l=o?I1(t.slice(1),o):void 0;if(l)return l;if(e.validators.length===0)return;const n=t.join(w1);return e.validators.find(({validator:i})=>i(n))?.classGroupId}const Z1=/^\[(.+)\]$/;function ie(t){if(Z1.test(t)){const e=Z1.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}}function le(t){const{theme:e,prefix:r}=t,o={nextPart:new Map,validators:[]};return ae(Object.entries(t.classGroups),r).forEach(([n,i])=>{p1(i,o,n,e)}),o}function p1(t,e,r,o){t.forEach(l=>{if(typeof l=="string"){const n=l===""?e:S1(e,l);n.classGroupId=r;return}if(typeof l=="function"){if(se(l)){p1(l(o),e,r,o);return}e.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([n,i])=>{p1(i,S1(e,n),r,o)})})}function S1(t,e){let r=t;return e.split(w1).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r}function se(t){return t.isThemeGetter}function ae(t,e){return e?t.map(([r,o])=>{const l=o.map(n=>typeof n=="string"?e+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,s])=>[e+i,s])):n);return[r,l]}):t}function ce(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,o=new Map;function l(n,i){r.set(n,i),e++,e>t&&(e=0,o=r,r=new Map)}return{get(n){let i=r.get(n);if(i!==void 0)return i;if((i=o.get(n))!==void 0)return l(n,i),i},set(n,i){r.has(n)?r.set(n,i):l(n,i)}}}const P1="!";function de(t){const e=t.separator,r=e.length===1,o=e[0],l=e.length;return function(i){const s=[];let a=0,f=0,u;for(let d=0;df?u-f:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:c,maybePostfixModifierPosition:b}}}function ue(t){if(t.length<=1)return t;const e=[];let r=[];return t.forEach(o=>{o[0]==="["?(e.push(...r.sort(),o),r=[]):r.push(o)}),e.push(...r.sort()),e}function fe(t){return{cache:ce(t.cacheSize),splitModifiers:de(t),...ne(t)}}const he=/\s+/;function ge(t,e){const{splitModifiers:r,getClassGroupId:o,getConflictingClassGroupIds:l}=e,n=new Set;return t.trim().split(he).map(i=>{const{modifiers:s,hasImportantModifier:a,baseClassName:f,maybePostfixModifierPosition:u}=r(i);let p=o(u?f.substring(0,u):f),h=!!u;if(!p){if(!u)return{isTailwindClass:!1,originalClassName:i};if(p=o(f),!p)return{isTailwindClass:!1,originalClassName:i};h=!1}const c=ue(s).join(":");return{isTailwindClass:!0,modifierId:a?c+P1:c,classGroupId:p,originalClassName:i,hasPostfixModifier:h}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:s,classGroupId:a,hasPostfixModifier:f}=i,u=s+a;return n.has(u)?!1:(n.add(u),l(a,f).forEach(p=>n.add(s+p)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function pe(){let t=0,e,r,o="";for(;tp(u),t());return r=fe(f),o=r.cache.get,l=r.cache.set,n=s,s(a)}function s(a){const f=o(a);if(f)return f;const u=ge(a,r);return l(a,u),u}return function(){return n(pe.apply(null,arguments))}}function w(t){const e=r=>r[t]||[];return e.isThemeGetter=!0,e}const N1=/^\[(?:([a-z-]+):)?(.+)\]$/i,me=/^\d+\/\d+$/,be=new Set(["px","full","screen"]),ve=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,we=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_e=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function z(t){return I(t)||be.has(t)||me.test(t)}function j(t){return R(t,"length",Se)}function I(t){return!!t&&!Number.isNaN(Number(t))}function a1(t){return R(t,"number",I)}function X(t){return!!t&&Number.isInteger(Number(t))}function xe(t){return t.endsWith("%")&&I(t.slice(0,-1))}function g(t){return N1.test(t)}function T(t){return ve.test(t)}const ke=new Set(["length","size","percentage"]);function Le(t){return R(t,ke,O1)}function Me(t){return R(t,"position",O1)}const Ve=new Set(["image","url"]);function ze(t){return R(t,Ve,je)}function Ze(t){return R(t,"",Ee)}function Y(){return!0}function R(t,e,r){const o=N1.exec(t);return o?o[1]?typeof e=="string"?o[1]===e:e.has(o[1]):r(o[2]):!1}function Se(t){return we.test(t)}function O1(){return!1}function Ee(t){return _e.test(t)}function je(t){return ye.test(t)}function Te(){const t=w("colors"),e=w("spacing"),r=w("blur"),o=w("brightness"),l=w("borderColor"),n=w("borderRadius"),i=w("borderSpacing"),s=w("borderWidth"),a=w("contrast"),f=w("grayscale"),u=w("hueRotate"),p=w("invert"),h=w("gap"),c=w("gradientColorStops"),b=w("gradientColorStopPositions"),d=w("inset"),C=w("margin"),_=w("opacity"),x=w("padding"),N=w("saturate"),V=w("scale"),O=w("sepia"),U=w("skew"),q=w("space"),W=w("translate"),M=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",g,e],v=()=>[g,e],n1=()=>["",z,j],m=()=>["auto",I,g],y1=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],i1=()=>["solid","dashed","dotted","double","none"],x1=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],h1=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",g],k1=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>[I,a1],l1=()=>[I,g];return{cacheSize:500,separator:":",theme:{colors:[Y],spacing:[z,j],blur:["none","",T,g],brightness:J(),borderColor:[t],borderRadius:["none","","full",T,g],borderSpacing:v(),borderWidth:n1(),contrast:J(),grayscale:F(),hueRotate:l1(),invert:F(),gap:v(),gradientColorStops:[t],gradientColorStopPositions:[xe,j],inset:D(),margin:D(),opacity:J(),padding:v(),saturate:J(),scale:J(),sepia:F(),skew:l1(),space:v(),translate:v()},classGroups:{aspect:[{aspect:["auto","square","video",g]}],container:["container"],columns:[{columns:[T]}],"break-after":[{"break-after":k1()}],"break-before":[{"break-before":k1()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...y1(),g]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[d]}],"inset-x":[{"inset-x":[d]}],"inset-y":[{"inset-y":[d]}],start:[{start:[d]}],end:[{end:[d]}],top:[{top:[d]}],right:[{right:[d]}],bottom:[{bottom:[d]}],left:[{left:[d]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",X,g]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",g]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",X,g]}],"grid-cols":[{"grid-cols":[Y]}],"col-start-end":[{col:["auto",{span:["full",X,g]},g]}],"col-start":[{"col-start":m()}],"col-end":[{"col-end":m()}],"grid-rows":[{"grid-rows":[Y]}],"row-start-end":[{row:["auto",{span:[X,g]},g]}],"row-start":[{"row-start":m()}],"row-end":[{"row-end":m()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",g]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",g]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...h1()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...h1(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...h1(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",g,e]}],"min-w":[{"min-w":[g,e,"min","max","fit"]}],"max-w":[{"max-w":[g,e,"none","full","min","max","fit","prose",{screen:[T]},T]}],h:[{h:[g,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[g,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[g,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[g,e,"auto","min","max","fit"]}],"font-size":[{text:["base",T,j]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",a1]}],"font-family":[{font:[Y]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",g]}],"line-clamp":[{"line-clamp":["none",I,a1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",z,g]}],"list-image":[{"list-image":["none",g]}],"list-style-type":[{list:["none","disc","decimal",g]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...i1(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",z,j]}],"underline-offset":[{"underline-offset":["auto",z,g]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...y1(),Me]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Le]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ze]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[c]}],"gradient-via":[{via:[c]}],"gradient-to":[{to:[c]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...i1(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:i1()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...i1()]}],"outline-offset":[{"outline-offset":[z,g]}],"outline-w":[{outline:[z,j]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:n1()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[z,j]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",T,Ze]}],"shadow-color":[{shadow:[Y]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":x1()}],"bg-blend":[{"bg-blend":x1()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",T,g]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",g]}],duration:[{duration:l1()}],ease:[{ease:["linear","in","out","in-out",g]}],delay:[{delay:l1()}],animate:[{animate:["none","spin","ping","pulse","bounce",g]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[V]}],"scale-x":[{"scale-x":[V]}],"scale-y":[{"scale-y":[V]}],rotate:[{rotate:[X,g]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",g]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[z,j,a1]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const He=Ce(Te);function E1(t,...e){return t.length===1&&!e.length?t[0]:He(t.reduce((r,o,l)=>(r.push(o,e[l]),r),[]))}const Be=globalThis.requestAnimationFrame||(t=>setTimeout(t,16.66));function Ae(t,e){let r,o,l,n=Date.now()-(e||1);function i(){t.apply(o,l),r=0}function s(){t.apply(o,l),n=Date.now()}return e===void 0?function(...a){o=this,l=a,!r&&(r=Be(i))}:function(...a){o=this,l=a,clearTimeout(r),r=+setTimeout(s,e-(Date.now()-n))}}function zt(t,e=300){let r;return function(...o){clearTimeout(r),r=+setTimeout(()=>{t.apply(this,o)},e)}}const Zt=U1({x:NaN,y:NaN},t=>{const e=Ae(({x:r,y:o})=>t({x:r,y:o}));return globalThis.addEventListener?.("pointermove",e),globalThis.addEventListener?.("pointerdown",e),function(){globalThis.removeEventListener?.("pointermove",e),globalThis.removeEventListener?.("pointerdown",e)}});let _1=!1;const C1=t=>{_1&&t.preventDefault()},Ge=({target:t})=>{if(!t)return;const e=()=>{t.removeEventListener("touchend",e),t.removeEventListener("touchmove",C1),t.removeEventListener("touchcancel",e)};t.addEventListener("touchmove",C1,{passive:!1}),t.addEventListener("touchcancel",e,{once:!0}),t.addEventListener("touchend",e,{once:!0})};globalThis.addEventListener?.("touchmove",C1,{passive:!1});globalThis.addEventListener?.("touchstart",Ge,{passive:!0});function St(){_1=!0}function Et(){_1=!1}function Ie(t){let e,r,o;const l=t[5].default,n=e1(l,t,t[4],null);let i=[t[3],{class:r=E1`flex grow flex-col ${t[1]&&"flex-row"} ${t[2]&&"grid max-h-max max-w-max [&>*]:col-start-1 [&>*]:row-start-1"} ${t[0]}`}],s={};for(let a=0;a{e.delete(t.key)})}function update_keyed_each(t,e,r,n,s,a,u,d,f,y,b,w){let A=t.length,R=a.length,I=A;const h={};for(;I--;)h[t[I].key]=I;const N=[],m=new Map,E=new Map,v=[];for(I=R;I--;){const q=w(s,a,I),Y=r(q);let z=u.get(Y);z?n&&v.push(()=>z.p(q,e)):(z=y(Y,q),z.c()),m.set(Y,N[I]=z),Y in h&&E.set(Y,Math.abs(I-h[Y]))}const C=new Set,$=new Set;function T(q){transition_in(q,1),q.m(d,b),u.set(q.key,q),b=q.first,R--}for(;A&&R;){const q=N[R-1],Y=t[A-1],z=q.key,M=Y.key;q===Y?(b=q.first,A--,R--):m.has(M)?!u.has(z)||C.has(z)?T(q):$.has(M)?A--:E.get(z)>E.get(M)?($.add(z),T(q)):(C.add(M),A--):(f(Y,u),A--)}for(;A--;){const q=t[A];m.has(q.key)||f(q,u)}for(;R;)T(N[R-1]);return run_all(v),N}let observing=0,observer=null;const dispatch=t=>t.forEach(e=>{e.target?.dispatchEvent(new CustomEvent("resize",{detail:e}))});function resize(t){return observer||(observer=new ResizeObserver(dispatch)),observer.observe(t),observing+=1,{destroy(){observer?.unobserve(t),observing-=1,observing<=0&&(observer?.disconnect(),observer=null)}}}function drag(t,e="touchstart"){function r(u){do{if(u?.draggable)return u;u=u?.parentElement||null}while(u);return null}function n(u){const d=r(u.target);d&&(lock(),u.preventDefault(),d.dispatchEvent(new DragEvent("dragstart",{bubbles:!0})))}function s(u){u.preventDefault(),addEventListener("pointercancel",a),addEventListener("pointerup",a)}function a(){unlock(),removeEventListener("pointercancel",a),removeEventListener("pointerup",a),t.dispatchEvent(new DragEvent("dragend",{bubbles:!0}))}return t.addEventListener(e,n),t.addEventListener("dragstart",s),{destroy(){t.removeEventListener(e,n),t.removeEventListener("dragstart",s)}}}function hold(t,{touch:e=!0,mouse:r=!1,duration:n=300}={}){function s(a){const u=setTimeout(()=>{d();const f=a instanceof TouchEvent?TouchEvent:MouseEvent;a.target?.dispatchEvent(new f("hold",a))},n),d=()=>{clearTimeout(u),e&&(t.removeEventListener("touchcancel",d),t.removeEventListener("touchmove",d),t.removeEventListener("touchend",d)),r&&(t.removeEventListener("mousemove",d),t.removeEventListener("mouseup",d))};e&&(t.addEventListener("touchcancel",d,{once:!0}),t.addEventListener("touchend",d,{once:!0}),t.addEventListener("touchmove",d,{once:!0,passive:!0})),r&&(t.addEventListener("mousemove",d,{once:!0}),t.addEventListener("mouseup",d,{once:!0}))}return e&&t.addEventListener("touchstart",s,{passive:!0}),r&&t.addEventListener("mousedown",s),{destroy(){t.removeEventListener("touchstart",s),t.removeEventListener("mousedown",s)}}}function create_fragment$7(t){let e,r,n;const s=t[6].default,a=create_slot(s,t,t[5],null);return{c(){e=element("div"),a&&a.c(),this.h()},l(u){e=claim_element(u,"DIV",{class:!0});var d=children(e);a&&a.l(d),d.forEach(detach),this.h()},h(){attr(e,"class",r=t[0]?"contents":"hidden"),toggle_class(e,"sm:contents",!t[0]&&t[1]),toggle_class(e,"md:contents",!t[0]&&t[2]),toggle_class(e,"lg:contents",!t[0]&&t[3]),toggle_class(e,"xl:contents",!t[0]&&t[4]),toggle_class(e,"sm:hidden",t[0]&&t[1]),toggle_class(e,"md:hidden",t[0]&&t[2]),toggle_class(e,"lg:hidden",t[0]&&t[3]),toggle_class(e,"xl:hidden",t[0]&&t[4])},m(u,d){insert_hydration(u,e,d),a&&a.m(e,null),n=!0},p(u,[d]){a&&a.p&&(!n||d&32)&&update_slot_base(a,s,u,u[5],n?get_slot_changes(s,u[5],d,null):get_all_dirty_from_scope(u[5]),null),(!n||d&1&&r!==(r=u[0]?"contents":"hidden"))&&attr(e,"class",r),(!n||d&3)&&toggle_class(e,"sm:contents",!u[0]&&u[1]),(!n||d&5)&&toggle_class(e,"md:contents",!u[0]&&u[2]),(!n||d&9)&&toggle_class(e,"lg:contents",!u[0]&&u[3]),(!n||d&17)&&toggle_class(e,"xl:contents",!u[0]&&u[4]),(!n||d&3)&&toggle_class(e,"sm:hidden",u[0]&&u[1]),(!n||d&5)&&toggle_class(e,"md:hidden",u[0]&&u[2]),(!n||d&9)&&toggle_class(e,"lg:hidden",u[0]&&u[3]),(!n||d&17)&&toggle_class(e,"xl:hidden",u[0]&&u[4])},i(u){n||(transition_in(a,u),n=!0)},o(u){transition_out(a,u),n=!1},d(u){u&&detach(e),a&&a.d(u)}}}function instance$8(t,e,r){let{$$slots:n={},$$scope:s}=e,{not:a=!1}=e,{sm:u=!1}=e,{md:d=!1}=e,{lg:f=!1}=e,{xl:y=!1}=e;return t.$$set=b=>{"not"in b&&r(0,a=b.not),"sm"in b&&r(1,u=b.sm),"md"in b&&r(2,d=b.md),"lg"in b&&r(3,f=b.lg),"xl"in b&&r(4,y=b.xl),"$$scope"in b&&r(5,s=b.$$scope)},[a,u,d,f,y,s,n]}class When extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$8,create_fragment$7,safe_not_equal,{not:0,sm:1,md:2,lg:3,xl:4})}}function create_fragment$6(t){let e;const r=t[1].default,n=create_slot(r,t,t[0],null);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,[a]){n&&n.p&&(!e||a&1)&&update_slot_base(n,r,s,s[0],e?get_slot_changes(r,s[0],a,null):get_all_dirty_from_scope(s[0]),null)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}const initRealm=()=>({ssr:"",claimed:new Set,mounted:new Set,claim:new Set,destroy:new Set,mount:new Set,target:void 0});function instance$7(t,e,r){let{$$slots:n={},$$scope:s}=e;return setContext("realm",{}),t.$$set=u=>{"$$scope"in u&&r(0,s=u.$$scope)},[s,n]}class Realm extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$7,create_fragment$6,safe_not_equal,{})}}function create_key_block(t){let e;const r=t[4].default,n=create_slot(r,t,t[3],null);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,a){n&&n.p&&(!e||a&8)&&update_slot_base(n,r,s,s[3],e?get_slot_changes(r,s[3],a,null):get_all_dirty_from_scope(s[3]),null)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}function create_fragment$5(t){let e=t[0],r,n,s=create_key_block(t);return{c(){s.c(),r=empty$1()},l(a){s.l(a),r=empty$1()},m(a,u){s.m(a,u),insert_hydration(a,r,u),n=!0},p(a,[u]){u&1&&safe_not_equal(e,e=a[0])?(group_outros(),transition_out(s,1,1,noop$2),check_outros(),s=create_key_block(a),s.c(),transition_in(s,1),s.m(r.parentNode,r)):s.p(a,u)},i(a){n||(transition_in(s),n=!0)},o(a){transition_out(s),n=!1},d(a){a&&detach(r),s.d(a)}}}function instance$6($$self,$$props,$$invalidate){let{$$slots:slots={},$$scope}=$$props,{to=""}=$$props,{unique=""}=$$props;const realm=getContext("realm");if(!realm)throw new Error("A portal should exists within a realm!");realm[to]||(realm[to]=initRealm());const target=eval("slots");if(target.default){const[t]=target.default;target.default[0]=(...e)=>{const r=t(...e),n=realm[to];let s=!0,a=!0;function u(y){if(!y||n.claimed.has(unique))return a=!1;r.l(y),unique&&n.claimed.add(unique)}function d(y,b){if(n.mounted.has(unique))return s=!1;a&&r.m(y,b),unique&&n.mounted.add(unique)}function f(y){s&&n.mounted.delete(unique),a&&n.claimed.delete(unique),s&&r.d(y),n.claim.delete(u),n.mount.delete(d),n.destroy.delete(f)}return n.claim.add(u),n.mount.add(d),n.destroy.add(f),{...r,d:f,l:()=>{},m:()=>n.target&&d.apply(null,n.target)}}}return $$self.$$set=t=>{"to"in t&&$$invalidate(0,to=t.to),"unique"in t&&$$invalidate(1,unique=t.unique),"$$scope"in t&&$$invalidate(3,$$scope=t.$$scope)},$$self.$$.update=()=>{$$self.$$.dirty&5&&(realm[to]||$$invalidate(2,realm[to]=initRealm(),realm))},[to,unique,realm,$$scope,slots]}class Portal extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$6,create_fragment$5,safe_not_equal,{to:0,unique:1})}}function minmax(t,e,r,n){return tr?n??r:t}const{Map:Map_1,window:window_1}=globals,get_default_slot_changes_1=t=>({item:t[0]&2048}),get_default_slot_context_1=t=>({item:t[11].data,index:NaN});function get_each_context(t,e,r){const n=t.slice();return n[52]=e[r],n[54]=r,n}const get_default_slot_changes$1=t=>({item:t[0]&16384,index:t[0]&16640}),get_default_slot_context$1=t=>({item:t[52],index:t[8]+t[54]});function create_each_block(t,e){let r,n,s,a;const u=e[40].default,d=create_slot(u,e,e[42],get_default_slot_context$1);return{key:t,first:null,c(){r=element("div"),d&&d.c(),n=space(),this.h()},l(f){r=claim_element(f,"DIV",{draggable:!0,style:!0});var y=children(r);d&&d.l(y),n=claim_space(y),y.forEach(detach),this.h()},h(){attr(r,"draggable",s=e[2]&&e[1](e[52])!=null?"true":void 0),set_style(r,"overflow-anchor","none"),toggle_class(r,"invisible",e[11]?.owner===e[3]&&e[11]?.key===e[1](e[52])),this.first=r},m(f,y){insert_hydration(f,r,y),d&&d.m(r,null),append_hydration(r,n),a=!0},p(f,y){e=f,d&&d.p&&(!a||y[0]&16640|y[1]&2048)&&update_slot_base(d,u,e,e[42],a?get_slot_changes(u,e[42],y,get_default_slot_changes$1):get_all_dirty_from_scope(e[42]),get_default_slot_context$1),(!a||y[0]&16390&&s!==(s=e[2]&&e[1](e[52])!=null?"true":void 0))&&attr(r,"draggable",s),(!a||y[0]&18442)&&toggle_class(r,"invisible",e[11]?.owner===e[3]&&e[11]?.key===e[1](e[52]))},i(f){a||(transition_in(d,f),a=!0)},o(f){transition_out(d,f),a=!1},d(f){f&&detach(r),d&&d.d(f)}}}function create_if_block$3(t){let e,r;return e=new Portal({props:{to:"overlay",$$slots:{default:[create_default_slot$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s[0]&2297|s[1]&2048&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_if_block_1$2(t){let e,r=`translate3d( +import{T as run_all,s as safe_not_equal,w as create_slot,f as element,g as claim_element,h as children,d as detach,j as attr,E as toggle_class,i as insert_hydration,x as update_slot_base,y as get_all_dirty_from_scope,z as get_slot_changes,L as setContext,e as empty$1,G as noop$2,A as getContext,a as space,c as claim_space,k as set_style,u as append_hydration,C as listen,J as action_destroyer,v as component_subscribe,W as createEventDispatcher,o as onMount,t as tick,F as set_store_value,p as binding_callbacks,H as compute_slots,X as assign$1,a1 as set_dynamic_element_data,M as bubble,a0 as src_url_equal,O as get_store_value,l as text,m as claim_text,n as set_data}from"./scheduler.yhBzS9E6.js";import{t as transition_out,a as transition_in,S as SvelteComponent,i as init$1,g as group_outros,c as check_outros,b as create_component,d as claim_component,m as mount_component,e as destroy_component}from"./index.f7836kWu.js";import{w as writable,d as derived}from"./paths.G112lh3q.js";import{l as lock,b as unlock,a as getScrollParent,p as position$1,I as Icon,g as get_spread_update}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";const globals=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function ensure_array_like(t){return t?.length!==void 0?t:Array.from(t)}function outro_and_destroy_block(t,e){transition_out(t,1,1,()=>{e.delete(t.key)})}function update_keyed_each(t,e,r,n,s,a,u,d,f,N,b,w){let A=t.length,R=a.length,S=A;const h={};for(;S--;)h[t[S].key]=S;const y=[],m=new Map,E=new Map,v=[];for(S=R;S--;){const q=w(s,a,S),$=r(q);let U=u.get($);U?n&&v.push(()=>U.p(q,e)):(U=N($,q),U.c()),m.set($,y[S]=U),$ in h&&E.set($,Math.abs(S-h[$]))}const C=new Set,V=new Set;function T(q){transition_in(q,1),q.m(d,b),u.set(q.key,q),b=q.first,R--}for(;A&&R;){const q=y[R-1],$=t[A-1],U=q.key,M=$.key;q===$?(b=q.first,A--,R--):m.has(M)?!u.has(U)||C.has(U)?T(q):V.has(M)?A--:E.get(U)>E.get(M)?(V.add(U),T(q)):(C.add(M),A--):(f($,u),A--)}for(;A--;){const q=t[A];m.has(q.key)||f(q,u)}for(;R;)T(y[R-1]);return run_all(v),y}let observing=0,observer=null;const dispatch=t=>t.forEach(e=>{e.target?.dispatchEvent(new CustomEvent("resize",{detail:e}))});function resize(t){return observer||(observer=new ResizeObserver(dispatch)),observer.observe(t),observing+=1,{destroy(){observer?.unobserve(t),observing-=1,observing<=0&&(observer?.disconnect(),observer=null)}}}function drag(t,e="touchstart"){function r(u){do{if(u?.draggable)return u;u=u?.parentElement||null}while(u);return null}function n(u){const d=r(u.target);d&&(lock(),u.preventDefault(),d.dispatchEvent(new DragEvent("dragstart",{bubbles:!0})))}function s(u){u.preventDefault(),addEventListener("pointercancel",a),addEventListener("pointerup",a)}function a(){unlock(),removeEventListener("pointercancel",a),removeEventListener("pointerup",a),t.dispatchEvent(new DragEvent("dragend",{bubbles:!0}))}return t.addEventListener(e,n),t.addEventListener("dragstart",s),{destroy(){t.removeEventListener(e,n),t.removeEventListener("dragstart",s)}}}function hold(t,{touch:e=!0,mouse:r=!1,duration:n=300}={}){function s(a){const u=setTimeout(()=>{d();const f=a instanceof TouchEvent?TouchEvent:MouseEvent;a.target?.dispatchEvent(new f("hold",a))},n),d=()=>{clearTimeout(u),e&&(t.removeEventListener("touchcancel",d),t.removeEventListener("touchmove",d),t.removeEventListener("touchend",d)),r&&(t.removeEventListener("mousemove",d),t.removeEventListener("mouseup",d))};e&&(t.addEventListener("touchcancel",d,{once:!0}),t.addEventListener("touchend",d,{once:!0}),t.addEventListener("touchmove",d,{once:!0,passive:!0})),r&&(t.addEventListener("mousemove",d,{once:!0}),t.addEventListener("mouseup",d,{once:!0}))}return e&&t.addEventListener("touchstart",s,{passive:!0}),r&&t.addEventListener("mousedown",s),{destroy(){t.removeEventListener("touchstart",s),t.removeEventListener("mousedown",s)}}}function create_fragment$7(t){let e,r,n;const s=t[6].default,a=create_slot(s,t,t[5],null);return{c(){e=element("div"),a&&a.c(),this.h()},l(u){e=claim_element(u,"DIV",{class:!0});var d=children(e);a&&a.l(d),d.forEach(detach),this.h()},h(){attr(e,"class",r=t[0]?"contents":"hidden"),toggle_class(e,"sm:contents",!t[0]&&t[1]),toggle_class(e,"md:contents",!t[0]&&t[2]),toggle_class(e,"lg:contents",!t[0]&&t[3]),toggle_class(e,"xl:contents",!t[0]&&t[4]),toggle_class(e,"sm:hidden",t[0]&&t[1]),toggle_class(e,"md:hidden",t[0]&&t[2]),toggle_class(e,"lg:hidden",t[0]&&t[3]),toggle_class(e,"xl:hidden",t[0]&&t[4])},m(u,d){insert_hydration(u,e,d),a&&a.m(e,null),n=!0},p(u,[d]){a&&a.p&&(!n||d&32)&&update_slot_base(a,s,u,u[5],n?get_slot_changes(s,u[5],d,null):get_all_dirty_from_scope(u[5]),null),(!n||d&1&&r!==(r=u[0]?"contents":"hidden"))&&attr(e,"class",r),(!n||d&3)&&toggle_class(e,"sm:contents",!u[0]&&u[1]),(!n||d&5)&&toggle_class(e,"md:contents",!u[0]&&u[2]),(!n||d&9)&&toggle_class(e,"lg:contents",!u[0]&&u[3]),(!n||d&17)&&toggle_class(e,"xl:contents",!u[0]&&u[4]),(!n||d&3)&&toggle_class(e,"sm:hidden",u[0]&&u[1]),(!n||d&5)&&toggle_class(e,"md:hidden",u[0]&&u[2]),(!n||d&9)&&toggle_class(e,"lg:hidden",u[0]&&u[3]),(!n||d&17)&&toggle_class(e,"xl:hidden",u[0]&&u[4])},i(u){n||(transition_in(a,u),n=!0)},o(u){transition_out(a,u),n=!1},d(u){u&&detach(e),a&&a.d(u)}}}function instance$8(t,e,r){let{$$slots:n={},$$scope:s}=e,{not:a=!1}=e,{sm:u=!1}=e,{md:d=!1}=e,{lg:f=!1}=e,{xl:N=!1}=e;return t.$$set=b=>{"not"in b&&r(0,a=b.not),"sm"in b&&r(1,u=b.sm),"md"in b&&r(2,d=b.md),"lg"in b&&r(3,f=b.lg),"xl"in b&&r(4,N=b.xl),"$$scope"in b&&r(5,s=b.$$scope)},[a,u,d,f,N,s,n]}class When extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$8,create_fragment$7,safe_not_equal,{not:0,sm:1,md:2,lg:3,xl:4})}}function create_fragment$6(t){let e;const r=t[1].default,n=create_slot(r,t,t[0],null);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,[a]){n&&n.p&&(!e||a&1)&&update_slot_base(n,r,s,s[0],e?get_slot_changes(r,s[0],a,null):get_all_dirty_from_scope(s[0]),null)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}const initRealm=()=>({ssr:"",claimed:new Set,mounted:new Set,claim:new Set,destroy:new Set,mount:new Set,target:void 0});function instance$7(t,e,r){let{$$slots:n={},$$scope:s}=e;return setContext("realm",{}),t.$$set=u=>{"$$scope"in u&&r(0,s=u.$$scope)},[s,n]}class Realm extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$7,create_fragment$6,safe_not_equal,{})}}function create_key_block(t){let e;const r=t[4].default,n=create_slot(r,t,t[3],null);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,a){n&&n.p&&(!e||a&8)&&update_slot_base(n,r,s,s[3],e?get_slot_changes(r,s[3],a,null):get_all_dirty_from_scope(s[3]),null)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}function create_fragment$5(t){let e=t[0],r,n,s=create_key_block(t);return{c(){s.c(),r=empty$1()},l(a){s.l(a),r=empty$1()},m(a,u){s.m(a,u),insert_hydration(a,r,u),n=!0},p(a,[u]){u&1&&safe_not_equal(e,e=a[0])?(group_outros(),transition_out(s,1,1,noop$2),check_outros(),s=create_key_block(a),s.c(),transition_in(s,1),s.m(r.parentNode,r)):s.p(a,u)},i(a){n||(transition_in(s),n=!0)},o(a){transition_out(s),n=!1},d(a){a&&detach(r),s.d(a)}}}function instance$6($$self,$$props,$$invalidate){let{$$slots:slots={},$$scope}=$$props,{to=""}=$$props,{unique=""}=$$props;const realm=getContext("realm");if(!realm)throw new Error("A portal should exists within a realm!");realm[to]||(realm[to]=initRealm());const target=eval("slots");if(target.default){const[t]=target.default;target.default[0]=(...e)=>{const r=t(...e),n=realm[to];let s=!0,a=!0;function u(N){if(!N||n.claimed.has(unique))return a=!1;r.l(N),unique&&n.claimed.add(unique)}function d(N,b){if(n.mounted.has(unique))return s=!1;a&&r.m(N,b),unique&&n.mounted.add(unique)}function f(N){s&&n.mounted.delete(unique),a&&n.claimed.delete(unique),s&&r.d(N),n.claim.delete(u),n.mount.delete(d),n.destroy.delete(f)}return n.claim.add(u),n.mount.add(d),n.destroy.add(f),{...r,d:f,l:()=>{},m:()=>n.target&&d.apply(null,n.target)}}}return $$self.$$set=t=>{"to"in t&&$$invalidate(0,to=t.to),"unique"in t&&$$invalidate(1,unique=t.unique),"$$scope"in t&&$$invalidate(3,$$scope=t.$$scope)},$$self.$$.update=()=>{$$self.$$.dirty&5&&(realm[to]||$$invalidate(2,realm[to]=initRealm(),realm))},[to,unique,realm,$$scope,slots]}class Portal extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$6,create_fragment$5,safe_not_equal,{to:0,unique:1})}}function minmax(t,e,r,n){return tr?n??r:t}const{Map:Map_1,window:window_1}=globals,get_default_slot_changes_1=t=>({item:t[0]&2048}),get_default_slot_context_1=t=>({item:t[11].data,index:NaN});function get_each_context(t,e,r){const n=t.slice();return n[52]=e[r],n[54]=r,n}const get_default_slot_changes$1=t=>({item:t[0]&16384,index:t[0]&16640}),get_default_slot_context$1=t=>({item:t[52],index:t[8]+t[54]});function create_each_block(t,e){let r,n,s,a;const u=e[40].default,d=create_slot(u,e,e[42],get_default_slot_context$1);return{key:t,first:null,c(){r=element("div"),d&&d.c(),n=space(),this.h()},l(f){r=claim_element(f,"DIV",{draggable:!0,style:!0});var N=children(r);d&&d.l(N),n=claim_space(N),N.forEach(detach),this.h()},h(){attr(r,"draggable",s=e[2]&&e[1](e[52])!=null?"true":void 0),set_style(r,"overflow-anchor","none"),toggle_class(r,"invisible",e[11]?.owner===e[3]&&e[11]?.key===e[1](e[52])),this.first=r},m(f,N){insert_hydration(f,r,N),d&&d.m(r,null),append_hydration(r,n),a=!0},p(f,N){e=f,d&&d.p&&(!a||N[0]&16640|N[1]&2048)&&update_slot_base(d,u,e,e[42],a?get_slot_changes(u,e[42],N,get_default_slot_changes$1):get_all_dirty_from_scope(e[42]),get_default_slot_context$1),(!a||N[0]&16390&&s!==(s=e[2]&&e[1](e[52])!=null?"true":void 0))&&attr(r,"draggable",s),(!a||N[0]&18442)&&toggle_class(r,"invisible",e[11]?.owner===e[3]&&e[11]?.key===e[1](e[52]))},i(f){a||(transition_in(d,f),a=!0)},o(f){transition_out(d,f),a=!1},d(f){f&&detach(r),d&&d.d(f)}}}function create_if_block$3(t){let e,r;return e=new Portal({props:{to:"overlay",$$slots:{default:[create_default_slot$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s[0]&2297|s[1]&2048&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_if_block_1$2(t){let e,r=`translate3d( ${t[11].back?t[11].back.x:t[7].x+Math.max(t[11].offset.x,-t[4].width/t[6]+t[0])}px, - ${t[11].back?t[11].back.y:t[7].y+Math.max(t[11].offset.y,-t[5]+t[0])}px, 0)`,n=`${t[4].width/t[6]-t[0]}px`,s=`${t[5]-t[0]}px`,a;const u=t[40].default,d=create_slot(u,t,t[42],get_default_slot_context_1);return{c(){e=element("div"),d&&d.c(),this.h()},l(f){e=claim_element(f,"DIV",{class:!0});var y=children(e);d&&d.l(y),y.forEach(detach),this.h()},h(){attr(e,"class","absolute will-change-transform contain-[size_layout]"),toggle_class(e,"transition-transform",t[11].back),set_style(e,"transform",r),set_style(e,"width",n),set_style(e,"height",s)},m(f,y){insert_hydration(f,e,y),d&&d.m(e,null),a=!0},p(f,y){d&&d.p&&(!a||y[0]&2048|y[1]&2048)&&update_slot_base(d,u,f,f[42],a?get_slot_changes(u,f[42],y,get_default_slot_changes_1):get_all_dirty_from_scope(f[42]),get_default_slot_context_1),(!a||y[0]&2048)&&toggle_class(e,"transition-transform",f[11].back),y[0]&2289&&r!==(r=`translate3d( + ${t[11].back?t[11].back.y:t[7].y+Math.max(t[11].offset.y,-t[5]+t[0])}px, 0)`,n=`${t[4].width/t[6]-t[0]}px`,s=`${t[5]-t[0]}px`,a;const u=t[40].default,d=create_slot(u,t,t[42],get_default_slot_context_1);return{c(){e=element("div"),d&&d.c(),this.h()},l(f){e=claim_element(f,"DIV",{class:!0});var N=children(e);d&&d.l(N),N.forEach(detach),this.h()},h(){attr(e,"class","absolute will-change-transform contain-[size_layout]"),toggle_class(e,"transition-transform",t[11].back),set_style(e,"transform",r),set_style(e,"width",n),set_style(e,"height",s)},m(f,N){insert_hydration(f,e,N),d&&d.m(e,null),a=!0},p(f,N){d&&d.p&&(!a||N[0]&2048|N[1]&2048)&&update_slot_base(d,u,f,f[42],a?get_slot_changes(u,f[42],N,get_default_slot_changes_1):get_all_dirty_from_scope(f[42]),get_default_slot_context_1),(!a||N[0]&2048)&&toggle_class(e,"transition-transform",f[11].back),N[0]&2289&&r!==(r=`translate3d( ${f[11].back?f[11].back.x:f[7].x+Math.max(f[11].offset.x,-f[4].width/f[6]+f[0])}px, - ${f[11].back?f[11].back.y:f[7].y+Math.max(f[11].offset.y,-f[5]+f[0])}px, 0)`)&&set_style(e,"transform",r),y[0]&81&&n!==(n=`${f[4].width/f[6]-f[0]}px`)&&set_style(e,"width",n),y[0]&33&&s!==(s=`${f[5]-f[0]}px`)&&set_style(e,"height",s)},i(f){a||(transition_in(d,f),a=!0)},o(f){transition_out(d,f),a=!1},d(f){f&&detach(e),d&&d.d(f)}}}function create_default_slot$1(t){let e,r,n=t[11]?.owner===t[3]&&create_if_block_1$2(t);return{c(){n&&n.c(),e=empty$1()},l(s){n&&n.l(s),e=empty$1()},m(s,a){n&&n.m(s,a),insert_hydration(s,e,a),r=!0},p(s,a){s[11]?.owner===s[3]?n?(n.p(s,a),a[0]&2056&&transition_in(n,1)):(n=create_if_block_1$2(s),n.c(),transition_in(n,1),n.m(e.parentNode,e)):n&&(group_outros(),transition_out(n,1,1,()=>{n=null}),check_outros())},i(s){r||(transition_in(n),r=!0)},o(s){transition_out(n),r=!1},d(s){s&&detach(e),n&&n.d(s)}}}function create_fragment$4(t){let e,r,n=[],s=new Map_1,a=`translate3d(0,${Math.ceil(t[8]/t[6])*t[5]}px,0)`,u=`${t[0]}px`,d,f=`${t[10]}px`,y,b,w,A=ensure_array_like(t[14]);const R=h=>h[12][(h[8]+h[54])%h[9]]??h[54];for(let h=0;h{I=null}),check_outros()),N[0]&1024&&f!==(f=`${h[10]}px`)&&set_style(e,"height",f)},i(h){if(!y){for(let N=0;Nr(11,T=Q));let{$$slots:q={},$$scope:Y}=e;const z=createEventDispatcher();let{gap:M=0}=e,{items:W}=e,{move:V=!1}=e,{fixed:ae=!1}=e,{overthrow:G=1}=e,{prerender:me=1}=e,{columns:Oe=1}=e,{key:P=Q=>Q}=e,{animate:J=!1}=e,{sortable:te=!1}=e,{container:le=void 0}=e,X=null,ye={x:0,y:0},ge=new DOMRect,be=new DOMRect,ke=!0,Ae=1,U=0,ne=0;function He(Q){!A&&Q.length&&tick().then(se);const Z=new Map,oe=Array.from({length:b}),Ne=new Set(w);for(let ue=0;ue=f))continue;const Te=A?.get(We);if(Te==null||Te=f||(oe[ue%b]=w[Te%b],Ne.delete(w[Te%b]),Te===ue||!J)||T?.owner===X&&We===T?.key)continue;const at=~~(Te/U)-~~(ue/U),lt=~~(Te%U)-~~(ue%U);Pe(Te,lt,at)}const he=[...Ne];return r(12,w=oe.map(ue=>ue??he.shift())),Z}function Pe(Q,Z,oe){const Ne=X?.children.item(Q-d),he=[`translate3d(${Z*100}%,${oe*100}%,0)`,"translate3d(0,0,0)"];Ne?.animate({transform:he,zIndex:["100","100"]},{easing:"ease",composite:"accumulate",duration:R})}function se(){if(!le||!X)return;r(4,be=X.parentElement?.getBoundingClientRect()),r(26,ge=le.getBoundingClientRect()),r(4,be.y+=ye.y,be),r(28,ne=be.y-ge.y-ge.height/2),r(4,be.width+=M,be);const Q=X.firstElementChild;if(!Q)return;const{width:Z,height:oe}=Q.getBoundingClientRect();!Z||!oe||(r(6,U=~~(be.width/(Z+M))),r(5,Ae=oe+M))}let de,Ce,j={x:0,y:0};async function je({target:Q}){if(se(),await tick(),!te||!X||!Q||T||Q.parentElement!==X||W[$]==null||P(W[$])==null)return;Ce=$,de=V?-1:Ce;const Z=Q.getBoundingClientRect();Z.x-=j.x,Z.y-=j.y,set_store_value(transfer,T={group:te===!0?X:te,key:P(W[$]),data:W[$],owner:X,offset:Z},T)}function Se(Q,Z=!1){if(!te||!T||ae||P(W[Q])==null)return;if(!Number.isInteger(Q)){de!=null&&T.owner!==X&&(Se(de,!0),de=void 0);return}if(P(W[Q])===T.key)return;Q<0&&!W.length&&(Q=0);const oe=W.findIndex(Ne=>P(Ne)===T?.key);oe!==Q&&(!Z&&de==null&&(de=oe,Ce=oe),~oe&&W.splice(oe,1),~Q&&W.splice(Q,0,T.data),requestAnimationFrame(()=>r(17,W))),!Z&&X&&set_store_value(transfer,T.owner=X,T)}async function ot(){if(!te||!T||Ce==null)return;const Q=W.findIndex(Z=>P(Z)===T?.key);if(T.owner===X&&~Q){const Z=X.children.item(Q-d);Z&&(set_store_value(transfer,T.back=Z.getBoundingClientRect(),T),set_store_value(transfer,T.group=Math.random().toString(),T),await new Promise(oe=>setTimeout(oe,150)))}if(Ce!==Q){const Z=T.data,oe=W[Q-1],Ne=(+!!~Ce<<1)+ +!!~Q,he=[void 0,"push","purge","rearrange"][Ne];he&&z("edit",{action:he,index:Q,after:oe,item:Z})}Ce=void 0,de=void 0,T.owner===X&&set_store_value(transfer,T=null,T)}onMount(()=>{function Q(Ne){const he=Ne.currentTarget;r(25,ye.x=he.scrollLeft,ye),r(25,ye.y=he.scrollTop,ye)}le||r(18,le=getScrollParent(X));const Z=te&&position$1.subscribe(Ne=>r(7,j=Ne));le.addEventListener("scroll",Q,{passive:!0}),le.addEventListener("resize",se);const{destroy:oe}=resize(le);return r(27,ke=!1),()=>{le?.removeEventListener("scroll",Q),le?.removeEventListener("resize",se),Z&&Z(),oe()}});function ze(Q){binding_callbacks[Q?"unshift":"push"](()=>{X=Q,r(3,X)})}return t.$$set=Q=>{"gap"in Q&&r(0,M=Q.gap),"items"in Q&&r(17,W=Q.items),"move"in Q&&r(19,V=Q.move),"fixed"in Q&&r(20,ae=Q.fixed),"overthrow"in Q&&r(21,G=Q.overthrow),"prerender"in Q&&r(22,me=Q.prerender),"columns"in Q&&r(23,Oe=Q.columns),"key"in Q&&r(1,P=Q.key),"animate"in Q&&r(24,J=Q.animate),"sortable"in Q&&r(2,te=Q.sortable),"container"in Q&&r(18,le=Q.container),"$$scope"in Q&&r(42,Y=Q.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&67108960&&r(38,n=Math.ceil(ge.height/Ae)*U),t.$$.dirty[0]&96|t.$$.dirty[1]&128&&r(39,s=n/U*Ae),t.$$.dirty[0]&131072|t.$$.dirty[1]&128&&r(36,a=Math.max(Math.ceil(W.length/n)-2,1)),t.$$.dirty[0]&301989888|t.$$.dirty[1]&288&&r(37,u=minmax(~~((ye.y-ne)/s),1,a)),t.$$.dirty[0]&2097152|t.$$.dirty[1]&192&&r(8,d=Math.max(u-G,0)*n),t.$$.dirty[0]&6291456|t.$$.dirty[1]&192&&r(35,f=Math.max((u+G+1)*n,me)),t.$$.dirty[0]&131328|t.$$.dirty[1]&16&&r(14,y=W.slice(d,f)),t.$$.dirty[0]&2097152|t.$$.dirty[1]&128&&r(9,b=(G*2+1)*n),t.$$.dirty[0]&512&&r(12,w=Array.from({length:b}).map((Q,Z)=>Z)),t.$$.dirty[0]&131072&&(A=He(W)),t.$$.dirty[0]&16777216&&(R=J===!0?300:J||0),t.$$.dirty[0]&131169&&r(10,I=Math.ceil(W.length/U)*Ae-M),t.$$.dirty[0]&8388608&&r(13,h=Number.isInteger(Oe)?`repeat(${Oe},1fr)`:`repeat(auto-fill,minmax(min(100%,${Oe}),1fr))`),t.$$.dirty[0]&1024&&Number.isFinite(I)&&(requestAnimationFrame(se),r(27,ke=!1)),t.$$.dirty[0]&134217728|t.$$.dirty[1]&96&&!ke&&u===a&&(z("end"),r(27,ke=!0)),t.$$.dirty[0]&12&&r(30,N=te===!0?X:te),t.$$.dirty[0]&100663441&&r(34,m=minmax(j.y+M/2,ge.top,ge.bottom,NaN)+ye.y-be.y),t.$$.dirty[0]&33554577&&r(33,E=minmax(j.x+M/2,be.left,be.right-M-1,NaN)+ye.x-be.x),t.$$.dirty[0]&32|t.$$.dirty[1]&8&&r(32,v=Math.floor(m/Ae)),t.$$.dirty[0]&80|t.$$.dirty[1]&4&&r(31,C=Math.floor(E/(be.width/U))),t.$$.dirty[0]&131136|t.$$.dirty[1]&3&&r(29,$=minmax(v*U+C,0,W.length-1)),t.$$.dirty[0]&1610614784&&T?.group===N&&Se($)},[M,P,te,X,be,Ae,U,j,d,b,I,T,w,h,y,je,ot,W,le,V,ae,G,me,Oe,J,ye,ge,ke,ne,$,N,C,v,E,m,f,a,u,n,s,q,ze,Y]}class Virtual extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$5,create_fragment$4,safe_not_equal,{gap:0,items:17,move:19,fixed:20,overthrow:21,prerender:22,columns:23,key:1,animate:24,sortable:2,container:18},null,[-1,-1])}}const get_after_slot_changes=t=>({}),get_after_slot_context=t=>({}),get_before_slot_changes=t=>({}),get_before_slot_context=t=>({});function create_if_block_1$1(t){let e,r;const n=t[9].before,s=create_slot(n,t,t[8],get_before_slot_context);return{c(){e=element("div"),s&&s.c(),this.h()},l(a){e=claim_element(a,"DIV",{class:!0});var u=children(e);s&&s.l(u),u.forEach(detach),this.h()},h(){attr(e,"class","z-20 flex items-center")},m(a,u){insert_hydration(a,e,u),s&&s.m(e,null),r=!0},p(a,u){s&&s.p&&(!r||u&256)&&update_slot_base(s,n,a,a[8],r?get_slot_changes(n,a[8],u,get_before_slot_changes):get_all_dirty_from_scope(a[8]),get_before_slot_context)},i(a){r||(transition_in(s,a),r=!0)},o(a){transition_out(s,a),r=!1},d(a){a&&detach(e),s&&s.d(a)}}}function create_if_block$2(t){let e;return{c(){e=element("hr"),this.h()},l(r){e=claim_element(r,"HR",{"aria-hidden":!0,class:!0}),this.h()},h(){attr(e,"aria-hidden",""),attr(e,"class","absolute bottom-0 h-[1px] w-full border-none bg-content/10 group-last-of-type:opacity-0")},m(r,n){insert_hydration(r,e,n)},d(r){r&&detach(e)}}}function create_dynamic_element(t){let e,r,n,s,a,u,d,f,y,b,w,A,R,I,h,N,m,E,v,C,$,T,q,Y,z=t[7].before&&create_if_block_1$1(t);const M=t[9].default,W=create_slot(M,t,t[8],null);let V=t[2]&&(t[1]||t[0])&&create_if_block$2();I=new Icon({props:{name:"circle"}}),m=new Icon({props:{name:"target"}});const ae=t[9].after,G=create_slot(ae,t,t[8],get_after_slot_context);let me=[{role:C=t[5]?"link":"button"},{tabindex:"0"},{href:t[5]},{draggable:"false"},{class:$="group relative z-10 flex w-full items-center gap-4 overflow-hidden px-4 outline-2 -outline-offset-2 outline-primary-600 contain-inline-size focus-visible:outline "+(t[4]?"cursor-pointer touch-manipulation select-none "+(t[2]?"":"transition-transform active:scale-95"):"")+" "+(t[0]?"focus-visible:z-50":t[1]?"rounded-lg py-1 focus-visible:z-50":"rounded-2xl py-4")+" "+(t[2]?"bg-surface":"bg-surface-100 shadow-[0_0_20px_-4px] shadow-black/20 dark:shadow-none")}],Oe={};for(let P=0;P*]:col-start-1 [&>*]:row-start-1"),set_dynamic_element_data(t[4]?t[5]?"a":"button":"article")(e,Oe)},m(P,J){insert_hydration(P,e,J),append_hydration(e,r),append_hydration(e,n),append_hydration(e,s),append_hydration(e,u),z&&z.m(e,null),append_hydration(e,d),append_hydration(e,f),W&&W.m(f,null),append_hydration(f,y),V&&V.m(f,null),append_hydration(e,w),append_hydration(e,A),append_hydration(A,R),mount_component(I,R,null),append_hydration(A,h),append_hydration(A,N),mount_component(m,N,null),append_hydration(A,E),append_hydration(A,v),G&&G.m(v,null),T=!0,q||(Y=[listen(e,"click",t[10]),listen(e,"contextmenu",t[11])],q=!0)},p(P,J){(!T||J&64)&&toggle_class(r,"opacity-100",P[6]===!0),(!T||J&20&&a!==(a="pointer-events-none absolute inset-0 z-0 bg-highlight opacity-0 "+(P[4]?"group-hover:opacity-30 "+(P[2]?"dark:group-hover:opacity-50":"dark:group-hover:opacity-10"):"")))&&attr(s,"class",a),P[7].before?z?(z.p(P,J),J&128&&transition_in(z,1)):(z=create_if_block_1$1(P),z.c(),transition_in(z,1),z.m(e,d)):z&&(group_outros(),transition_out(z,1,1,()=>{z=null}),check_outros()),W&&W.p&&(!T||J&256)&&update_slot_base(W,M,P,P[8],T?get_slot_changes(M,P[8],J,null):get_all_dirty_from_scope(P[8]),null),P[2]&&(P[1]||P[0])?V||(V=create_if_block$2(),V.c(),V.m(f,null)):V&&(V.d(1),V=null),(!T||J&11&&b!==(b="z-10 grid w-full grid-cols-1 items-baseline overflow-hidden contain-inline-size "+(P[1]||P[0]?"justify-start gap-0.5":"place-items-center justify-center gap-2")+" "+((P[1]||P[0])&&P[3]?"lg:auto-cols-fr lg:grid-flow-col lg:gap-4":"")))&&attr(f,"class",b),(!T||J&64)&&toggle_class(R,"opacity-100",P[6]),(!T||J&64)&&toggle_class(N,"scale-100",P[6]===!0),G&&G.p&&(!T||J&256)&&update_slot_base(G,ae,P,P[8],T?get_slot_changes(ae,P[8],J,get_after_slot_changes):get_all_dirty_from_scope(P[8]),get_after_slot_context),(!T||J&64)&&toggle_class(v,"opacity-100",!P[6]),set_dynamic_element_data(P[4]?P[5]?"a":"button":"article")(e,Oe=get_spread_update(me,[(!T||J&32&&C!==(C=P[5]?"link":"button"))&&{role:C},{tabindex:"0"},(!T||J&32)&&{href:P[5]},{draggable:"false"},(!T||J&23&&$!==($="group relative z-10 flex w-full items-center gap-4 overflow-hidden px-4 outline-2 -outline-offset-2 outline-primary-600 contain-inline-size focus-visible:outline "+(P[4]?"cursor-pointer touch-manipulation select-none "+(P[2]?"":"transition-transform active:scale-95"):"")+" "+(P[0]?"focus-visible:z-50":P[1]?"rounded-lg py-1 focus-visible:z-50":"rounded-2xl py-4")+" "+(P[2]?"bg-surface":"bg-surface-100 shadow-[0_0_20px_-4px] shadow-black/20 dark:shadow-none")))&&{class:$}]))},i(P){T||(transition_in(z),transition_in(W,P),transition_in(I.$$.fragment,P),transition_in(m.$$.fragment,P),transition_in(G,P),T=!0)},o(P){transition_out(z),transition_out(W,P),transition_out(I.$$.fragment,P),transition_out(m.$$.fragment,P),transition_out(G,P),T=!1},d(P){P&&detach(e),z&&z.d(),W&&W.d(P),V&&V.d(),destroy_component(I),destroy_component(m),G&&G.d(P),q=!1,run_all(Y)}}}function create_fragment$3(t){let e=t[4]?t[5]?"a":"button":"article",r,n,s=(t[4]?t[5]?"a":"button":"article")&&create_dynamic_element(t);return{c(){s&&s.c(),r=empty$1()},l(a){s&&s.l(a),r=empty$1()},m(a,u){s&&s.m(a,u),insert_hydration(a,r,u),n=!0},p(a,[u]){!a[4]||a[5],e?safe_not_equal(e,a[4]?a[5]?"a":"button":"article")?(s.d(1),s=create_dynamic_element(a),e=a[4]?a[5]?"a":"button":"article",s.c(),s.m(r.parentNode,r)):s.p(a,u):(s=create_dynamic_element(a),e=a[4]?a[5]?"a":"button":"article",s.c(),s.m(r.parentNode,r))},i(a){n||(transition_in(s,a),n=!0)},o(a){transition_out(s,a),n=!1},d(a){a&&detach(r),s&&s.d(a)}}}function instance$4(t,e,r){let{$$slots:n={},$$scope:s}=e;const a=compute_slots(n);let{xs:u=!1}=e,{sm:d=!1}=e,{flat:f=!1}=e,{flow:y=!1}=e,{interactive:b=!1}=e,{href:w=void 0}=e,{selected:A=!1}=e;function R(h){bubble.call(this,t,h)}function I(h){bubble.call(this,t,h)}return t.$$set=h=>{"xs"in h&&r(0,u=h.xs),"sm"in h&&r(1,d=h.sm),"flat"in h&&r(2,f=h.flat),"flow"in h&&r(3,y=h.flow),"interactive"in h&&r(4,b=h.interactive),"href"in h&&r(5,w=h.href),"selected"in h&&r(6,A=h.selected),"$$scope"in h&&r(8,s=h.$$scope)},[u,d,f,y,b,w,A,a,s,n,R,I]}class Card extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$4,create_fragment$3,safe_not_equal,{xs:0,sm:1,flat:2,flow:3,interactive:4,href:5,selected:6})}}function create_fragment$2(t){let e,r,n;const s=t[6].default,a=create_slot(s,t,t[5],null);return{c(){e=element("span"),a&&a.c(),this.h()},l(u){e=claim_element(u,"SPAN",{class:!0});var d=children(e);a&&a.l(d),d.forEach(detach),this.h()},h(){attr(e,"class",r="w-max max-w-full overflow-hidden text-ellipsis whitespace-nowrap rounded-md text-left [&>*]:align-bottom "+(t[1]?"animate-pulse bg-highlight text-transparent":"")+" "+(t[2]?"font-medium":"font-normal")),toggle_class(e,"text-content-200",t[0]),toggle_class(e,"ml-4",t[3]),toggle_class(e,"text-sm",t[4])},m(u,d){insert_hydration(u,e,d),a&&a.m(e,null),n=!0},p(u,[d]){a&&a.p&&(!n||d&32)&&update_slot_base(a,s,u,u[5],n?get_slot_changes(s,u[5],d,null):get_all_dirty_from_scope(u[5]),null),(!n||d&6&&r!==(r="w-max max-w-full overflow-hidden text-ellipsis whitespace-nowrap rounded-md text-left [&>*]:align-bottom "+(u[1]?"animate-pulse bg-highlight text-transparent":"")+" "+(u[2]?"font-medium":"font-normal")))&&attr(e,"class",r),(!n||d&7)&&toggle_class(e,"text-content-200",u[0]),(!n||d&14)&&toggle_class(e,"ml-4",u[3]),(!n||d&22)&&toggle_class(e,"text-sm",u[4])},i(u){n||(transition_in(a,u),n=!0)},o(u){transition_out(a,u),n=!1},d(u){u&&detach(e),a&&a.d(u)}}}function instance$3(t,e,r){let{$$slots:n={},$$scope:s}=e,{secondary:a=!1}=e,{loading:u=!1}=e,{accent:d=!1}=e,{indent:f=!1}=e,{sm:y=!1}=e;return t.$$set=b=>{"secondary"in b&&r(0,a=b.secondary),"loading"in b&&r(1,u=b.loading),"accent"in b&&r(2,d=b.accent),"indent"in b&&r(3,f=b.indent),"sm"in b&&r(4,y=b.sm),"$$scope"in b&&r(5,s=b.$$scope)},[a,u,d,f,y,s,n]}class Text extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$3,create_fragment$2,safe_not_equal,{secondary:0,loading:1,accent:2,indent:3,sm:4})}}function create_if_block_1(t){let e;const r=t[7].default,n=create_slot(r,t,t[6],null);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,a){n&&n.p&&(!e||a&64)&&update_slot_base(n,r,s,s[6],e?get_slot_changes(r,s[6],a,null):get_all_dirty_from_scope(s[6]),null)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}function create_if_block$1(t){let e,r,n,s,a,u;return{c(){e=element("img"),this.h()},l(d){e=claim_element(d,"IMG",{alt:!0,src:!0,class:!0,loading:!0,width:!0,height:!0,draggable:!0}),this.h()},h(){attr(e,"alt",t[3]),src_url_equal(e.src,r=t[2]<100/devicePixelRatio?t[0]:t[1])||attr(e,"src",r),attr(e,"class","opacity-0 transition-opacity duration-500"),attr(e,"loading","lazy"),attr(e,"width",n=t[2]+"px"),attr(e,"height",s=t[2]+"px"),attr(e,"draggable","false"),toggle_class(e,"opacity-100",t[5]==="ok")},m(d,f){insert_hydration(d,e,f),t[8](e),a||(u=[listen(e,"load",t[9]),listen(e,"error",t[10])],a=!0)},p(d,f){f&8&&attr(e,"alt",d[3]),f&7&&!src_url_equal(e.src,r=d[2]<100/devicePixelRatio?d[0]:d[1])&&attr(e,"src",r),f&4&&n!==(n=d[2]+"px")&&attr(e,"width",n),f&4&&s!==(s=d[2]+"px")&&attr(e,"height",s),f&32&&toggle_class(e,"opacity-100",d[5]==="ok")},i:noop$2,o:noop$2,d(d){d&&detach(e),t[8](null),a=!1,run_all(u)}}}function create_fragment$1(t){let e,r,n,s,a=`${t[2]}px`,u=`${t[2]}px`,d;const f=[create_if_block$1,create_if_block_1],y=[];function b(w,A){return w[1]&&w[5]!=="error"?0:w[5]==="error"?1:-1}return~(r=b(t))&&(n=y[r]=f[r](t)),{c(){e=element("div"),n&&n.c(),this.h()},l(w){e=claim_element(w,"DIV",{class:!0});var A=children(e);n&&n.l(A),A.forEach(detach),this.h()},h(){attr(e,"class",s="overflow-hidden "+(t[2]>200?"rounded-2xl":"rounded")+" bg-highlight-100"),toggle_class(e,"animate-pulse",t[5]==="loading"),set_style(e,"height",a),set_style(e,"width",u)},m(w,A){insert_hydration(w,e,A),~r&&y[r].m(e,null),d=!0},p(w,[A]){let R=r;r=b(w),r===R?~r&&y[r].p(w,A):(n&&(group_outros(),transition_out(y[R],1,1,()=>{y[R]=null}),check_outros()),~r?(n=y[r],n?n.p(w,A):(n=y[r]=f[r](w),n.c()),transition_in(n,1),n.m(e,null)):n=null),(!d||A&4&&s!==(s="overflow-hidden "+(w[2]>200?"rounded-2xl":"rounded")+" bg-highlight-100"))&&attr(e,"class",s),(!d||A&36)&&toggle_class(e,"animate-pulse",w[5]==="loading"),A&4&&a!==(a=`${w[2]}px`)&&set_style(e,"height",a),A&4&&u!==(u=`${w[2]}px`)&&set_style(e,"width",u)},i(w){d||(transition_in(n),d=!0)},o(w){transition_out(n),d=!1},d(w){w&&detach(e),~r&&y[r].d()}}}function instance$2(t,e,r){let n,{$$slots:s={},$$scope:a}=e,{thumbnail:u=void 0}=e,{src:d=void 0}=e,{size:f=48}=e,{alt:y=""}=e,b;onMount(()=>(b?.complete&&r(4,b.style.opacity="1",b),!1));function w(I){binding_callbacks[I?"unshift":"push"](()=>{b=I,r(4,b)})}const A=()=>r(5,n="ok"),R=()=>r(5,n="error");return t.$$set=I=>{"thumbnail"in I&&r(0,u=I.thumbnail),"src"in I&&r(1,d=I.src),"size"in I&&r(2,f=I.size),"alt"in I&&r(3,y=I.alt),"$$scope"in I&&r(6,a=I.$$scope)},t.$$.update=()=>{t.$$.dirty&2&&r(5,n=d===""||d===null?"error":"loading")},[u,d,f,y,b,n,a,s,w,A,R]}class Image extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$2,create_fragment$1,safe_not_equal,{thumbnail:0,src:1,size:2,alt:3})}}function capitalize(t,e=!0){return t&&(e?t.replace(/\b\w/g,r=>r.toUpperCase()):t.replace(/\b\w/,r=>r.toUpperCase()))}function clean(t){return t.normalize().trim().toLowerCase().replace(/\s+/g," ")}const __vite_glob_0_0=`CREATE TRIGGER IF NOT EXISTS cascade_playlists_library + ${f[11].back?f[11].back.y:f[7].y+Math.max(f[11].offset.y,-f[5]+f[0])}px, 0)`)&&set_style(e,"transform",r),N[0]&81&&n!==(n=`${f[4].width/f[6]-f[0]}px`)&&set_style(e,"width",n),N[0]&33&&s!==(s=`${f[5]-f[0]}px`)&&set_style(e,"height",s)},i(f){a||(transition_in(d,f),a=!0)},o(f){transition_out(d,f),a=!1},d(f){f&&detach(e),d&&d.d(f)}}}function create_default_slot$1(t){let e,r,n=t[11]?.owner===t[3]&&create_if_block_1$2(t);return{c(){n&&n.c(),e=empty$1()},l(s){n&&n.l(s),e=empty$1()},m(s,a){n&&n.m(s,a),insert_hydration(s,e,a),r=!0},p(s,a){s[11]?.owner===s[3]?n?(n.p(s,a),a[0]&2056&&transition_in(n,1)):(n=create_if_block_1$2(s),n.c(),transition_in(n,1),n.m(e.parentNode,e)):n&&(group_outros(),transition_out(n,1,1,()=>{n=null}),check_outros())},i(s){r||(transition_in(n),r=!0)},o(s){transition_out(n),r=!1},d(s){s&&detach(e),n&&n.d(s)}}}function create_fragment$4(t){let e,r,n=[],s=new Map_1,a=`translate3d(0,${Math.ceil(t[8]/t[6])*t[5]}px,0)`,u=`${t[0]}px`,d,f=`${t[10]}px`,N,b,w,A=ensure_array_like(t[14]);const R=h=>h[12][(h[8]+h[54])%h[9]]??h[54];for(let h=0;h{S=null}),check_outros()),y[0]&1024&&f!==(f=`${h[10]}px`)&&set_style(e,"height",f)},i(h){if(!N){for(let y=0;yr(11,T=z));let{$$slots:q={},$$scope:$}=e;const U=createEventDispatcher();let{gap:M=0}=e,{items:F}=e,{move:J=!1}=e,{fixed:ae=!1}=e,{overthrow:ee=1}=e,{prerender:ge=1}=e,{columns:Oe=1}=e,{key:P=z=>z}=e,{animate:H=!1}=e,{sortable:te=!1}=e,{container:le=void 0}=e,X=null,Ne={x:0,y:0},_e=new DOMRect,ye=new DOMRect,ke=!0,Ae=1,Q=0,ne=0;function He(z){!A&&z.length&&tick().then(se);const Y=new Map,oe=Array.from({length:b}),me=new Set(w);for(let ue=0;ue=f))continue;const Te=A?.get(We);if(Te==null||Te=f||(oe[ue%b]=w[Te%b],me.delete(w[Te%b]),Te===ue||!H)||T?.owner===X&&We===T?.key)continue;const at=~~(Te/Q)-~~(ue/Q),lt=~~(Te%Q)-~~(ue%Q);Pe(Te,lt,at)}const he=[...me];return r(12,w=oe.map(ue=>ue??he.shift())),Y}function Pe(z,Y,oe){const me=X?.children.item(z-d),he=[`translate3d(${Y*100}%,${oe*100}%,0)`,"translate3d(0,0,0)"];me?.animate({transform:he,zIndex:["100","100"]},{easing:"ease",composite:"accumulate",duration:R})}function se(){if(!le||!X)return;r(4,ye=X.parentElement?.getBoundingClientRect()),r(26,_e=le.getBoundingClientRect()),r(4,ye.y+=Ne.y,ye),r(28,ne=ye.y-_e.y-_e.height/2),r(4,ye.width+=M,ye);const z=X.firstElementChild;if(!z)return;const{width:Y,height:oe}=z.getBoundingClientRect();!Y||!oe||(r(6,Q=~~(ye.width/(Y+M))),r(5,Ae=oe+M))}let de,Ce,K={x:0,y:0};async function je({target:z}){if(se(),await tick(),!te||!X||!z||T||z.parentElement!==X||F[V]==null||P(F[V])==null)return;Ce=V,de=J?-1:Ce;const Y=z.getBoundingClientRect();Y.x-=K.x,Y.y-=K.y,set_store_value(transfer,T={group:te===!0?X:te,key:P(F[V]),data:F[V],owner:X,offset:Y},T)}function Ie(z,Y=!1){if(!te||!T||ae||P(F[z])==null)return;if(!Number.isInteger(z)){de!=null&&T.owner!==X&&(Ie(de,!0),de=void 0);return}if(P(F[z])===T.key)return;z<0&&!F.length&&(z=0);const oe=F.findIndex(me=>P(me)===T?.key);oe!==z&&(!Y&&de==null&&(de=oe,Ce=oe),~oe&&F.splice(oe,1),~z&&F.splice(z,0,T.data),requestAnimationFrame(()=>r(17,F))),!Y&&X&&set_store_value(transfer,T.owner=X,T)}async function ot(){if(!te||!T||Ce==null)return;const z=F.findIndex(Y=>P(Y)===T?.key);if(T.owner===X&&~z){const Y=X.children.item(z-d);Y&&(set_store_value(transfer,T.back=Y.getBoundingClientRect(),T),set_store_value(transfer,T.group=Math.random().toString(),T),await new Promise(oe=>setTimeout(oe,150)))}if(Ce!==z){const Y=T.data,oe=F[z-1],me=(+!!~Ce<<1)+ +!!~z,he=[void 0,"push","purge","rearrange"][me];he&&U("edit",{action:he,index:z,after:oe,item:Y})}Ce=void 0,de=void 0,T.owner===X&&set_store_value(transfer,T=null,T)}onMount(()=>{function z(me){const he=me.currentTarget;r(25,Ne.x=he.scrollLeft,Ne),r(25,Ne.y=he.scrollTop,Ne)}le||r(18,le=getScrollParent(X));const Y=te&&position$1.subscribe(me=>r(7,K=me));le.addEventListener("scroll",z,{passive:!0}),le.addEventListener("resize",se);const{destroy:oe}=resize(le);return r(27,ke=!1),()=>{le?.removeEventListener("scroll",z),le?.removeEventListener("resize",se),Y&&Y(),oe()}});function ze(z){binding_callbacks[z?"unshift":"push"](()=>{X=z,r(3,X)})}return t.$$set=z=>{"gap"in z&&r(0,M=z.gap),"items"in z&&r(17,F=z.items),"move"in z&&r(19,J=z.move),"fixed"in z&&r(20,ae=z.fixed),"overthrow"in z&&r(21,ee=z.overthrow),"prerender"in z&&r(22,ge=z.prerender),"columns"in z&&r(23,Oe=z.columns),"key"in z&&r(1,P=z.key),"animate"in z&&r(24,H=z.animate),"sortable"in z&&r(2,te=z.sortable),"container"in z&&r(18,le=z.container),"$$scope"in z&&r(42,$=z.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&67108960&&r(38,n=Math.ceil(_e.height/Ae)*Q),t.$$.dirty[0]&96|t.$$.dirty[1]&128&&r(39,s=n/Q*Ae),t.$$.dirty[0]&131072|t.$$.dirty[1]&128&&r(36,a=Math.max(Math.ceil(F.length/n)-2,1)),t.$$.dirty[0]&301989888|t.$$.dirty[1]&288&&r(37,u=minmax(~~((Ne.y-ne)/s),1,a)),t.$$.dirty[0]&2097152|t.$$.dirty[1]&192&&r(8,d=Math.max(u-ee,0)*n),t.$$.dirty[0]&6291456|t.$$.dirty[1]&192&&r(35,f=Math.max((u+ee+1)*n,ge)),t.$$.dirty[0]&131328|t.$$.dirty[1]&16&&r(14,N=F.slice(d,f)),t.$$.dirty[0]&2097152|t.$$.dirty[1]&128&&r(9,b=(ee*2+1)*n),t.$$.dirty[0]&512&&r(12,w=Array.from({length:b}).map((z,Y)=>Y)),t.$$.dirty[0]&131072&&(A=He(F)),t.$$.dirty[0]&16777216&&(R=H===!0?300:H||0),t.$$.dirty[0]&131169&&r(10,S=Math.ceil(F.length/Q)*Ae-M),t.$$.dirty[0]&8388608&&r(13,h=Number.isInteger(Oe)?`repeat(${Oe},1fr)`:`repeat(auto-fill,minmax(min(100%,${Oe}),1fr))`),t.$$.dirty[0]&1024&&Number.isFinite(S)&&(requestAnimationFrame(se),r(27,ke=!1)),t.$$.dirty[0]&134217728|t.$$.dirty[1]&96&&!ke&&u===a&&(U("end"),r(27,ke=!0)),t.$$.dirty[0]&12&&r(30,y=te===!0?X:te),t.$$.dirty[0]&100663441&&r(34,m=minmax(K.y+M/2,_e.top,_e.bottom,NaN)+Ne.y-ye.y),t.$$.dirty[0]&33554577&&r(33,E=minmax(K.x+M/2,ye.left,ye.right-M-1,NaN)+Ne.x-ye.x),t.$$.dirty[0]&32|t.$$.dirty[1]&8&&r(32,v=Math.floor(m/Ae)),t.$$.dirty[0]&80|t.$$.dirty[1]&4&&r(31,C=Math.floor(E/(ye.width/Q))),t.$$.dirty[0]&131136|t.$$.dirty[1]&3&&r(29,V=minmax(v*Q+C,0,F.length-1)),t.$$.dirty[0]&1610614784&&T?.group===y&&Ie(V)},[M,P,te,X,ye,Ae,Q,K,d,b,S,T,w,h,N,je,ot,F,le,J,ae,ee,ge,Oe,H,Ne,_e,ke,ne,V,y,C,v,E,m,f,a,u,n,s,q,ze,$]}class Virtual extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$5,create_fragment$4,safe_not_equal,{gap:0,items:17,move:19,fixed:20,overthrow:21,prerender:22,columns:23,key:1,animate:24,sortable:2,container:18},null,[-1,-1])}}const get_after_slot_changes=t=>({}),get_after_slot_context=t=>({}),get_before_slot_changes=t=>({}),get_before_slot_context=t=>({});function create_if_block_1$1(t){let e,r;const n=t[9].before,s=create_slot(n,t,t[8],get_before_slot_context);return{c(){e=element("div"),s&&s.c(),this.h()},l(a){e=claim_element(a,"DIV",{class:!0});var u=children(e);s&&s.l(u),u.forEach(detach),this.h()},h(){attr(e,"class","z-20 flex items-center")},m(a,u){insert_hydration(a,e,u),s&&s.m(e,null),r=!0},p(a,u){s&&s.p&&(!r||u&256)&&update_slot_base(s,n,a,a[8],r?get_slot_changes(n,a[8],u,get_before_slot_changes):get_all_dirty_from_scope(a[8]),get_before_slot_context)},i(a){r||(transition_in(s,a),r=!0)},o(a){transition_out(s,a),r=!1},d(a){a&&detach(e),s&&s.d(a)}}}function create_if_block$2(t){let e;return{c(){e=element("hr"),this.h()},l(r){e=claim_element(r,"HR",{"aria-hidden":!0,class:!0}),this.h()},h(){attr(e,"aria-hidden",""),attr(e,"class","absolute bottom-0 h-[1px] w-full border-none bg-content/10 group-last-of-type:opacity-0")},m(r,n){insert_hydration(r,e,n)},d(r){r&&detach(e)}}}function create_dynamic_element(t){let e,r,n,s,a,u,d,f,N,b,w,A,R,S,h,y,m,E,v,C,V,T,q,$,U=t[7].before&&create_if_block_1$1(t);const M=t[9].default,F=create_slot(M,t,t[8],null);let J=t[2]&&(t[1]||t[0])&&create_if_block$2();S=new Icon({props:{name:"circle"}}),m=new Icon({props:{name:"target"}});const ae=t[9].after,ee=create_slot(ae,t,t[8],get_after_slot_context);let ge=[{role:C=t[5]?"link":"button"},{tabindex:"0"},{href:t[5]},{draggable:"false"},{class:V="group relative z-10 flex w-full items-center gap-4 overflow-hidden px-4 outline-2 -outline-offset-2 outline-primary-600 contain-inline-size focus-visible:outline "+(t[4]?"cursor-pointer touch-manipulation select-none "+(t[2]?"":"transition-transform active:scale-95"):"")+" "+(t[0]?"focus-visible:z-50":t[1]?"rounded-lg py-1 focus-visible:z-50":"rounded-2xl py-4")+" "+(t[2]?"bg-surface":"bg-surface-100 shadow-[0_0_20px_-4px] shadow-black/20 dark:shadow-none")}],Oe={};for(let P=0;P*]:col-start-1 [&>*]:row-start-1"),set_dynamic_element_data(t[4]?t[5]?"a":"button":"article")(e,Oe)},m(P,H){insert_hydration(P,e,H),append_hydration(e,r),append_hydration(e,n),append_hydration(e,s),append_hydration(e,u),U&&U.m(e,null),append_hydration(e,d),append_hydration(e,f),F&&F.m(f,null),append_hydration(f,N),J&&J.m(f,null),append_hydration(e,w),append_hydration(e,A),append_hydration(A,R),mount_component(S,R,null),append_hydration(A,h),append_hydration(A,y),mount_component(m,y,null),append_hydration(A,E),append_hydration(A,v),ee&&ee.m(v,null),T=!0,q||($=[listen(e,"click",t[10]),listen(e,"contextmenu",t[11])],q=!0)},p(P,H){(!T||H&64)&&toggle_class(r,"opacity-100",P[6]===!0),(!T||H&20&&a!==(a="pointer-events-none absolute inset-0 z-0 bg-highlight opacity-0 "+(P[4]?"group-hover:opacity-30 "+(P[2]?"dark:group-hover:opacity-50":"dark:group-hover:opacity-10"):"")))&&attr(s,"class",a),P[7].before?U?(U.p(P,H),H&128&&transition_in(U,1)):(U=create_if_block_1$1(P),U.c(),transition_in(U,1),U.m(e,d)):U&&(group_outros(),transition_out(U,1,1,()=>{U=null}),check_outros()),F&&F.p&&(!T||H&256)&&update_slot_base(F,M,P,P[8],T?get_slot_changes(M,P[8],H,null):get_all_dirty_from_scope(P[8]),null),P[2]&&(P[1]||P[0])?J||(J=create_if_block$2(),J.c(),J.m(f,null)):J&&(J.d(1),J=null),(!T||H&11&&b!==(b="z-10 grid w-full grid-cols-1 items-baseline overflow-hidden contain-inline-size "+(P[1]||P[0]?"justify-start gap-0.5":"place-items-center justify-center gap-2")+" "+((P[1]||P[0])&&P[3]?"lg:auto-cols-fr lg:grid-flow-col lg:gap-4":"")))&&attr(f,"class",b),(!T||H&64)&&toggle_class(R,"opacity-100",P[6]),(!T||H&64)&&toggle_class(y,"scale-100",P[6]===!0),ee&&ee.p&&(!T||H&256)&&update_slot_base(ee,ae,P,P[8],T?get_slot_changes(ae,P[8],H,get_after_slot_changes):get_all_dirty_from_scope(P[8]),get_after_slot_context),(!T||H&64)&&toggle_class(v,"opacity-100",!P[6]),set_dynamic_element_data(P[4]?P[5]?"a":"button":"article")(e,Oe=get_spread_update(ge,[(!T||H&32&&C!==(C=P[5]?"link":"button"))&&{role:C},{tabindex:"0"},(!T||H&32)&&{href:P[5]},{draggable:"false"},(!T||H&23&&V!==(V="group relative z-10 flex w-full items-center gap-4 overflow-hidden px-4 outline-2 -outline-offset-2 outline-primary-600 contain-inline-size focus-visible:outline "+(P[4]?"cursor-pointer touch-manipulation select-none "+(P[2]?"":"transition-transform active:scale-95"):"")+" "+(P[0]?"focus-visible:z-50":P[1]?"rounded-lg py-1 focus-visible:z-50":"rounded-2xl py-4")+" "+(P[2]?"bg-surface":"bg-surface-100 shadow-[0_0_20px_-4px] shadow-black/20 dark:shadow-none")))&&{class:V}]))},i(P){T||(transition_in(U),transition_in(F,P),transition_in(S.$$.fragment,P),transition_in(m.$$.fragment,P),transition_in(ee,P),T=!0)},o(P){transition_out(U),transition_out(F,P),transition_out(S.$$.fragment,P),transition_out(m.$$.fragment,P),transition_out(ee,P),T=!1},d(P){P&&detach(e),U&&U.d(),F&&F.d(P),J&&J.d(),destroy_component(S),destroy_component(m),ee&&ee.d(P),q=!1,run_all($)}}}function create_fragment$3(t){let e=t[4]?t[5]?"a":"button":"article",r,n,s=(t[4]?t[5]?"a":"button":"article")&&create_dynamic_element(t);return{c(){s&&s.c(),r=empty$1()},l(a){s&&s.l(a),r=empty$1()},m(a,u){s&&s.m(a,u),insert_hydration(a,r,u),n=!0},p(a,[u]){!a[4]||a[5],e?safe_not_equal(e,a[4]?a[5]?"a":"button":"article")?(s.d(1),s=create_dynamic_element(a),e=a[4]?a[5]?"a":"button":"article",s.c(),s.m(r.parentNode,r)):s.p(a,u):(s=create_dynamic_element(a),e=a[4]?a[5]?"a":"button":"article",s.c(),s.m(r.parentNode,r))},i(a){n||(transition_in(s,a),n=!0)},o(a){transition_out(s,a),n=!1},d(a){a&&detach(r),s&&s.d(a)}}}function instance$4(t,e,r){let{$$slots:n={},$$scope:s}=e;const a=compute_slots(n);let{xs:u=!1}=e,{sm:d=!1}=e,{flat:f=!1}=e,{flow:N=!1}=e,{interactive:b=!1}=e,{href:w=void 0}=e,{selected:A=!1}=e;function R(h){bubble.call(this,t,h)}function S(h){bubble.call(this,t,h)}return t.$$set=h=>{"xs"in h&&r(0,u=h.xs),"sm"in h&&r(1,d=h.sm),"flat"in h&&r(2,f=h.flat),"flow"in h&&r(3,N=h.flow),"interactive"in h&&r(4,b=h.interactive),"href"in h&&r(5,w=h.href),"selected"in h&&r(6,A=h.selected),"$$scope"in h&&r(8,s=h.$$scope)},[u,d,f,N,b,w,A,a,s,n,R,S]}class Card extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$4,create_fragment$3,safe_not_equal,{xs:0,sm:1,flat:2,flow:3,interactive:4,href:5,selected:6})}}function create_fragment$2(t){let e,r,n;const s=t[6].default,a=create_slot(s,t,t[5],null);return{c(){e=element("span"),a&&a.c(),this.h()},l(u){e=claim_element(u,"SPAN",{class:!0});var d=children(e);a&&a.l(d),d.forEach(detach),this.h()},h(){attr(e,"class",r="w-max max-w-full overflow-hidden text-ellipsis whitespace-nowrap rounded-md text-left [&>*]:align-bottom "+(t[1]?"animate-pulse bg-highlight text-transparent":"")+" "+(t[2]?"font-medium":"font-normal")),toggle_class(e,"text-content-200",t[0]),toggle_class(e,"ml-4",t[3]),toggle_class(e,"text-sm",t[4])},m(u,d){insert_hydration(u,e,d),a&&a.m(e,null),n=!0},p(u,[d]){a&&a.p&&(!n||d&32)&&update_slot_base(a,s,u,u[5],n?get_slot_changes(s,u[5],d,null):get_all_dirty_from_scope(u[5]),null),(!n||d&6&&r!==(r="w-max max-w-full overflow-hidden text-ellipsis whitespace-nowrap rounded-md text-left [&>*]:align-bottom "+(u[1]?"animate-pulse bg-highlight text-transparent":"")+" "+(u[2]?"font-medium":"font-normal")))&&attr(e,"class",r),(!n||d&7)&&toggle_class(e,"text-content-200",u[0]),(!n||d&14)&&toggle_class(e,"ml-4",u[3]),(!n||d&22)&&toggle_class(e,"text-sm",u[4])},i(u){n||(transition_in(a,u),n=!0)},o(u){transition_out(a,u),n=!1},d(u){u&&detach(e),a&&a.d(u)}}}function instance$3(t,e,r){let{$$slots:n={},$$scope:s}=e,{secondary:a=!1}=e,{loading:u=!1}=e,{accent:d=!1}=e,{indent:f=!1}=e,{sm:N=!1}=e;return t.$$set=b=>{"secondary"in b&&r(0,a=b.secondary),"loading"in b&&r(1,u=b.loading),"accent"in b&&r(2,d=b.accent),"indent"in b&&r(3,f=b.indent),"sm"in b&&r(4,N=b.sm),"$$scope"in b&&r(5,s=b.$$scope)},[a,u,d,f,N,s,n]}class Text extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$3,create_fragment$2,safe_not_equal,{secondary:0,loading:1,accent:2,indent:3,sm:4})}}function create_if_block_1(t){let e;const r=t[7].default,n=create_slot(r,t,t[6],null);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,a){n&&n.p&&(!e||a&64)&&update_slot_base(n,r,s,s[6],e?get_slot_changes(r,s[6],a,null):get_all_dirty_from_scope(s[6]),null)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}function create_if_block$1(t){let e,r,n,s,a,u;return{c(){e=element("img"),this.h()},l(d){e=claim_element(d,"IMG",{alt:!0,src:!0,class:!0,loading:!0,width:!0,height:!0,draggable:!0}),this.h()},h(){attr(e,"alt",t[3]),src_url_equal(e.src,r=t[2]<100/devicePixelRatio?t[0]:t[1])||attr(e,"src",r),attr(e,"class","opacity-0 transition-opacity duration-500"),attr(e,"loading","lazy"),attr(e,"width",n=t[2]+"px"),attr(e,"height",s=t[2]+"px"),attr(e,"draggable","false"),toggle_class(e,"opacity-100",t[5]==="ok")},m(d,f){insert_hydration(d,e,f),t[8](e),a||(u=[listen(e,"load",t[9]),listen(e,"error",t[10])],a=!0)},p(d,f){f&8&&attr(e,"alt",d[3]),f&7&&!src_url_equal(e.src,r=d[2]<100/devicePixelRatio?d[0]:d[1])&&attr(e,"src",r),f&4&&n!==(n=d[2]+"px")&&attr(e,"width",n),f&4&&s!==(s=d[2]+"px")&&attr(e,"height",s),f&32&&toggle_class(e,"opacity-100",d[5]==="ok")},i:noop$2,o:noop$2,d(d){d&&detach(e),t[8](null),a=!1,run_all(u)}}}function create_fragment$1(t){let e,r,n,s,a=`${t[2]}px`,u=`${t[2]}px`,d;const f=[create_if_block$1,create_if_block_1],N=[];function b(w,A){return w[1]&&w[5]!=="error"?0:w[5]==="error"?1:-1}return~(r=b(t))&&(n=N[r]=f[r](t)),{c(){e=element("div"),n&&n.c(),this.h()},l(w){e=claim_element(w,"DIV",{class:!0});var A=children(e);n&&n.l(A),A.forEach(detach),this.h()},h(){attr(e,"class",s="overflow-hidden "+(t[2]>200?"rounded-2xl":"rounded")+" bg-highlight-100"),toggle_class(e,"animate-pulse",t[5]==="loading"),set_style(e,"height",a),set_style(e,"width",u)},m(w,A){insert_hydration(w,e,A),~r&&N[r].m(e,null),d=!0},p(w,[A]){let R=r;r=b(w),r===R?~r&&N[r].p(w,A):(n&&(group_outros(),transition_out(N[R],1,1,()=>{N[R]=null}),check_outros()),~r?(n=N[r],n?n.p(w,A):(n=N[r]=f[r](w),n.c()),transition_in(n,1),n.m(e,null)):n=null),(!d||A&4&&s!==(s="overflow-hidden "+(w[2]>200?"rounded-2xl":"rounded")+" bg-highlight-100"))&&attr(e,"class",s),(!d||A&36)&&toggle_class(e,"animate-pulse",w[5]==="loading"),A&4&&a!==(a=`${w[2]}px`)&&set_style(e,"height",a),A&4&&u!==(u=`${w[2]}px`)&&set_style(e,"width",u)},i(w){d||(transition_in(n),d=!0)},o(w){transition_out(n),d=!1},d(w){w&&detach(e),~r&&N[r].d()}}}function instance$2(t,e,r){let n,{$$slots:s={},$$scope:a}=e,{thumbnail:u=void 0}=e,{src:d=void 0}=e,{size:f=48}=e,{alt:N=""}=e,b;onMount(()=>(b?.complete&&r(4,b.style.opacity="1",b),!1));function w(S){binding_callbacks[S?"unshift":"push"](()=>{b=S,r(4,b)})}const A=()=>r(5,n="ok"),R=()=>r(5,n="error");return t.$$set=S=>{"thumbnail"in S&&r(0,u=S.thumbnail),"src"in S&&r(1,d=S.src),"size"in S&&r(2,f=S.size),"alt"in S&&r(3,N=S.alt),"$$scope"in S&&r(6,a=S.$$scope)},t.$$.update=()=>{t.$$.dirty&2&&r(5,n=d===""||d===null?"error":"loading")},[u,d,f,N,b,n,a,s,w,A,R]}class Image extends SvelteComponent{constructor(e){super(),init$1(this,e,instance$2,create_fragment$1,safe_not_equal,{thumbnail:0,src:1,size:2,alt:3})}}function capitalize(t,e=!0){return t&&(e?t.replace(/\b\w/g,r=>r.toUpperCase()):t.replace(/\b\w/,r=>r.toUpperCase()))}function clean(t){return t.normalize().trim().toLowerCase().replace(/\s+/g," ")}const __vite_glob_0_0=`CREATE TRIGGER IF NOT EXISTS cascade_playlists_library AFTER DELETE ON playlists FOR EACH ROW BEGIN @@ -418,17 +418,17 @@ END;`,__vite_glob_0_3=`INSERT OR IGNORE INTO playlists (id, title, "order", rele (-1, 'Listened', 1, 0, NULL, NULL), (-2, 'Recommended', 1, -1, NULL, NULL), (-3, 'Blocked', 1, -1, NULL, NULL), - (-4, 'Followed', 1, 0, NULL, NULL);`;function isUndefined(t){return typeof t>"u"||t===void 0}function isString(t){return typeof t=="string"}function isNumber(t){return typeof t=="number"}function isBoolean(t){return typeof t=="boolean"}function isNull(t){return t===null}function isDate(t){return t instanceof Date}function isBigInt(t){return typeof t=="bigint"}function isFunction(t){return typeof t=="function"}function isObject$3(t){return typeof t=="object"&&t!==null}function freeze(t){return Object.freeze(t)}function asArray(t){return isReadonlyArray(t)?t:[t]}function isReadonlyArray(t){return Array.isArray(t)}function noop$1(t){return t}const AlterTableNode=freeze({is(t){return t.kind==="AlterTableNode"},create(t){return freeze({kind:"AlterTableNode",table:t})},cloneWithTableProps(t,e){return freeze({...t,...e})},cloneWithColumnAlteration(t,e){return freeze({...t,columnAlterations:t.columnAlterations?[...t.columnAlterations,e]:[e]})}}),IdentifierNode=freeze({is(t){return t.kind==="IdentifierNode"},create(t){return freeze({kind:"IdentifierNode",name:t})}}),CreateIndexNode=freeze({is(t){return t.kind==="CreateIndexNode"},create(t){return freeze({kind:"CreateIndexNode",name:IdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})},cloneWithColumns(t,e){return freeze({...t,columns:[...t.columns||[],...e]})}}),CreateSchemaNode=freeze({is(t){return t.kind==="CreateSchemaNode"},create(t,e){return freeze({kind:"CreateSchemaNode",schema:IdentifierNode.create(t),...e})},cloneWith(t,e){return freeze({...t,...e})}}),ON_COMMIT_ACTIONS=["preserve rows","delete rows","drop"],CreateTableNode=freeze({is(t){return t.kind==="CreateTableNode"},create(t){return freeze({kind:"CreateTableNode",table:t,columns:freeze([])})},cloneWithColumn(t,e){return freeze({...t,columns:freeze([...t.columns,e])})},cloneWithConstraint(t,e){return freeze({...t,constraints:t.constraints?freeze([...t.constraints,e]):freeze([e])})},cloneWithFrontModifier(t,e){return freeze({...t,frontModifiers:t.frontModifiers?freeze([...t.frontModifiers,e]):freeze([e])})},cloneWithEndModifier(t,e){return freeze({...t,endModifiers:t.endModifiers?freeze([...t.endModifiers,e]):freeze([e])})},cloneWith(t,e){return freeze({...t,...e})}}),SchemableIdentifierNode=freeze({is(t){return t.kind==="SchemableIdentifierNode"},create(t){return freeze({kind:"SchemableIdentifierNode",identifier:IdentifierNode.create(t)})},createWithSchema(t,e){return freeze({kind:"SchemableIdentifierNode",schema:IdentifierNode.create(t),identifier:IdentifierNode.create(e)})}}),DropIndexNode=freeze({is(t){return t.kind==="DropIndexNode"},create(t,e){return freeze({kind:"DropIndexNode",name:SchemableIdentifierNode.create(t),...e})},cloneWith(t,e){return freeze({...t,...e})}}),DropSchemaNode=freeze({is(t){return t.kind==="DropSchemaNode"},create(t,e){return freeze({kind:"DropSchemaNode",schema:IdentifierNode.create(t),...e})},cloneWith(t,e){return freeze({...t,...e})}}),DropTableNode=freeze({is(t){return t.kind==="DropTableNode"},create(t,e){return freeze({kind:"DropTableNode",table:t,...e})},cloneWith(t,e){return freeze({...t,...e})}}),AliasNode=freeze({is(t){return t.kind==="AliasNode"},create(t,e){return freeze({kind:"AliasNode",node:t,alias:e})}}),TableNode=freeze({is(t){return t.kind==="TableNode"},create(t){return freeze({kind:"TableNode",table:SchemableIdentifierNode.create(t)})},createWithSchema(t,e){return freeze({kind:"TableNode",table:SchemableIdentifierNode.createWithSchema(t,e)})}});function isOperationNodeSource(t){return isObject$3(t)&&isFunction(t.toOperationNode)}function isExpression(t){return isObject$3(t)&&"expressionType"in t&&isOperationNodeSource(t)}function isAliasedExpression(t){return isObject$3(t)&&"expression"in t&&isString(t.alias)&&isOperationNodeSource(t)}const SelectModifierNode=freeze({is(t){return t.kind==="SelectModifierNode"},create(t,e){return freeze({kind:"SelectModifierNode",modifier:t,of:e})},createWithExpression(t){return freeze({kind:"SelectModifierNode",rawModifier:t})}}),AndNode=freeze({is(t){return t.kind==="AndNode"},create(t,e){return freeze({kind:"AndNode",left:t,right:e})}}),OrNode=freeze({is(t){return t.kind==="OrNode"},create(t,e){return freeze({kind:"OrNode",left:t,right:e})}}),OnNode=freeze({is(t){return t.kind==="OnNode"},create(t){return freeze({kind:"OnNode",on:t})},cloneWithOperation(t,e,r){return freeze({...t,on:e==="And"?AndNode.create(t.on,r):OrNode.create(t.on,r)})}}),JoinNode=freeze({is(t){return t.kind==="JoinNode"},create(t,e){return freeze({kind:"JoinNode",joinType:t,table:e,on:void 0})},createWithOn(t,e,r){return freeze({kind:"JoinNode",joinType:t,table:e,on:OnNode.create(r)})},cloneWithOn(t,e){return freeze({...t,on:t.on?OnNode.cloneWithOperation(t.on,"And",e):OnNode.create(e)})}}),BinaryOperationNode=freeze({is(t){return t.kind==="BinaryOperationNode"},create(t,e,r){return freeze({kind:"BinaryOperationNode",leftOperand:t,operator:e,rightOperand:r})}}),COMPARISON_OPERATORS=["=","==","!=","<>",">",">=","<","<=","in","not in","is","is not","like","not like","match","ilike","not ilike","@>","<@","&&","?","?&","!<","!>","<=>","!~","~","~*","!~*","@@","@@@","!!","<->","regexp","is distinct from","is not distinct from"],ARITHMETIC_OPERATORS=["+","-","*","/","%","^","&","|","#","<<",">>"],JSON_OPERATORS=["->","->>"],BINARY_OPERATORS=[...COMPARISON_OPERATORS,...ARITHMETIC_OPERATORS,"&&","||"],UNARY_FILTER_OPERATORS=["exists","not exists"],UNARY_OPERATORS=["not","-",...UNARY_FILTER_OPERATORS],OPERATORS=[...BINARY_OPERATORS,...JSON_OPERATORS,...UNARY_OPERATORS,"between","between symmetric"],OperatorNode=freeze({is(t){return t.kind==="OperatorNode"},create(t){return freeze({kind:"OperatorNode",operator:t})}});function isJSONOperator(t){return isString(t)&&JSON_OPERATORS.includes(t)}const ColumnNode=freeze({is(t){return t.kind==="ColumnNode"},create(t){return freeze({kind:"ColumnNode",column:IdentifierNode.create(t)})}}),SelectAllNode=freeze({is(t){return t.kind==="SelectAllNode"},create(){return freeze({kind:"SelectAllNode"})}}),ReferenceNode=freeze({is(t){return t.kind==="ReferenceNode"},create(t,e){return freeze({kind:"ReferenceNode",table:e,column:t})},createSelectAll(t){return freeze({kind:"ReferenceNode",table:t,column:SelectAllNode.create()})}});class DynamicReferenceBuilder{#e;get dynamicReference(){return this.#e}get refType(){}constructor(e){this.#e=e}toOperationNode(){return parseSimpleReferenceExpression(this.#e)}}function isDynamicReferenceBuilder(t){return isObject$3(t)&&isOperationNodeSource(t)&&isString(t.dynamicReference)}const OrderByItemNode=freeze({is(t){return t.kind==="OrderByItemNode"},create(t,e){return freeze({kind:"OrderByItemNode",orderBy:t,direction:e})}}),RawNode=freeze({is(t){return t.kind==="RawNode"},create(t,e){return freeze({kind:"RawNode",sqlFragments:freeze(t),parameters:freeze(e)})},createWithSql(t){return RawNode.create([t],[])},createWithChild(t){return RawNode.create(["",""],[t])},createWithChildren(t){return RawNode.create(new Array(t.length+1).fill(""),t)}});function isOrderByDirection(t){return t==="asc"||t==="desc"}function parseOrderBy(t){if(t.length===2)return[parseOrderByItem(t[0],t[1])];if(t.length===1){const[e]=t;return Array.isArray(e)?e.map(r=>parseOrderByItem(r)):[parseOrderByItem(e)]}throw new Error(`Invalid number of arguments at order by! expected 1-2, received ${t.length}`)}function parseOrderByItem(t,e){const r=parseOrderByExpression(t);if(OrderByItemNode.is(r)){if(e)throw new Error("Cannot specify direction twice!");return r}return OrderByItemNode.create(r,parseOrderByDirectionExpression(e))}function parseOrderByExpression(t){if(isExpressionOrFactory(t))return parseExpression(t);if(isDynamicReferenceBuilder(t))return t.toOperationNode();const[e,r]=t.split(" ");if(r){if(!isOrderByDirection(r))throw new Error(`Invalid order by direction: ${r}`);return OrderByItemNode.create(parseStringReference(e),parseOrderByDirectionExpression(r))}return parseStringReference(t)}function parseOrderByDirectionExpression(t){if(t)return t==="asc"||t==="desc"?RawNode.createWithSql(t):t.toOperationNode()}const JSONReferenceNode=freeze({is(t){return t.kind==="JSONReferenceNode"},create(t,e){return freeze({kind:"JSONReferenceNode",reference:t,traversal:e})},cloneWithTraversal(t,e){return freeze({...t,traversal:e})}}),JSONOperatorChainNode=freeze({is(t){return t.kind==="JSONOperatorChainNode"},create(t){return freeze({kind:"JSONOperatorChainNode",operator:t,values:freeze([])})},cloneWithValue(t,e){return freeze({...t,values:freeze([...t.values,e])})}}),JSONPathNode=freeze({is(t){return t.kind==="JSONPathNode"},create(t){return freeze({kind:"JSONPathNode",inOperator:t,pathLegs:freeze([])})},cloneWithLeg(t,e){return freeze({...t,pathLegs:freeze([...t.pathLegs,e])})}});function parseSimpleReferenceExpression(t){return isString(t)?parseStringReference(t):t.toOperationNode()}function parseReferenceExpressionOrList(t){return isReadonlyArray(t)?t.map(e=>parseReferenceExpression(e)):[parseReferenceExpression(t)]}function parseReferenceExpression(t){return isExpressionOrFactory(t)?parseExpression(t):parseSimpleReferenceExpression(t)}function parseJSONReference(t,e){const r=parseStringReference(t);if(isJSONOperator(e))return JSONReferenceNode.create(r,JSONOperatorChainNode.create(OperatorNode.create(e)));const n=e.slice(0,-1);if(isJSONOperator(n))return JSONReferenceNode.create(r,JSONPathNode.create(OperatorNode.create(n)));throw new Error(`Invalid JSON operator: ${e}`)}function parseStringReference(t){const e=".";if(!t.includes(e))return ReferenceNode.create(ColumnNode.create(t));const r=t.split(e).map(trim$2);if(r.length===3)return parseStringReferenceWithTableAndSchema(r);if(r.length===2)return parseStringReferenceWithTable(r);throw new Error(`invalid column reference ${t}`)}function parseAliasedStringReference(t){const e=" as ";if(t.includes(e)){const[r,n]=t.split(e).map(trim$2);return AliasNode.create(parseStringReference(r),IdentifierNode.create(n))}else return parseStringReference(t)}function parseColumnName(t){return ColumnNode.create(t)}function parseOrderedColumnName(t){const e=" ";if(t.includes(e)){const[r,n]=t.split(e).map(trim$2);if(!isOrderByDirection(n))throw new Error(`invalid order direction "${n}" next to "${r}"`);return parseOrderBy([r,n])[0]}else return parseColumnName(t)}function parseStringReferenceWithTableAndSchema(t){const[e,r,n]=t;return ReferenceNode.create(ColumnNode.create(n),TableNode.createWithSchema(e,r))}function parseStringReferenceWithTable(t){const[e,r]=t;return ReferenceNode.create(ColumnNode.create(r),TableNode.create(e))}function trim$2(t){return t.trim()}const PrimitiveValueListNode=freeze({is(t){return t.kind==="PrimitiveValueListNode"},create(t){return freeze({kind:"PrimitiveValueListNode",values:freeze([...t])})}}),ValueListNode=freeze({is(t){return t.kind==="ValueListNode"},create(t){return freeze({kind:"ValueListNode",values:freeze(t)})}}),ValueNode=freeze({is(t){return t.kind==="ValueNode"},create(t){return freeze({kind:"ValueNode",value:t})},createImmediate(t){return freeze({kind:"ValueNode",value:t,immediate:!0})}});function parseValueExpressionOrList(t){return isReadonlyArray(t)?parseValueExpressionList(t):parseValueExpression(t)}function parseValueExpression(t){return isExpressionOrFactory(t)?parseExpression(t):ValueNode.create(t)}function isSafeImmediateValue(t){return isNumber(t)||isBoolean(t)||isNull(t)}function parseSafeImmediateValue(t){if(!isSafeImmediateValue(t))throw new Error(`unsafe immediate value ${JSON.stringify(t)}`);return ValueNode.createImmediate(t)}function parseValueExpressionList(t){return t.some(isExpressionOrFactory)?ValueListNode.create(t.map(e=>parseValueExpression(e))):PrimitiveValueListNode.create(t)}const ParensNode=freeze({is(t){return t.kind==="ParensNode"},create(t){return freeze({kind:"ParensNode",node:t})}});function parseValueBinaryOperationOrExpression(t){if(t.length===3)return parseValueBinaryOperation(t[0],t[1],t[2]);if(t.length===1)return parseValueExpression(t[0]);throw new Error(`invalid arguments: ${JSON.stringify(t)}`)}function parseValueBinaryOperation(t,e,r){return isIsOperator(e)&&needsIsOperator(r)?BinaryOperationNode.create(parseReferenceExpression(t),parseOperator(e),ValueNode.createImmediate(r)):BinaryOperationNode.create(parseReferenceExpression(t),parseOperator(e),parseValueExpressionOrList(r))}function parseReferentialBinaryOperation(t,e,r){return BinaryOperationNode.create(parseReferenceExpression(t),parseOperator(e),parseReferenceExpression(r))}function parseFilterObject(t,e){return parseFilterList(Object.entries(t).filter(([,r])=>!isUndefined(r)).map(([r,n])=>parseValueBinaryOperation(r,needsIsOperator(n)?"is":"=",n)),e)}function parseFilterList(t,e){const r=e==="and"?AndNode.create:OrNode.create;if(t.length===0)return BinaryOperationNode.create(ValueNode.createImmediate(1),OperatorNode.create("="),ValueNode.createImmediate(e==="and"?1:0));let n=toOperationNode(t[0]);for(let s=1;s1?ParensNode.create(n):n}function isIsOperator(t){return t==="is"||t==="is not"}function needsIsOperator(t){return isNull(t)||isBoolean(t)}function parseOperator(t){if(isString(t)&&OPERATORS.includes(t))return OperatorNode.create(t);if(isOperationNodeSource(t))return t.toOperationNode();throw new Error(`invalid operator ${JSON.stringify(t)}`)}function toOperationNode(t){return isOperationNodeSource(t)?t.toOperationNode():t}const OrderByNode=freeze({is(t){return t.kind==="OrderByNode"},create(t){return freeze({kind:"OrderByNode",items:freeze([...t])})},cloneWithItems(t,e){return freeze({...t,items:freeze([...t.items,...e])})}}),PartitionByNode=freeze({is(t){return t.kind==="PartitionByNode"},create(t){return freeze({kind:"PartitionByNode",items:freeze(t)})},cloneWithItems(t,e){return freeze({...t,items:freeze([...t.items,...e])})}}),OverNode=freeze({is(t){return t.kind==="OverNode"},create(){return freeze({kind:"OverNode"})},cloneWithOrderByItems(t,e){return freeze({...t,orderBy:t.orderBy?OrderByNode.cloneWithItems(t.orderBy,e):OrderByNode.create(e)})},cloneWithPartitionByItems(t,e){return freeze({...t,partitionBy:t.partitionBy?PartitionByNode.cloneWithItems(t.partitionBy,e):PartitionByNode.create(e)})}}),FromNode=freeze({is(t){return t.kind==="FromNode"},create(t){return freeze({kind:"FromNode",froms:freeze(t)})},cloneWithFroms(t,e){return freeze({...t,froms:freeze([...t.froms,...e])})}}),GroupByNode=freeze({is(t){return t.kind==="GroupByNode"},create(t){return freeze({kind:"GroupByNode",items:freeze(t)})},cloneWithItems(t,e){return freeze({...t,items:freeze([...t.items,...e])})}}),HavingNode=freeze({is(t){return t.kind==="HavingNode"},create(t){return freeze({kind:"HavingNode",having:t})},cloneWithOperation(t,e,r){return freeze({...t,having:e==="And"?AndNode.create(t.having,r):OrNode.create(t.having,r)})}}),SelectQueryNode=freeze({is(t){return t.kind==="SelectQueryNode"},create(t){return freeze({kind:"SelectQueryNode",...t&&{with:t}})},createFrom(t,e){return freeze({kind:"SelectQueryNode",from:FromNode.create(t),...e&&{with:e}})},cloneWithSelections(t,e){return freeze({...t,selections:t.selections?freeze([...t.selections,...e]):freeze(e)})},cloneWithDistinctOn(t,e){return freeze({...t,distinctOn:t.distinctOn?freeze([...t.distinctOn,...e]):freeze(e)})},cloneWithFrontModifier(t,e){return freeze({...t,frontModifiers:t.frontModifiers?freeze([...t.frontModifiers,e]):freeze([e])})},cloneWithEndModifier(t,e){return freeze({...t,endModifiers:t.endModifiers?freeze([...t.endModifiers,e]):freeze([e])})},cloneWithOrderByItems(t,e){return freeze({...t,orderBy:t.orderBy?OrderByNode.cloneWithItems(t.orderBy,e):OrderByNode.create(e)})},cloneWithGroupByItems(t,e){return freeze({...t,groupBy:t.groupBy?GroupByNode.cloneWithItems(t.groupBy,e):GroupByNode.create(e)})},cloneWithLimit(t,e){return freeze({...t,limit:e})},cloneWithOffset(t,e){return freeze({...t,offset:e})},cloneWithHaving(t,e){return freeze({...t,having:t.having?HavingNode.cloneWithOperation(t.having,"And",e):HavingNode.create(e)})},cloneWithSetOperations(t,e){return freeze({...t,setOperations:t.setOperations?freeze([...t.setOperations,...e]):freeze([...e])})},cloneWithoutSelections(t){return freeze({...t,selections:[]})},cloneWithoutLimit(t){return freeze({...t,limit:void 0})},cloneWithoutOffset(t){return freeze({...t,offset:void 0})},cloneWithoutOrderBy(t){return freeze({...t,orderBy:void 0})}});function preventAwait(t,e){Object.defineProperties(t.prototype,{then:{enumerable:!1,value:()=>{throw new Error(e)}}})}class JoinBuilder{#e;constructor(e){this.#e=freeze(e)}on(...e){return new JoinBuilder({...this.#e,joinNode:JoinNode.cloneWithOn(this.#e.joinNode,parseValueBinaryOperationOrExpression(e))})}onRef(e,r,n){return new JoinBuilder({...this.#e,joinNode:JoinNode.cloneWithOn(this.#e.joinNode,parseReferentialBinaryOperation(e,r,n))})}onTrue(){return new JoinBuilder({...this.#e,joinNode:JoinNode.cloneWithOn(this.#e.joinNode,RawNode.createWithSql("true"))})}$call(e){return e(this)}toOperationNode(){return this.#e.joinNode}}preventAwait(JoinBuilder,"don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");const PartitionByItemNode=freeze({is(t){return t.kind==="PartitionByItemNode"},create(t){return freeze({kind:"PartitionByItemNode",partitionBy:t})}});function parsePartitionBy(t){return parseReferenceExpressionOrList(t).map(PartitionByItemNode.create)}class OverBuilder{#e;constructor(e){this.#e=freeze(e)}orderBy(e,r){return new OverBuilder({overNode:OverNode.cloneWithOrderByItems(this.#e.overNode,parseOrderBy([e,r]))})}partitionBy(e){return new OverBuilder({overNode:OverNode.cloneWithPartitionByItems(this.#e.overNode,parsePartitionBy(e))})}$call(e){return e(this)}toOperationNode(){return this.#e.overNode}}preventAwait(OverBuilder,"don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");const SelectionNode=freeze({is(t){return t.kind==="SelectionNode"},create(t){return freeze({kind:"SelectionNode",selection:t})},createSelectAll(){return freeze({kind:"SelectionNode",selection:SelectAllNode.create()})},createSelectAllFromTable(t){return freeze({kind:"SelectionNode",selection:ReferenceNode.createSelectAll(t)})}});function parseSelectArg(t){return isFunction(t)?parseSelectArg(t(expressionBuilder())):isReadonlyArray(t)?t.map(e=>parseSelectExpression(e)):[parseSelectExpression(t)]}function parseSelectExpression(t){return isString(t)?SelectionNode.create(parseAliasedStringReference(t)):isDynamicReferenceBuilder(t)?SelectionNode.create(t.toOperationNode()):SelectionNode.create(parseAliasedExpression(t))}function parseSelectAll(t){return t?Array.isArray(t)?t.map(parseSelectAllArg):[parseSelectAllArg(t)]:[SelectionNode.createSelectAll()]}function parseSelectAllArg(t){if(isString(t))return SelectionNode.createSelectAllFromTable(parseTable(t));throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`)}const ValuesNode=freeze({is(t){return t.kind==="ValuesNode"},create(t){return freeze({kind:"ValuesNode",values:freeze(t)})}}),DefaultInsertValueNode=freeze({is(t){return t.kind==="DefaultInsertValueNode"},create(){return freeze({kind:"DefaultInsertValueNode"})}});function parseInsertExpression(t){const e=isFunction(t)?t(expressionBuilder()):t,r=isReadonlyArray(e)?e:freeze([e]);return parseInsertColumnsAndValues(r)}function parseInsertColumnsAndValues(t){const e=parseColumnNamesAndIndexes(t);return[freeze([...e.keys()].map(ColumnNode.create)),ValuesNode.create(t.map(r=>parseRowValues(r,e)))]}function parseColumnNamesAndIndexes(t){const e=new Map;for(const r of t){const n=Object.keys(r);for(const s of n)!e.has(s)&&r[s]!==void 0&&e.set(s,e.size)}return e}function parseRowValues(t,e){const r=Object.keys(t),n=Array.from({length:e.size});let s=!1;for(const u of r){const d=e.get(u);if(isUndefined(d))continue;const f=t[u];(isUndefined(f)||isExpressionOrFactory(f))&&(s=!0),n[d]=f}if(r.lengthisUndefined(d)?u:parseValueExpression(d)))}return PrimitiveValueListNode.create(n)}const InsertQueryNode=freeze({is(t){return t.kind==="InsertQueryNode"},create(t,e,r){return freeze({kind:"InsertQueryNode",into:t,...e&&{with:e},replace:r})},cloneWith(t,e){return freeze({...t,...e})}}),UpdateQueryNode=freeze({is(t){return t.kind==="UpdateQueryNode"},create(t,e){return freeze({kind:"UpdateQueryNode",table:t,...e&&{with:e}})},cloneWithFromItems(t,e){return freeze({...t,from:t.from?FromNode.cloneWithFroms(t.from,e):FromNode.create(e)})},cloneWithUpdates(t,e){return freeze({...t,updates:t.updates?freeze([...t.updates,...e]):e})}}),UsingNode=freeze({is(t){return t.kind==="UsingNode"},create(t){return freeze({kind:"UsingNode",tables:freeze(t)})},cloneWithTables(t,e){return freeze({...t,tables:freeze([...t.tables,...e])})}}),DeleteQueryNode=freeze({is(t){return t.kind==="DeleteQueryNode"},create(t,e){return freeze({kind:"DeleteQueryNode",from:FromNode.create(t),...e&&{with:e}})},cloneWithOrderByItems(t,e){return freeze({...t,orderBy:t.orderBy?OrderByNode.cloneWithItems(t.orderBy,e):OrderByNode.create(e)})},cloneWithLimit(t,e){return freeze({...t,limit:e})},cloneWithUsing(t,e){return freeze({...t,using:t.using!==void 0?UsingNode.cloneWithTables(t.using,e):UsingNode.create(e)})}}),WhereNode=freeze({is(t){return t.kind==="WhereNode"},create(t){return freeze({kind:"WhereNode",where:t})},cloneWithOperation(t,e,r){return freeze({...t,where:e==="And"?AndNode.create(t.where,r):OrNode.create(t.where,r)})}}),ReturningNode=freeze({is(t){return t.kind==="ReturningNode"},create(t){return freeze({kind:"ReturningNode",selections:freeze(t)})},cloneWithSelections(t,e){return freeze({...t,selections:t.selections?freeze([...t.selections,...e]):freeze(e)})}}),ExplainNode=freeze({is(t){return t.kind==="ExplainNode"},create(t,e){return freeze({kind:"ExplainNode",format:t,options:e})}}),QueryNode=freeze({is(t){return SelectQueryNode.is(t)||InsertQueryNode.is(t)||UpdateQueryNode.is(t)||DeleteQueryNode.is(t)},cloneWithWhere(t,e){return freeze({...t,where:t.where?WhereNode.cloneWithOperation(t.where,"And",e):WhereNode.create(e)})},cloneWithJoin(t,e){return freeze({...t,joins:t.joins?freeze([...t.joins,e]):freeze([e])})},cloneWithReturning(t,e){return freeze({...t,returning:t.returning?ReturningNode.cloneWithSelections(t.returning,e):ReturningNode.create(e)})},cloneWithoutWhere(t){return freeze({...t,where:void 0})},cloneWithExplain(t,e,r){return freeze({...t,explain:ExplainNode.create(e,r?.toOperationNode())})}}),ColumnUpdateNode=freeze({is(t){return t.kind==="ColumnUpdateNode"},create(t,e){return freeze({kind:"ColumnUpdateNode",column:t,value:e})}});function parseUpdate(...t){return t.length===2?[ColumnUpdateNode.create(parseReferenceExpression(t[0]),parseValueExpression(t[1]))]:parseUpdateObjectExpression(t[0])}function parseUpdateObjectExpression(t){const e=isFunction(t)?t(expressionBuilder()):t;return Object.entries(e).filter(([r,n])=>n!==void 0).map(([r,n])=>ColumnUpdateNode.create(ColumnNode.create(r),parseValueExpression(n)))}const OnDuplicateKeyNode=freeze({is(t){return t.kind==="OnDuplicateKeyNode"},create(t){return freeze({kind:"OnDuplicateKeyNode",updates:t})}});class InsertResult{insertId;numInsertedOrUpdatedRows;constructor(e,r){this.insertId=e,this.numInsertedOrUpdatedRows=r}}class NoResultError extends Error{node;constructor(e){super("no result"),this.node=e}}function isNoResultErrorConstructor(t){return Object.prototype.hasOwnProperty.call(t,"prototype")}const OnConflictNode=freeze({is(t){return t.kind==="OnConflictNode"},create(){return freeze({kind:"OnConflictNode"})},cloneWith(t,e){return freeze({...t,...e})},cloneWithIndexWhere(t,e){return freeze({...t,indexWhere:t.indexWhere?WhereNode.cloneWithOperation(t.indexWhere,"And",e):WhereNode.create(e)})},cloneWithIndexOrWhere(t,e){return freeze({...t,indexWhere:t.indexWhere?WhereNode.cloneWithOperation(t.indexWhere,"Or",e):WhereNode.create(e)})},cloneWithUpdateWhere(t,e){return freeze({...t,updateWhere:t.updateWhere?WhereNode.cloneWithOperation(t.updateWhere,"And",e):WhereNode.create(e)})},cloneWithUpdateOrWhere(t,e){return freeze({...t,updateWhere:t.updateWhere?WhereNode.cloneWithOperation(t.updateWhere,"Or",e):WhereNode.create(e)})},cloneWithoutIndexWhere(t){return freeze({...t,indexWhere:void 0})},cloneWithoutUpdateWhere(t){return freeze({...t,updateWhere:void 0})}});class OnConflictBuilder{#e;constructor(e){this.#e=freeze(e)}column(e){const r=ColumnNode.create(e);return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?freeze([...this.#e.onConflictNode.columns,r]):freeze([r])})})}columns(e){const r=e.map(ColumnNode.create);return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?freeze([...this.#e.onConflictNode.columns,...r]):freeze(r)})})}constraint(e){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{constraint:IdentifierNode.create(e)})})}expression(e){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{indexExpression:e.toOperationNode()})})}where(...e){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithIndexWhere(this.#e.onConflictNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithIndexWhere(this.#e.onConflictNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithoutIndexWhere(this.#e.onConflictNode)})}doNothing(){return new OnConflictDoNothingBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{doNothing:!0})})}doUpdateSet(e){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{updates:parseUpdateObjectExpression(e)})})}$call(e){return e(this)}}preventAwait(OnConflictBuilder,"don't await OnConflictBuilder instances.");class OnConflictDoNothingBuilder{#e;constructor(e){this.#e=freeze(e)}toOperationNode(){return this.#e.onConflictNode}}preventAwait(OnConflictDoNothingBuilder,"don't await OnConflictDoNothingBuilder instances.");class OnConflictUpdateBuilder{#e;constructor(e){this.#e=freeze(e)}where(...e){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithUpdateWhere(this.#e.onConflictNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithUpdateWhere(this.#e.onConflictNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithoutUpdateWhere(this.#e.onConflictNode)})}$call(e){return e(this)}toOperationNode(){return this.#e.onConflictNode}}preventAwait(OnConflictUpdateBuilder,"don't await OnConflictUpdateBuilder instances.");class InsertQueryBuilder{#e;constructor(e){this.#e=freeze(e)}values(e){const[r,n]=parseInsertExpression(e);return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{columns:r,values:n})})}columns(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{columns:freeze(e.map(ColumnNode.create))})})}expression(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{values:parseExpression(e)})})}defaultValues(){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{defaultValues:!0})})}ignore(){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{ignore:!0})})}onConflict(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{onConflict:e(new OnConflictBuilder({onConflictNode:OnConflictNode.create()})).toOperationNode()})})}onDuplicateKeyUpdate(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{onDuplicateKey:OnDuplicateKeyNode.create(parseUpdateObjectExpression(e))})})}returning(e){return new InsertQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectArg(e))})}returningAll(){return new InsertQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectAll())})}$call(e){return e(this)}$if(e,r){return e?r(this):new InsertQueryBuilder({...this.#e})}$castTo(){return new InsertQueryBuilder(this.#e)}$narrowType(){return new InsertQueryBuilder(this.#e)}$assertType(){return new InsertQueryBuilder(this.#e)}withPlugin(e){return new InsertQueryBuilder({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile(),r=e.query,n=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?n.rows:[new InsertResult(n.insertId,n.numAffectedRows??n.numUpdatedOrDeletedRows)]}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new InsertQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(InsertQueryBuilder,"don't await InsertQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");class DeleteResult{numDeletedRows;constructor(e){this.numDeletedRows=e}}const LimitNode=freeze({is(t){return t.kind==="LimitNode"},create(t){return freeze({kind:"LimitNode",limit:t})}});class DeleteQueryBuilder{#e;constructor(e){this.#e=freeze(e)}where(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithoutWhere(this.#e.queryNode)})}using(e){return new DeleteQueryBuilder({...this.#e,queryNode:DeleteQueryNode.cloneWithUsing(this.#e.queryNode,parseTableExpressionOrList(e))})}innerJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("InnerJoin",e))})}leftJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LeftJoin",e))})}rightJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("RightJoin",e))})}fullJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("FullJoin",e))})}returning(e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectArg(e))})}returningAll(e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectAll(e))})}orderBy(e,r){return new DeleteQueryBuilder({...this.#e,queryNode:DeleteQueryNode.cloneWithOrderByItems(this.#e.queryNode,parseOrderBy([e,r]))})}limit(e){return new DeleteQueryBuilder({...this.#e,queryNode:DeleteQueryNode.cloneWithLimit(this.#e.queryNode,LimitNode.create(parseValueExpression(e)))})}$call(e){return e(this)}$if(e,r){return e?r(this):new DeleteQueryBuilder({...this.#e})}$castTo(){return new DeleteQueryBuilder(this.#e)}$narrowType(){return new DeleteQueryBuilder(this.#e)}$assertType(){return new DeleteQueryBuilder(this.#e)}withPlugin(e){return new DeleteQueryBuilder({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile(),r=e.query,n=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?n.rows:[new DeleteResult(n.numAffectedRows??n.numUpdatedOrDeletedRows??BigInt(0))]}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(DeleteQueryBuilder,"don't await DeleteQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");class UpdateResult{numUpdatedRows;numChangedRows;constructor(e,r){this.numUpdatedRows=e,this.numChangedRows=r}}class UpdateQueryBuilder{#e;constructor(e){this.#e=freeze(e)}where(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithoutWhere(this.#e.queryNode)})}from(e){return new UpdateQueryBuilder({...this.#e,queryNode:UpdateQueryNode.cloneWithFromItems(this.#e.queryNode,parseTableExpressionOrList(e))})}innerJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("InnerJoin",e))})}leftJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LeftJoin",e))})}rightJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("RightJoin",e))})}fullJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("FullJoin",e))})}set(...e){return new UpdateQueryBuilder({...this.#e,queryNode:UpdateQueryNode.cloneWithUpdates(this.#e.queryNode,parseUpdate(...e))})}returning(e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectArg(e))})}returningAll(){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectAll())})}$call(e){return e(this)}$if(e,r){return e?r(this):new UpdateQueryBuilder({...this.#e})}$castTo(){return new UpdateQueryBuilder(this.#e)}$narrowType(){return new UpdateQueryBuilder(this.#e)}$assertType(){return new UpdateQueryBuilder(this.#e)}withPlugin(e){return new UpdateQueryBuilder({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile(),r=e.query,n=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?n.rows:[new UpdateResult(n.numAffectedRows??n.numUpdatedOrDeletedRows??BigInt(0),n.numChangedRows)]}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(UpdateQueryBuilder,"don't await UpdateQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");const CommonTableExpressionNameNode=freeze({is(t){return t.kind==="CommonTableExpressionNameNode"},create(t,e){return freeze({kind:"CommonTableExpressionNameNode",table:TableNode.create(t),columns:e?freeze(e.map(ColumnNode.create)):void 0})}}),CommonTableExpressionNode=freeze({is(t){return t.kind==="CommonTableExpressionNode"},create(t,e){return freeze({kind:"CommonTableExpressionNode",name:t,expression:e})},cloneWith(t,e){return freeze({...t,...e})}});class CTEBuilder{#e;constructor(e){this.#e=freeze(e)}materialized(){return new CTEBuilder({...this.#e,node:CommonTableExpressionNode.cloneWith(this.#e.node,{materialized:!0})})}notMaterialized(){return new CTEBuilder({...this.#e,node:CommonTableExpressionNode.cloneWith(this.#e.node,{materialized:!1})})}toOperationNode(){return this.#e.node}}preventAwait(CTEBuilder,"don't await CTEBuilder instances. They are never executed directly and are always just a part of a query.");function parseCommonTableExpression(t,e){const r=e(createQueryCreator()).toOperationNode();return isFunction(t)?t(cteBuilderFactory(r)).toOperationNode():CommonTableExpressionNode.create(parseCommonTableExpressionName(t),r)}function cteBuilderFactory(t){return e=>new CTEBuilder({node:CommonTableExpressionNode.create(parseCommonTableExpressionName(e),t)})}function parseCommonTableExpressionName(t){if(t.includes("(")){const e=t.split(/[\(\)]/),r=e[0],n=e[1].split(",").map(s=>s.trim());return CommonTableExpressionNameNode.create(r,n)}else return CommonTableExpressionNameNode.create(t)}const WithNode=freeze({is(t){return t.kind==="WithNode"},create(t,e){return freeze({kind:"WithNode",expressions:freeze([t]),...e})},cloneWithExpression(t,e){return freeze({...t,expressions:freeze([...t.expressions,e])})}}),CHARS=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function randomString(t){let e="";for(let r=0;rthis.transformNode(r)))}transformSelectQuery(e){return{kind:"SelectQueryNode",from:this.transformNode(e.from),selections:this.transformNodeList(e.selections),distinctOn:this.transformNodeList(e.distinctOn),joins:this.transformNodeList(e.joins),groupBy:this.transformNode(e.groupBy),orderBy:this.transformNode(e.orderBy),where:this.transformNode(e.where),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),limit:this.transformNode(e.limit),offset:this.transformNode(e.offset),with:this.transformNode(e.with),having:this.transformNode(e.having),explain:this.transformNode(e.explain),setOperations:this.transformNodeList(e.setOperations)}}transformSelection(e){return{kind:"SelectionNode",selection:this.transformNode(e.selection)}}transformColumn(e){return{kind:"ColumnNode",column:this.transformNode(e.column)}}transformAlias(e){return{kind:"AliasNode",node:this.transformNode(e.node),alias:this.transformNode(e.alias)}}transformTable(e){return{kind:"TableNode",table:this.transformNode(e.table)}}transformFrom(e){return{kind:"FromNode",froms:this.transformNodeList(e.froms)}}transformReference(e){return{kind:"ReferenceNode",column:this.transformNode(e.column),table:this.transformNode(e.table)}}transformAnd(e){return{kind:"AndNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformOr(e){return{kind:"OrNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformValueList(e){return{kind:"ValueListNode",values:this.transformNodeList(e.values)}}transformParens(e){return{kind:"ParensNode",node:this.transformNode(e.node)}}transformJoin(e){return{kind:"JoinNode",joinType:e.joinType,table:this.transformNode(e.table),on:this.transformNode(e.on)}}transformRaw(e){return{kind:"RawNode",sqlFragments:freeze([...e.sqlFragments]),parameters:this.transformNodeList(e.parameters)}}transformWhere(e){return{kind:"WhereNode",where:this.transformNode(e.where)}}transformInsertQuery(e){return{kind:"InsertQueryNode",into:this.transformNode(e.into),columns:this.transformNodeList(e.columns),values:this.transformNode(e.values),returning:this.transformNode(e.returning),onConflict:this.transformNode(e.onConflict),onDuplicateKey:this.transformNode(e.onDuplicateKey),with:this.transformNode(e.with),ignore:e.ignore,replace:e.replace,explain:this.transformNode(e.explain),defaultValues:e.defaultValues}}transformValues(e){return{kind:"ValuesNode",values:this.transformNodeList(e.values)}}transformDeleteQuery(e){return{kind:"DeleteQueryNode",from:this.transformNode(e.from),using:this.transformNode(e.using),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),returning:this.transformNode(e.returning),with:this.transformNode(e.with),orderBy:this.transformNode(e.orderBy),limit:this.transformNode(e.limit),explain:this.transformNode(e.explain)}}transformReturning(e){return{kind:"ReturningNode",selections:this.transformNodeList(e.selections)}}transformCreateTable(e){return{kind:"CreateTableNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),constraints:this.transformNodeList(e.constraints),temporary:e.temporary,ifNotExists:e.ifNotExists,onCommit:e.onCommit,frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),selectQuery:this.transformNode(e.selectQuery)}}transformColumnDefinition(e){return{kind:"ColumnDefinitionNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),references:this.transformNode(e.references),primaryKey:e.primaryKey,autoIncrement:e.autoIncrement,unique:e.unique,notNull:e.notNull,unsigned:e.unsigned,defaultTo:this.transformNode(e.defaultTo),check:this.transformNode(e.check),generated:this.transformNode(e.generated),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),nullsNotDistinct:e.nullsNotDistinct}}transformAddColumn(e){return{kind:"AddColumnNode",column:this.transformNode(e.column)}}transformDropTable(e){return{kind:"DropTableNode",table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformOrderBy(e){return{kind:"OrderByNode",items:this.transformNodeList(e.items)}}transformOrderByItem(e){return{kind:"OrderByItemNode",orderBy:this.transformNode(e.orderBy),direction:this.transformNode(e.direction)}}transformGroupBy(e){return{kind:"GroupByNode",items:this.transformNodeList(e.items)}}transformGroupByItem(e){return{kind:"GroupByItemNode",groupBy:this.transformNode(e.groupBy)}}transformUpdateQuery(e){return{kind:"UpdateQueryNode",table:this.transformNode(e.table),from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),updates:this.transformNodeList(e.updates),returning:this.transformNode(e.returning),with:this.transformNode(e.with),explain:this.transformNode(e.explain)}}transformColumnUpdate(e){return{kind:"ColumnUpdateNode",column:this.transformNode(e.column),value:this.transformNode(e.value)}}transformLimit(e){return{kind:"LimitNode",limit:this.transformNode(e.limit)}}transformOffset(e){return{kind:"OffsetNode",offset:this.transformNode(e.offset)}}transformOnConflict(e){return{kind:"OnConflictNode",columns:this.transformNodeList(e.columns),constraint:this.transformNode(e.constraint),indexExpression:this.transformNode(e.indexExpression),indexWhere:this.transformNode(e.indexWhere),updates:this.transformNodeList(e.updates),updateWhere:this.transformNode(e.updateWhere),doNothing:e.doNothing}}transformOnDuplicateKey(e){return{kind:"OnDuplicateKeyNode",updates:this.transformNodeList(e.updates)}}transformCreateIndex(e){return{kind:"CreateIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),unique:e.unique,using:this.transformNode(e.using),ifNotExists:e.ifNotExists,where:this.transformNode(e.where),nullsNotDistinct:e.nullsNotDistinct}}transformList(e){return{kind:"ListNode",items:this.transformNodeList(e.items)}}transformDropIndex(e){return{kind:"DropIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformPrimaryKeyConstraint(e){return{kind:"PrimaryKeyConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformUniqueConstraint(e){return{kind:"UniqueConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name),nullsNotDistinct:e.nullsNotDistinct}}transformForeignKeyConstraint(e){return{kind:"ForeignKeyConstraintNode",columns:this.transformNodeList(e.columns),references:this.transformNode(e.references),name:this.transformNode(e.name),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformSetOperation(e){return{kind:"SetOperationNode",operator:e.operator,expression:this.transformNode(e.expression),all:e.all}}transformReferences(e){return{kind:"ReferencesNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformCheckConstraint(e){return{kind:"CheckConstraintNode",expression:this.transformNode(e.expression),name:this.transformNode(e.name)}}transformWith(e){return{kind:"WithNode",expressions:this.transformNodeList(e.expressions),recursive:e.recursive}}transformCommonTableExpression(e){return{kind:"CommonTableExpressionNode",name:this.transformNode(e.name),materialized:e.materialized,expression:this.transformNode(e.expression)}}transformCommonTableExpressionName(e){return{kind:"CommonTableExpressionNameNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns)}}transformHaving(e){return{kind:"HavingNode",having:this.transformNode(e.having)}}transformCreateSchema(e){return{kind:"CreateSchemaNode",schema:this.transformNode(e.schema),ifNotExists:e.ifNotExists}}transformDropSchema(e){return{kind:"DropSchemaNode",schema:this.transformNode(e.schema),ifExists:e.ifExists,cascade:e.cascade}}transformAlterTable(e){return{kind:"AlterTableNode",table:this.transformNode(e.table),renameTo:this.transformNode(e.renameTo),setSchema:this.transformNode(e.setSchema),columnAlterations:this.transformNodeList(e.columnAlterations),addConstraint:this.transformNode(e.addConstraint),dropConstraint:this.transformNode(e.dropConstraint),addIndex:this.transformNode(e.addIndex),dropIndex:this.transformNode(e.dropIndex)}}transformDropColumn(e){return{kind:"DropColumnNode",column:this.transformNode(e.column)}}transformRenameColumn(e){return{kind:"RenameColumnNode",column:this.transformNode(e.column),renameTo:this.transformNode(e.renameTo)}}transformAlterColumn(e){return{kind:"AlterColumnNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),dataTypeExpression:this.transformNode(e.dataTypeExpression),setDefault:this.transformNode(e.setDefault),dropDefault:e.dropDefault,setNotNull:e.setNotNull,dropNotNull:e.dropNotNull}}transformModifyColumn(e){return{kind:"ModifyColumnNode",column:this.transformNode(e.column)}}transformAddConstraint(e){return{kind:"AddConstraintNode",constraint:this.transformNode(e.constraint)}}transformDropConstraint(e){return{kind:"DropConstraintNode",constraintName:this.transformNode(e.constraintName),ifExists:e.ifExists,modifier:e.modifier}}transformCreateView(e){return{kind:"CreateViewNode",name:this.transformNode(e.name),temporary:e.temporary,orReplace:e.orReplace,ifNotExists:e.ifNotExists,materialized:e.materialized,columns:this.transformNodeList(e.columns),as:this.transformNode(e.as)}}transformDropView(e){return{kind:"DropViewNode",name:this.transformNode(e.name),ifExists:e.ifExists,materialized:e.materialized,cascade:e.cascade}}transformGenerated(e){return{kind:"GeneratedNode",byDefault:e.byDefault,always:e.always,identity:e.identity,stored:e.stored,expression:this.transformNode(e.expression)}}transformDefaultValue(e){return{kind:"DefaultValueNode",defaultValue:this.transformNode(e.defaultValue)}}transformOn(e){return{kind:"OnNode",on:this.transformNode(e.on)}}transformSelectModifier(e){return{kind:"SelectModifierNode",modifier:e.modifier,rawModifier:this.transformNode(e.rawModifier),of:this.transformNodeList(e.of)}}transformCreateType(e){return{kind:"CreateTypeNode",name:this.transformNode(e.name),enum:this.transformNode(e.enum)}}transformDropType(e){return{kind:"DropTypeNode",name:this.transformNode(e.name),ifExists:e.ifExists}}transformExplain(e){return{kind:"ExplainNode",format:e.format,options:this.transformNode(e.options)}}transformSchemableIdentifier(e){return{kind:"SchemableIdentifierNode",schema:this.transformNode(e.schema),identifier:this.transformNode(e.identifier)}}transformAggregateFunction(e){return{kind:"AggregateFunctionNode",aggregated:this.transformNodeList(e.aggregated),distinct:e.distinct,filter:this.transformNode(e.filter),func:e.func,over:this.transformNode(e.over)}}transformOver(e){return{kind:"OverNode",orderBy:this.transformNode(e.orderBy),partitionBy:this.transformNode(e.partitionBy)}}transformPartitionBy(e){return{kind:"PartitionByNode",items:this.transformNodeList(e.items)}}transformPartitionByItem(e){return{kind:"PartitionByItemNode",partitionBy:this.transformNode(e.partitionBy)}}transformBinaryOperation(e){return{kind:"BinaryOperationNode",leftOperand:this.transformNode(e.leftOperand),operator:this.transformNode(e.operator),rightOperand:this.transformNode(e.rightOperand)}}transformUnaryOperation(e){return{kind:"UnaryOperationNode",operator:this.transformNode(e.operator),operand:this.transformNode(e.operand)}}transformUsing(e){return{kind:"UsingNode",tables:this.transformNodeList(e.tables)}}transformFunction(e){return{kind:"FunctionNode",func:e.func,arguments:this.transformNodeList(e.arguments)}}transformCase(e){return{kind:"CaseNode",value:this.transformNode(e.value),when:this.transformNodeList(e.when),else:this.transformNode(e.else),isStatement:e.isStatement}}transformWhen(e){return{kind:"WhenNode",condition:this.transformNode(e.condition),result:this.transformNode(e.result)}}transformJSONReference(e){return{kind:"JSONReferenceNode",reference:this.transformNode(e.reference),traversal:this.transformNode(e.traversal)}}transformJSONPath(e){return{kind:"JSONPathNode",inOperator:this.transformNode(e.inOperator),pathLegs:this.transformNodeList(e.pathLegs)}}transformJSONPathLeg(e){return{kind:"JSONPathLegNode",type:e.type,value:e.value}}transformJSONOperatorChain(e){return{kind:"JSONOperatorChainNode",operator:this.transformNode(e.operator),values:this.transformNodeList(e.values)}}transformTuple(e){return{kind:"TupleNode",values:this.transformNodeList(e.values)}}transformAddIndex(e){return{kind:"AddIndexNode",name:this.transformNode(e.name),columns:this.transformNodeList(e.columns),unique:e.unique,using:this.transformNode(e.using),ifNotExists:e.ifNotExists}}transformDataType(e){return e}transformSelectAll(e){return e}transformIdentifier(e){return e}transformValue(e){return e}transformPrimitiveValueList(e){return e}transformOperator(e){return e}transformDefaultInsertValue(e){return e}}const ROOT_OPERATION_NODES=freeze({AlterTableNode:!0,CreateIndexNode:!0,CreateSchemaNode:!0,CreateTableNode:!0,CreateTypeNode:!0,CreateViewNode:!0,DeleteQueryNode:!0,DropIndexNode:!0,DropSchemaNode:!0,DropTableNode:!0,DropTypeNode:!0,DropViewNode:!0,InsertQueryNode:!0,RawNode:!0,SelectQueryNode:!0,UpdateQueryNode:!0});class WithSchemaTransformer extends OperationNodeTransformer{#e;#t=new Set;#r=new Set;constructor(e){super(),this.#e=e}transformNodeImpl(e){if(!this.#n(e))return super.transformNodeImpl(e);const r=this.#s(e);for(const a of r)this.#r.add(a);const n=this.#i(e);for(const a of n)this.#t.add(a);const s=super.transformNodeImpl(e);for(const a of n)this.#t.delete(a);for(const a of r)this.#r.delete(a);return s}transformSchemableIdentifier(e){const r=super.transformSchemableIdentifier(e);return r.schema||!this.#t.has(e.identifier.name)?r:{...r,schema:IdentifierNode.create(this.#e)}}transformReferences(e){const r=super.transformReferences(e);return r.table.table.schema?r:{...r,table:TableNode.createWithSchema(this.#e,r.table.table.identifier.name)}}#n(e){return e.kind in ROOT_OPERATION_NODES}#i(e){const r=new Set;if("name"in e&&e.name&&SchemableIdentifierNode.is(e.name)&&this.#a(e.name,r),"from"in e&&e.from)for(const n of e.from.froms)this.#o(n,r);if("into"in e&&e.into&&this.#o(e.into,r),"table"in e&&e.table&&this.#o(e.table,r),"joins"in e&&e.joins)for(const n of e.joins)this.#o(n.table,r);return r}#s(e){const r=new Set;return"with"in e&&e.with&&this.#u(e.with,r),r}#o(e,r){const n=TableNode.is(e)?e:AliasNode.is(e)&&TableNode.is(e.node)?e.node:null;n&&this.#a(n.table,r)}#a(e,r){const n=e.identifier.name;!this.#t.has(n)&&!this.#r.has(n)&&r.add(n)}#u(e,r){for(const n of e.expressions){const s=n.name.table.table.identifier.name;this.#r.has(s)||r.add(s)}}}class WithSchemaPlugin{#e;constructor(e){this.#e=new WithSchemaTransformer(e)}transformQuery(e){return this.#e.transformNode(e.node)}async transformResult(e){return e.result}}class QueryCreator{#e;constructor(e){this.#e=freeze(e)}selectFrom(e){return createSelectQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:SelectQueryNode.createFrom(parseTableExpressionOrList(e),this.#e.withNode)})}selectNoFrom(e){return createSelectQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:SelectQueryNode.cloneWithSelections(SelectQueryNode.create(this.#e.withNode),parseSelectArg(e))})}insertInto(e){return new InsertQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:InsertQueryNode.create(parseTable(e),this.#e.withNode)})}replaceInto(e){return new InsertQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:InsertQueryNode.create(parseTable(e),this.#e.withNode,!0)})}deleteFrom(e){return new DeleteQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:DeleteQueryNode.create(parseTableExpressionOrList(e),this.#e.withNode)})}updateTable(e){return new UpdateQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:UpdateQueryNode.create(parseTableExpression(e),this.#e.withNode)})}with(e,r){const n=parseCommonTableExpression(e,r);return new QueryCreator({...this.#e,withNode:this.#e.withNode?WithNode.cloneWithExpression(this.#e.withNode,n):WithNode.create(n)})}withRecursive(e,r){const n=parseCommonTableExpression(e,r);return new QueryCreator({...this.#e,withNode:this.#e.withNode?WithNode.cloneWithExpression(this.#e.withNode,n):WithNode.create(n,{recursive:!0})})}withPlugin(e){return new QueryCreator({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new QueryCreator({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new QueryCreator({...this.#e,executor:this.#e.executor.withPluginAtFront(new WithSchemaPlugin(e))})}}class Deferred{#e;#t;#r;constructor(){this.#e=new Promise((e,r)=>{this.#r=r,this.#t=e})}get promise(){return this.#e}resolve=e=>{this.#t&&this.#t(e)};reject=e=>{this.#r&&this.#r(e)}}const LOGGED_MESSAGES=new Set;function logOnce(t){LOGGED_MESSAGES.has(t)||(LOGGED_MESSAGES.add(t),console.log(t))}const NO_PLUGINS=freeze([]);class QueryExecutorBase{#e;constructor(e=NO_PLUGINS){this.#e=e}get plugins(){return this.#e}transformQuery(e,r){for(const n of this.#e){const s=n.transformQuery({node:e,queryId:r});if(s.kind===e.kind)e=s;else throw new Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${e.kind}`,`but it returned a ${s.kind}`].join(" "))}return e}async executeQuery(e,r){return await this.provideConnection(async n=>{const s=await n.executeQuery(e),a=await this.#t(s,r);return warnOfOutdatedDriverOrPlugins(s,a),a})}async*stream(e,r,n){const s=new Deferred,a=new Deferred;this.provideConnection(async d=>(s.resolve(d),await a.promise)).catch(d=>s.reject(d));const u=await s.promise;try{for await(const d of u.streamQuery(e,r))yield await this.#t(d,n)}finally{a.resolve()}}async#t(e,r){for(const n of this.#e)e=await n.transformResult({result:e,queryId:r});return e}}function warnOfOutdatedDriverOrPlugins(t,e){const{numAffectedRows:r}=t;r===void 0&&t.numUpdatedOrDeletedRows===void 0||r!==void 0&&e.numAffectedRows!==void 0||logOnce("kysely:warning: outdated driver/plugin detected! QueryResult.numUpdatedOrDeletedRows is deprecated and will be removed in a future release.")}class NoopQueryExecutor extends QueryExecutorBase{get adapter(){throw new Error("this query cannot be compiled to SQL")}compileQuery(){throw new Error("this query cannot be compiled to SQL")}provideConnection(){throw new Error("this query cannot be executed")}withConnectionProvider(){throw new Error("this query cannot have a connection provider")}withPlugin(e){return new NoopQueryExecutor([...this.plugins,e])}withPlugins(e){return new NoopQueryExecutor([...this.plugins,...e])}withPluginAtFront(e){return new NoopQueryExecutor([e,...this.plugins])}withoutPlugins(){return new NoopQueryExecutor([])}}const NOOP_QUERY_EXECUTOR=new NoopQueryExecutor;function createQueryCreator(){return new QueryCreator({executor:NOOP_QUERY_EXECUTOR})}function createJoinBuilder(t,e){return new JoinBuilder({joinNode:JoinNode.create(t,parseTableExpression(e))})}function createOverBuilder(){return new OverBuilder({overNode:OverNode.create()})}function parseJoin(t,e){if(e.length===3)return parseSingleOnJoin(t,e[0],e[1],e[2]);if(e.length===2)return parseCallbackJoin(t,e[0],e[1]);throw new Error("not implemented")}function parseCallbackJoin(t,e,r){return r(createJoinBuilder(t,e)).toOperationNode()}function parseSingleOnJoin(t,e,r,n){return JoinNode.createWithOn(t,parseTableExpression(e),parseReferentialBinaryOperation(r,"=",n))}const OffsetNode=freeze({is(t){return t.kind==="OffsetNode"},create(t){return freeze({kind:"OffsetNode",offset:t})}}),GroupByItemNode=freeze({is(t){return t.kind==="GroupByItemNode"},create(t){return freeze({kind:"GroupByItemNode",groupBy:t})}});function parseGroupBy(t){return t=isFunction(t)?t(expressionBuilder()):t,parseReferenceExpressionOrList(t).map(GroupByItemNode.create)}const SetOperationNode=freeze({is(t){return t.kind==="SetOperationNode"},create(t,e,r){return freeze({kind:"SetOperationNode",operator:t,expression:e,all:r})}});function parseSetOperations(t,e,r){return isFunction(e)&&(e=e(createExpressionBuilder())),isReadonlyArray(e)||(e=[e]),e.map(n=>SetOperationNode.create(t,parseExpression(n),r))}class ExpressionWrapper{#e;constructor(e){this.#e=e}get expressionType(){}as(e){return new AliasedExpressionWrapper(this,e)}or(...e){return new OrWrapper(OrNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}and(...e){return new AndWrapper(AndNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}$castTo(){return new ExpressionWrapper(this.#e)}$notNull(){return new ExpressionWrapper(this.#e)}toOperationNode(){return this.#e}}class AliasedExpressionWrapper{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),isOperationNodeSource(this.#t)?this.#t.toOperationNode():IdentifierNode.create(this.#t))}}class OrWrapper{#e;constructor(e){this.#e=e}get expressionType(){}as(e){return new AliasedExpressionWrapper(this,e)}or(...e){return new OrWrapper(OrNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}$castTo(){return new OrWrapper(this.#e)}toOperationNode(){return ParensNode.create(this.#e)}}class AndWrapper{#e;constructor(e){this.#e=e}get expressionType(){}as(e){return new AliasedExpressionWrapper(this,e)}and(...e){return new AndWrapper(AndNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}$castTo(){return new AndWrapper(this.#e)}toOperationNode(){return ParensNode.create(this.#e)}}class SelectQueryBuilderImpl{#e;constructor(e){this.#e=freeze(e)}get expressionType(){}get isSelectQueryBuilder(){return!0}where(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}having(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithHaving(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}havingRef(e,r,n){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithHaving(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}select(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSelections(this.#e.queryNode,parseSelectArg(e))})}distinctOn(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithDistinctOn(this.#e.queryNode,parseReferenceExpressionOrList(e))})}modifyFront(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithFrontModifier(this.#e.queryNode,SelectModifierNode.createWithExpression(e.toOperationNode()))})}modifyEnd(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.createWithExpression(e.toOperationNode()))})}distinct(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithFrontModifier(this.#e.queryNode,SelectModifierNode.create("Distinct"))})}forUpdate(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForUpdate",e?asArray(e).map(parseTable):void 0))})}forShare(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForShare",e?asArray(e).map(parseTable):void 0))})}forKeyShare(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForKeyShare",e?asArray(e).map(parseTable):void 0))})}forNoKeyUpdate(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForNoKeyUpdate",e?asArray(e).map(parseTable):void 0))})}skipLocked(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("SkipLocked"))})}noWait(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("NoWait"))})}selectAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSelections(this.#e.queryNode,parseSelectAll(e))})}innerJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("InnerJoin",e))})}leftJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LeftJoin",e))})}rightJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("RightJoin",e))})}fullJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("FullJoin",e))})}innerJoinLateral(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LateralInnerJoin",e))})}leftJoinLateral(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LateralLeftJoin",e))})}orderBy(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithOrderByItems(this.#e.queryNode,parseOrderBy(e))})}groupBy(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithGroupByItems(this.#e.queryNode,parseGroupBy(e))})}limit(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithLimit(this.#e.queryNode,LimitNode.create(parseValueExpression(e)))})}offset(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithOffset(this.#e.queryNode,OffsetNode.create(parseValueExpression(e)))})}union(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("union",e,!1))})}unionAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("union",e,!0))})}intersect(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("intersect",e,!1))})}intersectAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("intersect",e,!0))})}except(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("except",e,!1))})}exceptAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("except",e,!0))})}as(e){return new AliasedSelectQueryBuilderImpl(this,e)}clearSelect(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutSelections(this.#e.queryNode)})}clearWhere(){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithoutWhere(this.#e.queryNode)})}clearLimit(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutLimit(this.#e.queryNode)})}clearOffset(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutOffset(this.#e.queryNode)})}clearOrderBy(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutOrderBy(this.#e.queryNode)})}$call(e){return e(this)}$if(e,r){return e?r(this):new SelectQueryBuilderImpl({...this.#e})}$castTo(){return new SelectQueryBuilderImpl(this.#e)}$narrowType(){return new SelectQueryBuilderImpl(this.#e)}$assertType(){return new SelectQueryBuilderImpl(this.#e)}$asTuple(){return new ExpressionWrapper(this.toOperationNode())}withPlugin(e){return new SelectQueryBuilderImpl({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile();return(await this.#e.executor.executeQuery(e,this.#e.queryId)).rows}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(SelectQueryBuilderImpl,"don't await SelectQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");function createSelectQueryBuilder(t){return new SelectQueryBuilderImpl(t)}class AliasedSelectQueryBuilderImpl{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}get isAliasedSelectQueryBuilder(){return!0}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),IdentifierNode.create(this.#t))}}preventAwait(AliasedSelectQueryBuilderImpl,"don't await AliasedSelectQueryBuilder instances directly. AliasedSelectQueryBuilder should never be executed directly since it's always a part of another query.");const AggregateFunctionNode=freeze({is(t){return t.kind==="AggregateFunctionNode"},create(t,e=[]){return freeze({kind:"AggregateFunctionNode",func:t,aggregated:e})},cloneWithDistinct(t){return freeze({...t,distinct:!0})},cloneWithFilter(t,e){return freeze({...t,filter:t.filter?WhereNode.cloneWithOperation(t.filter,"And",e):WhereNode.create(e)})},cloneWithOrFilter(t,e){return freeze({...t,filter:t.filter?WhereNode.cloneWithOperation(t.filter,"Or",e):WhereNode.create(e)})},cloneWithOver(t,e){return freeze({...t,over:e})}}),FunctionNode=freeze({is(t){return t.kind==="FunctionNode"},create(t,e){return freeze({kind:"FunctionNode",func:t,arguments:e})}});class AggregateFunctionBuilder{#e;constructor(e){this.#e=freeze(e)}get expressionType(){}as(e){return new AliasedAggregateFunctionBuilder(this,e)}distinct(){return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithDistinct(this.#e.aggregateFunctionNode)})}filterWhere(...e){return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithFilter(this.#e.aggregateFunctionNode,parseValueBinaryOperationOrExpression(e))})}filterWhereRef(e,r,n){return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithFilter(this.#e.aggregateFunctionNode,parseReferentialBinaryOperation(e,r,n))})}over(e){const r=createOverBuilder();return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithOver(this.#e.aggregateFunctionNode,(e?e(r):r).toOperationNode())})}$call(e){return e(this)}$castTo(){return new AggregateFunctionBuilder(this.#e)}$notNull(){return new AggregateFunctionBuilder(this.#e)}toOperationNode(){return this.#e.aggregateFunctionNode}}preventAwait(AggregateFunctionBuilder,"don't await AggregateFunctionBuilder instances. They are never executed directly and are always just a part of a query.");class AliasedAggregateFunctionBuilder{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),IdentifierNode.create(this.#t))}}function createFunctionModule(){const t=(r,n)=>new ExpressionWrapper(FunctionNode.create(r,parseReferenceExpressionOrList(n??[]))),e=(r,n)=>new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create(r,n?parseReferenceExpressionOrList(n):void 0)});return Object.assign(t,{agg:e,avg(r){return e("avg",[r])},coalesce(...r){return t("coalesce",r)},count(r){return e("count",[r])},countAll(r){return new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create("count",parseSelectAll(r))})},max(r){return e("max",[r])},min(r){return e("min",[r])},sum(r){return e("sum",[r])},any(r){return t("any",[r])},jsonAgg(r){return new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create("json_agg",[isString(r)?parseTable(r):r.toOperationNode()])})},toJson(r){return new ExpressionWrapper(FunctionNode.create("to_json",[isString(r)?parseTable(r):r.toOperationNode()]))}})}const UnaryOperationNode=freeze({is(t){return t.kind==="UnaryOperationNode"},create(t,e){return freeze({kind:"UnaryOperationNode",operator:t,operand:e})}});function parseUnaryOperation(t,e){return UnaryOperationNode.create(OperatorNode.create(t),parseReferenceExpression(e))}const WhenNode=freeze({is(t){return t.kind==="WhenNode"},create(t){return freeze({kind:"WhenNode",condition:t})},cloneWithResult(t,e){return freeze({...t,result:e})}}),CaseNode=freeze({is(t){return t.kind==="CaseNode"},create(t){return freeze({kind:"CaseNode",value:t})},cloneWithWhen(t,e){return freeze({...t,when:freeze(t.when?[...t.when,e]:[e])})},cloneWithThen(t,e){return freeze({...t,when:t.when?freeze([...t.when.slice(0,-1),WhenNode.cloneWithResult(t.when[t.when.length-1],e)]):void 0})},cloneWith(t,e){return freeze({...t,...e})}});class CaseBuilder{#e;constructor(e){this.#e=freeze(e)}when(...e){return new CaseThenBuilder({...this.#e,node:CaseNode.cloneWithWhen(this.#e.node,WhenNode.create(parseValueBinaryOperationOrExpression(e)))})}}class CaseThenBuilder{#e;constructor(e){this.#e=freeze(e)}then(e){return new CaseWhenBuilder({...this.#e,node:CaseNode.cloneWithThen(this.#e.node,isSafeImmediateValue(e)?parseSafeImmediateValue(e):parseValueExpression(e))})}}class CaseWhenBuilder{#e;constructor(e){this.#e=freeze(e)}when(...e){return new CaseThenBuilder({...this.#e,node:CaseNode.cloneWithWhen(this.#e.node,WhenNode.create(parseValueBinaryOperationOrExpression(e)))})}else(e){return new CaseEndBuilder({...this.#e,node:CaseNode.cloneWith(this.#e.node,{else:isSafeImmediateValue(e)?parseSafeImmediateValue(e):parseValueExpression(e)})})}end(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!1}))}endCase(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!0}))}}class CaseEndBuilder{#e;constructor(e){this.#e=freeze(e)}end(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!1}))}endCase(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!0}))}}const JSONPathLegNode=freeze({is(t){return t.kind==="JSONPathLegNode"},create(t,e){return freeze({kind:"JSONPathLegNode",type:t,value:e})}});class JSONPathBuilder{#e;constructor(e){this.#e=e}at(e){return this.#t("ArrayLocation",e)}key(e){return this.#t("Member",e)}#t(e,r){return JSONReferenceNode.is(this.#e)?new TraversedJSONPathBuilder(JSONReferenceNode.cloneWithTraversal(this.#e,JSONPathNode.is(this.#e.traversal)?JSONPathNode.cloneWithLeg(this.#e.traversal,JSONPathLegNode.create(e,r)):JSONOperatorChainNode.cloneWithValue(this.#e.traversal,ValueNode.createImmediate(r)))):new TraversedJSONPathBuilder(JSONPathNode.cloneWithLeg(this.#e,JSONPathLegNode.create(e,r)))}}class TraversedJSONPathBuilder extends JSONPathBuilder{#e;constructor(e){super(e),this.#e=e}get expressionType(){}as(e){return new AliasedJSONPathBuilder(this,e)}$castTo(){return new JSONPathBuilder(this.#e)}$notNull(){return new JSONPathBuilder(this.#e)}toOperationNode(){return this.#e}}class AliasedJSONPathBuilder{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),isOperationNodeSource(this.#t)?this.#t.toOperationNode():IdentifierNode.create(this.#t))}}const TupleNode=freeze({is(t){return t.kind==="TupleNode"},create(t){return freeze({kind:"TupleNode",values:freeze(t)})}});function createExpressionBuilder(t=NOOP_QUERY_EXECUTOR){function e(s,a,u){return new ExpressionWrapper(parseValueBinaryOperation(s,a,u))}function r(s,a){return new ExpressionWrapper(parseUnaryOperation(s,a))}const n=Object.assign(e,{fn:void 0,eb:void 0,selectFrom(s){return createSelectQueryBuilder({queryId:createQueryId(),executor:t,queryNode:SelectQueryNode.createFrom(parseTableExpressionOrList(s))})},case(s){return new CaseBuilder({node:CaseNode.create(isUndefined(s)?void 0:parseReferenceExpression(s))})},ref(s,a){return isUndefined(a)?new ExpressionWrapper(parseStringReference(s)):new JSONPathBuilder(parseJSONReference(s,a))},jsonPath(){return new JSONPathBuilder(JSONPathNode.create())},table(s){return new ExpressionWrapper(parseTable(s))},val(s){return new ExpressionWrapper(parseValueExpression(s))},refTuple(...s){return new ExpressionWrapper(TupleNode.create(s.map(parseReferenceExpression)))},tuple(...s){return new ExpressionWrapper(TupleNode.create(s.map(parseValueExpression)))},lit(s){return new ExpressionWrapper(parseSafeImmediateValue(s))},unary:r,not(s){return r("not",s)},exists(s){return r("exists",s)},neg(s){return r("-",s)},between(s,a,u){return new ExpressionWrapper(BinaryOperationNode.create(parseReferenceExpression(s),OperatorNode.create("between"),AndNode.create(parseValueExpression(a),parseValueExpression(u))))},betweenSymmetric(s,a,u){return new ExpressionWrapper(BinaryOperationNode.create(parseReferenceExpression(s),OperatorNode.create("between symmetric"),AndNode.create(parseValueExpression(a),parseValueExpression(u))))},and(s){return isReadonlyArray(s)?new ExpressionWrapper(parseFilterList(s,"and")):new ExpressionWrapper(parseFilterObject(s,"and"))},or(s){return isReadonlyArray(s)?new ExpressionWrapper(parseFilterList(s,"or")):new ExpressionWrapper(parseFilterObject(s,"or"))},parens(...s){const a=parseValueBinaryOperationOrExpression(s);return ParensNode.is(a)?new ExpressionWrapper(a):new ExpressionWrapper(ParensNode.create(a))},withSchema(s){return createExpressionBuilder(t.withPluginAtFront(new WithSchemaPlugin(s)))}});return n.fn=createFunctionModule(),n.eb=n,n}function expressionBuilder(t){return createExpressionBuilder()}function parseExpression(t){if(isOperationNodeSource(t))return t.toOperationNode();if(isFunction(t))return t(expressionBuilder()).toOperationNode();throw new Error(`invalid expression: ${JSON.stringify(t)}`)}function parseAliasedExpression(t){if(isOperationNodeSource(t))return t.toOperationNode();if(isFunction(t))return t(expressionBuilder()).toOperationNode();throw new Error(`invalid aliased expression: ${JSON.stringify(t)}`)}function isExpressionOrFactory(t){return isExpression(t)||isAliasedExpression(t)||isFunction(t)}function parseTableExpressionOrList(t){return isReadonlyArray(t)?t.map(e=>parseTableExpression(e)):[parseTableExpression(t)]}function parseTableExpression(t){return isString(t)?parseAliasedTable(t):parseAliasedExpression(t)}function parseAliasedTable(t){const e=" as ";if(t.includes(e)){const[r,n]=t.split(e).map(trim$1);return AliasNode.create(parseTable(r),IdentifierNode.create(n))}else return parseTable(t)}function parseTable(t){const e=".";if(t.includes(e)){const[r,n]=t.split(e).map(trim$1);return TableNode.createWithSchema(r,n)}else return TableNode.create(t)}function trim$1(t){return t.trim()}const AddColumnNode=freeze({is(t){return t.kind==="AddColumnNode"},create(t){return freeze({kind:"AddColumnNode",column:t})}}),ColumnDefinitionNode=freeze({is(t){return t.kind==="ColumnDefinitionNode"},create(t,e){return freeze({kind:"ColumnDefinitionNode",column:ColumnNode.create(t),dataType:e})},cloneWithFrontModifier(t,e){return freeze({...t,frontModifiers:t.frontModifiers?freeze([...t.frontModifiers,e]):[e]})},cloneWithEndModifier(t,e){return freeze({...t,endModifiers:t.endModifiers?freeze([...t.endModifiers,e]):[e]})},cloneWith(t,e){return freeze({...t,...e})}}),DropColumnNode=freeze({is(t){return t.kind==="DropColumnNode"},create(t){return freeze({kind:"DropColumnNode",column:ColumnNode.create(t)})}}),RenameColumnNode=freeze({is(t){return t.kind==="RenameColumnNode"},create(t,e){return freeze({kind:"RenameColumnNode",column:ColumnNode.create(t),renameTo:ColumnNode.create(e)})}}),CheckConstraintNode=freeze({is(t){return t.kind==="CheckConstraintNode"},create(t,e){return freeze({kind:"CheckConstraintNode",expression:t,name:e?IdentifierNode.create(e):void 0})}}),ON_MODIFY_FOREIGN_ACTIONS=["no action","restrict","cascade","set null","set default"],ReferencesNode=freeze({is(t){return t.kind==="ReferencesNode"},create(t,e){return freeze({kind:"ReferencesNode",table:t,columns:freeze([...e])})},cloneWithOnDelete(t,e){return freeze({...t,onDelete:e})},cloneWithOnUpdate(t,e){return freeze({...t,onUpdate:e})}});function parseDefaultValueExpression(t){return isOperationNodeSource(t)?t.toOperationNode():ValueNode.createImmediate(t)}const GeneratedNode=freeze({is(t){return t.kind==="GeneratedNode"},create(t){return freeze({kind:"GeneratedNode",...t})},createWithExpression(t){return freeze({kind:"GeneratedNode",always:!0,expression:t})},cloneWith(t,e){return freeze({...t,...e})}}),DefaultValueNode=freeze({is(t){return t.kind==="DefaultValueNode"},create(t){return freeze({kind:"DefaultValueNode",defaultValue:t})}});function parseOnModifyForeignAction(t){if(ON_MODIFY_FOREIGN_ACTIONS.includes(t))return t;throw new Error(`invalid OnModifyForeignAction ${t}`)}class ColumnDefinitionBuilder{#e;constructor(e){this.#e=e}autoIncrement(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{autoIncrement:!0}))}primaryKey(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{primaryKey:!0}))}references(e){const r=parseStringReference(e);if(!r.table||SelectAllNode.is(r.column))throw new Error(`invalid call references('${e}'). The reference must have format table.column or schema.table.column`);return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{references:ReferencesNode.create(r.table,[r.column])}))}onDelete(e){if(!this.#e.references)throw new Error("on delete constraint can only be added for foreign keys");return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{references:ReferencesNode.cloneWithOnDelete(this.#e.references,parseOnModifyForeignAction(e))}))}onUpdate(e){if(!this.#e.references)throw new Error("on update constraint can only be added for foreign keys");return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{references:ReferencesNode.cloneWithOnUpdate(this.#e.references,parseOnModifyForeignAction(e))}))}unique(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{unique:!0}))}notNull(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{notNull:!0}))}unsigned(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{unsigned:!0}))}defaultTo(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{defaultTo:DefaultValueNode.create(parseDefaultValueExpression(e))}))}check(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{check:CheckConstraintNode.create(e.toOperationNode())}))}generatedAlwaysAs(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.createWithExpression(e.toOperationNode())}))}generatedAlwaysAsIdentity(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.create({identity:!0,always:!0})}))}generatedByDefaultAsIdentity(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.create({identity:!0,byDefault:!0})}))}stored(){if(!this.#e.generated)throw new Error("stored() can only be called after generatedAlwaysAs");return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.cloneWith(this.#e.generated,{stored:!0})}))}modifyFront(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWithFrontModifier(this.#e,e.toOperationNode()))}nullsNotDistinct(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{nullsNotDistinct:!0}))}modifyEnd(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWithEndModifier(this.#e,e.toOperationNode()))}$call(e){return e(this)}toOperationNode(){return this.#e}}preventAwait(ColumnDefinitionBuilder,"don't await ColumnDefinitionBuilder instances directly.");const ModifyColumnNode=freeze({is(t){return t.kind==="ModifyColumnNode"},create(t){return freeze({kind:"ModifyColumnNode",column:t})}}),DataTypeNode=freeze({is(t){return t.kind==="DataTypeNode"},create(t){return freeze({kind:"DataTypeNode",dataType:t})}});function parseDataTypeExpression(t){return isOperationNodeSource(t)?t.toOperationNode():DataTypeNode.create(t)}const ForeignKeyConstraintNode=freeze({is(t){return t.kind==="ForeignKeyConstraintNode"},create(t,e,r,n){return freeze({kind:"ForeignKeyConstraintNode",columns:t,references:ReferencesNode.create(e,r),name:n?IdentifierNode.create(n):void 0})},cloneWith(t,e){return freeze({...t,...e})}});class ForeignKeyConstraintBuilder{#e;constructor(e){this.#e=e}onDelete(e){return new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.cloneWith(this.#e,{onDelete:parseOnModifyForeignAction(e)}))}onUpdate(e){return new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.cloneWith(this.#e,{onUpdate:parseOnModifyForeignAction(e)}))}$call(e){return e(this)}toOperationNode(){return this.#e}}preventAwait(ForeignKeyConstraintBuilder,"don't await ForeignKeyConstraintBuilder instances directly.");const AddConstraintNode=freeze({is(t){return t.kind==="AddConstraintNode"},create(t){return freeze({kind:"AddConstraintNode",constraint:t})}}),UniqueConstraintNode=freeze({is(t){return t.kind==="UniqueConstraintNode"},create(t,e,r){return freeze({kind:"UniqueConstraintNode",columns:freeze(t.map(ColumnNode.create)),name:e?IdentifierNode.create(e):void 0,nullsNotDistinct:r})},cloneWith(t,e){return freeze({...t,...e})}}),DropConstraintNode=freeze({is(t){return t.kind==="DropConstraintNode"},create(t){return freeze({kind:"DropConstraintNode",constraintName:IdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})}}),AlterColumnNode=freeze({is(t){return t.kind==="AlterColumnNode"},create(t,e,r){return freeze({kind:"AlterColumnNode",column:ColumnNode.create(t),[e]:r})}});class AlterColumnBuilder{#e;constructor(e){this.#e=e}setDataType(e){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"dataType",parseDataTypeExpression(e)))}setDefault(e){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"setDefault",parseDefaultValueExpression(e)))}dropDefault(){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"dropDefault",!0))}setNotNull(){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"setNotNull",!0))}dropNotNull(){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"dropNotNull",!0))}$call(e){return e(this)}}class AlteredColumnBuilder{#e;constructor(e){this.#e=e}toOperationNode(){return this.#e}}class AlterTableExecutor{#e;constructor(e){this.#e=freeze(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableExecutor,"don't await AlterTableExecutor instances directly. To execute the query you need to call `execute`");class AlterTableAddForeignKeyConstraintBuilder{#e;constructor(e){this.#e=freeze(e)}onDelete(e){return new AlterTableAddForeignKeyConstraintBuilder({...this.#e,constraintBuilder:this.#e.constraintBuilder.onDelete(e)})}onUpdate(e){return new AlterTableAddForeignKeyConstraintBuilder({...this.#e,constraintBuilder:this.#e.constraintBuilder.onUpdate(e)})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(this.#e.constraintBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableAddForeignKeyConstraintBuilder,"don't await AlterTableAddForeignKeyConstraintBuilder instances directly. To execute the query you need to call `execute`");class AlterTableDropConstraintBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.cloneWith(this.#e.node.dropConstraint,{ifExists:!0})})})}cascade(){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.cloneWith(this.#e.node.dropConstraint,{modifier:"cascade"})})})}restrict(){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.cloneWith(this.#e.node.dropConstraint,{modifier:"restrict"})})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableDropConstraintBuilder,"don't await AlterTableDropConstraintBuilder instances directly. To execute the query you need to call `execute`");const PrimaryConstraintNode=freeze({is(t){return t.kind==="PrimaryKeyConstraintNode"},create(t,e){return freeze({kind:"PrimaryKeyConstraintNode",columns:freeze(t.map(ColumnNode.create)),name:e?IdentifierNode.create(e):void 0})}}),AddIndexNode=freeze({is(t){return t.kind==="AddIndexNode"},create(t){return freeze({kind:"AddIndexNode",name:IdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})},cloneWithColumns(t,e){return freeze({...t,columns:[...t.columns||[],...e]})}});class AlterTableAddIndexBuilder{#e;constructor(e){this.#e=freeze(e)}unique(){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWith(this.#e.node.addIndex,{unique:!0})})})}column(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWithColumns(this.#e.node.addIndex,[parseOrderedColumnName(e)])})})}columns(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWithColumns(this.#e.node.addIndex,e.map(parseOrderedColumnName))})})}expression(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWithColumns(this.#e.node.addIndex,[e.toOperationNode()])})})}using(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWith(this.#e.node.addIndex,{using:RawNode.createWithSql(e)})})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableAddIndexBuilder,"don't await AlterTableAddIndexBuilder instances directly. To execute the query you need to call `execute`");class UniqueConstraintNodeBuilder{#e;constructor(e){this.#e=e}toOperationNode(){return this.#e}nullsNotDistinct(){return new UniqueConstraintNodeBuilder(UniqueConstraintNode.cloneWith(this.#e,{nullsNotDistinct:!0}))}}preventAwait(UniqueConstraintNodeBuilder,"don't await UniqueConstraintNodeBuilder instances directly.");class AlterTableBuilder{#e;constructor(e){this.#e=freeze(e)}renameTo(e){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{renameTo:parseTable(e)})})}setSchema(e){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{setSchema:IdentifierNode.create(e)})})}alterColumn(e,r){const n=r(new AlterColumnBuilder(e));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,n.toOperationNode())})}dropColumn(e){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,DropColumnNode.create(e))})}renameColumn(e,r){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,RenameColumnNode.create(e,r))})}addColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,AddColumnNode.create(s.toOperationNode()))})}modifyColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,ModifyColumnNode.create(s.toOperationNode()))})}addUniqueConstraint(e,r,n=noop$1){const s=n(new UniqueConstraintNodeBuilder(UniqueConstraintNode.create(r,e)));return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(s.toOperationNode())})})}addCheckConstraint(e,r){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(CheckConstraintNode.create(r.toOperationNode(),e))})})}addForeignKeyConstraint(e,r,n,s){return new AlterTableAddForeignKeyConstraintBuilder({...this.#e,constraintBuilder:new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.create(r.map(ColumnNode.create),parseTable(n),s.map(ColumnNode.create),e))})}addPrimaryKeyConstraint(e,r){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(PrimaryConstraintNode.create(r,e))})})}dropConstraint(e){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.create(e)})})}addIndex(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.create(e)})})}dropIndex(e){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropIndex:DropIndexNode.create(e)})})}$call(e){return e(this)}}class AlterTableColumnAlteringBuilder{#e;constructor(e){this.#e=freeze(e)}alterColumn(e,r){const n=r(new AlterColumnBuilder(e));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,n.toOperationNode())})}dropColumn(e){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,DropColumnNode.create(e))})}renameColumn(e,r){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,RenameColumnNode.create(e,r))})}addColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,AddColumnNode.create(s.toOperationNode()))})}modifyColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,ModifyColumnNode.create(s.toOperationNode()))})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableBuilder,"don't await AlterTableBuilder instances");preventAwait(AlterColumnBuilder,"don't await AlterColumnBuilder instances");preventAwait(AlterTableColumnAlteringBuilder,"don't await AlterTableColumnAlteringBuilder instances directly. To execute the query you need to call `execute`");class ImmediateValueTransformer extends OperationNodeTransformer{transformValue(e){return{...super.transformValue(e),immediate:!0}}}class CreateIndexBuilder{#e;constructor(e){this.#e=freeze(e)}ifNotExists(){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{ifNotExists:!0})})}unique(){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{unique:!0})})}nullsNotDistinct(){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{nullsNotDistinct:!0})})}on(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{table:parseTable(e)})})}column(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWithColumns(this.#e.node,[parseOrderedColumnName(e)])})}columns(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWithColumns(this.#e.node,e.map(parseOrderedColumnName))})}expression(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWithColumns(this.#e.node,[e.toOperationNode()])})}using(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{using:RawNode.createWithSql(e)})})}where(...e){const r=new ImmediateValueTransformer;return new CreateIndexBuilder({...this.#e,node:QueryNode.cloneWithWhere(this.#e.node,r.transformNode(parseValueBinaryOperationOrExpression(e)))})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateIndexBuilder,"don't await CreateIndexBuilder instances directly. To execute the query you need to call `execute`");class CreateSchemaBuilder{#e;constructor(e){this.#e=freeze(e)}ifNotExists(){return new CreateSchemaBuilder({...this.#e,node:CreateSchemaNode.cloneWith(this.#e.node,{ifNotExists:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateSchemaBuilder,"don't await CreateSchemaBuilder instances directly. To execute the query you need to call `execute`");function parseOnCommitAction(t){if(ON_COMMIT_ACTIONS.includes(t))return t;throw new Error(`invalid OnCommitAction ${t}`)}class CreateTableBuilder{#e;constructor(e){this.#e=freeze(e)}temporary(){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{temporary:!0})})}onCommit(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{onCommit:parseOnCommitAction(e)})})}ifNotExists(){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{ifNotExists:!0})})}addColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithColumn(this.#e.node,s.toOperationNode())})}addPrimaryKeyConstraint(e,r){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,PrimaryConstraintNode.create(r,e))})}addUniqueConstraint(e,r,n=noop$1){const s=n(new UniqueConstraintNodeBuilder(UniqueConstraintNode.create(r,e)));return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,s.toOperationNode())})}addCheckConstraint(e,r){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,CheckConstraintNode.create(r.toOperationNode(),e))})}addForeignKeyConstraint(e,r,n,s,a=noop$1){const u=a(new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.create(r.map(ColumnNode.create),parseTable(n),s.map(ColumnNode.create),e)));return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,u.toOperationNode())})}modifyFront(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithFrontModifier(this.#e.node,e.toOperationNode())})}modifyEnd(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithEndModifier(this.#e.node,e.toOperationNode())})}as(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{selectQuery:parseExpression(e)})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateTableBuilder,"don't await CreateTableBuilder instances directly. To execute the query you need to call `execute`");class DropIndexBuilder{#e;constructor(e){this.#e=freeze(e)}on(e){return new DropIndexBuilder({...this.#e,node:DropIndexNode.cloneWith(this.#e.node,{table:parseTable(e)})})}ifExists(){return new DropIndexBuilder({...this.#e,node:DropIndexNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropIndexBuilder({...this.#e,node:DropIndexNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropIndexBuilder,"don't await DropIndexBuilder instances directly. To execute the query you need to call `execute`");class DropSchemaBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new DropSchemaBuilder({...this.#e,node:DropSchemaNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropSchemaBuilder({...this.#e,node:DropSchemaNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropSchemaBuilder,"don't await DropSchemaBuilder instances directly. To execute the query you need to call `execute`");class DropTableBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new DropTableBuilder({...this.#e,node:DropTableNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropTableBuilder({...this.#e,node:DropTableNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropTableBuilder,"don't await DropTableBuilder instances directly. To execute the query you need to call `execute`");const CreateViewNode=freeze({is(t){return t.kind==="CreateViewNode"},create(t){return freeze({kind:"CreateViewNode",name:SchemableIdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})}});class ImmediateValuePlugin{#e=new ImmediateValueTransformer;transformQuery(e){return this.#e.transformNode(e.node)}transformResult(e){return Promise.resolve(e.result)}}class CreateViewBuilder{#e;constructor(e){this.#e=freeze(e)}temporary(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{temporary:!0})})}materialized(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{materialized:!0})})}ifNotExists(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{ifNotExists:!0})})}orReplace(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{orReplace:!0})})}columns(e){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{columns:e.map(parseColumnName)})})}as(e){const r=e.withPlugin(new ImmediateValuePlugin).toOperationNode();return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{as:r})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateViewBuilder,"don't await CreateViewBuilder instances directly. To execute the query you need to call `execute`");const DropViewNode=freeze({is(t){return t.kind==="DropViewNode"},create(t){return freeze({kind:"DropViewNode",name:SchemableIdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})}});class DropViewBuilder{#e;constructor(e){this.#e=freeze(e)}materialized(){return new DropViewBuilder({...this.#e,node:DropViewNode.cloneWith(this.#e.node,{materialized:!0})})}ifExists(){return new DropViewBuilder({...this.#e,node:DropViewNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropViewBuilder({...this.#e,node:DropViewNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropViewBuilder,"don't await DropViewBuilder instances directly. To execute the query you need to call `execute`");const CreateTypeNode=freeze({is(t){return t.kind==="CreateTypeNode"},create(t){return freeze({kind:"CreateTypeNode",name:t})},cloneWithEnum(t,e){return freeze({...t,enum:ValueListNode.create(e.map(r=>ValueNode.createImmediate(r)))})}});class CreateTypeBuilder{#e;constructor(e){this.#e=freeze(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}asEnum(e){return new CreateTypeBuilder({...this.#e,node:CreateTypeNode.cloneWithEnum(this.#e.node,e)})}$call(e){return e(this)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateTypeBuilder,"don't await CreateTypeBuilder instances directly. To execute the query you need to call `execute`");const DropTypeNode=freeze({is(t){return t.kind==="DropTypeNode"},create(t){return freeze({kind:"DropTypeNode",name:t})},cloneWith(t,e){return freeze({...t,...e})}});class DropTypeBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new DropTypeBuilder({...this.#e,node:DropTypeNode.cloneWith(this.#e.node,{ifExists:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropTypeBuilder,"don't await DropTypeBuilder instances directly. To execute the query you need to call `execute`");function parseSchemableIdentifier(t){const e=".";if(t.includes(e)){const r=t.split(e).map(trim);if(r.length===2)return SchemableIdentifierNode.createWithSchema(r[0],r[1]);throw new Error(`invalid schemable identifier ${t}`)}else return SchemableIdentifierNode.create(t)}function trim(t){return t.trim()}class SchemaModule{#e;constructor(e){this.#e=e}createTable(e){return new CreateTableBuilder({queryId:createQueryId(),executor:this.#e,node:CreateTableNode.create(parseTable(e))})}dropTable(e){return new DropTableBuilder({queryId:createQueryId(),executor:this.#e,node:DropTableNode.create(parseTable(e))})}createIndex(e){return new CreateIndexBuilder({queryId:createQueryId(),executor:this.#e,node:CreateIndexNode.create(e)})}dropIndex(e){return new DropIndexBuilder({queryId:createQueryId(),executor:this.#e,node:DropIndexNode.create(e)})}createSchema(e){return new CreateSchemaBuilder({queryId:createQueryId(),executor:this.#e,node:CreateSchemaNode.create(e)})}dropSchema(e){return new DropSchemaBuilder({queryId:createQueryId(),executor:this.#e,node:DropSchemaNode.create(e)})}alterTable(e){return new AlterTableBuilder({queryId:createQueryId(),executor:this.#e,node:AlterTableNode.create(parseTable(e))})}createView(e){return new CreateViewBuilder({queryId:createQueryId(),executor:this.#e,node:CreateViewNode.create(e)})}dropView(e){return new DropViewBuilder({queryId:createQueryId(),executor:this.#e,node:DropViewNode.create(e)})}createType(e){return new CreateTypeBuilder({queryId:createQueryId(),executor:this.#e,node:CreateTypeNode.create(parseSchemableIdentifier(e))})}dropType(e){return new DropTypeBuilder({queryId:createQueryId(),executor:this.#e,node:DropTypeNode.create(parseSchemableIdentifier(e))})}withPlugin(e){return new SchemaModule(this.#e.withPlugin(e))}withoutPlugins(){return new SchemaModule(this.#e.withoutPlugins())}withSchema(e){return new SchemaModule(this.#e.withPluginAtFront(new WithSchemaPlugin(e)))}}class DynamicModule{ref(e){return new DynamicReferenceBuilder(e)}}class DefaultConnectionProvider{#e;constructor(e){this.#e=e}async provideConnection(e){const r=await this.#e.acquireConnection();try{return await e(r)}finally{await this.#e.releaseConnection(r)}}}class DefaultQueryExecutor extends QueryExecutorBase{#e;#t;#r;constructor(e,r,n,s=[]){super(s),this.#e=e,this.#t=r,this.#r=n}get adapter(){return this.#t}compileQuery(e){return this.#e.compileQuery(e)}provideConnection(e){return this.#r.provideConnection(e)}withPlugins(e){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[...this.plugins,...e])}withPlugin(e){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[...this.plugins,e])}withPluginAtFront(e){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[e,...this.plugins])}withConnectionProvider(e){return new DefaultQueryExecutor(this.#e,this.#t,e,[...this.plugins])}withoutPlugins(){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[])}}function performanceNow(){return typeof performance<"u"&&isFunction(performance.now)?performance.now():Date.now()}class RuntimeDriver{#e;#t;#r;#n;#i;#s=new WeakSet;constructor(e,r){this.#n=!1,this.#e=e,this.#t=r}async init(){if(this.#i)throw new Error("driver has already been destroyed");this.#r||(this.#r=this.#e.init().then(()=>{this.#n=!0}).catch(e=>(this.#r=void 0,Promise.reject(e)))),await this.#r}async acquireConnection(){if(this.#i)throw new Error("driver has already been destroyed");this.#n||await this.init();const e=await this.#e.acquireConnection();return this.#s.has(e)||(this.#o()&&this.#a(e),this.#s.add(e)),e}async releaseConnection(e){await this.#e.releaseConnection(e)}beginTransaction(e,r){return this.#e.beginTransaction(e,r)}commitTransaction(e){return this.#e.commitTransaction(e)}rollbackTransaction(e){return this.#e.rollbackTransaction(e)}async destroy(){this.#r&&(await this.#r,this.#i||(this.#i=this.#e.destroy().catch(e=>(this.#i=void 0,Promise.reject(e)))),await this.#i)}#o(){return this.#t.isLevelEnabled("query")||this.#t.isLevelEnabled("error")}#a(e){const r=e.executeQuery;e.executeQuery=async n=>{let s;const a=performanceNow();try{return await r.call(e,n)}catch(u){throw s=u,await this.#u(u,n,a),u}finally{s||await this.#l(n,a)}}}async#u(e,r,n){await this.#t.error(()=>({level:"error",error:e,query:r,queryDurationMillis:this.#c(n)}))}async#l(e,r){await this.#t.query(()=>({level:"query",query:e,queryDurationMillis:this.#c(r)}))}#c(e){return performanceNow()-e}}const ignoreError=()=>{};class SingleConnectionProvider{#e;#t;constructor(e){this.#e=e}async provideConnection(e){for(;this.#t;)await this.#t.catch(ignoreError);return this.#t=this.#r(e).finally(()=>{this.#t=void 0}),this.#t}async#r(e){return await e(this.#e)}}const TRANSACTION_ISOLATION_LEVELS=["read uncommitted","read committed","repeatable read","serializable","snapshot"];freeze(["query","error"]);class Log{#e;#t;constructor(e){isFunction(e)?(this.#t=e,this.#e=freeze({query:!0,error:!0})):(this.#t=defaultLogger,this.#e=freeze({query:e.includes("query"),error:e.includes("error")}))}isLevelEnabled(e){return this.#e[e]}async query(e){this.#e.query&&await this.#t(e())}async error(e){this.#e.error&&await this.#t(e())}}function defaultLogger(t){t.level==="query"?(console.log(`kysely:query: ${t.query.sql}`),console.log(`kysely:query: duration: ${t.queryDurationMillis.toFixed(1)}ms`)):t.level==="error"&&(t.error instanceof Error?console.error(`kysely:error: ${t.error.stack??t.error.message}`):console.error(`kysely:error: ${JSON.stringify({error:t.error,query:t.query.sql,queryDurationMillis:t.queryDurationMillis})}`))}function isCompilable(t){return isObject$3(t)&&isFunction(t.compile)}class Kysely extends QueryCreator{#e;constructor(e){let r,n;if(isKyselyProps(e))r={executor:e.executor},n={...e};else{const s=e.dialect,a=s.createDriver(),u=s.createQueryCompiler(),d=s.createAdapter(),f=new Log(e.log??[]),y=new RuntimeDriver(a,f),b=new DefaultConnectionProvider(y),w=new DefaultQueryExecutor(u,d,b,e.plugins??[]);r={executor:w},n={config:e,executor:w,dialect:s,driver:y}}super(r),this.#e=freeze(n)}get schema(){return new SchemaModule(this.#e.executor)}get dynamic(){return new DynamicModule}get introspection(){return this.#e.dialect.createIntrospector(this.withoutPlugins())}case(e){return new CaseBuilder({node:CaseNode.create(isUndefined(e)?void 0:parseExpression(e))})}get fn(){return createFunctionModule()}transaction(){return new TransactionBuilder({...this.#e})}connection(){return new ConnectionBuilder({...this.#e})}withPlugin(e){return new Kysely({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Kysely({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new Kysely({...this.#e,executor:this.#e.executor.withPluginAtFront(new WithSchemaPlugin(e))})}withTables(){return new Kysely({...this.#e})}async destroy(){await this.#e.driver.destroy()}get isTransaction(){return!1}getExecutor(){return this.#e.executor}executeQuery(e,r=createQueryId()){const n=isCompilable(e)?e.compile():e;return this.getExecutor().executeQuery(n,r)}}class Transaction extends Kysely{#e;constructor(e){super(e),this.#e=e}get isTransaction(){return!0}transaction(){throw new Error("calling the transaction method for a Transaction is not supported")}connection(){throw new Error("calling the connection method for a Transaction is not supported")}async destroy(){throw new Error("calling the destroy method for a Transaction is not supported")}withPlugin(e){return new Transaction({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Transaction({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new Transaction({...this.#e,executor:this.#e.executor.withPluginAtFront(new WithSchemaPlugin(e))})}withTables(){return new Transaction({...this.#e})}}function isKyselyProps(t){return isObject$3(t)&&isObject$3(t.config)&&isObject$3(t.driver)&&isObject$3(t.executor)&&isObject$3(t.dialect)}class ConnectionBuilder{#e;constructor(e){this.#e=freeze(e)}async execute(e){return this.#e.executor.provideConnection(async r=>{const n=this.#e.executor.withConnectionProvider(new SingleConnectionProvider(r)),s=new Kysely({...this.#e,executor:n});return await e(s)})}}preventAwait(ConnectionBuilder,"don't await ConnectionBuilder instances directly. To execute the query you need to call the `execute` method");class TransactionBuilder{#e;constructor(e){this.#e=freeze(e)}setIsolationLevel(e){return new TransactionBuilder({...this.#e,isolationLevel:e})}async execute(e){const{isolationLevel:r,...n}=this.#e,s={isolationLevel:r};return validateTransactionSettings(s),this.#e.executor.provideConnection(async a=>{const u=this.#e.executor.withConnectionProvider(new SingleConnectionProvider(a)),d=new Transaction({...n,executor:u});try{await this.#e.driver.beginTransaction(a,s);const f=await e(d);return await this.#e.driver.commitTransaction(a),f}catch(f){throw await this.#e.driver.rollbackTransaction(a),f}})}}preventAwait(TransactionBuilder,"don't await TransactionBuilder instances directly. To execute the transaction you need to call the `execute` method");function validateTransactionSettings(t){if(t.isolationLevel&&!TRANSACTION_ISOLATION_LEVELS.includes(t.isolationLevel))throw new Error(`invalid transaction isolation level ${t.isolationLevel}`)}class RawBuilderImpl{#e;constructor(e){this.#e=freeze(e)}get expressionType(){}get isRawBuilder(){return!0}as(e){return new AliasedRawBuilderImpl(this,e)}$castTo(){return new RawBuilderImpl({...this.#e})}$notNull(){return new RawBuilderImpl(this.#e)}withPlugin(e){return new RawBuilderImpl({...this.#e,plugins:this.#e.plugins!==void 0?freeze([...this.#e.plugins,e]):freeze([e])})}toOperationNode(){return this.#r(this.#t())}compile(e){return this.#n(this.#t(e))}async execute(e){const r=this.#t(e);return r.executeQuery(this.#n(r),this.#e.queryId)}#t(e){const r=e!==void 0?e.getExecutor():NOOP_QUERY_EXECUTOR;return this.#e.plugins!==void 0?r.withPlugins(this.#e.plugins):r}#r(e){return e.transformQuery(this.#e.rawNode,this.#e.queryId)}#n(e){return e.compileQuery(this.#r(e),this.#e.queryId)}}function createRawBuilder(t){return new RawBuilderImpl(t)}preventAwait(RawBuilderImpl,"don't await RawBuilder instances directly. To execute the query you need to call `execute`");class AliasedRawBuilderImpl{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}get rawBuilder(){return this.#e}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),isOperationNodeSource(this.#t)?this.#t.toOperationNode():IdentifierNode.create(this.#t))}}preventAwait(AliasedRawBuilderImpl,"don't await AliasedRawBuilder instances directly. AliasedRawBuilder should never be executed directly since it's always a part of another query.");const sql=Object.assign((t,...e)=>createRawBuilder({queryId:createQueryId(),rawNode:RawNode.create(t,e?.map(parseParameter)??[])}),{ref(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseStringReference(t))})},val(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseValueExpression(t))})},value(t){return this.val(t)},table(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseTable(t))})},id(...t){const e=new Array(t.length+1).fill(".");return e[0]="",e[e.length-1]="",createRawBuilder({queryId:createQueryId(),rawNode:RawNode.create(e,t.map(IdentifierNode.create))})},lit(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(ValueNode.createImmediate(t))})},literal(t){return this.lit(t)},raw(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithSql(t)})},join(t,e=sql`, `){const r=new Array(2*t.length-1),n=e.toOperationNode();for(let s=0;s{this.nodeStack.push(e),this.#e[e.kind](e),this.nodeStack.pop()}}class DefaultQueryCompiler extends OperationNodeVisitor{#e="";#t=[];get numParameters(){return this.#t.length}compileQuery(e){return this.#e="",this.#t=[],this.visitNode(e),freeze({query:e,sql:this.getSql(),parameters:[...this.#t]})}getSql(){return this.#e}visitSelectQuery(e){const r=this.parentNode!==void 0&&!ParensNode.is(this.parentNode)&&!InsertQueryNode.is(this.parentNode)&&!CreateTableNode.is(this.parentNode)&&!CreateViewNode.is(this.parentNode)&&!SetOperationNode.is(this.parentNode);this.parentNode===void 0&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("select"),e.distinctOn&&(this.append(" "),this.compileDistinctOn(e.distinctOn)),e.frontModifiers?.length&&(this.append(" "),this.compileList(e.frontModifiers," ")),e.selections&&(this.append(" "),this.compileList(e.selections)),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.groupBy&&(this.append(" "),this.visitNode(e.groupBy)),e.having&&(this.append(" "),this.visitNode(e.having)),e.setOperations&&(this.append(" "),this.compileList(e.setOperations," ")),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.offset&&(this.append(" "),this.visitNode(e.offset)),e.endModifiers?.length&&(this.append(" "),this.compileList(this.sortSelectModifiers([...e.endModifiers])," ")),r&&this.append(")")}visitFrom(e){this.append("from "),this.compileList(e.froms)}visitSelection(e){this.visitNode(e.selection)}visitColumn(e){this.visitNode(e.column)}compileDistinctOn(e){this.append("distinct on ("),this.compileList(e),this.append(")")}compileList(e,r=", "){const n=e.length-1;for(let s=0;s<=n;s++)this.visitNode(e[s]),ss&&this.visitNode(n[s])}visitOperator(e){this.append(e.operator)}visitTable(e){this.visitNode(e.table)}visitSchemableIdentifier(e){e.schema&&(this.visitNode(e.schema),this.append(".")),this.visitNode(e.identifier)}visitCreateTable(e){this.append("create "),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.temporary&&this.append("temporary "),this.append("table "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.table),e.selectQuery?(this.append(" as "),this.visitNode(e.selectQuery)):(this.append(" ("),this.compileList([...e.columns,...e.constraints??[]]),this.append(")"),e.onCommit&&(this.append(" on commit "),this.append(e.onCommit)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," ")))}visitColumnDefinition(e){this.visitNode(e.column),this.append(" "),this.visitNode(e.dataType),e.unsigned&&this.append(" unsigned"),e.frontModifiers&&e.frontModifiers.length>0&&(this.append(" "),this.compileList(e.frontModifiers," ")),e.generated&&(this.append(" "),this.visitNode(e.generated)),e.defaultTo&&(this.append(" "),this.visitNode(e.defaultTo)),e.notNull&&this.append(" not null"),e.unique&&this.append(" unique"),e.nullsNotDistinct&&this.append(" nulls not distinct"),e.primaryKey&&this.append(" primary key"),e.autoIncrement&&(this.append(" "),this.append(this.getAutoIncrement())),e.references&&(this.append(" "),this.visitNode(e.references)),e.check&&(this.append(" "),this.visitNode(e.check)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}getAutoIncrement(){return"auto_increment"}visitReferences(e){this.append("references "),this.visitNode(e.table),this.append(" ("),this.compileList(e.columns),this.append(")"),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitDropTable(e){this.append("drop table "),e.ifExists&&this.append("if exists "),this.visitNode(e.table),e.cascade&&this.append(" cascade")}visitDataType(e){this.append(e.dataType)}visitOrderBy(e){this.append("order by "),this.compileList(e.items)}visitOrderByItem(e){this.visitNode(e.orderBy),e.direction&&(this.append(" "),this.visitNode(e.direction))}visitGroupBy(e){this.append("group by "),this.compileList(e.items)}visitGroupByItem(e){this.visitNode(e.groupBy)}visitUpdateQuery(e){const r=this.nodeStack.find(QueryNode.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("update "),this.visitNode(e.table),this.append(" set "),e.updates&&this.compileList(e.updates),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitColumnUpdate(e){this.visitNode(e.column),this.append(" = "),this.visitNode(e.value)}visitLimit(e){this.append("limit "),this.visitNode(e.limit)}visitOffset(e){this.append("offset "),this.visitNode(e.offset)}visitOnConflict(e){this.append("on conflict"),e.columns?(this.append(" ("),this.compileList(e.columns),this.append(")")):e.constraint?(this.append(" on constraint "),this.visitNode(e.constraint)):e.indexExpression&&(this.append(" ("),this.visitNode(e.indexExpression),this.append(")")),e.indexWhere&&(this.append(" "),this.visitNode(e.indexWhere)),e.doNothing===!0?this.append(" do nothing"):e.updates&&(this.append(" do update set "),this.compileList(e.updates),e.updateWhere&&(this.append(" "),this.visitNode(e.updateWhere)))}visitOnDuplicateKey(e){this.append("on duplicate key update "),this.compileList(e.updates)}visitCreateIndex(e){this.append("create "),e.unique&&this.append("unique "),this.append("index "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.using&&(this.append(" using "),this.visitNode(e.using)),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.nullsNotDistinct&&this.append(" nulls not distinct"),e.where&&(this.append(" "),this.visitNode(e.where))}visitDropIndex(e){this.append("drop index "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.cascade&&this.append(" cascade")}visitCreateSchema(e){this.append("create schema "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.schema)}visitDropSchema(e){this.append("drop schema "),e.ifExists&&this.append("if exists "),this.visitNode(e.schema),e.cascade&&this.append(" cascade")}visitPrimaryKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("primary key ("),this.compileList(e.columns),this.append(")")}visitUniqueConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("unique"),e.nullsNotDistinct&&this.append(" nulls not distinct"),this.append(" ("),this.compileList(e.columns),this.append(")")}visitCheckConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("check ("),this.visitNode(e.expression),this.append(")")}visitForeignKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("foreign key ("),this.compileList(e.columns),this.append(") "),this.visitNode(e.references),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitList(e){this.compileList(e.items)}visitWith(e){this.append("with "),e.recursive&&this.append("recursive "),this.compileList(e.expressions)}visitCommonTableExpression(e){this.visitNode(e.name),this.append(" as "),isBoolean(e.materialized)&&(e.materialized||this.append("not "),this.append("materialized ")),this.visitNode(e.expression)}visitCommonTableExpressionName(e){this.visitNode(e.table),e.columns&&(this.append("("),this.compileList(e.columns),this.append(")"))}visitAlterTable(e){this.append("alter table "),this.visitNode(e.table),this.append(" "),e.renameTo&&(this.append("rename to "),this.visitNode(e.renameTo)),e.setSchema&&(this.append("set schema "),this.visitNode(e.setSchema)),e.addConstraint&&this.visitNode(e.addConstraint),e.dropConstraint&&this.visitNode(e.dropConstraint),e.columnAlterations&&this.compileColumnAlterations(e.columnAlterations),e.addIndex&&this.visitNode(e.addIndex),e.dropIndex&&this.visitNode(e.dropIndex)}visitAddColumn(e){this.append("add column "),this.visitNode(e.column)}visitRenameColumn(e){this.append("rename column "),this.visitNode(e.column),this.append(" to "),this.visitNode(e.renameTo)}visitDropColumn(e){this.append("drop column "),this.visitNode(e.column)}visitAlterColumn(e){this.append("alter column "),this.visitNode(e.column),this.append(" "),e.dataType&&(this.announcesNewColumnDataType()&&this.append("type "),this.visitNode(e.dataType),e.dataTypeExpression&&(this.append("using "),this.visitNode(e.dataTypeExpression))),e.setDefault&&(this.append("set default "),this.visitNode(e.setDefault)),e.dropDefault&&this.append("drop default"),e.setNotNull&&this.append("set not null"),e.dropNotNull&&this.append("drop not null")}visitModifyColumn(e){this.append("modify column "),this.visitNode(e.column)}visitAddConstraint(e){this.append("add "),this.visitNode(e.constraint)}visitDropConstraint(e){this.append("drop constraint "),e.ifExists&&this.append("if exists "),this.visitNode(e.constraintName),e.modifier==="cascade"?this.append(" cascade"):e.modifier==="restrict"&&this.append(" restrict")}visitSetOperation(e){this.append(e.operator),this.append(" "),e.all&&this.append("all "),this.visitNode(e.expression)}visitCreateView(e){this.append("create "),e.orReplace&&this.append("or replace "),e.materialized&&this.append("materialized "),e.temporary&&this.append("temporary "),this.append("view "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),this.append(" "),e.columns&&(this.append("("),this.compileList(e.columns),this.append(") ")),e.as&&(this.append("as "),this.visitNode(e.as))}visitDropView(e){this.append("drop "),e.materialized&&this.append("materialized "),this.append("view "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.cascade&&this.append(" cascade")}visitGenerated(e){this.append("generated "),e.always&&this.append("always "),e.byDefault&&this.append("by default "),this.append("as "),e.identity&&this.append("identity"),e.expression&&(this.append("("),this.visitNode(e.expression),this.append(")")),e.stored&&this.append(" stored")}visitDefaultValue(e){this.append("default "),this.visitNode(e.defaultValue)}visitSelectModifier(e){e.rawModifier?this.visitNode(e.rawModifier):this.append(SELECT_MODIFIER_SQL[e.modifier]),e.of&&(this.append(" of "),this.compileList(e.of,", "))}visitCreateType(e){this.append("create type "),this.visitNode(e.name),e.enum&&(this.append(" as enum "),this.visitNode(e.enum))}visitDropType(e){this.append("drop type "),e.ifExists&&this.append("if exists "),this.visitNode(e.name)}visitExplain(e){this.append("explain"),(e.options||e.format)&&(this.append(" "),this.append(this.getLeftExplainOptionsWrapper()),e.options&&(this.visitNode(e.options),e.format&&this.append(this.getExplainOptionsDelimiter())),e.format&&(this.append("format"),this.append(this.getExplainOptionAssignment()),this.append(e.format)),this.append(this.getRightExplainOptionsWrapper()))}visitDefaultInsertValue(e){this.append("default")}visitAggregateFunction(e){this.append(e.func),this.append("("),e.distinct&&this.append("distinct "),this.compileList(e.aggregated),this.append(")"),e.filter&&(this.append(" filter("),this.visitNode(e.filter),this.append(")")),e.over&&(this.append(" "),this.visitNode(e.over))}visitOver(e){this.append("over("),e.partitionBy&&(this.visitNode(e.partitionBy),e.orderBy&&this.append(" ")),e.orderBy&&this.visitNode(e.orderBy),this.append(")")}visitPartitionBy(e){this.append("partition by "),this.compileList(e.items)}visitPartitionByItem(e){this.visitNode(e.partitionBy)}visitBinaryOperation(e){this.visitNode(e.leftOperand),this.append(" "),this.visitNode(e.operator),this.append(" "),this.visitNode(e.rightOperand)}visitUnaryOperation(e){this.visitNode(e.operator),this.isMinusOperator(e.operator)||this.append(" "),this.visitNode(e.operand)}isMinusOperator(e){return OperatorNode.is(e)&&e.operator==="-"}visitUsing(e){this.append("using "),this.compileList(e.tables)}visitFunction(e){this.append(e.func),this.append("("),this.compileList(e.arguments),this.append(")")}visitCase(e){this.append("case"),e.value&&(this.append(" "),this.visitNode(e.value)),e.when&&(this.append(" "),this.compileList(e.when," ")),e.else&&(this.append(" else "),this.visitNode(e.else)),this.append(" end"),e.isStatement&&this.append(" case")}visitWhen(e){this.append("when "),this.visitNode(e.condition),e.result&&(this.append(" then "),this.visitNode(e.result))}visitJSONReference(e){this.visitNode(e.reference),this.visitNode(e.traversal)}visitJSONPath(e){e.inOperator&&this.visitNode(e.inOperator),this.append("'$");for(const r of e.pathLegs)this.visitNode(r);this.append("'")}visitJSONPathLeg(e){const r=e.type==="ArrayLocation";this.append(r?"[":"."),this.append(String(e.value)),r&&this.append("]")}visitJSONOperatorChain(e){for(let r=0,n=e.values.length;r"),this.visitNode(e.values[r])}visitAddIndex(e){this.append("add "),e.unique&&this.append("unique "),this.append("index "),this.visitNode(e.name),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.using&&(this.append(" using "),this.visitNode(e.using))}append(e){this.#e+=e}appendValue(e){this.addParameter(e),this.append(this.getCurrentParameterPlaceholder())}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getCurrentParameterPlaceholder(){return"$"+this.numParameters}getLeftExplainOptionsWrapper(){return"("}getExplainOptionAssignment(){return" "}getExplainOptionsDelimiter(){return", "}getRightExplainOptionsWrapper(){return")"}sanitizeIdentifier(e){const r=this.getLeftIdentifierWrapper(),n=this.getRightIdentifierWrapper();let s="";for(const a of e)s+=a,a===r?s+=r:a===n&&(s+=n);return s}addParameter(e){this.#t.push(e)}appendImmediateValue(e){if(isString(e))this.append(`'${e}'`);else if(isNumber(e)||isBoolean(e))this.append(e.toString());else if(isNull(e))this.append("null");else if(isDate(e))this.appendImmediateValue(e.toISOString());else if(isBigInt(e))this.appendImmediateValue(e.toString());else throw new Error(`invalid immediate value ${e}`)}sortSelectModifiers(e){return e.sort((r,n)=>r.modifier&&n.modifier?SELECT_MODIFIER_PRIORITY[r.modifier]-SELECT_MODIFIER_PRIORITY[n.modifier]:1),freeze(e)}compileColumnAlterations(e){this.compileList(e)}announcesNewColumnDataType(){return!0}}const SELECT_MODIFIER_SQL=freeze({ForKeyShare:"for key share",ForNoKeyUpdate:"for no key update",ForUpdate:"for update",ForShare:"for share",NoWait:"nowait",SkipLocked:"skip locked",Distinct:"distinct"}),SELECT_MODIFIER_PRIORITY=freeze({ForKeyShare:1,ForNoKeyUpdate:1,ForUpdate:1,ForShare:1,NoWait:2,SkipLocked:2,Distinct:0}),JOIN_TYPE_SQL=freeze({InnerJoin:"inner join",LeftJoin:"left join",RightJoin:"right join",FullJoin:"full join",LateralInnerJoin:"inner join lateral",LateralLeftJoin:"left join lateral"}),CompiledQuery=freeze({raw(t,e=[]){return freeze({sql:t,query:RawNode.createWithSql(t),parameters:freeze(e)})}});class DialectAdapterBase{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}}class SqliteDriver{#e;#t=new ConnectionMutex;#r;#n;constructor(e){this.#e=freeze({...e})}async init(){this.#r=isFunction(this.#e.database)?await this.#e.database():this.#e.database,this.#n=new SqliteConnection(this.#r),this.#e.onCreateConnection&&await this.#e.onCreateConnection(this.#n)}async acquireConnection(){return await this.#t.lock(),this.#n}async beginTransaction(e){await e.executeQuery(CompiledQuery.raw("begin"))}async commitTransaction(e){await e.executeQuery(CompiledQuery.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(CompiledQuery.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}}class SqliteConnection{#e;constructor(e){this.#e=e}executeQuery(e){const{sql:r,parameters:n}=e,s=this.#e.prepare(r);if(s.reader)return Promise.resolve({rows:s.all(n)});{const{changes:a,lastInsertRowid:u}=s.run(n),d=a!=null?BigInt(a):void 0;return Promise.resolve({numUpdatedOrDeletedRows:d,numAffectedRows:d,insertId:u!=null?BigInt(u):void 0,rows:[]})}}async*streamQuery(e,r){const{sql:n,parameters:s,query:a}=e,u=this.#e.prepare(n);if(SelectQueryNode.is(a)){const d=u.iterate(s);for(const f of d)yield{rows:[f]}}else throw new Error("Sqlite driver only supports streaming of select queries")}}class ConnectionMutex{#e;#t;async lock(){for(;this.#e;)await this.#e;this.#e=new Promise(e=>{this.#t=e})}unlock(){const e=this.#t;this.#e=void 0,this.#t=void 0,e?.()}}const ID_WRAP_REGEX=/"/g;class SqliteQueryCompiler extends DefaultQueryCompiler{getCurrentParameterPlaceholder(){return"?"}getLeftExplainOptionsWrapper(){return""}getRightExplainOptionsWrapper(){return""}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}sanitizeIdentifier(e){return e.replace(ID_WRAP_REGEX,'""')}visitDefaultInsertValue(e){this.append("null")}}const DEFAULT_MIGRATION_TABLE="kysely_migration",DEFAULT_MIGRATION_LOCK_TABLE="kysely_migration_lock";freeze({__noMigrations__:!0});class SqliteIntrospector{#e;constructor(e){this.#e=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("sqlite_master").where("type","in",["table","view"]).where("name","not like","sqlite_%").select("name").orderBy("name").$castTo();e.withInternalKyselyTables||(r=r.where("name","!=",DEFAULT_MIGRATION_TABLE).where("name","!=",DEFAULT_MIGRATION_LOCK_TABLE));const n=await r.execute();return Promise.all(n.map(({name:s})=>this.#t(s)))}async getMetadata(e){return{tables:await this.getTables(e)}}async#t(e){const r=this.#e,n=await r.selectFrom("sqlite_master").where("name","=",e).select(["sql","type"]).$castTo().executeTakeFirstOrThrow(),s=n.sql?.split(/[\(\),]/)?.find(u=>u.toLowerCase().includes("autoincrement"))?.trimStart()?.split(/\s+/)?.[0]?.replace(/["`]/g,""),a=await r.selectFrom(sql`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).orderBy("cid").execute();return{name:e,isView:n.type==="view",columns:a.map(u=>({name:u.name,dataType:u.type,isNullable:!u.notnull,isAutoIncrementing:u.name===s,hasDefaultValue:u.dflt_value!=null}))}}}class SqliteAdapter extends DialectAdapterBase{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(e,r){}async releaseMigrationLock(e,r){}}class SqliteDialect{#e;constructor(e){this.#e=freeze({...e})}createDriver(){return new SqliteDriver(this.#e)}createQueryCompiler(){return new SqliteQueryCompiler}createAdapter(){return new SqliteAdapter}createIntrospector(e){return new SqliteIntrospector(e)}}function toBytes(t){return Uint8Array.from([...t].map(e=>e.charCodeAt(0)))}function fromBytes(t){return String.fromCharCode(...t)}function encode(t){return t.length?[fromBytes(t[0].site_id),...t.flatMap(e=>[e.cid,fromBytes(e.pk),e.table,JSON.stringify(e.val),e.db_version,e.col_version,e.cl,e.seq])]:[]}function decode(t){if(!t[0])return[];const e=toBytes(t[0]),r=[];for(let n=1;n"u"||t===void 0}function isString(t){return typeof t=="string"}function isNumber(t){return typeof t=="number"}function isBoolean(t){return typeof t=="boolean"}function isNull(t){return t===null}function isDate(t){return t instanceof Date}function isBigInt(t){return typeof t=="bigint"}function isFunction(t){return typeof t=="function"}function isObject$3(t){return typeof t=="object"&&t!==null}function freeze(t){return Object.freeze(t)}function asArray(t){return isReadonlyArray(t)?t:[t]}function isReadonlyArray(t){return Array.isArray(t)}function noop$1(t){return t}const AlterTableNode=freeze({is(t){return t.kind==="AlterTableNode"},create(t){return freeze({kind:"AlterTableNode",table:t})},cloneWithTableProps(t,e){return freeze({...t,...e})},cloneWithColumnAlteration(t,e){return freeze({...t,columnAlterations:t.columnAlterations?[...t.columnAlterations,e]:[e]})}}),IdentifierNode=freeze({is(t){return t.kind==="IdentifierNode"},create(t){return freeze({kind:"IdentifierNode",name:t})}}),CreateIndexNode=freeze({is(t){return t.kind==="CreateIndexNode"},create(t){return freeze({kind:"CreateIndexNode",name:IdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})},cloneWithColumns(t,e){return freeze({...t,columns:[...t.columns||[],...e]})}}),CreateSchemaNode=freeze({is(t){return t.kind==="CreateSchemaNode"},create(t,e){return freeze({kind:"CreateSchemaNode",schema:IdentifierNode.create(t),...e})},cloneWith(t,e){return freeze({...t,...e})}}),ON_COMMIT_ACTIONS=["preserve rows","delete rows","drop"],CreateTableNode=freeze({is(t){return t.kind==="CreateTableNode"},create(t){return freeze({kind:"CreateTableNode",table:t,columns:freeze([])})},cloneWithColumn(t,e){return freeze({...t,columns:freeze([...t.columns,e])})},cloneWithConstraint(t,e){return freeze({...t,constraints:t.constraints?freeze([...t.constraints,e]):freeze([e])})},cloneWithFrontModifier(t,e){return freeze({...t,frontModifiers:t.frontModifiers?freeze([...t.frontModifiers,e]):freeze([e])})},cloneWithEndModifier(t,e){return freeze({...t,endModifiers:t.endModifiers?freeze([...t.endModifiers,e]):freeze([e])})},cloneWith(t,e){return freeze({...t,...e})}}),SchemableIdentifierNode=freeze({is(t){return t.kind==="SchemableIdentifierNode"},create(t){return freeze({kind:"SchemableIdentifierNode",identifier:IdentifierNode.create(t)})},createWithSchema(t,e){return freeze({kind:"SchemableIdentifierNode",schema:IdentifierNode.create(t),identifier:IdentifierNode.create(e)})}}),DropIndexNode=freeze({is(t){return t.kind==="DropIndexNode"},create(t,e){return freeze({kind:"DropIndexNode",name:SchemableIdentifierNode.create(t),...e})},cloneWith(t,e){return freeze({...t,...e})}}),DropSchemaNode=freeze({is(t){return t.kind==="DropSchemaNode"},create(t,e){return freeze({kind:"DropSchemaNode",schema:IdentifierNode.create(t),...e})},cloneWith(t,e){return freeze({...t,...e})}}),DropTableNode=freeze({is(t){return t.kind==="DropTableNode"},create(t,e){return freeze({kind:"DropTableNode",table:t,...e})},cloneWith(t,e){return freeze({...t,...e})}}),AliasNode=freeze({is(t){return t.kind==="AliasNode"},create(t,e){return freeze({kind:"AliasNode",node:t,alias:e})}}),TableNode=freeze({is(t){return t.kind==="TableNode"},create(t){return freeze({kind:"TableNode",table:SchemableIdentifierNode.create(t)})},createWithSchema(t,e){return freeze({kind:"TableNode",table:SchemableIdentifierNode.createWithSchema(t,e)})}});function isOperationNodeSource(t){return isObject$3(t)&&isFunction(t.toOperationNode)}function isExpression(t){return isObject$3(t)&&"expressionType"in t&&isOperationNodeSource(t)}function isAliasedExpression(t){return isObject$3(t)&&"expression"in t&&isString(t.alias)&&isOperationNodeSource(t)}const SelectModifierNode=freeze({is(t){return t.kind==="SelectModifierNode"},create(t,e){return freeze({kind:"SelectModifierNode",modifier:t,of:e})},createWithExpression(t){return freeze({kind:"SelectModifierNode",rawModifier:t})}}),AndNode=freeze({is(t){return t.kind==="AndNode"},create(t,e){return freeze({kind:"AndNode",left:t,right:e})}}),OrNode=freeze({is(t){return t.kind==="OrNode"},create(t,e){return freeze({kind:"OrNode",left:t,right:e})}}),OnNode=freeze({is(t){return t.kind==="OnNode"},create(t){return freeze({kind:"OnNode",on:t})},cloneWithOperation(t,e,r){return freeze({...t,on:e==="And"?AndNode.create(t.on,r):OrNode.create(t.on,r)})}}),JoinNode=freeze({is(t){return t.kind==="JoinNode"},create(t,e){return freeze({kind:"JoinNode",joinType:t,table:e,on:void 0})},createWithOn(t,e,r){return freeze({kind:"JoinNode",joinType:t,table:e,on:OnNode.create(r)})},cloneWithOn(t,e){return freeze({...t,on:t.on?OnNode.cloneWithOperation(t.on,"And",e):OnNode.create(e)})}}),BinaryOperationNode=freeze({is(t){return t.kind==="BinaryOperationNode"},create(t,e,r){return freeze({kind:"BinaryOperationNode",leftOperand:t,operator:e,rightOperand:r})}}),COMPARISON_OPERATORS=["=","==","!=","<>",">",">=","<","<=","in","not in","is","is not","like","not like","match","ilike","not ilike","@>","<@","&&","?","?&","!<","!>","<=>","!~","~","~*","!~*","@@","@@@","!!","<->","regexp","is distinct from","is not distinct from"],ARITHMETIC_OPERATORS=["+","-","*","/","%","^","&","|","#","<<",">>"],JSON_OPERATORS=["->","->>"],BINARY_OPERATORS=[...COMPARISON_OPERATORS,...ARITHMETIC_OPERATORS,"&&","||"],UNARY_FILTER_OPERATORS=["exists","not exists"],UNARY_OPERATORS=["not","-",...UNARY_FILTER_OPERATORS],OPERATORS=[...BINARY_OPERATORS,...JSON_OPERATORS,...UNARY_OPERATORS,"between","between symmetric"],OperatorNode=freeze({is(t){return t.kind==="OperatorNode"},create(t){return freeze({kind:"OperatorNode",operator:t})}});function isJSONOperator(t){return isString(t)&&JSON_OPERATORS.includes(t)}const ColumnNode=freeze({is(t){return t.kind==="ColumnNode"},create(t){return freeze({kind:"ColumnNode",column:IdentifierNode.create(t)})}}),SelectAllNode=freeze({is(t){return t.kind==="SelectAllNode"},create(){return freeze({kind:"SelectAllNode"})}}),ReferenceNode=freeze({is(t){return t.kind==="ReferenceNode"},create(t,e){return freeze({kind:"ReferenceNode",table:e,column:t})},createSelectAll(t){return freeze({kind:"ReferenceNode",table:t,column:SelectAllNode.create()})}});class DynamicReferenceBuilder{#e;get dynamicReference(){return this.#e}get refType(){}constructor(e){this.#e=e}toOperationNode(){return parseSimpleReferenceExpression(this.#e)}}function isDynamicReferenceBuilder(t){return isObject$3(t)&&isOperationNodeSource(t)&&isString(t.dynamicReference)}const OrderByItemNode=freeze({is(t){return t.kind==="OrderByItemNode"},create(t,e){return freeze({kind:"OrderByItemNode",orderBy:t,direction:e})}}),RawNode=freeze({is(t){return t.kind==="RawNode"},create(t,e){return freeze({kind:"RawNode",sqlFragments:freeze(t),parameters:freeze(e)})},createWithSql(t){return RawNode.create([t],[])},createWithChild(t){return RawNode.create(["",""],[t])},createWithChildren(t){return RawNode.create(new Array(t.length+1).fill(""),t)}});function isOrderByDirection(t){return t==="asc"||t==="desc"}function parseOrderBy(t){if(t.length===2)return[parseOrderByItem(t[0],t[1])];if(t.length===1){const[e]=t;return Array.isArray(e)?e.map(r=>parseOrderByItem(r)):[parseOrderByItem(e)]}throw new Error(`Invalid number of arguments at order by! expected 1-2, received ${t.length}`)}function parseOrderByItem(t,e){const r=parseOrderByExpression(t);if(OrderByItemNode.is(r)){if(e)throw new Error("Cannot specify direction twice!");return r}return OrderByItemNode.create(r,parseOrderByDirectionExpression(e))}function parseOrderByExpression(t){if(isExpressionOrFactory(t))return parseExpression(t);if(isDynamicReferenceBuilder(t))return t.toOperationNode();const[e,r]=t.split(" ");if(r){if(!isOrderByDirection(r))throw new Error(`Invalid order by direction: ${r}`);return OrderByItemNode.create(parseStringReference(e),parseOrderByDirectionExpression(r))}return parseStringReference(t)}function parseOrderByDirectionExpression(t){if(t)return t==="asc"||t==="desc"?RawNode.createWithSql(t):t.toOperationNode()}const JSONReferenceNode=freeze({is(t){return t.kind==="JSONReferenceNode"},create(t,e){return freeze({kind:"JSONReferenceNode",reference:t,traversal:e})},cloneWithTraversal(t,e){return freeze({...t,traversal:e})}}),JSONOperatorChainNode=freeze({is(t){return t.kind==="JSONOperatorChainNode"},create(t){return freeze({kind:"JSONOperatorChainNode",operator:t,values:freeze([])})},cloneWithValue(t,e){return freeze({...t,values:freeze([...t.values,e])})}}),JSONPathNode=freeze({is(t){return t.kind==="JSONPathNode"},create(t){return freeze({kind:"JSONPathNode",inOperator:t,pathLegs:freeze([])})},cloneWithLeg(t,e){return freeze({...t,pathLegs:freeze([...t.pathLegs,e])})}});function parseSimpleReferenceExpression(t){return isString(t)?parseStringReference(t):t.toOperationNode()}function parseReferenceExpressionOrList(t){return isReadonlyArray(t)?t.map(e=>parseReferenceExpression(e)):[parseReferenceExpression(t)]}function parseReferenceExpression(t){return isExpressionOrFactory(t)?parseExpression(t):parseSimpleReferenceExpression(t)}function parseJSONReference(t,e){const r=parseStringReference(t);if(isJSONOperator(e))return JSONReferenceNode.create(r,JSONOperatorChainNode.create(OperatorNode.create(e)));const n=e.slice(0,-1);if(isJSONOperator(n))return JSONReferenceNode.create(r,JSONPathNode.create(OperatorNode.create(n)));throw new Error(`Invalid JSON operator: ${e}`)}function parseStringReference(t){const e=".";if(!t.includes(e))return ReferenceNode.create(ColumnNode.create(t));const r=t.split(e).map(trim$2);if(r.length===3)return parseStringReferenceWithTableAndSchema(r);if(r.length===2)return parseStringReferenceWithTable(r);throw new Error(`invalid column reference ${t}`)}function parseAliasedStringReference(t){const e=" as ";if(t.includes(e)){const[r,n]=t.split(e).map(trim$2);return AliasNode.create(parseStringReference(r),IdentifierNode.create(n))}else return parseStringReference(t)}function parseColumnName(t){return ColumnNode.create(t)}function parseOrderedColumnName(t){const e=" ";if(t.includes(e)){const[r,n]=t.split(e).map(trim$2);if(!isOrderByDirection(n))throw new Error(`invalid order direction "${n}" next to "${r}"`);return parseOrderBy([r,n])[0]}else return parseColumnName(t)}function parseStringReferenceWithTableAndSchema(t){const[e,r,n]=t;return ReferenceNode.create(ColumnNode.create(n),TableNode.createWithSchema(e,r))}function parseStringReferenceWithTable(t){const[e,r]=t;return ReferenceNode.create(ColumnNode.create(r),TableNode.create(e))}function trim$2(t){return t.trim()}const PrimitiveValueListNode=freeze({is(t){return t.kind==="PrimitiveValueListNode"},create(t){return freeze({kind:"PrimitiveValueListNode",values:freeze([...t])})}}),ValueListNode=freeze({is(t){return t.kind==="ValueListNode"},create(t){return freeze({kind:"ValueListNode",values:freeze(t)})}}),ValueNode=freeze({is(t){return t.kind==="ValueNode"},create(t){return freeze({kind:"ValueNode",value:t})},createImmediate(t){return freeze({kind:"ValueNode",value:t,immediate:!0})}});function parseValueExpressionOrList(t){return isReadonlyArray(t)?parseValueExpressionList(t):parseValueExpression(t)}function parseValueExpression(t){return isExpressionOrFactory(t)?parseExpression(t):ValueNode.create(t)}function isSafeImmediateValue(t){return isNumber(t)||isBoolean(t)||isNull(t)}function parseSafeImmediateValue(t){if(!isSafeImmediateValue(t))throw new Error(`unsafe immediate value ${JSON.stringify(t)}`);return ValueNode.createImmediate(t)}function parseValueExpressionList(t){return t.some(isExpressionOrFactory)?ValueListNode.create(t.map(e=>parseValueExpression(e))):PrimitiveValueListNode.create(t)}const ParensNode=freeze({is(t){return t.kind==="ParensNode"},create(t){return freeze({kind:"ParensNode",node:t})}});function parseValueBinaryOperationOrExpression(t){if(t.length===3)return parseValueBinaryOperation(t[0],t[1],t[2]);if(t.length===1)return parseValueExpression(t[0]);throw new Error(`invalid arguments: ${JSON.stringify(t)}`)}function parseValueBinaryOperation(t,e,r){return isIsOperator(e)&&needsIsOperator(r)?BinaryOperationNode.create(parseReferenceExpression(t),parseOperator(e),ValueNode.createImmediate(r)):BinaryOperationNode.create(parseReferenceExpression(t),parseOperator(e),parseValueExpressionOrList(r))}function parseReferentialBinaryOperation(t,e,r){return BinaryOperationNode.create(parseReferenceExpression(t),parseOperator(e),parseReferenceExpression(r))}function parseFilterObject(t,e){return parseFilterList(Object.entries(t).filter(([,r])=>!isUndefined(r)).map(([r,n])=>parseValueBinaryOperation(r,needsIsOperator(n)?"is":"=",n)),e)}function parseFilterList(t,e){const r=e==="and"?AndNode.create:OrNode.create;if(t.length===0)return BinaryOperationNode.create(ValueNode.createImmediate(1),OperatorNode.create("="),ValueNode.createImmediate(e==="and"?1:0));let n=toOperationNode(t[0]);for(let s=1;s1?ParensNode.create(n):n}function isIsOperator(t){return t==="is"||t==="is not"}function needsIsOperator(t){return isNull(t)||isBoolean(t)}function parseOperator(t){if(isString(t)&&OPERATORS.includes(t))return OperatorNode.create(t);if(isOperationNodeSource(t))return t.toOperationNode();throw new Error(`invalid operator ${JSON.stringify(t)}`)}function toOperationNode(t){return isOperationNodeSource(t)?t.toOperationNode():t}const OrderByNode=freeze({is(t){return t.kind==="OrderByNode"},create(t){return freeze({kind:"OrderByNode",items:freeze([...t])})},cloneWithItems(t,e){return freeze({...t,items:freeze([...t.items,...e])})}}),PartitionByNode=freeze({is(t){return t.kind==="PartitionByNode"},create(t){return freeze({kind:"PartitionByNode",items:freeze(t)})},cloneWithItems(t,e){return freeze({...t,items:freeze([...t.items,...e])})}}),OverNode=freeze({is(t){return t.kind==="OverNode"},create(){return freeze({kind:"OverNode"})},cloneWithOrderByItems(t,e){return freeze({...t,orderBy:t.orderBy?OrderByNode.cloneWithItems(t.orderBy,e):OrderByNode.create(e)})},cloneWithPartitionByItems(t,e){return freeze({...t,partitionBy:t.partitionBy?PartitionByNode.cloneWithItems(t.partitionBy,e):PartitionByNode.create(e)})}}),FromNode=freeze({is(t){return t.kind==="FromNode"},create(t){return freeze({kind:"FromNode",froms:freeze(t)})},cloneWithFroms(t,e){return freeze({...t,froms:freeze([...t.froms,...e])})}}),GroupByNode=freeze({is(t){return t.kind==="GroupByNode"},create(t){return freeze({kind:"GroupByNode",items:freeze(t)})},cloneWithItems(t,e){return freeze({...t,items:freeze([...t.items,...e])})}}),HavingNode=freeze({is(t){return t.kind==="HavingNode"},create(t){return freeze({kind:"HavingNode",having:t})},cloneWithOperation(t,e,r){return freeze({...t,having:e==="And"?AndNode.create(t.having,r):OrNode.create(t.having,r)})}}),SelectQueryNode=freeze({is(t){return t.kind==="SelectQueryNode"},create(t){return freeze({kind:"SelectQueryNode",...t&&{with:t}})},createFrom(t,e){return freeze({kind:"SelectQueryNode",from:FromNode.create(t),...e&&{with:e}})},cloneWithSelections(t,e){return freeze({...t,selections:t.selections?freeze([...t.selections,...e]):freeze(e)})},cloneWithDistinctOn(t,e){return freeze({...t,distinctOn:t.distinctOn?freeze([...t.distinctOn,...e]):freeze(e)})},cloneWithFrontModifier(t,e){return freeze({...t,frontModifiers:t.frontModifiers?freeze([...t.frontModifiers,e]):freeze([e])})},cloneWithEndModifier(t,e){return freeze({...t,endModifiers:t.endModifiers?freeze([...t.endModifiers,e]):freeze([e])})},cloneWithOrderByItems(t,e){return freeze({...t,orderBy:t.orderBy?OrderByNode.cloneWithItems(t.orderBy,e):OrderByNode.create(e)})},cloneWithGroupByItems(t,e){return freeze({...t,groupBy:t.groupBy?GroupByNode.cloneWithItems(t.groupBy,e):GroupByNode.create(e)})},cloneWithLimit(t,e){return freeze({...t,limit:e})},cloneWithOffset(t,e){return freeze({...t,offset:e})},cloneWithHaving(t,e){return freeze({...t,having:t.having?HavingNode.cloneWithOperation(t.having,"And",e):HavingNode.create(e)})},cloneWithSetOperations(t,e){return freeze({...t,setOperations:t.setOperations?freeze([...t.setOperations,...e]):freeze([...e])})},cloneWithoutSelections(t){return freeze({...t,selections:[]})},cloneWithoutLimit(t){return freeze({...t,limit:void 0})},cloneWithoutOffset(t){return freeze({...t,offset:void 0})},cloneWithoutOrderBy(t){return freeze({...t,orderBy:void 0})}});function preventAwait(t,e){Object.defineProperties(t.prototype,{then:{enumerable:!1,value:()=>{throw new Error(e)}}})}class JoinBuilder{#e;constructor(e){this.#e=freeze(e)}on(...e){return new JoinBuilder({...this.#e,joinNode:JoinNode.cloneWithOn(this.#e.joinNode,parseValueBinaryOperationOrExpression(e))})}onRef(e,r,n){return new JoinBuilder({...this.#e,joinNode:JoinNode.cloneWithOn(this.#e.joinNode,parseReferentialBinaryOperation(e,r,n))})}onTrue(){return new JoinBuilder({...this.#e,joinNode:JoinNode.cloneWithOn(this.#e.joinNode,RawNode.createWithSql("true"))})}$call(e){return e(this)}toOperationNode(){return this.#e.joinNode}}preventAwait(JoinBuilder,"don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");const PartitionByItemNode=freeze({is(t){return t.kind==="PartitionByItemNode"},create(t){return freeze({kind:"PartitionByItemNode",partitionBy:t})}});function parsePartitionBy(t){return parseReferenceExpressionOrList(t).map(PartitionByItemNode.create)}class OverBuilder{#e;constructor(e){this.#e=freeze(e)}orderBy(e,r){return new OverBuilder({overNode:OverNode.cloneWithOrderByItems(this.#e.overNode,parseOrderBy([e,r]))})}partitionBy(e){return new OverBuilder({overNode:OverNode.cloneWithPartitionByItems(this.#e.overNode,parsePartitionBy(e))})}$call(e){return e(this)}toOperationNode(){return this.#e.overNode}}preventAwait(OverBuilder,"don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");const SelectionNode=freeze({is(t){return t.kind==="SelectionNode"},create(t){return freeze({kind:"SelectionNode",selection:t})},createSelectAll(){return freeze({kind:"SelectionNode",selection:SelectAllNode.create()})},createSelectAllFromTable(t){return freeze({kind:"SelectionNode",selection:ReferenceNode.createSelectAll(t)})}});function parseSelectArg(t){return isFunction(t)?parseSelectArg(t(expressionBuilder())):isReadonlyArray(t)?t.map(e=>parseSelectExpression(e)):[parseSelectExpression(t)]}function parseSelectExpression(t){return isString(t)?SelectionNode.create(parseAliasedStringReference(t)):isDynamicReferenceBuilder(t)?SelectionNode.create(t.toOperationNode()):SelectionNode.create(parseAliasedExpression(t))}function parseSelectAll(t){return t?Array.isArray(t)?t.map(parseSelectAllArg):[parseSelectAllArg(t)]:[SelectionNode.createSelectAll()]}function parseSelectAllArg(t){if(isString(t))return SelectionNode.createSelectAllFromTable(parseTable(t));throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`)}const ValuesNode=freeze({is(t){return t.kind==="ValuesNode"},create(t){return freeze({kind:"ValuesNode",values:freeze(t)})}}),DefaultInsertValueNode=freeze({is(t){return t.kind==="DefaultInsertValueNode"},create(){return freeze({kind:"DefaultInsertValueNode"})}});function parseInsertExpression(t){const e=isFunction(t)?t(expressionBuilder()):t,r=isReadonlyArray(e)?e:freeze([e]);return parseInsertColumnsAndValues(r)}function parseInsertColumnsAndValues(t){const e=parseColumnNamesAndIndexes(t);return[freeze([...e.keys()].map(ColumnNode.create)),ValuesNode.create(t.map(r=>parseRowValues(r,e)))]}function parseColumnNamesAndIndexes(t){const e=new Map;for(const r of t){const n=Object.keys(r);for(const s of n)!e.has(s)&&r[s]!==void 0&&e.set(s,e.size)}return e}function parseRowValues(t,e){const r=Object.keys(t),n=Array.from({length:e.size});let s=!1;for(const u of r){const d=e.get(u);if(isUndefined(d))continue;const f=t[u];(isUndefined(f)||isExpressionOrFactory(f))&&(s=!0),n[d]=f}if(r.lengthisUndefined(d)?u:parseValueExpression(d)))}return PrimitiveValueListNode.create(n)}const InsertQueryNode=freeze({is(t){return t.kind==="InsertQueryNode"},create(t,e,r){return freeze({kind:"InsertQueryNode",into:t,...e&&{with:e},replace:r})},cloneWith(t,e){return freeze({...t,...e})}}),UpdateQueryNode=freeze({is(t){return t.kind==="UpdateQueryNode"},create(t,e){return freeze({kind:"UpdateQueryNode",table:t,...e&&{with:e}})},cloneWithFromItems(t,e){return freeze({...t,from:t.from?FromNode.cloneWithFroms(t.from,e):FromNode.create(e)})},cloneWithUpdates(t,e){return freeze({...t,updates:t.updates?freeze([...t.updates,...e]):e})}}),UsingNode=freeze({is(t){return t.kind==="UsingNode"},create(t){return freeze({kind:"UsingNode",tables:freeze(t)})},cloneWithTables(t,e){return freeze({...t,tables:freeze([...t.tables,...e])})}}),DeleteQueryNode=freeze({is(t){return t.kind==="DeleteQueryNode"},create(t,e){return freeze({kind:"DeleteQueryNode",from:FromNode.create(t),...e&&{with:e}})},cloneWithOrderByItems(t,e){return freeze({...t,orderBy:t.orderBy?OrderByNode.cloneWithItems(t.orderBy,e):OrderByNode.create(e)})},cloneWithLimit(t,e){return freeze({...t,limit:e})},cloneWithUsing(t,e){return freeze({...t,using:t.using!==void 0?UsingNode.cloneWithTables(t.using,e):UsingNode.create(e)})}}),WhereNode=freeze({is(t){return t.kind==="WhereNode"},create(t){return freeze({kind:"WhereNode",where:t})},cloneWithOperation(t,e,r){return freeze({...t,where:e==="And"?AndNode.create(t.where,r):OrNode.create(t.where,r)})}}),ReturningNode=freeze({is(t){return t.kind==="ReturningNode"},create(t){return freeze({kind:"ReturningNode",selections:freeze(t)})},cloneWithSelections(t,e){return freeze({...t,selections:t.selections?freeze([...t.selections,...e]):freeze(e)})}}),ExplainNode=freeze({is(t){return t.kind==="ExplainNode"},create(t,e){return freeze({kind:"ExplainNode",format:t,options:e})}}),QueryNode=freeze({is(t){return SelectQueryNode.is(t)||InsertQueryNode.is(t)||UpdateQueryNode.is(t)||DeleteQueryNode.is(t)},cloneWithWhere(t,e){return freeze({...t,where:t.where?WhereNode.cloneWithOperation(t.where,"And",e):WhereNode.create(e)})},cloneWithJoin(t,e){return freeze({...t,joins:t.joins?freeze([...t.joins,e]):freeze([e])})},cloneWithReturning(t,e){return freeze({...t,returning:t.returning?ReturningNode.cloneWithSelections(t.returning,e):ReturningNode.create(e)})},cloneWithoutWhere(t){return freeze({...t,where:void 0})},cloneWithExplain(t,e,r){return freeze({...t,explain:ExplainNode.create(e,r?.toOperationNode())})}}),ColumnUpdateNode=freeze({is(t){return t.kind==="ColumnUpdateNode"},create(t,e){return freeze({kind:"ColumnUpdateNode",column:t,value:e})}});function parseUpdate(...t){return t.length===2?[ColumnUpdateNode.create(parseReferenceExpression(t[0]),parseValueExpression(t[1]))]:parseUpdateObjectExpression(t[0])}function parseUpdateObjectExpression(t){const e=isFunction(t)?t(expressionBuilder()):t;return Object.entries(e).filter(([r,n])=>n!==void 0).map(([r,n])=>ColumnUpdateNode.create(ColumnNode.create(r),parseValueExpression(n)))}const OnDuplicateKeyNode=freeze({is(t){return t.kind==="OnDuplicateKeyNode"},create(t){return freeze({kind:"OnDuplicateKeyNode",updates:t})}});class InsertResult{insertId;numInsertedOrUpdatedRows;constructor(e,r){this.insertId=e,this.numInsertedOrUpdatedRows=r}}class NoResultError extends Error{node;constructor(e){super("no result"),this.node=e}}function isNoResultErrorConstructor(t){return Object.prototype.hasOwnProperty.call(t,"prototype")}const OnConflictNode=freeze({is(t){return t.kind==="OnConflictNode"},create(){return freeze({kind:"OnConflictNode"})},cloneWith(t,e){return freeze({...t,...e})},cloneWithIndexWhere(t,e){return freeze({...t,indexWhere:t.indexWhere?WhereNode.cloneWithOperation(t.indexWhere,"And",e):WhereNode.create(e)})},cloneWithIndexOrWhere(t,e){return freeze({...t,indexWhere:t.indexWhere?WhereNode.cloneWithOperation(t.indexWhere,"Or",e):WhereNode.create(e)})},cloneWithUpdateWhere(t,e){return freeze({...t,updateWhere:t.updateWhere?WhereNode.cloneWithOperation(t.updateWhere,"And",e):WhereNode.create(e)})},cloneWithUpdateOrWhere(t,e){return freeze({...t,updateWhere:t.updateWhere?WhereNode.cloneWithOperation(t.updateWhere,"Or",e):WhereNode.create(e)})},cloneWithoutIndexWhere(t){return freeze({...t,indexWhere:void 0})},cloneWithoutUpdateWhere(t){return freeze({...t,updateWhere:void 0})}});class OnConflictBuilder{#e;constructor(e){this.#e=freeze(e)}column(e){const r=ColumnNode.create(e);return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?freeze([...this.#e.onConflictNode.columns,r]):freeze([r])})})}columns(e){const r=e.map(ColumnNode.create);return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{columns:this.#e.onConflictNode.columns?freeze([...this.#e.onConflictNode.columns,...r]):freeze(r)})})}constraint(e){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{constraint:IdentifierNode.create(e)})})}expression(e){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{indexExpression:e.toOperationNode()})})}where(...e){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithIndexWhere(this.#e.onConflictNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithIndexWhere(this.#e.onConflictNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new OnConflictBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithoutIndexWhere(this.#e.onConflictNode)})}doNothing(){return new OnConflictDoNothingBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{doNothing:!0})})}doUpdateSet(e){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWith(this.#e.onConflictNode,{updates:parseUpdateObjectExpression(e)})})}$call(e){return e(this)}}preventAwait(OnConflictBuilder,"don't await OnConflictBuilder instances.");class OnConflictDoNothingBuilder{#e;constructor(e){this.#e=freeze(e)}toOperationNode(){return this.#e.onConflictNode}}preventAwait(OnConflictDoNothingBuilder,"don't await OnConflictDoNothingBuilder instances.");class OnConflictUpdateBuilder{#e;constructor(e){this.#e=freeze(e)}where(...e){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithUpdateWhere(this.#e.onConflictNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithUpdateWhere(this.#e.onConflictNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new OnConflictUpdateBuilder({...this.#e,onConflictNode:OnConflictNode.cloneWithoutUpdateWhere(this.#e.onConflictNode)})}$call(e){return e(this)}toOperationNode(){return this.#e.onConflictNode}}preventAwait(OnConflictUpdateBuilder,"don't await OnConflictUpdateBuilder instances.");class InsertQueryBuilder{#e;constructor(e){this.#e=freeze(e)}values(e){const[r,n]=parseInsertExpression(e);return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{columns:r,values:n})})}columns(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{columns:freeze(e.map(ColumnNode.create))})})}expression(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{values:parseExpression(e)})})}defaultValues(){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{defaultValues:!0})})}ignore(){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{ignore:!0})})}onConflict(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{onConflict:e(new OnConflictBuilder({onConflictNode:OnConflictNode.create()})).toOperationNode()})})}onDuplicateKeyUpdate(e){return new InsertQueryBuilder({...this.#e,queryNode:InsertQueryNode.cloneWith(this.#e.queryNode,{onDuplicateKey:OnDuplicateKeyNode.create(parseUpdateObjectExpression(e))})})}returning(e){return new InsertQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectArg(e))})}returningAll(){return new InsertQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectAll())})}$call(e){return e(this)}$if(e,r){return e?r(this):new InsertQueryBuilder({...this.#e})}$castTo(){return new InsertQueryBuilder(this.#e)}$narrowType(){return new InsertQueryBuilder(this.#e)}$assertType(){return new InsertQueryBuilder(this.#e)}withPlugin(e){return new InsertQueryBuilder({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile(),r=e.query,n=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?n.rows:[new InsertResult(n.insertId,n.numAffectedRows??n.numUpdatedOrDeletedRows)]}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new InsertQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(InsertQueryBuilder,"don't await InsertQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");class DeleteResult{numDeletedRows;constructor(e){this.numDeletedRows=e}}const LimitNode=freeze({is(t){return t.kind==="LimitNode"},create(t){return freeze({kind:"LimitNode",limit:t})}});class DeleteQueryBuilder{#e;constructor(e){this.#e=freeze(e)}where(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithoutWhere(this.#e.queryNode)})}using(e){return new DeleteQueryBuilder({...this.#e,queryNode:DeleteQueryNode.cloneWithUsing(this.#e.queryNode,parseTableExpressionOrList(e))})}innerJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("InnerJoin",e))})}leftJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LeftJoin",e))})}rightJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("RightJoin",e))})}fullJoin(...e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("FullJoin",e))})}returning(e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectArg(e))})}returningAll(e){return new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectAll(e))})}orderBy(e,r){return new DeleteQueryBuilder({...this.#e,queryNode:DeleteQueryNode.cloneWithOrderByItems(this.#e.queryNode,parseOrderBy([e,r]))})}limit(e){return new DeleteQueryBuilder({...this.#e,queryNode:DeleteQueryNode.cloneWithLimit(this.#e.queryNode,LimitNode.create(parseValueExpression(e)))})}$call(e){return e(this)}$if(e,r){return e?r(this):new DeleteQueryBuilder({...this.#e})}$castTo(){return new DeleteQueryBuilder(this.#e)}$narrowType(){return new DeleteQueryBuilder(this.#e)}$assertType(){return new DeleteQueryBuilder(this.#e)}withPlugin(e){return new DeleteQueryBuilder({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile(),r=e.query,n=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?n.rows:[new DeleteResult(n.numAffectedRows??n.numUpdatedOrDeletedRows??BigInt(0))]}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new DeleteQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(DeleteQueryBuilder,"don't await DeleteQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");class UpdateResult{numUpdatedRows;numChangedRows;constructor(e,r){this.numUpdatedRows=e,this.numChangedRows=r}}class UpdateQueryBuilder{#e;constructor(e){this.#e=freeze(e)}where(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}clearWhere(){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithoutWhere(this.#e.queryNode)})}from(e){return new UpdateQueryBuilder({...this.#e,queryNode:UpdateQueryNode.cloneWithFromItems(this.#e.queryNode,parseTableExpressionOrList(e))})}innerJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("InnerJoin",e))})}leftJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LeftJoin",e))})}rightJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("RightJoin",e))})}fullJoin(...e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("FullJoin",e))})}set(...e){return new UpdateQueryBuilder({...this.#e,queryNode:UpdateQueryNode.cloneWithUpdates(this.#e.queryNode,parseUpdate(...e))})}returning(e){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectArg(e))})}returningAll(){return new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithReturning(this.#e.queryNode,parseSelectAll())})}$call(e){return e(this)}$if(e,r){return e?r(this):new UpdateQueryBuilder({...this.#e})}$castTo(){return new UpdateQueryBuilder(this.#e)}$narrowType(){return new UpdateQueryBuilder(this.#e)}$assertType(){return new UpdateQueryBuilder(this.#e)}withPlugin(e){return new UpdateQueryBuilder({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile(),r=e.query,n=await this.#e.executor.executeQuery(e,this.#e.queryId);return this.#e.executor.adapter.supportsReturning&&r.returning?n.rows:[new UpdateResult(n.numAffectedRows??n.numUpdatedOrDeletedRows??BigInt(0),n.numChangedRows)]}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new UpdateQueryBuilder({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(UpdateQueryBuilder,"don't await UpdateQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");const CommonTableExpressionNameNode=freeze({is(t){return t.kind==="CommonTableExpressionNameNode"},create(t,e){return freeze({kind:"CommonTableExpressionNameNode",table:TableNode.create(t),columns:e?freeze(e.map(ColumnNode.create)):void 0})}}),CommonTableExpressionNode=freeze({is(t){return t.kind==="CommonTableExpressionNode"},create(t,e){return freeze({kind:"CommonTableExpressionNode",name:t,expression:e})},cloneWith(t,e){return freeze({...t,...e})}});class CTEBuilder{#e;constructor(e){this.#e=freeze(e)}materialized(){return new CTEBuilder({...this.#e,node:CommonTableExpressionNode.cloneWith(this.#e.node,{materialized:!0})})}notMaterialized(){return new CTEBuilder({...this.#e,node:CommonTableExpressionNode.cloneWith(this.#e.node,{materialized:!1})})}toOperationNode(){return this.#e.node}}preventAwait(CTEBuilder,"don't await CTEBuilder instances. They are never executed directly and are always just a part of a query.");function parseCommonTableExpression(t,e){const r=e(createQueryCreator()).toOperationNode();return isFunction(t)?t(cteBuilderFactory(r)).toOperationNode():CommonTableExpressionNode.create(parseCommonTableExpressionName(t),r)}function cteBuilderFactory(t){return e=>new CTEBuilder({node:CommonTableExpressionNode.create(parseCommonTableExpressionName(e),t)})}function parseCommonTableExpressionName(t){if(t.includes("(")){const e=t.split(/[\(\)]/),r=e[0],n=e[1].split(",").map(s=>s.trim());return CommonTableExpressionNameNode.create(r,n)}else return CommonTableExpressionNameNode.create(t)}const WithNode=freeze({is(t){return t.kind==="WithNode"},create(t,e){return freeze({kind:"WithNode",expressions:freeze([t]),...e})},cloneWithExpression(t,e){return freeze({...t,expressions:freeze([...t.expressions,e])})}}),CHARS=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function randomString(t){let e="";for(let r=0;rthis.transformNode(r)))}transformSelectQuery(e){return{kind:"SelectQueryNode",from:this.transformNode(e.from),selections:this.transformNodeList(e.selections),distinctOn:this.transformNodeList(e.distinctOn),joins:this.transformNodeList(e.joins),groupBy:this.transformNode(e.groupBy),orderBy:this.transformNode(e.orderBy),where:this.transformNode(e.where),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),limit:this.transformNode(e.limit),offset:this.transformNode(e.offset),with:this.transformNode(e.with),having:this.transformNode(e.having),explain:this.transformNode(e.explain),setOperations:this.transformNodeList(e.setOperations)}}transformSelection(e){return{kind:"SelectionNode",selection:this.transformNode(e.selection)}}transformColumn(e){return{kind:"ColumnNode",column:this.transformNode(e.column)}}transformAlias(e){return{kind:"AliasNode",node:this.transformNode(e.node),alias:this.transformNode(e.alias)}}transformTable(e){return{kind:"TableNode",table:this.transformNode(e.table)}}transformFrom(e){return{kind:"FromNode",froms:this.transformNodeList(e.froms)}}transformReference(e){return{kind:"ReferenceNode",column:this.transformNode(e.column),table:this.transformNode(e.table)}}transformAnd(e){return{kind:"AndNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformOr(e){return{kind:"OrNode",left:this.transformNode(e.left),right:this.transformNode(e.right)}}transformValueList(e){return{kind:"ValueListNode",values:this.transformNodeList(e.values)}}transformParens(e){return{kind:"ParensNode",node:this.transformNode(e.node)}}transformJoin(e){return{kind:"JoinNode",joinType:e.joinType,table:this.transformNode(e.table),on:this.transformNode(e.on)}}transformRaw(e){return{kind:"RawNode",sqlFragments:freeze([...e.sqlFragments]),parameters:this.transformNodeList(e.parameters)}}transformWhere(e){return{kind:"WhereNode",where:this.transformNode(e.where)}}transformInsertQuery(e){return{kind:"InsertQueryNode",into:this.transformNode(e.into),columns:this.transformNodeList(e.columns),values:this.transformNode(e.values),returning:this.transformNode(e.returning),onConflict:this.transformNode(e.onConflict),onDuplicateKey:this.transformNode(e.onDuplicateKey),with:this.transformNode(e.with),ignore:e.ignore,replace:e.replace,explain:this.transformNode(e.explain),defaultValues:e.defaultValues}}transformValues(e){return{kind:"ValuesNode",values:this.transformNodeList(e.values)}}transformDeleteQuery(e){return{kind:"DeleteQueryNode",from:this.transformNode(e.from),using:this.transformNode(e.using),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),returning:this.transformNode(e.returning),with:this.transformNode(e.with),orderBy:this.transformNode(e.orderBy),limit:this.transformNode(e.limit),explain:this.transformNode(e.explain)}}transformReturning(e){return{kind:"ReturningNode",selections:this.transformNodeList(e.selections)}}transformCreateTable(e){return{kind:"CreateTableNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),constraints:this.transformNodeList(e.constraints),temporary:e.temporary,ifNotExists:e.ifNotExists,onCommit:e.onCommit,frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),selectQuery:this.transformNode(e.selectQuery)}}transformColumnDefinition(e){return{kind:"ColumnDefinitionNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),references:this.transformNode(e.references),primaryKey:e.primaryKey,autoIncrement:e.autoIncrement,unique:e.unique,notNull:e.notNull,unsigned:e.unsigned,defaultTo:this.transformNode(e.defaultTo),check:this.transformNode(e.check),generated:this.transformNode(e.generated),frontModifiers:this.transformNodeList(e.frontModifiers),endModifiers:this.transformNodeList(e.endModifiers),nullsNotDistinct:e.nullsNotDistinct}}transformAddColumn(e){return{kind:"AddColumnNode",column:this.transformNode(e.column)}}transformDropTable(e){return{kind:"DropTableNode",table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformOrderBy(e){return{kind:"OrderByNode",items:this.transformNodeList(e.items)}}transformOrderByItem(e){return{kind:"OrderByItemNode",orderBy:this.transformNode(e.orderBy),direction:this.transformNode(e.direction)}}transformGroupBy(e){return{kind:"GroupByNode",items:this.transformNodeList(e.items)}}transformGroupByItem(e){return{kind:"GroupByItemNode",groupBy:this.transformNode(e.groupBy)}}transformUpdateQuery(e){return{kind:"UpdateQueryNode",table:this.transformNode(e.table),from:this.transformNode(e.from),joins:this.transformNodeList(e.joins),where:this.transformNode(e.where),updates:this.transformNodeList(e.updates),returning:this.transformNode(e.returning),with:this.transformNode(e.with),explain:this.transformNode(e.explain)}}transformColumnUpdate(e){return{kind:"ColumnUpdateNode",column:this.transformNode(e.column),value:this.transformNode(e.value)}}transformLimit(e){return{kind:"LimitNode",limit:this.transformNode(e.limit)}}transformOffset(e){return{kind:"OffsetNode",offset:this.transformNode(e.offset)}}transformOnConflict(e){return{kind:"OnConflictNode",columns:this.transformNodeList(e.columns),constraint:this.transformNode(e.constraint),indexExpression:this.transformNode(e.indexExpression),indexWhere:this.transformNode(e.indexWhere),updates:this.transformNodeList(e.updates),updateWhere:this.transformNode(e.updateWhere),doNothing:e.doNothing}}transformOnDuplicateKey(e){return{kind:"OnDuplicateKeyNode",updates:this.transformNodeList(e.updates)}}transformCreateIndex(e){return{kind:"CreateIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),unique:e.unique,using:this.transformNode(e.using),ifNotExists:e.ifNotExists,where:this.transformNode(e.where),nullsNotDistinct:e.nullsNotDistinct}}transformList(e){return{kind:"ListNode",items:this.transformNodeList(e.items)}}transformDropIndex(e){return{kind:"DropIndexNode",name:this.transformNode(e.name),table:this.transformNode(e.table),ifExists:e.ifExists,cascade:e.cascade}}transformPrimaryKeyConstraint(e){return{kind:"PrimaryKeyConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name)}}transformUniqueConstraint(e){return{kind:"UniqueConstraintNode",columns:this.transformNodeList(e.columns),name:this.transformNode(e.name),nullsNotDistinct:e.nullsNotDistinct}}transformForeignKeyConstraint(e){return{kind:"ForeignKeyConstraintNode",columns:this.transformNodeList(e.columns),references:this.transformNode(e.references),name:this.transformNode(e.name),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformSetOperation(e){return{kind:"SetOperationNode",operator:e.operator,expression:this.transformNode(e.expression),all:e.all}}transformReferences(e){return{kind:"ReferencesNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns),onDelete:e.onDelete,onUpdate:e.onUpdate}}transformCheckConstraint(e){return{kind:"CheckConstraintNode",expression:this.transformNode(e.expression),name:this.transformNode(e.name)}}transformWith(e){return{kind:"WithNode",expressions:this.transformNodeList(e.expressions),recursive:e.recursive}}transformCommonTableExpression(e){return{kind:"CommonTableExpressionNode",name:this.transformNode(e.name),materialized:e.materialized,expression:this.transformNode(e.expression)}}transformCommonTableExpressionName(e){return{kind:"CommonTableExpressionNameNode",table:this.transformNode(e.table),columns:this.transformNodeList(e.columns)}}transformHaving(e){return{kind:"HavingNode",having:this.transformNode(e.having)}}transformCreateSchema(e){return{kind:"CreateSchemaNode",schema:this.transformNode(e.schema),ifNotExists:e.ifNotExists}}transformDropSchema(e){return{kind:"DropSchemaNode",schema:this.transformNode(e.schema),ifExists:e.ifExists,cascade:e.cascade}}transformAlterTable(e){return{kind:"AlterTableNode",table:this.transformNode(e.table),renameTo:this.transformNode(e.renameTo),setSchema:this.transformNode(e.setSchema),columnAlterations:this.transformNodeList(e.columnAlterations),addConstraint:this.transformNode(e.addConstraint),dropConstraint:this.transformNode(e.dropConstraint),addIndex:this.transformNode(e.addIndex),dropIndex:this.transformNode(e.dropIndex)}}transformDropColumn(e){return{kind:"DropColumnNode",column:this.transformNode(e.column)}}transformRenameColumn(e){return{kind:"RenameColumnNode",column:this.transformNode(e.column),renameTo:this.transformNode(e.renameTo)}}transformAlterColumn(e){return{kind:"AlterColumnNode",column:this.transformNode(e.column),dataType:this.transformNode(e.dataType),dataTypeExpression:this.transformNode(e.dataTypeExpression),setDefault:this.transformNode(e.setDefault),dropDefault:e.dropDefault,setNotNull:e.setNotNull,dropNotNull:e.dropNotNull}}transformModifyColumn(e){return{kind:"ModifyColumnNode",column:this.transformNode(e.column)}}transformAddConstraint(e){return{kind:"AddConstraintNode",constraint:this.transformNode(e.constraint)}}transformDropConstraint(e){return{kind:"DropConstraintNode",constraintName:this.transformNode(e.constraintName),ifExists:e.ifExists,modifier:e.modifier}}transformCreateView(e){return{kind:"CreateViewNode",name:this.transformNode(e.name),temporary:e.temporary,orReplace:e.orReplace,ifNotExists:e.ifNotExists,materialized:e.materialized,columns:this.transformNodeList(e.columns),as:this.transformNode(e.as)}}transformDropView(e){return{kind:"DropViewNode",name:this.transformNode(e.name),ifExists:e.ifExists,materialized:e.materialized,cascade:e.cascade}}transformGenerated(e){return{kind:"GeneratedNode",byDefault:e.byDefault,always:e.always,identity:e.identity,stored:e.stored,expression:this.transformNode(e.expression)}}transformDefaultValue(e){return{kind:"DefaultValueNode",defaultValue:this.transformNode(e.defaultValue)}}transformOn(e){return{kind:"OnNode",on:this.transformNode(e.on)}}transformSelectModifier(e){return{kind:"SelectModifierNode",modifier:e.modifier,rawModifier:this.transformNode(e.rawModifier),of:this.transformNodeList(e.of)}}transformCreateType(e){return{kind:"CreateTypeNode",name:this.transformNode(e.name),enum:this.transformNode(e.enum)}}transformDropType(e){return{kind:"DropTypeNode",name:this.transformNode(e.name),ifExists:e.ifExists}}transformExplain(e){return{kind:"ExplainNode",format:e.format,options:this.transformNode(e.options)}}transformSchemableIdentifier(e){return{kind:"SchemableIdentifierNode",schema:this.transformNode(e.schema),identifier:this.transformNode(e.identifier)}}transformAggregateFunction(e){return{kind:"AggregateFunctionNode",aggregated:this.transformNodeList(e.aggregated),distinct:e.distinct,filter:this.transformNode(e.filter),func:e.func,over:this.transformNode(e.over)}}transformOver(e){return{kind:"OverNode",orderBy:this.transformNode(e.orderBy),partitionBy:this.transformNode(e.partitionBy)}}transformPartitionBy(e){return{kind:"PartitionByNode",items:this.transformNodeList(e.items)}}transformPartitionByItem(e){return{kind:"PartitionByItemNode",partitionBy:this.transformNode(e.partitionBy)}}transformBinaryOperation(e){return{kind:"BinaryOperationNode",leftOperand:this.transformNode(e.leftOperand),operator:this.transformNode(e.operator),rightOperand:this.transformNode(e.rightOperand)}}transformUnaryOperation(e){return{kind:"UnaryOperationNode",operator:this.transformNode(e.operator),operand:this.transformNode(e.operand)}}transformUsing(e){return{kind:"UsingNode",tables:this.transformNodeList(e.tables)}}transformFunction(e){return{kind:"FunctionNode",func:e.func,arguments:this.transformNodeList(e.arguments)}}transformCase(e){return{kind:"CaseNode",value:this.transformNode(e.value),when:this.transformNodeList(e.when),else:this.transformNode(e.else),isStatement:e.isStatement}}transformWhen(e){return{kind:"WhenNode",condition:this.transformNode(e.condition),result:this.transformNode(e.result)}}transformJSONReference(e){return{kind:"JSONReferenceNode",reference:this.transformNode(e.reference),traversal:this.transformNode(e.traversal)}}transformJSONPath(e){return{kind:"JSONPathNode",inOperator:this.transformNode(e.inOperator),pathLegs:this.transformNodeList(e.pathLegs)}}transformJSONPathLeg(e){return{kind:"JSONPathLegNode",type:e.type,value:e.value}}transformJSONOperatorChain(e){return{kind:"JSONOperatorChainNode",operator:this.transformNode(e.operator),values:this.transformNodeList(e.values)}}transformTuple(e){return{kind:"TupleNode",values:this.transformNodeList(e.values)}}transformAddIndex(e){return{kind:"AddIndexNode",name:this.transformNode(e.name),columns:this.transformNodeList(e.columns),unique:e.unique,using:this.transformNode(e.using),ifNotExists:e.ifNotExists}}transformDataType(e){return e}transformSelectAll(e){return e}transformIdentifier(e){return e}transformValue(e){return e}transformPrimitiveValueList(e){return e}transformOperator(e){return e}transformDefaultInsertValue(e){return e}}const ROOT_OPERATION_NODES=freeze({AlterTableNode:!0,CreateIndexNode:!0,CreateSchemaNode:!0,CreateTableNode:!0,CreateTypeNode:!0,CreateViewNode:!0,DeleteQueryNode:!0,DropIndexNode:!0,DropSchemaNode:!0,DropTableNode:!0,DropTypeNode:!0,DropViewNode:!0,InsertQueryNode:!0,RawNode:!0,SelectQueryNode:!0,UpdateQueryNode:!0});class WithSchemaTransformer extends OperationNodeTransformer{#e;#t=new Set;#r=new Set;constructor(e){super(),this.#e=e}transformNodeImpl(e){if(!this.#n(e))return super.transformNodeImpl(e);const r=this.#s(e);for(const a of r)this.#r.add(a);const n=this.#i(e);for(const a of n)this.#t.add(a);const s=super.transformNodeImpl(e);for(const a of n)this.#t.delete(a);for(const a of r)this.#r.delete(a);return s}transformSchemableIdentifier(e){const r=super.transformSchemableIdentifier(e);return r.schema||!this.#t.has(e.identifier.name)?r:{...r,schema:IdentifierNode.create(this.#e)}}transformReferences(e){const r=super.transformReferences(e);return r.table.table.schema?r:{...r,table:TableNode.createWithSchema(this.#e,r.table.table.identifier.name)}}#n(e){return e.kind in ROOT_OPERATION_NODES}#i(e){const r=new Set;if("name"in e&&e.name&&SchemableIdentifierNode.is(e.name)&&this.#a(e.name,r),"from"in e&&e.from)for(const n of e.from.froms)this.#o(n,r);if("into"in e&&e.into&&this.#o(e.into,r),"table"in e&&e.table&&this.#o(e.table,r),"joins"in e&&e.joins)for(const n of e.joins)this.#o(n.table,r);return r}#s(e){const r=new Set;return"with"in e&&e.with&&this.#u(e.with,r),r}#o(e,r){const n=TableNode.is(e)?e:AliasNode.is(e)&&TableNode.is(e.node)?e.node:null;n&&this.#a(n.table,r)}#a(e,r){const n=e.identifier.name;!this.#t.has(n)&&!this.#r.has(n)&&r.add(n)}#u(e,r){for(const n of e.expressions){const s=n.name.table.table.identifier.name;this.#r.has(s)||r.add(s)}}}class WithSchemaPlugin{#e;constructor(e){this.#e=new WithSchemaTransformer(e)}transformQuery(e){return this.#e.transformNode(e.node)}async transformResult(e){return e.result}}class QueryCreator{#e;constructor(e){this.#e=freeze(e)}selectFrom(e){return createSelectQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:SelectQueryNode.createFrom(parseTableExpressionOrList(e),this.#e.withNode)})}selectNoFrom(e){return createSelectQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:SelectQueryNode.cloneWithSelections(SelectQueryNode.create(this.#e.withNode),parseSelectArg(e))})}insertInto(e){return new InsertQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:InsertQueryNode.create(parseTable(e),this.#e.withNode)})}replaceInto(e){return new InsertQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:InsertQueryNode.create(parseTable(e),this.#e.withNode,!0)})}deleteFrom(e){return new DeleteQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:DeleteQueryNode.create(parseTableExpressionOrList(e),this.#e.withNode)})}updateTable(e){return new UpdateQueryBuilder({queryId:createQueryId(),executor:this.#e.executor,queryNode:UpdateQueryNode.create(parseTableExpression(e),this.#e.withNode)})}with(e,r){const n=parseCommonTableExpression(e,r);return new QueryCreator({...this.#e,withNode:this.#e.withNode?WithNode.cloneWithExpression(this.#e.withNode,n):WithNode.create(n)})}withRecursive(e,r){const n=parseCommonTableExpression(e,r);return new QueryCreator({...this.#e,withNode:this.#e.withNode?WithNode.cloneWithExpression(this.#e.withNode,n):WithNode.create(n,{recursive:!0})})}withPlugin(e){return new QueryCreator({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new QueryCreator({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new QueryCreator({...this.#e,executor:this.#e.executor.withPluginAtFront(new WithSchemaPlugin(e))})}}class Deferred{#e;#t;#r;constructor(){this.#e=new Promise((e,r)=>{this.#r=r,this.#t=e})}get promise(){return this.#e}resolve=e=>{this.#t&&this.#t(e)};reject=e=>{this.#r&&this.#r(e)}}const LOGGED_MESSAGES=new Set;function logOnce(t){LOGGED_MESSAGES.has(t)||(LOGGED_MESSAGES.add(t),console.log(t))}const NO_PLUGINS=freeze([]);class QueryExecutorBase{#e;constructor(e=NO_PLUGINS){this.#e=e}get plugins(){return this.#e}transformQuery(e,r){for(const n of this.#e){const s=n.transformQuery({node:e,queryId:r});if(s.kind===e.kind)e=s;else throw new Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${e.kind}`,`but it returned a ${s.kind}`].join(" "))}return e}async executeQuery(e,r){return await this.provideConnection(async n=>{const s=await n.executeQuery(e),a=await this.#t(s,r);return warnOfOutdatedDriverOrPlugins(s,a),a})}async*stream(e,r,n){const s=new Deferred,a=new Deferred;this.provideConnection(async d=>(s.resolve(d),await a.promise)).catch(d=>s.reject(d));const u=await s.promise;try{for await(const d of u.streamQuery(e,r))yield await this.#t(d,n)}finally{a.resolve()}}async#t(e,r){for(const n of this.#e)e=await n.transformResult({result:e,queryId:r});return e}}function warnOfOutdatedDriverOrPlugins(t,e){const{numAffectedRows:r}=t;r===void 0&&t.numUpdatedOrDeletedRows===void 0||r!==void 0&&e.numAffectedRows!==void 0||logOnce("kysely:warning: outdated driver/plugin detected! QueryResult.numUpdatedOrDeletedRows is deprecated and will be removed in a future release.")}class NoopQueryExecutor extends QueryExecutorBase{get adapter(){throw new Error("this query cannot be compiled to SQL")}compileQuery(){throw new Error("this query cannot be compiled to SQL")}provideConnection(){throw new Error("this query cannot be executed")}withConnectionProvider(){throw new Error("this query cannot have a connection provider")}withPlugin(e){return new NoopQueryExecutor([...this.plugins,e])}withPlugins(e){return new NoopQueryExecutor([...this.plugins,...e])}withPluginAtFront(e){return new NoopQueryExecutor([e,...this.plugins])}withoutPlugins(){return new NoopQueryExecutor([])}}const NOOP_QUERY_EXECUTOR=new NoopQueryExecutor;function createQueryCreator(){return new QueryCreator({executor:NOOP_QUERY_EXECUTOR})}function createJoinBuilder(t,e){return new JoinBuilder({joinNode:JoinNode.create(t,parseTableExpression(e))})}function createOverBuilder(){return new OverBuilder({overNode:OverNode.create()})}function parseJoin(t,e){if(e.length===3)return parseSingleOnJoin(t,e[0],e[1],e[2]);if(e.length===2)return parseCallbackJoin(t,e[0],e[1]);throw new Error("not implemented")}function parseCallbackJoin(t,e,r){return r(createJoinBuilder(t,e)).toOperationNode()}function parseSingleOnJoin(t,e,r,n){return JoinNode.createWithOn(t,parseTableExpression(e),parseReferentialBinaryOperation(r,"=",n))}const OffsetNode=freeze({is(t){return t.kind==="OffsetNode"},create(t){return freeze({kind:"OffsetNode",offset:t})}}),GroupByItemNode=freeze({is(t){return t.kind==="GroupByItemNode"},create(t){return freeze({kind:"GroupByItemNode",groupBy:t})}});function parseGroupBy(t){return t=isFunction(t)?t(expressionBuilder()):t,parseReferenceExpressionOrList(t).map(GroupByItemNode.create)}const SetOperationNode=freeze({is(t){return t.kind==="SetOperationNode"},create(t,e,r){return freeze({kind:"SetOperationNode",operator:t,expression:e,all:r})}});function parseSetOperations(t,e,r){return isFunction(e)&&(e=e(createExpressionBuilder())),isReadonlyArray(e)||(e=[e]),e.map(n=>SetOperationNode.create(t,parseExpression(n),r))}class ExpressionWrapper{#e;constructor(e){this.#e=e}get expressionType(){}as(e){return new AliasedExpressionWrapper(this,e)}or(...e){return new OrWrapper(OrNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}and(...e){return new AndWrapper(AndNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}$castTo(){return new ExpressionWrapper(this.#e)}$notNull(){return new ExpressionWrapper(this.#e)}toOperationNode(){return this.#e}}class AliasedExpressionWrapper{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),isOperationNodeSource(this.#t)?this.#t.toOperationNode():IdentifierNode.create(this.#t))}}class OrWrapper{#e;constructor(e){this.#e=e}get expressionType(){}as(e){return new AliasedExpressionWrapper(this,e)}or(...e){return new OrWrapper(OrNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}$castTo(){return new OrWrapper(this.#e)}toOperationNode(){return ParensNode.create(this.#e)}}class AndWrapper{#e;constructor(e){this.#e=e}get expressionType(){}as(e){return new AliasedExpressionWrapper(this,e)}and(...e){return new AndWrapper(AndNode.create(this.#e,parseValueBinaryOperationOrExpression(e)))}$castTo(){return new AndWrapper(this.#e)}toOperationNode(){return ParensNode.create(this.#e)}}class SelectQueryBuilderImpl{#e;constructor(e){this.#e=freeze(e)}get expressionType(){}get isSelectQueryBuilder(){return!0}where(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}whereRef(e,r,n){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithWhere(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}having(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithHaving(this.#e.queryNode,parseValueBinaryOperationOrExpression(e))})}havingRef(e,r,n){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithHaving(this.#e.queryNode,parseReferentialBinaryOperation(e,r,n))})}select(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSelections(this.#e.queryNode,parseSelectArg(e))})}distinctOn(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithDistinctOn(this.#e.queryNode,parseReferenceExpressionOrList(e))})}modifyFront(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithFrontModifier(this.#e.queryNode,SelectModifierNode.createWithExpression(e.toOperationNode()))})}modifyEnd(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.createWithExpression(e.toOperationNode()))})}distinct(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithFrontModifier(this.#e.queryNode,SelectModifierNode.create("Distinct"))})}forUpdate(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForUpdate",e?asArray(e).map(parseTable):void 0))})}forShare(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForShare",e?asArray(e).map(parseTable):void 0))})}forKeyShare(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForKeyShare",e?asArray(e).map(parseTable):void 0))})}forNoKeyUpdate(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("ForNoKeyUpdate",e?asArray(e).map(parseTable):void 0))})}skipLocked(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("SkipLocked"))})}noWait(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithEndModifier(this.#e.queryNode,SelectModifierNode.create("NoWait"))})}selectAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSelections(this.#e.queryNode,parseSelectAll(e))})}innerJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("InnerJoin",e))})}leftJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LeftJoin",e))})}rightJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("RightJoin",e))})}fullJoin(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("FullJoin",e))})}innerJoinLateral(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LateralInnerJoin",e))})}leftJoinLateral(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithJoin(this.#e.queryNode,parseJoin("LateralLeftJoin",e))})}orderBy(...e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithOrderByItems(this.#e.queryNode,parseOrderBy(e))})}groupBy(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithGroupByItems(this.#e.queryNode,parseGroupBy(e))})}limit(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithLimit(this.#e.queryNode,LimitNode.create(parseValueExpression(e)))})}offset(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithOffset(this.#e.queryNode,OffsetNode.create(parseValueExpression(e)))})}union(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("union",e,!1))})}unionAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("union",e,!0))})}intersect(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("intersect",e,!1))})}intersectAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("intersect",e,!0))})}except(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("except",e,!1))})}exceptAll(e){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithSetOperations(this.#e.queryNode,parseSetOperations("except",e,!0))})}as(e){return new AliasedSelectQueryBuilderImpl(this,e)}clearSelect(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutSelections(this.#e.queryNode)})}clearWhere(){return new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithoutWhere(this.#e.queryNode)})}clearLimit(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutLimit(this.#e.queryNode)})}clearOffset(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutOffset(this.#e.queryNode)})}clearOrderBy(){return new SelectQueryBuilderImpl({...this.#e,queryNode:SelectQueryNode.cloneWithoutOrderBy(this.#e.queryNode)})}$call(e){return e(this)}$if(e,r){return e?r(this):new SelectQueryBuilderImpl({...this.#e})}$castTo(){return new SelectQueryBuilderImpl(this.#e)}$narrowType(){return new SelectQueryBuilderImpl(this.#e)}$assertType(){return new SelectQueryBuilderImpl(this.#e)}$asTuple(){return new ExpressionWrapper(this.toOperationNode())}withPlugin(e){return new SelectQueryBuilderImpl({...this.#e,executor:this.#e.executor.withPlugin(e)})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.queryNode,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){const e=this.compile();return(await this.#e.executor.executeQuery(e,this.#e.queryId)).rows}async executeTakeFirst(){const[e]=await this.execute();return e}async executeTakeFirstOrThrow(e=NoResultError){const r=await this.executeTakeFirst();if(r===void 0)throw isNoResultErrorConstructor(e)?new e(this.toOperationNode()):e(this.toOperationNode());return r}async*stream(e=100){const r=this.compile(),n=this.#e.executor.stream(r,e,this.#e.queryId);for await(const s of n)yield*s.rows}async explain(e,r){return await new SelectQueryBuilderImpl({...this.#e,queryNode:QueryNode.cloneWithExplain(this.#e.queryNode,e,r)}).execute()}}preventAwait(SelectQueryBuilderImpl,"don't await SelectQueryBuilder instances directly. To execute the query you need to call `execute` or `executeTakeFirst`.");function createSelectQueryBuilder(t){return new SelectQueryBuilderImpl(t)}class AliasedSelectQueryBuilderImpl{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}get isAliasedSelectQueryBuilder(){return!0}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),IdentifierNode.create(this.#t))}}preventAwait(AliasedSelectQueryBuilderImpl,"don't await AliasedSelectQueryBuilder instances directly. AliasedSelectQueryBuilder should never be executed directly since it's always a part of another query.");const AggregateFunctionNode=freeze({is(t){return t.kind==="AggregateFunctionNode"},create(t,e=[]){return freeze({kind:"AggregateFunctionNode",func:t,aggregated:e})},cloneWithDistinct(t){return freeze({...t,distinct:!0})},cloneWithFilter(t,e){return freeze({...t,filter:t.filter?WhereNode.cloneWithOperation(t.filter,"And",e):WhereNode.create(e)})},cloneWithOrFilter(t,e){return freeze({...t,filter:t.filter?WhereNode.cloneWithOperation(t.filter,"Or",e):WhereNode.create(e)})},cloneWithOver(t,e){return freeze({...t,over:e})}}),FunctionNode=freeze({is(t){return t.kind==="FunctionNode"},create(t,e){return freeze({kind:"FunctionNode",func:t,arguments:e})}});class AggregateFunctionBuilder{#e;constructor(e){this.#e=freeze(e)}get expressionType(){}as(e){return new AliasedAggregateFunctionBuilder(this,e)}distinct(){return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithDistinct(this.#e.aggregateFunctionNode)})}filterWhere(...e){return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithFilter(this.#e.aggregateFunctionNode,parseValueBinaryOperationOrExpression(e))})}filterWhereRef(e,r,n){return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithFilter(this.#e.aggregateFunctionNode,parseReferentialBinaryOperation(e,r,n))})}over(e){const r=createOverBuilder();return new AggregateFunctionBuilder({...this.#e,aggregateFunctionNode:AggregateFunctionNode.cloneWithOver(this.#e.aggregateFunctionNode,(e?e(r):r).toOperationNode())})}$call(e){return e(this)}$castTo(){return new AggregateFunctionBuilder(this.#e)}$notNull(){return new AggregateFunctionBuilder(this.#e)}toOperationNode(){return this.#e.aggregateFunctionNode}}preventAwait(AggregateFunctionBuilder,"don't await AggregateFunctionBuilder instances. They are never executed directly and are always just a part of a query.");class AliasedAggregateFunctionBuilder{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),IdentifierNode.create(this.#t))}}function createFunctionModule(){const t=(r,n)=>new ExpressionWrapper(FunctionNode.create(r,parseReferenceExpressionOrList(n??[]))),e=(r,n)=>new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create(r,n?parseReferenceExpressionOrList(n):void 0)});return Object.assign(t,{agg:e,avg(r){return e("avg",[r])},coalesce(...r){return t("coalesce",r)},count(r){return e("count",[r])},countAll(r){return new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create("count",parseSelectAll(r))})},max(r){return e("max",[r])},min(r){return e("min",[r])},sum(r){return e("sum",[r])},any(r){return t("any",[r])},jsonAgg(r){return new AggregateFunctionBuilder({aggregateFunctionNode:AggregateFunctionNode.create("json_agg",[isString(r)?parseTable(r):r.toOperationNode()])})},toJson(r){return new ExpressionWrapper(FunctionNode.create("to_json",[isString(r)?parseTable(r):r.toOperationNode()]))}})}const UnaryOperationNode=freeze({is(t){return t.kind==="UnaryOperationNode"},create(t,e){return freeze({kind:"UnaryOperationNode",operator:t,operand:e})}});function parseUnaryOperation(t,e){return UnaryOperationNode.create(OperatorNode.create(t),parseReferenceExpression(e))}const WhenNode=freeze({is(t){return t.kind==="WhenNode"},create(t){return freeze({kind:"WhenNode",condition:t})},cloneWithResult(t,e){return freeze({...t,result:e})}}),CaseNode=freeze({is(t){return t.kind==="CaseNode"},create(t){return freeze({kind:"CaseNode",value:t})},cloneWithWhen(t,e){return freeze({...t,when:freeze(t.when?[...t.when,e]:[e])})},cloneWithThen(t,e){return freeze({...t,when:t.when?freeze([...t.when.slice(0,-1),WhenNode.cloneWithResult(t.when[t.when.length-1],e)]):void 0})},cloneWith(t,e){return freeze({...t,...e})}});class CaseBuilder{#e;constructor(e){this.#e=freeze(e)}when(...e){return new CaseThenBuilder({...this.#e,node:CaseNode.cloneWithWhen(this.#e.node,WhenNode.create(parseValueBinaryOperationOrExpression(e)))})}}class CaseThenBuilder{#e;constructor(e){this.#e=freeze(e)}then(e){return new CaseWhenBuilder({...this.#e,node:CaseNode.cloneWithThen(this.#e.node,isSafeImmediateValue(e)?parseSafeImmediateValue(e):parseValueExpression(e))})}}class CaseWhenBuilder{#e;constructor(e){this.#e=freeze(e)}when(...e){return new CaseThenBuilder({...this.#e,node:CaseNode.cloneWithWhen(this.#e.node,WhenNode.create(parseValueBinaryOperationOrExpression(e)))})}else(e){return new CaseEndBuilder({...this.#e,node:CaseNode.cloneWith(this.#e.node,{else:isSafeImmediateValue(e)?parseSafeImmediateValue(e):parseValueExpression(e)})})}end(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!1}))}endCase(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!0}))}}class CaseEndBuilder{#e;constructor(e){this.#e=freeze(e)}end(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!1}))}endCase(){return new ExpressionWrapper(CaseNode.cloneWith(this.#e.node,{isStatement:!0}))}}const JSONPathLegNode=freeze({is(t){return t.kind==="JSONPathLegNode"},create(t,e){return freeze({kind:"JSONPathLegNode",type:t,value:e})}});class JSONPathBuilder{#e;constructor(e){this.#e=e}at(e){return this.#t("ArrayLocation",e)}key(e){return this.#t("Member",e)}#t(e,r){return JSONReferenceNode.is(this.#e)?new TraversedJSONPathBuilder(JSONReferenceNode.cloneWithTraversal(this.#e,JSONPathNode.is(this.#e.traversal)?JSONPathNode.cloneWithLeg(this.#e.traversal,JSONPathLegNode.create(e,r)):JSONOperatorChainNode.cloneWithValue(this.#e.traversal,ValueNode.createImmediate(r)))):new TraversedJSONPathBuilder(JSONPathNode.cloneWithLeg(this.#e,JSONPathLegNode.create(e,r)))}}class TraversedJSONPathBuilder extends JSONPathBuilder{#e;constructor(e){super(e),this.#e=e}get expressionType(){}as(e){return new AliasedJSONPathBuilder(this,e)}$castTo(){return new JSONPathBuilder(this.#e)}$notNull(){return new JSONPathBuilder(this.#e)}toOperationNode(){return this.#e}}class AliasedJSONPathBuilder{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),isOperationNodeSource(this.#t)?this.#t.toOperationNode():IdentifierNode.create(this.#t))}}const TupleNode=freeze({is(t){return t.kind==="TupleNode"},create(t){return freeze({kind:"TupleNode",values:freeze(t)})}});function createExpressionBuilder(t=NOOP_QUERY_EXECUTOR){function e(s,a,u){return new ExpressionWrapper(parseValueBinaryOperation(s,a,u))}function r(s,a){return new ExpressionWrapper(parseUnaryOperation(s,a))}const n=Object.assign(e,{fn:void 0,eb:void 0,selectFrom(s){return createSelectQueryBuilder({queryId:createQueryId(),executor:t,queryNode:SelectQueryNode.createFrom(parseTableExpressionOrList(s))})},case(s){return new CaseBuilder({node:CaseNode.create(isUndefined(s)?void 0:parseReferenceExpression(s))})},ref(s,a){return isUndefined(a)?new ExpressionWrapper(parseStringReference(s)):new JSONPathBuilder(parseJSONReference(s,a))},jsonPath(){return new JSONPathBuilder(JSONPathNode.create())},table(s){return new ExpressionWrapper(parseTable(s))},val(s){return new ExpressionWrapper(parseValueExpression(s))},refTuple(...s){return new ExpressionWrapper(TupleNode.create(s.map(parseReferenceExpression)))},tuple(...s){return new ExpressionWrapper(TupleNode.create(s.map(parseValueExpression)))},lit(s){return new ExpressionWrapper(parseSafeImmediateValue(s))},unary:r,not(s){return r("not",s)},exists(s){return r("exists",s)},neg(s){return r("-",s)},between(s,a,u){return new ExpressionWrapper(BinaryOperationNode.create(parseReferenceExpression(s),OperatorNode.create("between"),AndNode.create(parseValueExpression(a),parseValueExpression(u))))},betweenSymmetric(s,a,u){return new ExpressionWrapper(BinaryOperationNode.create(parseReferenceExpression(s),OperatorNode.create("between symmetric"),AndNode.create(parseValueExpression(a),parseValueExpression(u))))},and(s){return isReadonlyArray(s)?new ExpressionWrapper(parseFilterList(s,"and")):new ExpressionWrapper(parseFilterObject(s,"and"))},or(s){return isReadonlyArray(s)?new ExpressionWrapper(parseFilterList(s,"or")):new ExpressionWrapper(parseFilterObject(s,"or"))},parens(...s){const a=parseValueBinaryOperationOrExpression(s);return ParensNode.is(a)?new ExpressionWrapper(a):new ExpressionWrapper(ParensNode.create(a))},withSchema(s){return createExpressionBuilder(t.withPluginAtFront(new WithSchemaPlugin(s)))}});return n.fn=createFunctionModule(),n.eb=n,n}function expressionBuilder(t){return createExpressionBuilder()}function parseExpression(t){if(isOperationNodeSource(t))return t.toOperationNode();if(isFunction(t))return t(expressionBuilder()).toOperationNode();throw new Error(`invalid expression: ${JSON.stringify(t)}`)}function parseAliasedExpression(t){if(isOperationNodeSource(t))return t.toOperationNode();if(isFunction(t))return t(expressionBuilder()).toOperationNode();throw new Error(`invalid aliased expression: ${JSON.stringify(t)}`)}function isExpressionOrFactory(t){return isExpression(t)||isAliasedExpression(t)||isFunction(t)}function parseTableExpressionOrList(t){return isReadonlyArray(t)?t.map(e=>parseTableExpression(e)):[parseTableExpression(t)]}function parseTableExpression(t){return isString(t)?parseAliasedTable(t):parseAliasedExpression(t)}function parseAliasedTable(t){const e=" as ";if(t.includes(e)){const[r,n]=t.split(e).map(trim$1);return AliasNode.create(parseTable(r),IdentifierNode.create(n))}else return parseTable(t)}function parseTable(t){const e=".";if(t.includes(e)){const[r,n]=t.split(e).map(trim$1);return TableNode.createWithSchema(r,n)}else return TableNode.create(t)}function trim$1(t){return t.trim()}const AddColumnNode=freeze({is(t){return t.kind==="AddColumnNode"},create(t){return freeze({kind:"AddColumnNode",column:t})}}),ColumnDefinitionNode=freeze({is(t){return t.kind==="ColumnDefinitionNode"},create(t,e){return freeze({kind:"ColumnDefinitionNode",column:ColumnNode.create(t),dataType:e})},cloneWithFrontModifier(t,e){return freeze({...t,frontModifiers:t.frontModifiers?freeze([...t.frontModifiers,e]):[e]})},cloneWithEndModifier(t,e){return freeze({...t,endModifiers:t.endModifiers?freeze([...t.endModifiers,e]):[e]})},cloneWith(t,e){return freeze({...t,...e})}}),DropColumnNode=freeze({is(t){return t.kind==="DropColumnNode"},create(t){return freeze({kind:"DropColumnNode",column:ColumnNode.create(t)})}}),RenameColumnNode=freeze({is(t){return t.kind==="RenameColumnNode"},create(t,e){return freeze({kind:"RenameColumnNode",column:ColumnNode.create(t),renameTo:ColumnNode.create(e)})}}),CheckConstraintNode=freeze({is(t){return t.kind==="CheckConstraintNode"},create(t,e){return freeze({kind:"CheckConstraintNode",expression:t,name:e?IdentifierNode.create(e):void 0})}}),ON_MODIFY_FOREIGN_ACTIONS=["no action","restrict","cascade","set null","set default"],ReferencesNode=freeze({is(t){return t.kind==="ReferencesNode"},create(t,e){return freeze({kind:"ReferencesNode",table:t,columns:freeze([...e])})},cloneWithOnDelete(t,e){return freeze({...t,onDelete:e})},cloneWithOnUpdate(t,e){return freeze({...t,onUpdate:e})}});function parseDefaultValueExpression(t){return isOperationNodeSource(t)?t.toOperationNode():ValueNode.createImmediate(t)}const GeneratedNode=freeze({is(t){return t.kind==="GeneratedNode"},create(t){return freeze({kind:"GeneratedNode",...t})},createWithExpression(t){return freeze({kind:"GeneratedNode",always:!0,expression:t})},cloneWith(t,e){return freeze({...t,...e})}}),DefaultValueNode=freeze({is(t){return t.kind==="DefaultValueNode"},create(t){return freeze({kind:"DefaultValueNode",defaultValue:t})}});function parseOnModifyForeignAction(t){if(ON_MODIFY_FOREIGN_ACTIONS.includes(t))return t;throw new Error(`invalid OnModifyForeignAction ${t}`)}class ColumnDefinitionBuilder{#e;constructor(e){this.#e=e}autoIncrement(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{autoIncrement:!0}))}primaryKey(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{primaryKey:!0}))}references(e){const r=parseStringReference(e);if(!r.table||SelectAllNode.is(r.column))throw new Error(`invalid call references('${e}'). The reference must have format table.column or schema.table.column`);return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{references:ReferencesNode.create(r.table,[r.column])}))}onDelete(e){if(!this.#e.references)throw new Error("on delete constraint can only be added for foreign keys");return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{references:ReferencesNode.cloneWithOnDelete(this.#e.references,parseOnModifyForeignAction(e))}))}onUpdate(e){if(!this.#e.references)throw new Error("on update constraint can only be added for foreign keys");return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{references:ReferencesNode.cloneWithOnUpdate(this.#e.references,parseOnModifyForeignAction(e))}))}unique(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{unique:!0}))}notNull(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{notNull:!0}))}unsigned(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{unsigned:!0}))}defaultTo(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{defaultTo:DefaultValueNode.create(parseDefaultValueExpression(e))}))}check(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{check:CheckConstraintNode.create(e.toOperationNode())}))}generatedAlwaysAs(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.createWithExpression(e.toOperationNode())}))}generatedAlwaysAsIdentity(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.create({identity:!0,always:!0})}))}generatedByDefaultAsIdentity(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.create({identity:!0,byDefault:!0})}))}stored(){if(!this.#e.generated)throw new Error("stored() can only be called after generatedAlwaysAs");return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{generated:GeneratedNode.cloneWith(this.#e.generated,{stored:!0})}))}modifyFront(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWithFrontModifier(this.#e,e.toOperationNode()))}nullsNotDistinct(){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWith(this.#e,{nullsNotDistinct:!0}))}modifyEnd(e){return new ColumnDefinitionBuilder(ColumnDefinitionNode.cloneWithEndModifier(this.#e,e.toOperationNode()))}$call(e){return e(this)}toOperationNode(){return this.#e}}preventAwait(ColumnDefinitionBuilder,"don't await ColumnDefinitionBuilder instances directly.");const ModifyColumnNode=freeze({is(t){return t.kind==="ModifyColumnNode"},create(t){return freeze({kind:"ModifyColumnNode",column:t})}}),DataTypeNode=freeze({is(t){return t.kind==="DataTypeNode"},create(t){return freeze({kind:"DataTypeNode",dataType:t})}});function parseDataTypeExpression(t){return isOperationNodeSource(t)?t.toOperationNode():DataTypeNode.create(t)}const ForeignKeyConstraintNode=freeze({is(t){return t.kind==="ForeignKeyConstraintNode"},create(t,e,r,n){return freeze({kind:"ForeignKeyConstraintNode",columns:t,references:ReferencesNode.create(e,r),name:n?IdentifierNode.create(n):void 0})},cloneWith(t,e){return freeze({...t,...e})}});class ForeignKeyConstraintBuilder{#e;constructor(e){this.#e=e}onDelete(e){return new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.cloneWith(this.#e,{onDelete:parseOnModifyForeignAction(e)}))}onUpdate(e){return new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.cloneWith(this.#e,{onUpdate:parseOnModifyForeignAction(e)}))}$call(e){return e(this)}toOperationNode(){return this.#e}}preventAwait(ForeignKeyConstraintBuilder,"don't await ForeignKeyConstraintBuilder instances directly.");const AddConstraintNode=freeze({is(t){return t.kind==="AddConstraintNode"},create(t){return freeze({kind:"AddConstraintNode",constraint:t})}}),UniqueConstraintNode=freeze({is(t){return t.kind==="UniqueConstraintNode"},create(t,e,r){return freeze({kind:"UniqueConstraintNode",columns:freeze(t.map(ColumnNode.create)),name:e?IdentifierNode.create(e):void 0,nullsNotDistinct:r})},cloneWith(t,e){return freeze({...t,...e})}}),DropConstraintNode=freeze({is(t){return t.kind==="DropConstraintNode"},create(t){return freeze({kind:"DropConstraintNode",constraintName:IdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})}}),AlterColumnNode=freeze({is(t){return t.kind==="AlterColumnNode"},create(t,e,r){return freeze({kind:"AlterColumnNode",column:ColumnNode.create(t),[e]:r})}});class AlterColumnBuilder{#e;constructor(e){this.#e=e}setDataType(e){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"dataType",parseDataTypeExpression(e)))}setDefault(e){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"setDefault",parseDefaultValueExpression(e)))}dropDefault(){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"dropDefault",!0))}setNotNull(){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"setNotNull",!0))}dropNotNull(){return new AlteredColumnBuilder(AlterColumnNode.create(this.#e,"dropNotNull",!0))}$call(e){return e(this)}}class AlteredColumnBuilder{#e;constructor(e){this.#e=e}toOperationNode(){return this.#e}}class AlterTableExecutor{#e;constructor(e){this.#e=freeze(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableExecutor,"don't await AlterTableExecutor instances directly. To execute the query you need to call `execute`");class AlterTableAddForeignKeyConstraintBuilder{#e;constructor(e){this.#e=freeze(e)}onDelete(e){return new AlterTableAddForeignKeyConstraintBuilder({...this.#e,constraintBuilder:this.#e.constraintBuilder.onDelete(e)})}onUpdate(e){return new AlterTableAddForeignKeyConstraintBuilder({...this.#e,constraintBuilder:this.#e.constraintBuilder.onUpdate(e)})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(this.#e.constraintBuilder.toOperationNode())}),this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableAddForeignKeyConstraintBuilder,"don't await AlterTableAddForeignKeyConstraintBuilder instances directly. To execute the query you need to call `execute`");class AlterTableDropConstraintBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.cloneWith(this.#e.node.dropConstraint,{ifExists:!0})})})}cascade(){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.cloneWith(this.#e.node.dropConstraint,{modifier:"cascade"})})})}restrict(){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.cloneWith(this.#e.node.dropConstraint,{modifier:"restrict"})})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableDropConstraintBuilder,"don't await AlterTableDropConstraintBuilder instances directly. To execute the query you need to call `execute`");const PrimaryConstraintNode=freeze({is(t){return t.kind==="PrimaryKeyConstraintNode"},create(t,e){return freeze({kind:"PrimaryKeyConstraintNode",columns:freeze(t.map(ColumnNode.create)),name:e?IdentifierNode.create(e):void 0})}}),AddIndexNode=freeze({is(t){return t.kind==="AddIndexNode"},create(t){return freeze({kind:"AddIndexNode",name:IdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})},cloneWithColumns(t,e){return freeze({...t,columns:[...t.columns||[],...e]})}});class AlterTableAddIndexBuilder{#e;constructor(e){this.#e=freeze(e)}unique(){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWith(this.#e.node.addIndex,{unique:!0})})})}column(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWithColumns(this.#e.node.addIndex,[parseOrderedColumnName(e)])})})}columns(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWithColumns(this.#e.node.addIndex,e.map(parseOrderedColumnName))})})}expression(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWithColumns(this.#e.node.addIndex,[e.toOperationNode()])})})}using(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.cloneWith(this.#e.node.addIndex,{using:RawNode.createWithSql(e)})})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableAddIndexBuilder,"don't await AlterTableAddIndexBuilder instances directly. To execute the query you need to call `execute`");class UniqueConstraintNodeBuilder{#e;constructor(e){this.#e=e}toOperationNode(){return this.#e}nullsNotDistinct(){return new UniqueConstraintNodeBuilder(UniqueConstraintNode.cloneWith(this.#e,{nullsNotDistinct:!0}))}}preventAwait(UniqueConstraintNodeBuilder,"don't await UniqueConstraintNodeBuilder instances directly.");class AlterTableBuilder{#e;constructor(e){this.#e=freeze(e)}renameTo(e){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{renameTo:parseTable(e)})})}setSchema(e){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{setSchema:IdentifierNode.create(e)})})}alterColumn(e,r){const n=r(new AlterColumnBuilder(e));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,n.toOperationNode())})}dropColumn(e){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,DropColumnNode.create(e))})}renameColumn(e,r){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,RenameColumnNode.create(e,r))})}addColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,AddColumnNode.create(s.toOperationNode()))})}modifyColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,ModifyColumnNode.create(s.toOperationNode()))})}addUniqueConstraint(e,r,n=noop$1){const s=n(new UniqueConstraintNodeBuilder(UniqueConstraintNode.create(r,e)));return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(s.toOperationNode())})})}addCheckConstraint(e,r){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(CheckConstraintNode.create(r.toOperationNode(),e))})})}addForeignKeyConstraint(e,r,n,s){return new AlterTableAddForeignKeyConstraintBuilder({...this.#e,constraintBuilder:new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.create(r.map(ColumnNode.create),parseTable(n),s.map(ColumnNode.create),e))})}addPrimaryKeyConstraint(e,r){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addConstraint:AddConstraintNode.create(PrimaryConstraintNode.create(r,e))})})}dropConstraint(e){return new AlterTableDropConstraintBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropConstraint:DropConstraintNode.create(e)})})}addIndex(e){return new AlterTableAddIndexBuilder({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{addIndex:AddIndexNode.create(e)})})}dropIndex(e){return new AlterTableExecutor({...this.#e,node:AlterTableNode.cloneWithTableProps(this.#e.node,{dropIndex:DropIndexNode.create(e)})})}$call(e){return e(this)}}class AlterTableColumnAlteringBuilder{#e;constructor(e){this.#e=freeze(e)}alterColumn(e,r){const n=r(new AlterColumnBuilder(e));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,n.toOperationNode())})}dropColumn(e){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,DropColumnNode.create(e))})}renameColumn(e,r){return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,RenameColumnNode.create(e,r))})}addColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,AddColumnNode.create(s.toOperationNode()))})}modifyColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new AlterTableColumnAlteringBuilder({...this.#e,node:AlterTableNode.cloneWithColumnAlteration(this.#e.node,ModifyColumnNode.create(s.toOperationNode()))})}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(AlterTableBuilder,"don't await AlterTableBuilder instances");preventAwait(AlterColumnBuilder,"don't await AlterColumnBuilder instances");preventAwait(AlterTableColumnAlteringBuilder,"don't await AlterTableColumnAlteringBuilder instances directly. To execute the query you need to call `execute`");class ImmediateValueTransformer extends OperationNodeTransformer{transformValue(e){return{...super.transformValue(e),immediate:!0}}}class CreateIndexBuilder{#e;constructor(e){this.#e=freeze(e)}ifNotExists(){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{ifNotExists:!0})})}unique(){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{unique:!0})})}nullsNotDistinct(){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{nullsNotDistinct:!0})})}on(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{table:parseTable(e)})})}column(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWithColumns(this.#e.node,[parseOrderedColumnName(e)])})}columns(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWithColumns(this.#e.node,e.map(parseOrderedColumnName))})}expression(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWithColumns(this.#e.node,[e.toOperationNode()])})}using(e){return new CreateIndexBuilder({...this.#e,node:CreateIndexNode.cloneWith(this.#e.node,{using:RawNode.createWithSql(e)})})}where(...e){const r=new ImmediateValueTransformer;return new CreateIndexBuilder({...this.#e,node:QueryNode.cloneWithWhere(this.#e.node,r.transformNode(parseValueBinaryOperationOrExpression(e)))})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateIndexBuilder,"don't await CreateIndexBuilder instances directly. To execute the query you need to call `execute`");class CreateSchemaBuilder{#e;constructor(e){this.#e=freeze(e)}ifNotExists(){return new CreateSchemaBuilder({...this.#e,node:CreateSchemaNode.cloneWith(this.#e.node,{ifNotExists:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateSchemaBuilder,"don't await CreateSchemaBuilder instances directly. To execute the query you need to call `execute`");function parseOnCommitAction(t){if(ON_COMMIT_ACTIONS.includes(t))return t;throw new Error(`invalid OnCommitAction ${t}`)}class CreateTableBuilder{#e;constructor(e){this.#e=freeze(e)}temporary(){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{temporary:!0})})}onCommit(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{onCommit:parseOnCommitAction(e)})})}ifNotExists(){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{ifNotExists:!0})})}addColumn(e,r,n=noop$1){const s=n(new ColumnDefinitionBuilder(ColumnDefinitionNode.create(e,parseDataTypeExpression(r))));return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithColumn(this.#e.node,s.toOperationNode())})}addPrimaryKeyConstraint(e,r){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,PrimaryConstraintNode.create(r,e))})}addUniqueConstraint(e,r,n=noop$1){const s=n(new UniqueConstraintNodeBuilder(UniqueConstraintNode.create(r,e)));return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,s.toOperationNode())})}addCheckConstraint(e,r){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,CheckConstraintNode.create(r.toOperationNode(),e))})}addForeignKeyConstraint(e,r,n,s,a=noop$1){const u=a(new ForeignKeyConstraintBuilder(ForeignKeyConstraintNode.create(r.map(ColumnNode.create),parseTable(n),s.map(ColumnNode.create),e)));return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithConstraint(this.#e.node,u.toOperationNode())})}modifyFront(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithFrontModifier(this.#e.node,e.toOperationNode())})}modifyEnd(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWithEndModifier(this.#e.node,e.toOperationNode())})}as(e){return new CreateTableBuilder({...this.#e,node:CreateTableNode.cloneWith(this.#e.node,{selectQuery:parseExpression(e)})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateTableBuilder,"don't await CreateTableBuilder instances directly. To execute the query you need to call `execute`");class DropIndexBuilder{#e;constructor(e){this.#e=freeze(e)}on(e){return new DropIndexBuilder({...this.#e,node:DropIndexNode.cloneWith(this.#e.node,{table:parseTable(e)})})}ifExists(){return new DropIndexBuilder({...this.#e,node:DropIndexNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropIndexBuilder({...this.#e,node:DropIndexNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropIndexBuilder,"don't await DropIndexBuilder instances directly. To execute the query you need to call `execute`");class DropSchemaBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new DropSchemaBuilder({...this.#e,node:DropSchemaNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropSchemaBuilder({...this.#e,node:DropSchemaNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropSchemaBuilder,"don't await DropSchemaBuilder instances directly. To execute the query you need to call `execute`");class DropTableBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new DropTableBuilder({...this.#e,node:DropTableNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropTableBuilder({...this.#e,node:DropTableNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropTableBuilder,"don't await DropTableBuilder instances directly. To execute the query you need to call `execute`");const CreateViewNode=freeze({is(t){return t.kind==="CreateViewNode"},create(t){return freeze({kind:"CreateViewNode",name:SchemableIdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})}});class ImmediateValuePlugin{#e=new ImmediateValueTransformer;transformQuery(e){return this.#e.transformNode(e.node)}transformResult(e){return Promise.resolve(e.result)}}class CreateViewBuilder{#e;constructor(e){this.#e=freeze(e)}temporary(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{temporary:!0})})}materialized(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{materialized:!0})})}ifNotExists(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{ifNotExists:!0})})}orReplace(){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{orReplace:!0})})}columns(e){return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{columns:e.map(parseColumnName)})})}as(e){const r=e.withPlugin(new ImmediateValuePlugin).toOperationNode();return new CreateViewBuilder({...this.#e,node:CreateViewNode.cloneWith(this.#e.node,{as:r})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateViewBuilder,"don't await CreateViewBuilder instances directly. To execute the query you need to call `execute`");const DropViewNode=freeze({is(t){return t.kind==="DropViewNode"},create(t){return freeze({kind:"DropViewNode",name:SchemableIdentifierNode.create(t)})},cloneWith(t,e){return freeze({...t,...e})}});class DropViewBuilder{#e;constructor(e){this.#e=freeze(e)}materialized(){return new DropViewBuilder({...this.#e,node:DropViewNode.cloneWith(this.#e.node,{materialized:!0})})}ifExists(){return new DropViewBuilder({...this.#e,node:DropViewNode.cloneWith(this.#e.node,{ifExists:!0})})}cascade(){return new DropViewBuilder({...this.#e,node:DropViewNode.cloneWith(this.#e.node,{cascade:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropViewBuilder,"don't await DropViewBuilder instances directly. To execute the query you need to call `execute`");const CreateTypeNode=freeze({is(t){return t.kind==="CreateTypeNode"},create(t){return freeze({kind:"CreateTypeNode",name:t})},cloneWithEnum(t,e){return freeze({...t,enum:ValueListNode.create(e.map(r=>ValueNode.createImmediate(r)))})}});class CreateTypeBuilder{#e;constructor(e){this.#e=freeze(e)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}asEnum(e){return new CreateTypeBuilder({...this.#e,node:CreateTypeNode.cloneWithEnum(this.#e.node,e)})}$call(e){return e(this)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(CreateTypeBuilder,"don't await CreateTypeBuilder instances directly. To execute the query you need to call `execute`");const DropTypeNode=freeze({is(t){return t.kind==="DropTypeNode"},create(t){return freeze({kind:"DropTypeNode",name:t})},cloneWith(t,e){return freeze({...t,...e})}});class DropTypeBuilder{#e;constructor(e){this.#e=freeze(e)}ifExists(){return new DropTypeBuilder({...this.#e,node:DropTypeNode.cloneWith(this.#e.node,{ifExists:!0})})}$call(e){return e(this)}toOperationNode(){return this.#e.executor.transformQuery(this.#e.node,this.#e.queryId)}compile(){return this.#e.executor.compileQuery(this.toOperationNode(),this.#e.queryId)}async execute(){await this.#e.executor.executeQuery(this.compile(),this.#e.queryId)}}preventAwait(DropTypeBuilder,"don't await DropTypeBuilder instances directly. To execute the query you need to call `execute`");function parseSchemableIdentifier(t){const e=".";if(t.includes(e)){const r=t.split(e).map(trim);if(r.length===2)return SchemableIdentifierNode.createWithSchema(r[0],r[1]);throw new Error(`invalid schemable identifier ${t}`)}else return SchemableIdentifierNode.create(t)}function trim(t){return t.trim()}class SchemaModule{#e;constructor(e){this.#e=e}createTable(e){return new CreateTableBuilder({queryId:createQueryId(),executor:this.#e,node:CreateTableNode.create(parseTable(e))})}dropTable(e){return new DropTableBuilder({queryId:createQueryId(),executor:this.#e,node:DropTableNode.create(parseTable(e))})}createIndex(e){return new CreateIndexBuilder({queryId:createQueryId(),executor:this.#e,node:CreateIndexNode.create(e)})}dropIndex(e){return new DropIndexBuilder({queryId:createQueryId(),executor:this.#e,node:DropIndexNode.create(e)})}createSchema(e){return new CreateSchemaBuilder({queryId:createQueryId(),executor:this.#e,node:CreateSchemaNode.create(e)})}dropSchema(e){return new DropSchemaBuilder({queryId:createQueryId(),executor:this.#e,node:DropSchemaNode.create(e)})}alterTable(e){return new AlterTableBuilder({queryId:createQueryId(),executor:this.#e,node:AlterTableNode.create(parseTable(e))})}createView(e){return new CreateViewBuilder({queryId:createQueryId(),executor:this.#e,node:CreateViewNode.create(e)})}dropView(e){return new DropViewBuilder({queryId:createQueryId(),executor:this.#e,node:DropViewNode.create(e)})}createType(e){return new CreateTypeBuilder({queryId:createQueryId(),executor:this.#e,node:CreateTypeNode.create(parseSchemableIdentifier(e))})}dropType(e){return new DropTypeBuilder({queryId:createQueryId(),executor:this.#e,node:DropTypeNode.create(parseSchemableIdentifier(e))})}withPlugin(e){return new SchemaModule(this.#e.withPlugin(e))}withoutPlugins(){return new SchemaModule(this.#e.withoutPlugins())}withSchema(e){return new SchemaModule(this.#e.withPluginAtFront(new WithSchemaPlugin(e)))}}class DynamicModule{ref(e){return new DynamicReferenceBuilder(e)}}class DefaultConnectionProvider{#e;constructor(e){this.#e=e}async provideConnection(e){const r=await this.#e.acquireConnection();try{return await e(r)}finally{await this.#e.releaseConnection(r)}}}class DefaultQueryExecutor extends QueryExecutorBase{#e;#t;#r;constructor(e,r,n,s=[]){super(s),this.#e=e,this.#t=r,this.#r=n}get adapter(){return this.#t}compileQuery(e){return this.#e.compileQuery(e)}provideConnection(e){return this.#r.provideConnection(e)}withPlugins(e){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[...this.plugins,...e])}withPlugin(e){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[...this.plugins,e])}withPluginAtFront(e){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[e,...this.plugins])}withConnectionProvider(e){return new DefaultQueryExecutor(this.#e,this.#t,e,[...this.plugins])}withoutPlugins(){return new DefaultQueryExecutor(this.#e,this.#t,this.#r,[])}}function performanceNow(){return typeof performance<"u"&&isFunction(performance.now)?performance.now():Date.now()}class RuntimeDriver{#e;#t;#r;#n;#i;#s=new WeakSet;constructor(e,r){this.#n=!1,this.#e=e,this.#t=r}async init(){if(this.#i)throw new Error("driver has already been destroyed");this.#r||(this.#r=this.#e.init().then(()=>{this.#n=!0}).catch(e=>(this.#r=void 0,Promise.reject(e)))),await this.#r}async acquireConnection(){if(this.#i)throw new Error("driver has already been destroyed");this.#n||await this.init();const e=await this.#e.acquireConnection();return this.#s.has(e)||(this.#o()&&this.#a(e),this.#s.add(e)),e}async releaseConnection(e){await this.#e.releaseConnection(e)}beginTransaction(e,r){return this.#e.beginTransaction(e,r)}commitTransaction(e){return this.#e.commitTransaction(e)}rollbackTransaction(e){return this.#e.rollbackTransaction(e)}async destroy(){this.#r&&(await this.#r,this.#i||(this.#i=this.#e.destroy().catch(e=>(this.#i=void 0,Promise.reject(e)))),await this.#i)}#o(){return this.#t.isLevelEnabled("query")||this.#t.isLevelEnabled("error")}#a(e){const r=e.executeQuery;e.executeQuery=async n=>{let s;const a=performanceNow();try{return await r.call(e,n)}catch(u){throw s=u,await this.#u(u,n,a),u}finally{s||await this.#l(n,a)}}}async#u(e,r,n){await this.#t.error(()=>({level:"error",error:e,query:r,queryDurationMillis:this.#c(n)}))}async#l(e,r){await this.#t.query(()=>({level:"query",query:e,queryDurationMillis:this.#c(r)}))}#c(e){return performanceNow()-e}}const ignoreError=()=>{};class SingleConnectionProvider{#e;#t;constructor(e){this.#e=e}async provideConnection(e){for(;this.#t;)await this.#t.catch(ignoreError);return this.#t=this.#r(e).finally(()=>{this.#t=void 0}),this.#t}async#r(e){return await e(this.#e)}}const TRANSACTION_ISOLATION_LEVELS=["read uncommitted","read committed","repeatable read","serializable","snapshot"];freeze(["query","error"]);class Log{#e;#t;constructor(e){isFunction(e)?(this.#t=e,this.#e=freeze({query:!0,error:!0})):(this.#t=defaultLogger,this.#e=freeze({query:e.includes("query"),error:e.includes("error")}))}isLevelEnabled(e){return this.#e[e]}async query(e){this.#e.query&&await this.#t(e())}async error(e){this.#e.error&&await this.#t(e())}}function defaultLogger(t){t.level==="query"?(console.log(`kysely:query: ${t.query.sql}`),console.log(`kysely:query: duration: ${t.queryDurationMillis.toFixed(1)}ms`)):t.level==="error"&&(t.error instanceof Error?console.error(`kysely:error: ${t.error.stack??t.error.message}`):console.error(`kysely:error: ${JSON.stringify({error:t.error,query:t.query.sql,queryDurationMillis:t.queryDurationMillis})}`))}function isCompilable(t){return isObject$3(t)&&isFunction(t.compile)}class Kysely extends QueryCreator{#e;constructor(e){let r,n;if(isKyselyProps(e))r={executor:e.executor},n={...e};else{const s=e.dialect,a=s.createDriver(),u=s.createQueryCompiler(),d=s.createAdapter(),f=new Log(e.log??[]),N=new RuntimeDriver(a,f),b=new DefaultConnectionProvider(N),w=new DefaultQueryExecutor(u,d,b,e.plugins??[]);r={executor:w},n={config:e,executor:w,dialect:s,driver:N}}super(r),this.#e=freeze(n)}get schema(){return new SchemaModule(this.#e.executor)}get dynamic(){return new DynamicModule}get introspection(){return this.#e.dialect.createIntrospector(this.withoutPlugins())}case(e){return new CaseBuilder({node:CaseNode.create(isUndefined(e)?void 0:parseExpression(e))})}get fn(){return createFunctionModule()}transaction(){return new TransactionBuilder({...this.#e})}connection(){return new ConnectionBuilder({...this.#e})}withPlugin(e){return new Kysely({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Kysely({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new Kysely({...this.#e,executor:this.#e.executor.withPluginAtFront(new WithSchemaPlugin(e))})}withTables(){return new Kysely({...this.#e})}async destroy(){await this.#e.driver.destroy()}get isTransaction(){return!1}getExecutor(){return this.#e.executor}executeQuery(e,r=createQueryId()){const n=isCompilable(e)?e.compile():e;return this.getExecutor().executeQuery(n,r)}}class Transaction extends Kysely{#e;constructor(e){super(e),this.#e=e}get isTransaction(){return!0}transaction(){throw new Error("calling the transaction method for a Transaction is not supported")}connection(){throw new Error("calling the connection method for a Transaction is not supported")}async destroy(){throw new Error("calling the destroy method for a Transaction is not supported")}withPlugin(e){return new Transaction({...this.#e,executor:this.#e.executor.withPlugin(e)})}withoutPlugins(){return new Transaction({...this.#e,executor:this.#e.executor.withoutPlugins()})}withSchema(e){return new Transaction({...this.#e,executor:this.#e.executor.withPluginAtFront(new WithSchemaPlugin(e))})}withTables(){return new Transaction({...this.#e})}}function isKyselyProps(t){return isObject$3(t)&&isObject$3(t.config)&&isObject$3(t.driver)&&isObject$3(t.executor)&&isObject$3(t.dialect)}class ConnectionBuilder{#e;constructor(e){this.#e=freeze(e)}async execute(e){return this.#e.executor.provideConnection(async r=>{const n=this.#e.executor.withConnectionProvider(new SingleConnectionProvider(r)),s=new Kysely({...this.#e,executor:n});return await e(s)})}}preventAwait(ConnectionBuilder,"don't await ConnectionBuilder instances directly. To execute the query you need to call the `execute` method");class TransactionBuilder{#e;constructor(e){this.#e=freeze(e)}setIsolationLevel(e){return new TransactionBuilder({...this.#e,isolationLevel:e})}async execute(e){const{isolationLevel:r,...n}=this.#e,s={isolationLevel:r};return validateTransactionSettings(s),this.#e.executor.provideConnection(async a=>{const u=this.#e.executor.withConnectionProvider(new SingleConnectionProvider(a)),d=new Transaction({...n,executor:u});try{await this.#e.driver.beginTransaction(a,s);const f=await e(d);return await this.#e.driver.commitTransaction(a),f}catch(f){throw await this.#e.driver.rollbackTransaction(a),f}})}}preventAwait(TransactionBuilder,"don't await TransactionBuilder instances directly. To execute the transaction you need to call the `execute` method");function validateTransactionSettings(t){if(t.isolationLevel&&!TRANSACTION_ISOLATION_LEVELS.includes(t.isolationLevel))throw new Error(`invalid transaction isolation level ${t.isolationLevel}`)}class RawBuilderImpl{#e;constructor(e){this.#e=freeze(e)}get expressionType(){}get isRawBuilder(){return!0}as(e){return new AliasedRawBuilderImpl(this,e)}$castTo(){return new RawBuilderImpl({...this.#e})}$notNull(){return new RawBuilderImpl(this.#e)}withPlugin(e){return new RawBuilderImpl({...this.#e,plugins:this.#e.plugins!==void 0?freeze([...this.#e.plugins,e]):freeze([e])})}toOperationNode(){return this.#r(this.#t())}compile(e){return this.#n(this.#t(e))}async execute(e){const r=this.#t(e);return r.executeQuery(this.#n(r),this.#e.queryId)}#t(e){const r=e!==void 0?e.getExecutor():NOOP_QUERY_EXECUTOR;return this.#e.plugins!==void 0?r.withPlugins(this.#e.plugins):r}#r(e){return e.transformQuery(this.#e.rawNode,this.#e.queryId)}#n(e){return e.compileQuery(this.#r(e),this.#e.queryId)}}function createRawBuilder(t){return new RawBuilderImpl(t)}preventAwait(RawBuilderImpl,"don't await RawBuilder instances directly. To execute the query you need to call `execute`");class AliasedRawBuilderImpl{#e;#t;constructor(e,r){this.#e=e,this.#t=r}get expression(){return this.#e}get alias(){return this.#t}get rawBuilder(){return this.#e}toOperationNode(){return AliasNode.create(this.#e.toOperationNode(),isOperationNodeSource(this.#t)?this.#t.toOperationNode():IdentifierNode.create(this.#t))}}preventAwait(AliasedRawBuilderImpl,"don't await AliasedRawBuilder instances directly. AliasedRawBuilder should never be executed directly since it's always a part of another query.");const sql=Object.assign((t,...e)=>createRawBuilder({queryId:createQueryId(),rawNode:RawNode.create(t,e?.map(parseParameter)??[])}),{ref(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseStringReference(t))})},val(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseValueExpression(t))})},value(t){return this.val(t)},table(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(parseTable(t))})},id(...t){const e=new Array(t.length+1).fill(".");return e[0]="",e[e.length-1]="",createRawBuilder({queryId:createQueryId(),rawNode:RawNode.create(e,t.map(IdentifierNode.create))})},lit(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithChild(ValueNode.createImmediate(t))})},literal(t){return this.lit(t)},raw(t){return createRawBuilder({queryId:createQueryId(),rawNode:RawNode.createWithSql(t)})},join(t,e=sql`, `){const r=new Array(2*t.length-1),n=e.toOperationNode();for(let s=0;s{this.nodeStack.push(e),this.#e[e.kind](e),this.nodeStack.pop()}}class DefaultQueryCompiler extends OperationNodeVisitor{#e="";#t=[];get numParameters(){return this.#t.length}compileQuery(e){return this.#e="",this.#t=[],this.visitNode(e),freeze({query:e,sql:this.getSql(),parameters:[...this.#t]})}getSql(){return this.#e}visitSelectQuery(e){const r=this.parentNode!==void 0&&!ParensNode.is(this.parentNode)&&!InsertQueryNode.is(this.parentNode)&&!CreateTableNode.is(this.parentNode)&&!CreateViewNode.is(this.parentNode)&&!SetOperationNode.is(this.parentNode);this.parentNode===void 0&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("select"),e.distinctOn&&(this.append(" "),this.compileDistinctOn(e.distinctOn)),e.frontModifiers?.length&&(this.append(" "),this.compileList(e.frontModifiers," ")),e.selections&&(this.append(" "),this.compileList(e.selections)),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.groupBy&&(this.append(" "),this.visitNode(e.groupBy)),e.having&&(this.append(" "),this.visitNode(e.having)),e.setOperations&&(this.append(" "),this.compileList(e.setOperations," ")),e.orderBy&&(this.append(" "),this.visitNode(e.orderBy)),e.limit&&(this.append(" "),this.visitNode(e.limit)),e.offset&&(this.append(" "),this.visitNode(e.offset)),e.endModifiers?.length&&(this.append(" "),this.compileList(this.sortSelectModifiers([...e.endModifiers])," ")),r&&this.append(")")}visitFrom(e){this.append("from "),this.compileList(e.froms)}visitSelection(e){this.visitNode(e.selection)}visitColumn(e){this.visitNode(e.column)}compileDistinctOn(e){this.append("distinct on ("),this.compileList(e),this.append(")")}compileList(e,r=", "){const n=e.length-1;for(let s=0;s<=n;s++)this.visitNode(e[s]),ss&&this.visitNode(n[s])}visitOperator(e){this.append(e.operator)}visitTable(e){this.visitNode(e.table)}visitSchemableIdentifier(e){e.schema&&(this.visitNode(e.schema),this.append(".")),this.visitNode(e.identifier)}visitCreateTable(e){this.append("create "),e.frontModifiers&&e.frontModifiers.length>0&&(this.compileList(e.frontModifiers," "),this.append(" ")),e.temporary&&this.append("temporary "),this.append("table "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.table),e.selectQuery?(this.append(" as "),this.visitNode(e.selectQuery)):(this.append(" ("),this.compileList([...e.columns,...e.constraints??[]]),this.append(")"),e.onCommit&&(this.append(" on commit "),this.append(e.onCommit)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," ")))}visitColumnDefinition(e){this.visitNode(e.column),this.append(" "),this.visitNode(e.dataType),e.unsigned&&this.append(" unsigned"),e.frontModifiers&&e.frontModifiers.length>0&&(this.append(" "),this.compileList(e.frontModifiers," ")),e.generated&&(this.append(" "),this.visitNode(e.generated)),e.defaultTo&&(this.append(" "),this.visitNode(e.defaultTo)),e.notNull&&this.append(" not null"),e.unique&&this.append(" unique"),e.nullsNotDistinct&&this.append(" nulls not distinct"),e.primaryKey&&this.append(" primary key"),e.autoIncrement&&(this.append(" "),this.append(this.getAutoIncrement())),e.references&&(this.append(" "),this.visitNode(e.references)),e.check&&(this.append(" "),this.visitNode(e.check)),e.endModifiers&&e.endModifiers.length>0&&(this.append(" "),this.compileList(e.endModifiers," "))}getAutoIncrement(){return"auto_increment"}visitReferences(e){this.append("references "),this.visitNode(e.table),this.append(" ("),this.compileList(e.columns),this.append(")"),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitDropTable(e){this.append("drop table "),e.ifExists&&this.append("if exists "),this.visitNode(e.table),e.cascade&&this.append(" cascade")}visitDataType(e){this.append(e.dataType)}visitOrderBy(e){this.append("order by "),this.compileList(e.items)}visitOrderByItem(e){this.visitNode(e.orderBy),e.direction&&(this.append(" "),this.visitNode(e.direction))}visitGroupBy(e){this.append("group by "),this.compileList(e.items)}visitGroupByItem(e){this.visitNode(e.groupBy)}visitUpdateQuery(e){const r=this.nodeStack.find(QueryNode.is)!==e;!r&&e.explain&&(this.visitNode(e.explain),this.append(" ")),r&&this.append("("),e.with&&(this.visitNode(e.with),this.append(" ")),this.append("update "),this.visitNode(e.table),this.append(" set "),e.updates&&this.compileList(e.updates),e.from&&(this.append(" "),this.visitNode(e.from)),e.joins&&(this.append(" "),this.compileList(e.joins," ")),e.where&&(this.append(" "),this.visitNode(e.where)),e.returning&&(this.append(" "),this.visitNode(e.returning)),r&&this.append(")")}visitColumnUpdate(e){this.visitNode(e.column),this.append(" = "),this.visitNode(e.value)}visitLimit(e){this.append("limit "),this.visitNode(e.limit)}visitOffset(e){this.append("offset "),this.visitNode(e.offset)}visitOnConflict(e){this.append("on conflict"),e.columns?(this.append(" ("),this.compileList(e.columns),this.append(")")):e.constraint?(this.append(" on constraint "),this.visitNode(e.constraint)):e.indexExpression&&(this.append(" ("),this.visitNode(e.indexExpression),this.append(")")),e.indexWhere&&(this.append(" "),this.visitNode(e.indexWhere)),e.doNothing===!0?this.append(" do nothing"):e.updates&&(this.append(" do update set "),this.compileList(e.updates),e.updateWhere&&(this.append(" "),this.visitNode(e.updateWhere)))}visitOnDuplicateKey(e){this.append("on duplicate key update "),this.compileList(e.updates)}visitCreateIndex(e){this.append("create "),e.unique&&this.append("unique "),this.append("index "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.using&&(this.append(" using "),this.visitNode(e.using)),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.nullsNotDistinct&&this.append(" nulls not distinct"),e.where&&(this.append(" "),this.visitNode(e.where))}visitDropIndex(e){this.append("drop index "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.table&&(this.append(" on "),this.visitNode(e.table)),e.cascade&&this.append(" cascade")}visitCreateSchema(e){this.append("create schema "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.schema)}visitDropSchema(e){this.append("drop schema "),e.ifExists&&this.append("if exists "),this.visitNode(e.schema),e.cascade&&this.append(" cascade")}visitPrimaryKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("primary key ("),this.compileList(e.columns),this.append(")")}visitUniqueConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("unique"),e.nullsNotDistinct&&this.append(" nulls not distinct"),this.append(" ("),this.compileList(e.columns),this.append(")")}visitCheckConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("check ("),this.visitNode(e.expression),this.append(")")}visitForeignKeyConstraint(e){e.name&&(this.append("constraint "),this.visitNode(e.name),this.append(" ")),this.append("foreign key ("),this.compileList(e.columns),this.append(") "),this.visitNode(e.references),e.onDelete&&(this.append(" on delete "),this.append(e.onDelete)),e.onUpdate&&(this.append(" on update "),this.append(e.onUpdate))}visitList(e){this.compileList(e.items)}visitWith(e){this.append("with "),e.recursive&&this.append("recursive "),this.compileList(e.expressions)}visitCommonTableExpression(e){this.visitNode(e.name),this.append(" as "),isBoolean(e.materialized)&&(e.materialized||this.append("not "),this.append("materialized ")),this.visitNode(e.expression)}visitCommonTableExpressionName(e){this.visitNode(e.table),e.columns&&(this.append("("),this.compileList(e.columns),this.append(")"))}visitAlterTable(e){this.append("alter table "),this.visitNode(e.table),this.append(" "),e.renameTo&&(this.append("rename to "),this.visitNode(e.renameTo)),e.setSchema&&(this.append("set schema "),this.visitNode(e.setSchema)),e.addConstraint&&this.visitNode(e.addConstraint),e.dropConstraint&&this.visitNode(e.dropConstraint),e.columnAlterations&&this.compileColumnAlterations(e.columnAlterations),e.addIndex&&this.visitNode(e.addIndex),e.dropIndex&&this.visitNode(e.dropIndex)}visitAddColumn(e){this.append("add column "),this.visitNode(e.column)}visitRenameColumn(e){this.append("rename column "),this.visitNode(e.column),this.append(" to "),this.visitNode(e.renameTo)}visitDropColumn(e){this.append("drop column "),this.visitNode(e.column)}visitAlterColumn(e){this.append("alter column "),this.visitNode(e.column),this.append(" "),e.dataType&&(this.announcesNewColumnDataType()&&this.append("type "),this.visitNode(e.dataType),e.dataTypeExpression&&(this.append("using "),this.visitNode(e.dataTypeExpression))),e.setDefault&&(this.append("set default "),this.visitNode(e.setDefault)),e.dropDefault&&this.append("drop default"),e.setNotNull&&this.append("set not null"),e.dropNotNull&&this.append("drop not null")}visitModifyColumn(e){this.append("modify column "),this.visitNode(e.column)}visitAddConstraint(e){this.append("add "),this.visitNode(e.constraint)}visitDropConstraint(e){this.append("drop constraint "),e.ifExists&&this.append("if exists "),this.visitNode(e.constraintName),e.modifier==="cascade"?this.append(" cascade"):e.modifier==="restrict"&&this.append(" restrict")}visitSetOperation(e){this.append(e.operator),this.append(" "),e.all&&this.append("all "),this.visitNode(e.expression)}visitCreateView(e){this.append("create "),e.orReplace&&this.append("or replace "),e.materialized&&this.append("materialized "),e.temporary&&this.append("temporary "),this.append("view "),e.ifNotExists&&this.append("if not exists "),this.visitNode(e.name),this.append(" "),e.columns&&(this.append("("),this.compileList(e.columns),this.append(") ")),e.as&&(this.append("as "),this.visitNode(e.as))}visitDropView(e){this.append("drop "),e.materialized&&this.append("materialized "),this.append("view "),e.ifExists&&this.append("if exists "),this.visitNode(e.name),e.cascade&&this.append(" cascade")}visitGenerated(e){this.append("generated "),e.always&&this.append("always "),e.byDefault&&this.append("by default "),this.append("as "),e.identity&&this.append("identity"),e.expression&&(this.append("("),this.visitNode(e.expression),this.append(")")),e.stored&&this.append(" stored")}visitDefaultValue(e){this.append("default "),this.visitNode(e.defaultValue)}visitSelectModifier(e){e.rawModifier?this.visitNode(e.rawModifier):this.append(SELECT_MODIFIER_SQL[e.modifier]),e.of&&(this.append(" of "),this.compileList(e.of,", "))}visitCreateType(e){this.append("create type "),this.visitNode(e.name),e.enum&&(this.append(" as enum "),this.visitNode(e.enum))}visitDropType(e){this.append("drop type "),e.ifExists&&this.append("if exists "),this.visitNode(e.name)}visitExplain(e){this.append("explain"),(e.options||e.format)&&(this.append(" "),this.append(this.getLeftExplainOptionsWrapper()),e.options&&(this.visitNode(e.options),e.format&&this.append(this.getExplainOptionsDelimiter())),e.format&&(this.append("format"),this.append(this.getExplainOptionAssignment()),this.append(e.format)),this.append(this.getRightExplainOptionsWrapper()))}visitDefaultInsertValue(e){this.append("default")}visitAggregateFunction(e){this.append(e.func),this.append("("),e.distinct&&this.append("distinct "),this.compileList(e.aggregated),this.append(")"),e.filter&&(this.append(" filter("),this.visitNode(e.filter),this.append(")")),e.over&&(this.append(" "),this.visitNode(e.over))}visitOver(e){this.append("over("),e.partitionBy&&(this.visitNode(e.partitionBy),e.orderBy&&this.append(" ")),e.orderBy&&this.visitNode(e.orderBy),this.append(")")}visitPartitionBy(e){this.append("partition by "),this.compileList(e.items)}visitPartitionByItem(e){this.visitNode(e.partitionBy)}visitBinaryOperation(e){this.visitNode(e.leftOperand),this.append(" "),this.visitNode(e.operator),this.append(" "),this.visitNode(e.rightOperand)}visitUnaryOperation(e){this.visitNode(e.operator),this.isMinusOperator(e.operator)||this.append(" "),this.visitNode(e.operand)}isMinusOperator(e){return OperatorNode.is(e)&&e.operator==="-"}visitUsing(e){this.append("using "),this.compileList(e.tables)}visitFunction(e){this.append(e.func),this.append("("),this.compileList(e.arguments),this.append(")")}visitCase(e){this.append("case"),e.value&&(this.append(" "),this.visitNode(e.value)),e.when&&(this.append(" "),this.compileList(e.when," ")),e.else&&(this.append(" else "),this.visitNode(e.else)),this.append(" end"),e.isStatement&&this.append(" case")}visitWhen(e){this.append("when "),this.visitNode(e.condition),e.result&&(this.append(" then "),this.visitNode(e.result))}visitJSONReference(e){this.visitNode(e.reference),this.visitNode(e.traversal)}visitJSONPath(e){e.inOperator&&this.visitNode(e.inOperator),this.append("'$");for(const r of e.pathLegs)this.visitNode(r);this.append("'")}visitJSONPathLeg(e){const r=e.type==="ArrayLocation";this.append(r?"[":"."),this.append(String(e.value)),r&&this.append("]")}visitJSONOperatorChain(e){for(let r=0,n=e.values.length;r"),this.visitNode(e.values[r])}visitAddIndex(e){this.append("add "),e.unique&&this.append("unique "),this.append("index "),this.visitNode(e.name),e.columns&&(this.append(" ("),this.compileList(e.columns),this.append(")")),e.using&&(this.append(" using "),this.visitNode(e.using))}append(e){this.#e+=e}appendValue(e){this.addParameter(e),this.append(this.getCurrentParameterPlaceholder())}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getCurrentParameterPlaceholder(){return"$"+this.numParameters}getLeftExplainOptionsWrapper(){return"("}getExplainOptionAssignment(){return" "}getExplainOptionsDelimiter(){return", "}getRightExplainOptionsWrapper(){return")"}sanitizeIdentifier(e){const r=this.getLeftIdentifierWrapper(),n=this.getRightIdentifierWrapper();let s="";for(const a of e)s+=a,a===r?s+=r:a===n&&(s+=n);return s}addParameter(e){this.#t.push(e)}appendImmediateValue(e){if(isString(e))this.append(`'${e}'`);else if(isNumber(e)||isBoolean(e))this.append(e.toString());else if(isNull(e))this.append("null");else if(isDate(e))this.appendImmediateValue(e.toISOString());else if(isBigInt(e))this.appendImmediateValue(e.toString());else throw new Error(`invalid immediate value ${e}`)}sortSelectModifiers(e){return e.sort((r,n)=>r.modifier&&n.modifier?SELECT_MODIFIER_PRIORITY[r.modifier]-SELECT_MODIFIER_PRIORITY[n.modifier]:1),freeze(e)}compileColumnAlterations(e){this.compileList(e)}announcesNewColumnDataType(){return!0}}const SELECT_MODIFIER_SQL=freeze({ForKeyShare:"for key share",ForNoKeyUpdate:"for no key update",ForUpdate:"for update",ForShare:"for share",NoWait:"nowait",SkipLocked:"skip locked",Distinct:"distinct"}),SELECT_MODIFIER_PRIORITY=freeze({ForKeyShare:1,ForNoKeyUpdate:1,ForUpdate:1,ForShare:1,NoWait:2,SkipLocked:2,Distinct:0}),JOIN_TYPE_SQL=freeze({InnerJoin:"inner join",LeftJoin:"left join",RightJoin:"right join",FullJoin:"full join",LateralInnerJoin:"inner join lateral",LateralLeftJoin:"left join lateral"}),CompiledQuery=freeze({raw(t,e=[]){return freeze({sql:t,query:RawNode.createWithSql(t),parameters:freeze(e)})}});class DialectAdapterBase{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}}class SqliteDriver{#e;#t=new ConnectionMutex;#r;#n;constructor(e){this.#e=freeze({...e})}async init(){this.#r=isFunction(this.#e.database)?await this.#e.database():this.#e.database,this.#n=new SqliteConnection(this.#r),this.#e.onCreateConnection&&await this.#e.onCreateConnection(this.#n)}async acquireConnection(){return await this.#t.lock(),this.#n}async beginTransaction(e){await e.executeQuery(CompiledQuery.raw("begin"))}async commitTransaction(e){await e.executeQuery(CompiledQuery.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(CompiledQuery.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}}class SqliteConnection{#e;constructor(e){this.#e=e}executeQuery(e){const{sql:r,parameters:n}=e,s=this.#e.prepare(r);if(s.reader)return Promise.resolve({rows:s.all(n)});{const{changes:a,lastInsertRowid:u}=s.run(n),d=a!=null?BigInt(a):void 0;return Promise.resolve({numUpdatedOrDeletedRows:d,numAffectedRows:d,insertId:u!=null?BigInt(u):void 0,rows:[]})}}async*streamQuery(e,r){const{sql:n,parameters:s,query:a}=e,u=this.#e.prepare(n);if(SelectQueryNode.is(a)){const d=u.iterate(s);for(const f of d)yield{rows:[f]}}else throw new Error("Sqlite driver only supports streaming of select queries")}}class ConnectionMutex{#e;#t;async lock(){for(;this.#e;)await this.#e;this.#e=new Promise(e=>{this.#t=e})}unlock(){const e=this.#t;this.#e=void 0,this.#t=void 0,e?.()}}const ID_WRAP_REGEX=/"/g;class SqliteQueryCompiler extends DefaultQueryCompiler{getCurrentParameterPlaceholder(){return"?"}getLeftExplainOptionsWrapper(){return""}getRightExplainOptionsWrapper(){return""}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}sanitizeIdentifier(e){return e.replace(ID_WRAP_REGEX,'""')}visitDefaultInsertValue(e){this.append("null")}}const DEFAULT_MIGRATION_TABLE="kysely_migration",DEFAULT_MIGRATION_LOCK_TABLE="kysely_migration_lock";freeze({__noMigrations__:!0});class SqliteIntrospector{#e;constructor(e){this.#e=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("sqlite_master").where("type","in",["table","view"]).where("name","not like","sqlite_%").select("name").orderBy("name").$castTo();e.withInternalKyselyTables||(r=r.where("name","!=",DEFAULT_MIGRATION_TABLE).where("name","!=",DEFAULT_MIGRATION_LOCK_TABLE));const n=await r.execute();return Promise.all(n.map(({name:s})=>this.#t(s)))}async getMetadata(e){return{tables:await this.getTables(e)}}async#t(e){const r=this.#e,n=await r.selectFrom("sqlite_master").where("name","=",e).select(["sql","type"]).$castTo().executeTakeFirstOrThrow(),s=n.sql?.split(/[\(\),]/)?.find(u=>u.toLowerCase().includes("autoincrement"))?.trimStart()?.split(/\s+/)?.[0]?.replace(/["`]/g,""),a=await r.selectFrom(sql`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).orderBy("cid").execute();return{name:e,isView:n.type==="view",columns:a.map(u=>({name:u.name,dataType:u.type,isNullable:!u.notnull,isAutoIncrementing:u.name===s,hasDefaultValue:u.dflt_value!=null}))}}}class SqliteAdapter extends DialectAdapterBase{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(e,r){}async releaseMigrationLock(e,r){}}class SqliteDialect{#e;constructor(e){this.#e=freeze({...e})}createDriver(){return new SqliteDriver(this.#e)}createQueryCompiler(){return new SqliteQueryCompiler}createAdapter(){return new SqliteAdapter}createIntrospector(e){return new SqliteIntrospector(e)}}function toBytes(t){return Uint8Array.from([...t].map(e=>e.charCodeAt(0)))}function fromBytes(t){return String.fromCharCode(...t)}function encode(t){return t.length?[fromBytes(t[0].site_id),...t.flatMap(e=>[e.cid,fromBytes(e.pk),e.table,JSON.stringify(e.val),e.db_version,e.col_version,e.cl,e.seq])]:[]}function decode(t){if(!t[0])return[];const e=toBytes(t[0]),r=[];for(let n=1;nt.execute(this).then(e=>e.rows[0])}}function updateVersion(t){return this.updateTable("__crstore_sync").set({version:t??sql`crsql_db_version()`})}function selectClient(){const t=sql`SELECT crsql_site_id() as client`;return{execute:()=>t.execute(this).then(e=>fromBytes(e.rows[0].client))}}function changesSince(t,e){let r=this.selectFrom("crsql_changes").select(sql`crsql_site_id()`.as("site_id")).select(["cid","pk","table","val","db_version","col_version","cl","seq"]).where("db_version",">",t).$if(!t,n=>n.where("cid","!=","__crsql_del")).$if(e===null,n=>n.where("site_id","is",sql`crsql_site_id()`)).$if(typeof e=="string",n=>n.where("site_id","is not",toBytes(e))).$castTo();return{execute:()=>r.execute().then(encode)}}function insertChanges(t){const e=async r=>{t.length&&(await r.insertInto("crsql_changes").values(decode(t)).execute(),await updateVersion.bind(r)().execute())};return{execute:()=>this.isTransaction?e(this):this.transaction().execute(e)}}function resolveChanges(t){return{execute:()=>applyOperation.bind(this)(e=>insertChanges.bind(e)(t).execute()).execute().then(e=>e.changes)}}function applyOperation(t,...e){return{execute:()=>this.transaction().execute(async r=>{const{current:n}=await selectVersion.bind(r)().execute(),s=await t(r,...e),a=await changesSince.bind(r)(n).execute();return{result:s,changes:a}})}}function finalize(){const t=sql`select crsql_finalize();`;return{execute:()=>t.execute(this)}}function affectedTables(t){if(Array.isArray(t)){const e=new Set;for(let r=3;rr.table)||[],...t.selections?.map(r=>r.selection)||[],...t.with?.expressions.map(r=>r.expression)||[]].flatMap(affectedTables);return[...new Set(e)]}return[]}const wasmUrl=""+new URL("../assets/crsqlite.mmzGBJgt.wasm",import.meta.url).href;var Module=(()=>{var t=import.meta.url;return function(e={}){var r=e,n,s;r.ready=new Promise((i,o)=>{n=i,s=o});var a=Object.assign({},r),u="./this.program",d=(i,o)=>{throw o},f=typeof window=="object",y=typeof importScripts=="function",b="",w;(f||y)&&(y?b=self.location.href:typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),t&&(b=t),b.indexOf("blob:")!==0?b=b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):b="",y&&(w=i=>{var o=new XMLHttpRequest;return o.open("GET",i,!1),o.responseType="arraybuffer",o.send(null),new Uint8Array(o.response)}));var A=r.print||console.log.bind(console),R=r.printErr||console.error.bind(console);Object.assign(r,a),a=null,r.thisProgram&&(u=r.thisProgram),r.quit&&(d=r.quit);var I;r.wasmBinary&&(I=r.wasmBinary);var h=r.noExitRuntime||!0;typeof WebAssembly!="object"&&te("no native wasm support detected");var N,m=!1,E,v,C,$,T,q,Y,z;function M(){var i=N.buffer;r.HEAP8=v=new Int8Array(i),r.HEAP16=$=new Int16Array(i),r.HEAPU8=C=new Uint8Array(i),r.HEAPU16=new Uint16Array(i),r.HEAP32=T=new Int32Array(i),r.HEAPU32=q=new Uint32Array(i),r.HEAPF32=Y=new Float32Array(i),r.HEAPF64=z=new Float64Array(i)}var W=[],V=[],ae=[],G=[],me=0;function Oe(){var i=r.preRun.shift();W.unshift(i)}var P=0,J=null;function te(i){throw r.onAbort&&r.onAbort(i),i="Aborted("+i+")",R(i),m=!0,E=1,i=new WebAssembly.RuntimeError(i+". Build with -sASSERTIONS for more info."),s(i),i}function le(i){return i.startsWith("data:application/octet-stream;base64,")}var X;if(r.locateFile){if(X="crsqlite.wasm",!le(X)){var ye=X;X=r.locateFile?r.locateFile(ye,b):b+ye}}else X=new URL(""+new URL("../assets/crsqlite.mmzGBJgt.wasm",import.meta.url).href,import.meta.url).href;function ge(i){if(i==X&&I)return new Uint8Array(I);if(w)return w(i);throw"both async and sync fetching of the wasm failed"}function be(i){return I||!f&&!y||typeof fetch!="function"?Promise.resolve().then(()=>ge(i)):fetch(i,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw"failed to load wasm binary file at '"+i+"'";return o.arrayBuffer()}).catch(()=>ge(i))}function ke(i,o,l){return be(i).then(c=>WebAssembly.instantiate(c,o)).then(c=>c).then(l,c=>{R(`failed to asynchronously prepare wasm: ${c}`),te(c)})}function Ae(i,o){var l=X;return I||typeof WebAssembly.instantiateStreaming!="function"||le(l)||typeof fetch!="function"?ke(l,i,o):fetch(l,{credentials:"same-origin"}).then(c=>WebAssembly.instantiateStreaming(c,i).then(o,function(p){return R(`wasm streaming compile failed: ${p}`),R("falling back to ArrayBuffer instantiation"),ke(l,i,o)}))}var U,ne;function He(i){this.name="ExitStatus",this.message=`Program terminated with exit(${i})`,this.status=i}var Pe=i=>{for(;0>0];case"i8":return v[i>>0];case"i16":return $[i>>1];case"i32":return T[i>>2];case"i64":te("to do getValue(i64) use WASM_BIGINT");case"float":return Y[i>>2];case"double":return z[i>>3];case"*":return q[i>>2];default:te(`invalid type for getValue: ${o}`)}}function de(i,o,l="i8"){switch(l.endsWith("*")&&(l="*"),l){case"i1":v[i>>0]=o;break;case"i8":v[i>>0]=o;break;case"i16":$[i>>1]=o;break;case"i32":T[i>>2]=o;break;case"i64":te("to do setValue(i64) use WASM_BIGINT");case"float":Y[i>>2]=o;break;case"double":z[i>>3]=o;break;case"*":q[i>>2]=o;break;default:te(`invalid type for setValue: ${l}`)}}var Ce=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,j=(i,o,l)=>{var c=o+l;for(l=o;i[l]&&!(l>=c);)++l;if(16p?c+=String.fromCharCode(p):(p-=65536,c+=String.fromCharCode(55296|p>>10,56320|p&1023))}}else c+=String.fromCharCode(p)}return c},je=(i,o)=>{for(var l=0,c=i.length-1;0<=c;c--){var p=i[c];p==="."?i.splice(c,1):p===".."?(i.splice(c,1),l++):l&&(i.splice(c,1),l--)}if(o)for(;l;l--)i.unshift("..");return i},Se=i=>{var o=i.charAt(0)==="/",l=i.substr(-1)==="/";return(i=je(i.split("/").filter(c=>!!c),!o).join("/"))||o||(i="."),i&&l&&(i+="/"),(o?"/":"")+i},ot=i=>{var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(i).slice(1);return i=o[0],o=o[1],!i&&!o?".":(o&&(o=o.substr(0,o.length-1)),i+o)},ze=i=>{if(i==="/")return"/";i=Se(i),i=i.replace(/\/$/,"");var o=i.lastIndexOf("/");return o===-1?i:i.substr(o+1)},Q=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return i=>crypto.getRandomValues(i);te("initRandomDevice")},Z=i=>(Z=Q())(i);function oe(){for(var i="",o=!1,l=arguments.length-1;-1<=l&&!o;l--){if(o=0<=l?arguments[l]:"/",typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";i=o+"/"+i,o=o.charAt(0)==="/"}return i=je(i.split("/").filter(c=>!!c),!o).join("/"),(o?"/":"")+i||"."}var Ne=[],he=i=>{for(var o=0,l=0;l=c?o++:2047>=c?o+=2:55296<=c&&57343>=c?(o+=4,++l):o+=3}return o},ue=(i,o,l,c)=>{if(!(0=_){var k=i.charCodeAt(++g);_=65536+((_&1023)<<10)|k&1023}if(127>=_){if(l>=c)break;o[l++]=_}else{if(2047>=_){if(l+1>=c)break;o[l++]=192|_>>6}else{if(65535>=_){if(l+2>=c)break;o[l++]=224|_>>12}else{if(l+3>=c)break;o[l++]=240|_>>18,o[l++]=128|_>>12&63}o[l++]=128|_>>6&63}o[l++]=128|_&63}}return o[l]=0,l-p},We=[];function Te(i,o){We[i]={input:[],Ub:[],ec:o},ft(i,at)}var at={open(i){var o=We[i.node.ic];if(!o)throw new L(43);i.Vb=o,i.seekable=!1},close(i){i.Vb.ec.lc(i.Vb)},lc(i){i.Vb.ec.lc(i.Vb)},read(i,o,l,c){if(!i.Vb||!i.Vb.ec.Ac)throw new L(60);for(var p=0,g=0;gt.execute(this).then(e=>e.rows[0])}}function updateVersion(t){return this.updateTable("__crstore_sync").set({version:t??sql`crsql_db_version()`})}function selectClient(){const t=sql`SELECT crsql_site_id() as client`;return{execute:()=>t.execute(this).then(e=>fromBytes(e.rows[0].client))}}function changesSince(t,e){let r=this.selectFrom("crsql_changes").select(sql`crsql_site_id()`.as("site_id")).select(["cid","pk","table","val","db_version","col_version","cl","seq"]).where("db_version",">",t).$if(!t,n=>n.where("cid","!=","__crsql_del")).$if(e===null,n=>n.where("site_id","is",sql`crsql_site_id()`)).$if(typeof e=="string",n=>n.where("site_id","is not",toBytes(e))).$castTo();return{execute:()=>r.execute().then(encode)}}function insertChanges(t){const e=async r=>{t.length&&(await r.insertInto("crsql_changes").values(decode(t)).execute(),await updateVersion.bind(r)().execute())};return{execute:()=>this.isTransaction?e(this):this.transaction().execute(e)}}function resolveChanges(t){return{execute:()=>applyOperation.bind(this)(e=>insertChanges.bind(e)(t).execute()).execute().then(e=>e.changes)}}function applyOperation(t,...e){return{execute:()=>this.transaction().execute(async r=>{const{current:n}=await selectVersion.bind(r)().execute(),s=await t(r,...e),a=await changesSince.bind(r)(n).execute();return{result:s,changes:a}})}}function finalize(){const t=sql`select crsql_finalize();`;return{execute:()=>t.execute(this)}}function affectedTables(t){if(Array.isArray(t)){const e=new Set;for(let r=3;rr.table)||[],...t.selections?.map(r=>r.selection)||[],...t.with?.expressions.map(r=>r.expression)||[]].flatMap(affectedTables);return[...new Set(e)]}return[]}const wasmUrl=""+new URL("../assets/crsqlite.mmzGBJgt.wasm",import.meta.url).href;var Module=(()=>{var t=import.meta.url;return function(e={}){var r=e,n,s;r.ready=new Promise((i,o)=>{n=i,s=o});var a=Object.assign({},r),u="./this.program",d=(i,o)=>{throw o},f=typeof window=="object",N=typeof importScripts=="function",b="",w;(f||N)&&(N?b=self.location.href:typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),t&&(b=t),b.indexOf("blob:")!==0?b=b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):b="",N&&(w=i=>{var o=new XMLHttpRequest;return o.open("GET",i,!1),o.responseType="arraybuffer",o.send(null),new Uint8Array(o.response)}));var A=r.print||console.log.bind(console),R=r.printErr||console.error.bind(console);Object.assign(r,a),a=null,r.thisProgram&&(u=r.thisProgram),r.quit&&(d=r.quit);var S;r.wasmBinary&&(S=r.wasmBinary);var h=r.noExitRuntime||!0;typeof WebAssembly!="object"&&te("no native wasm support detected");var y,m=!1,E,v,C,V,T,q,$,U;function M(){var i=y.buffer;r.HEAP8=v=new Int8Array(i),r.HEAP16=V=new Int16Array(i),r.HEAPU8=C=new Uint8Array(i),r.HEAPU16=new Uint16Array(i),r.HEAP32=T=new Int32Array(i),r.HEAPU32=q=new Uint32Array(i),r.HEAPF32=$=new Float32Array(i),r.HEAPF64=U=new Float64Array(i)}var F=[],J=[],ae=[],ee=[],ge=0;function Oe(){var i=r.preRun.shift();F.unshift(i)}var P=0,H=null;function te(i){throw r.onAbort&&r.onAbort(i),i="Aborted("+i+")",R(i),m=!0,E=1,i=new WebAssembly.RuntimeError(i+". Build with -sASSERTIONS for more info."),s(i),i}function le(i){return i.startsWith("data:application/octet-stream;base64,")}var X;if(r.locateFile){if(X="crsqlite.wasm",!le(X)){var Ne=X;X=r.locateFile?r.locateFile(Ne,b):b+Ne}}else X=new URL(""+new URL("../assets/crsqlite.mmzGBJgt.wasm",import.meta.url).href,import.meta.url).href;function _e(i){if(i==X&&S)return new Uint8Array(S);if(w)return w(i);throw"both async and sync fetching of the wasm failed"}function ye(i){return S||!f&&!N||typeof fetch!="function"?Promise.resolve().then(()=>_e(i)):fetch(i,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw"failed to load wasm binary file at '"+i+"'";return o.arrayBuffer()}).catch(()=>_e(i))}function ke(i,o,l){return ye(i).then(c=>WebAssembly.instantiate(c,o)).then(c=>c).then(l,c=>{R(`failed to asynchronously prepare wasm: ${c}`),te(c)})}function Ae(i,o){var l=X;return S||typeof WebAssembly.instantiateStreaming!="function"||le(l)||typeof fetch!="function"?ke(l,i,o):fetch(l,{credentials:"same-origin"}).then(c=>WebAssembly.instantiateStreaming(c,i).then(o,function(p){return R(`wasm streaming compile failed: ${p}`),R("falling back to ArrayBuffer instantiation"),ke(l,i,o)}))}var Q,ne;function He(i){this.name="ExitStatus",this.message=`Program terminated with exit(${i})`,this.status=i}var Pe=i=>{for(;0>0];case"i8":return v[i>>0];case"i16":return V[i>>1];case"i32":return T[i>>2];case"i64":te("to do getValue(i64) use WASM_BIGINT");case"float":return $[i>>2];case"double":return U[i>>3];case"*":return q[i>>2];default:te(`invalid type for getValue: ${o}`)}}function de(i,o,l="i8"){switch(l.endsWith("*")&&(l="*"),l){case"i1":v[i>>0]=o;break;case"i8":v[i>>0]=o;break;case"i16":V[i>>1]=o;break;case"i32":T[i>>2]=o;break;case"i64":te("to do setValue(i64) use WASM_BIGINT");case"float":$[i>>2]=o;break;case"double":U[i>>3]=o;break;case"*":q[i>>2]=o;break;default:te(`invalid type for setValue: ${l}`)}}var Ce=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,K=(i,o,l)=>{var c=o+l;for(l=o;i[l]&&!(l>=c);)++l;if(16p?c+=String.fromCharCode(p):(p-=65536,c+=String.fromCharCode(55296|p>>10,56320|p&1023))}}else c+=String.fromCharCode(p)}return c},je=(i,o)=>{for(var l=0,c=i.length-1;0<=c;c--){var p=i[c];p==="."?i.splice(c,1):p===".."?(i.splice(c,1),l++):l&&(i.splice(c,1),l--)}if(o)for(;l;l--)i.unshift("..");return i},Ie=i=>{var o=i.charAt(0)==="/",l=i.substr(-1)==="/";return(i=je(i.split("/").filter(c=>!!c),!o).join("/"))||o||(i="."),i&&l&&(i+="/"),(o?"/":"")+i},ot=i=>{var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(i).slice(1);return i=o[0],o=o[1],!i&&!o?".":(o&&(o=o.substr(0,o.length-1)),i+o)},ze=i=>{if(i==="/")return"/";i=Ie(i),i=i.replace(/\/$/,"");var o=i.lastIndexOf("/");return o===-1?i:i.substr(o+1)},z=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return i=>crypto.getRandomValues(i);te("initRandomDevice")},Y=i=>(Y=z())(i);function oe(){for(var i="",o=!1,l=arguments.length-1;-1<=l&&!o;l--){if(o=0<=l?arguments[l]:"/",typeof o!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";i=o+"/"+i,o=o.charAt(0)==="/"}return i=je(i.split("/").filter(c=>!!c),!o).join("/"),(o?"/":"")+i||"."}var me=[],he=i=>{for(var o=0,l=0;l=c?o++:2047>=c?o+=2:55296<=c&&57343>=c?(o+=4,++l):o+=3}return o},ue=(i,o,l,c)=>{if(!(0=_){var k=i.charCodeAt(++g);_=65536+((_&1023)<<10)|k&1023}if(127>=_){if(l>=c)break;o[l++]=_}else{if(2047>=_){if(l+1>=c)break;o[l++]=192|_>>6}else{if(65535>=_){if(l+2>=c)break;o[l++]=224|_>>12}else{if(l+3>=c)break;o[l++]=240|_>>18,o[l++]=128|_>>12&63}o[l++]=128|_>>6&63}o[l++]=128|_&63}}return o[l]=0,l-p},We=[];function Te(i,o){We[i]={input:[],Ub:[],ec:o},ft(i,at)}var at={open(i){var o=We[i.node.ic];if(!o)throw new L(43);i.Vb=o,i.seekable=!1},close(i){i.Vb.ec.lc(i.Vb)},lc(i){i.Vb.ec.lc(i.Vb)},read(i,o,l,c){if(!i.Vb||!i.Vb.ec.Ac)throw new L(60);for(var p=0,g=0;g=o||(o=Math.max(o,l*(1048576>l?2:1.125)>>>0),l!=0&&(o=Math.max(o,256)),l=i.Qb,i.Qb=new Uint8Array(o),0=i.node.Sb)return 0;if(i=Math.min(i.node.Sb-p,c),8o)throw new L(28);return o},xc(i,o,l){gt(i.node,o+l),i.node.Sb=Math.max(i.node.Sb,o+l)},nc(i,o,l,c,p){if((i.node.mode&61440)!==32768)throw new L(43);if(i=i.node.Qb,p&2||i.buffer!==v.buffer){if((0{var l=0;return i&&(l|=365),o&&(l|=146),l},ut=null,Ot={},Me=[],Xr=1,Le=null,Tt=!0,L=null,ct={};function Ee(i,o={}){if(i=oe(i),!i)return{path:"",node:null};if(o=Object.assign({zc:!0,vc:0},o),8!!_);for(var l=ut,c="/",p=0;p>>0)%Le.length}function It(i){var o=dt(i.parent.id,i.name);if(Le[o]===i)Le[o]=i.dc;else for(o=Le[o];o;){if(o.dc===i){o.dc=i.dc;break}o=o.dc}}function Be(i,o){var l;if(l=(l=Qe(i,"x"))?l:i.Fb.fc?0:2)throw new L(l,i);for(l=Le[dt(i.id,o)];l;l=l.dc){var c=l.name;if(l.parent.id===i.id&&c===o)return l}return i.Fb.fc(i,o)}function St(i,o,l,c){return i=new Dr(i,o,l,c),o=dt(i.parent.id,i.name),i.dc=Le[o],Le[o]=i}function Ie(i){return(i&61440)===16384}function vt(i){var o=["r","w","rw"][i&3];return i&512&&(o+="w"),o}function Qe(i,o){if(Tt)return 0;if(!o.includes("r")||i.mode&292){if(o.includes("w")&&!(i.mode&146)||o.includes("x")&&!(i.mode&73))return 2}else return 2;return 0}function Ct(i,o){try{return Be(i,o),20}catch{}return Qe(i,"wx")}function Rt(i,o,l){try{var c=Be(i,o)}catch(p){return p.Rb}if(i=Qe(i,"wx"))return i;if(l){if(!Ie(c.mode))return 54;if(c===c.parent||Ke(c)==="/")return 10}else if(Ie(c.mode))return 31;return 0}function Yr(){for(var i=0;4096>=i;i++)if(!Me[i])return i;throw new L(33)}function we(i){if(i=Me[i],!i)throw new L(8);return i}function xt(i,o=-1){return Ve||(Ve=function(){this.kc={}},Ve.prototype={},Object.defineProperties(Ve.prototype,{object:{get(){return this.node},set(l){this.node=l}},flags:{get(){return this.kc.flags},set(l){this.kc.flags=l}},position:{get(){return this.kc.position},set(l){this.kc.position=l}}})),i=Object.assign(new Ve,i),o==-1&&(o=Yr()),i.Zb=o,Me[o]=i}var Zr={open(i){i.Pb=Ot[i.node.ic].Pb,i.Pb.open&&i.Pb.open(i)},bc(){throw new L(70)}};function ft(i,o){Ot[i]={Pb:o}}function kt(i,o){var l=o==="/",c=!o;if(l&&ut)throw new L(10);if(!l&&!c){var p=Ee(o,{zc:!1});if(o=p.path,p=p.node,p.cc)throw new L(10);if(!Ie(p.mode))throw new L(54)}o={type:i,ed:{},Cc:o,Oc:[]},i=i.Xb(o),i.Xb=o,o.root=i,l?ut=i:p&&(p.cc=o,p.Xb&&p.Xb.Oc.push(o))}function ht(i,o,l){var c=Ee(i,{parent:!0}).node;if(i=ze(i),!i||i==="."||i==="..")throw new L(28);var p=Ct(c,i);if(p)throw new L(p);if(!c.Fb.mc)throw new L(63);return c.Fb.mc(c,i,o,l)}function Re(i,o){return ht(i,(o!==void 0?o:511)&1023|16384,0)}function Ge(i,o,l){typeof l>"u"&&(l=o,o=438),ht(i,o|8192,l)}function pt(i,o){if(!oe(i))throw new L(44);var l=Ee(o,{parent:!0}).node;if(!l)throw new L(44);o=ze(o);var c=Ct(l,o);if(c)throw new L(c);if(!l.Fb.qc)throw new L(63);l.Fb.qc(l,o,i)}function At(i){var o=Ee(i,{parent:!0}).node;i=ze(i);var l=Be(o,i),c=Rt(o,i,!0);if(c)throw new L(c);if(!o.Fb.pc)throw new L(63);if(l.cc)throw new L(10);o.Fb.pc(o,i),It(l)}function Lt(i){if(i=Ee(i).node,!i)throw new L(44);if(!i.Fb.jc)throw new L(28);return oe(Ke(i.parent),i.Fb.jc(i))}function Xe(i,o){if(i=Ee(i,{ac:!o}).node,!i)throw new L(44);if(!i.Fb.Wb)throw new L(63);return i.Fb.Wb(i)}function qt(i){return Xe(i,!0)}function Dt(i,o){if(i=typeof i=="string"?Ee(i,{ac:!0}).node:i,!i.Fb.Tb)throw new L(63);i.Fb.Tb(i,{mode:o&4095|i.mode&-4096,timestamp:Date.now()})}function Wt(i,o){if(0>o)throw new L(28);if(i=typeof i=="string"?Ee(i,{ac:!0}).node:i,!i.Fb.Tb)throw new L(63);if(Ie(i.mode))throw new L(31);if((i.mode&61440)!==32768)throw new L(28);var l=Qe(i,"w");if(l)throw new L(l);i.Fb.Tb(i,{size:o,timestamp:Date.now()})}function Ye(i,o,l){if(i==="")throw new L(44);if(typeof o=="string"){var c={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[o];if(typeof c>"u")throw Error(`Unknown file open mode: ${o}`);o=c}if(l=o&64?(typeof l>"u"?438:l)&4095|32768:0,typeof i=="object")var p=i;else{i=Se(i);try{p=Ee(i,{ac:!(o&131072)}).node}catch{}}if(c=!1,o&64)if(p){if(o&128)throw new L(20)}else p=ht(i,l,0),c=!0;if(!p)throw new L(44);if((p.mode&61440)===8192&&(o&=-513),o&65536&&!Ie(p.mode))throw new L(54);if(!c&&(l=p?(p.mode&61440)===40960?32:Ie(p.mode)&&(vt(o)!=="r"||o&512)?31:Qe(p,vt(o)):44))throw new L(l);return o&512&&!c&&Wt(p,0),o&=-131713,p=xt({node:p,path:Ke(p),flags:o,seekable:!0,position:0,Pb:p.Pb,Uc:[],error:!1}),p.Pb.open&&p.Pb.open(p),!r.logReadFiles||o&1||(Ze||(Ze={}),i in Ze||(Ze[i]=1)),p}function Bt(i,o,l){if(i.Zb===null)throw new L(8);if(!i.seekable||!i.Pb.bc)throw new L(70);if(l!=0&&l!=1&&l!=2)throw new L(28);i.position=i.Pb.bc(i,o,l),i.Uc=[]}function Ft(){L||(L=function(i,o){this.name="ErrnoError",this.node=o,this.Sc=function(l){this.Rb=l},this.Sc(i),this.message="FS error"},L.prototype=Error(),L.prototype.constructor=L,[44].forEach(i=>{ct[i]=new L(i),ct[i].stack=""}))}var Pt;function $e(i,o,l){i=Se("/dev/"+i);var c=Gr(!!o,!!l);mt||(mt=64);var p=mt++<<8|0;ft(p,{open(g){g.seekable=!1},close(){l&&l.buffer&&l.buffer.length&&l(10)},read(g,_,k,O){for(var S=0,D=0;D>2]=c.Kc,T[l+4>>2]=c.mode,q[l+8>>2]=c.Qc,T[l+12>>2]=c.uid,T[l+16>>2]=c.Nc,T[l+20>>2]=c.ic,ne=[c.size>>>0,(U=c.size,1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[l+24>>2]=ne[0],T[l+28>>2]=ne[1],T[l+32>>2]=4096,T[l+36>>2]=c.Ic,i=c.Gc.getTime(),o=c.Pc.getTime();var p=c.Jc.getTime();return ne=[Math.floor(i/1e3)>>>0,(U=Math.floor(i/1e3),1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[l+40>>2]=ne[0],T[l+44>>2]=ne[1],q[l+48>>2]=i%1e3*1e3,ne=[Math.floor(o/1e3)>>>0,(U=Math.floor(o/1e3),1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[l+56>>2]=ne[0],T[l+60>>2]=ne[1],q[l+64>>2]=o%1e3*1e3,ne=[Math.floor(p/1e3)>>>0,(U=Math.floor(p/1e3),1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[l+72>>2]=ne[0],T[l+76>>2]=ne[1],q[l+80>>2]=p%1e3*1e3,ne=[c.Bc>>>0,(U=c.Bc,1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[l+88>>2]=ne[0],T[l+92>>2]=ne[1],0}var tt=void 0;function rt(){var i=T[tt>>2];return tt+=4,i}var Je=(i,o)=>o+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*o:NaN,en=[0,31,60,91,121,152,182,213,244,274,305,335],tn=[0,31,59,90,120,151,181,212,243,273,304,334],zt=i=>{var o=he(i)+1,l=Et(o);return l&&ue(i,C,l,o),l},Nt={},Qt=()=>{if(!yt){var i={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"},o;for(o in Nt)Nt[o]===void 0?delete i[o]:i[o]=Nt[o];var l=[];for(o in i)l.push(`${o}=${i[o]}`);yt=l}return yt},yt;function Ut(){}function Mt(){}function $t(){}function Vt(){}function Jt(){}function Ht(){}function jt(){}function Kt(){}function Gt(){}function Xt(){}function Yt(){}function Zt(){}function er(){}function tr(){}function rr(){}function nr(){}function ir(){}function sr(){}function or(){}function ar(){}function lr(){}function ur(){}function cr(){}function dr(){}function fr(){}function hr(){}function pr(){}function mr(){}function Nr(){}function yr(){}function br(){}function wr(){}function Er(){}function _r(){}function gr(){}function Or(){}function Tr(){}function Ir(){}function Sr(){}function vr(){}var Cr=i=>{E=i,h||0{i instanceof He||i=="unwind"||d(1,i)},nt=i=>{try{i()}catch(o){te(o)}};function rn(i){var o={},l;for(l in i)(function(c){var p=i[c];o[c]=typeof p=="function"?function(){it.push(c);try{return p.apply(null,arguments)}finally{m||(it.pop()===c||te(),xe&&qe===1&&it.length===0&&(qe=0,nt($r),typeof Fibers<"u"&&Fibers.fd()))}}:p})(l);return o}var qe=0,xe=null,Rr=0,it=[],xr={},kr={},nn=0,wt=null,sn=[];function on(){return new Promise((i,o)=>{wt={resolve:i,reject:o}})}function an(){var i=Et(16396),o=i+12;q[i>>2]=o,q[i+4>>2]=o+16384,o=it[0];var l=xr[o];return l===void 0&&(l=nn++,xr[o]=l,kr[l]=o),T[i+8>>2]=l,i}function Ar(i){if(!m){if(qe===0){var o=!1,l=!1;i((c=0)=>{if(!m&&(Rr=c,o=!0,l)){qe=2,nt(()=>Vr(xe)),typeof Browser<"u"&&Browser.tc.Mc&&Browser.tc.resume(),c=!1;try{var p=(0,F[kr[T[xe+8>>2]]])()}catch(k){p=k,c=!0}var g=!1;if(!xe){var _=wt;_&&(wt=null,(c?_.reject:_.resolve)(p),g=!0)}if(c&&!g)throw p}}),l=!0,o||(qe=1,xe=an(),typeof Browser<"u"&&Browser.tc.Mc&&Browser.tc.pause(),nt(()=>Mr(xe)))}else qe===2?(qe=0,nt(Jr),Br(xe),xe=null,sn.forEach(c=>{if(!m)try{if(c(),!(h||0{i().then(o)})}var qr={},ve=(i,o,l,c,p)=>{function g(x){return--me,O!==0&&Ur(O),o==="string"?x?j(C,x):"":o==="boolean"?!!x:x}var _={string:x=>{var B=0;if(x!=null&&x!==0){B=he(x)+1;var H=_t(B);ue(x,C,H,B),B=H}return B},array:x=>{var B=_t(x.length);return v.set(x,B),B}};i=r["_"+i];var k=[],O=0;if(c)for(var S=0;S0,write:(c,p,g,_)=>_}),Ge("/dev/null",259),Te(1280,lt),Te(1536,Kr),Ge("/dev/tty",1280),Ge("/dev/tty1",1536);var i=new Uint8Array(1024),o=0,l=()=>(o===0&&(o=Z(i).byteLength),i[--o]);$e("random",l),$e("urandom",l),Re("/dev/shm"),Re("/dev/shm/tmp")}(),function(){Re("/proc");var i=Re("/proc/self");Re("/proc/self/fd"),kt({Xb(){var o=St(i,"fd",16895,73);return o.Fb={fc(l,c){var p=we(+c);return l={parent:null,Xb:{Cc:"fake"},Fb:{jc:()=>p.path}},l.parent=l}},o}},"/proc/self/fd")}(),function(){const i=new Map;r.setAuthorizer=function(o,l,c){return l?i.set(o,{f:l,wc:c}):i.delete(o),ve("set_authorizer","number",["number"],[o])},Ut=function(o,l,c,p,g,_){if(i.has(o)){const{f:k,wc:O}=i.get(o);return k(O,l,c?c?j(C,c):"":null,p?p?j(C,p):"":null,g?g?j(C,g):"":null,_?_?j(C,_):"":null)}return 0}}(),function(){function i(c,p){const g=[];for(let _=0;c[p+_]!=0;++_){if(1e3<_)throw Error("C-string never terminated after 1k characters");g.push(c[p+_])}return String.fromCharCode(...g)}const o=new Map,l=new Map;r.updateHook=function(c,p){const g=o.size;return o.set(g,p),ve("update_hook","void",["number","number"],[c,g])},r.createFunction=function(c,p,g,_,k,O){const S=o.size;return o.set(S,{f:O,$b:k}),ve("create_function","number","number string number number number number".split(" "),[c,p,g,_,S,0])},r.createAggregate=function(c,p,g,_,k,O,S){const D=o.size;return o.set(D,{step:O,Lc:S,$b:k}),ve("create_function","number","number string number number number number".split(" "),[c,p,g,_,D,1])},r.getFunctionUserData=function(c){return l.get(c)},Ht=function(c,p,g,_,k,O){c=o.get(c);const S=C;k=BigInt(O)<<32n|BigInt(k)&4294967295n,c(p,i(S,g),i(S,_),k)},$t=function(c,p,g,_){c=o.get(c),l.set(p,c.$b),c.f(p,new Uint32Array(C.buffer,_,g)),l.delete(p)},Jt=function(c,p,g,_){c=o.get(c),l.set(p,c.$b),c.step(p,new Uint32Array(C.buffer,_,g)),l.delete(p)},Mt=function(c,p){c=o.get(c),l.set(p,c.$b),c.Lc(p),l.delete(p)}}(),function(){const i=new Map;r.progressHandler=function(o,l,c,p){return c?i.set(o,{f:c,wc:p}):i.delete(o),ve("progress_handler",null,["number","number"],[o,l])},Vt=function(o){if(i.has(o)){const{f:l,wc:c}=i.get(o);return l(c)}return 0}}(),function(){function i(O,S){const D=`get${O}`,x=`set${O}`;return new Proxy(new DataView(C.buffer,S,O==="Int32"?4:8),{get(B,H){if(H===D)return function(ee,fe){if(!fe)throw Error("must be little endian");return B[H](ee,fe)};if(H===x)return function(ee,fe,ce){if(!ce)throw Error("must be little endian");return B[H](ee,fe,ce)};if(typeof H=="string"&&H.match(/^(get)|(set)/))throw Error("invalid type");return B[H]}})}const o=typeof qr=="object",l=new Map,c=new Map,p=new Map,g=o?new Set:null,_=o?new Set:null,k=new Map;cr=function(O,S,D,x){k.set(O?j(C,O):"",{size:S,hc:Array.from(new Uint32Array(C.buffer,x,D))})},r.createModule=function(O,S,D,x){o&&(D.handleAsync=Lr);const B=l.size;return l.set(B,{module:D,$b:x}),x=0,D.xCreate&&(x|=1),D.xConnect&&(x|=2),D.xBestIndex&&(x|=4),D.xDisconnect&&(x|=8),D.xDestroy&&(x|=16),D.xOpen&&(x|=32),D.xClose&&(x|=64),D.xFilter&&(x|=128),D.xNext&&(x|=256),D.xEof&&(x|=512),D.xColumn&&(x|=1024),D.xRowid&&(x|=2048),D.xUpdate&&(x|=4096),D.xBegin&&(x|=8192),D.xSync&&(x|=16384),D.xCommit&&(x|=32768),D.xRollback&&(x|=65536),D.xFindFunction&&(x|=131072),D.xRename&&(x|=262144),ve("create_module","number",["number","string","number","number"],[O,S,B,x])},er=function(O,S,D,x,B,H){if(S=l.get(S),c.set(B,S),o){g.delete(B);for(const ee of g)c.delete(ee)}return x=Array.from(new Uint32Array(C.buffer,x,D)).map(ee=>ee?j(C,ee):""),S.module.xCreate(O,S.$b,x,B,i("Int32",H))},Zt=function(O,S,D,x,B,H){if(S=l.get(S),c.set(B,S),o){g.delete(B);for(const ee of g)c.delete(ee)}return x=Array.from(new Uint32Array(C.buffer,x,D)).map(ee=>ee?j(C,ee):""),S.module.xConnect(O,S.$b,x,B,i("Int32",H))},Kt=function(O,S){var D=c.get(O),x=k.get("sqlite3_index_info").hc;const B={};B.nConstraint=se(S+x[0],"i32"),B.aConstraint=[];for(var H=se(S+x[1],"*"),ee=k.get("sqlite3_index_constraint").size,fe=0;fe>=2,q[_]+q[_+1]*2**32}const l=typeof qr=="object",c=new Map,p=new Map;r.registerVFS=function(_,k){if(ve("sqlite3_vfs_find","number",["string"],[_.name]))throw Error(`VFS '${_.name}' already registered`);l&&(_.handleAsync=Lr);var O=_.dd??64;const S=r._malloc(4);return k=ve("register_vfs","number",["string","number","number","number"],[_.name,O,k?1:0,S]),k||(O=se(S,"*"),c.set(O,_)),r._free(S),k};const g=l?new Set:null;mr=function(_){const k=p.get(_);return l?g.add(_):p.delete(_),k.xClose(_)},gr=function(_,k,O,S){return p.get(_).xRead(_,C.subarray(k,k+O),o(S))},vr=function(_,k,O,S){return p.get(_).xWrite(_,C.subarray(k,k+O),o(S))},Ir=function(_,k){return p.get(_).xTruncate(_,o(k))},Tr=function(_,k){return p.get(_).xSync(_,k)},wr=function(_,k){const O=p.get(_);return k=i("BigInt64",k),O.xFileSize(_,k)},Er=function(_,k){return p.get(_).xLock(_,k)},Sr=function(_,k){return p.get(_).xUnlock(_,k)},pr=function(_,k){const O=p.get(_);return k=i("Int32",k),O.xCheckReservedLock(_,k)},br=function(_,k,O){const S=p.get(_);return O=new DataView(C.buffer,O),S.xFileControl(_,k,O)},Or=function(_){return p.get(_).xSectorSize(_)},yr=function(_){return p.get(_).xDeviceCharacteristics(_)},_r=function(_,k,O,S,D){if(_=c.get(_),p.set(O,_),l){g.delete(O);for(var x of g)p.delete(x)}if(x=null,S&64){x=1;const B=[];for(;x;){const H=C[k++];if(H)B.push(H);else switch(C[k]||(x=null),x){case 1:B.push(63),x=2;break;case 2:B.push(61),x=3;break;case 3:B.push(38),x=2}}x=new TextDecoder().decode(new Uint8Array(B))}else k&&(x=k?j(C,k):"");return D=i("Int32",D),_.xOpen(x,O,S,D)},Nr=function(_,k,O){return c.get(_).xDelete(k?j(C,k):"",O)},hr=function(_,k,O,S){return _=c.get(_),S=i("Int32",S),_.xAccess(k?j(C,k):"",O,S)}}();var ln={a:(i,o,l,c)=>{te(`Assertion failed: ${i?j(C,i):""}, at: `+[o?o?j(C,o):"":"unknown filename",l,c?c?j(C,c):"":"unknown function"])},L:function(i,o){try{return i=i?j(C,i):"",Dt(i,o),0}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return-l.Rb}},N:function(i,o,l){try{if(o=o?j(C,o):"",o=Fe(i,o),l&-8)return-28;var c=Ee(o,{ac:!0}).node;return c?(i="",l&4&&(i+="r"),l&2&&(i+="w"),l&1&&(i+="x"),i&&Qe(c,i)?-2:0):-44}catch(p){if(typeof ie>"u"||p.name!=="ErrnoError")throw p;return-p.Rb}},M:function(i,o){try{var l=we(i);return Dt(l.node,o),0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},K:function(i){try{var o=we(i).node,l=typeof o=="string"?Ee(o,{ac:!0}).node:o;if(!l.Fb.Tb)throw new L(63);return l.Fb.Tb(l,{timestamp:Date.now()}),0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},b:function(i,o,l){tt=l;try{var c=we(i);switch(o){case 0:var p=rt();if(0>p)return-28;for(;Me[p];)p++;return xt(c,p).Zb;case 1:case 2:return 0;case 3:return c.flags;case 4:return p=rt(),c.flags|=p,0;case 5:return p=rt(),$[p+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return T[Wr()>>2]=28,-1;default:return-28}}catch(g){if(typeof ie>"u"||g.name!=="ErrnoError")throw g;return-g.Rb}},J:function(i,o){try{var l=we(i);return et(Xe,l.path,o)}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},n:function(i,o,l){o=Je(o,l);try{if(isNaN(o))return 61;var c=we(i);if(!(c.flags&2097155))throw new L(28);return Wt(c.node,o),0}catch(p){if(typeof ie>"u"||p.name!=="ErrnoError")throw p;return-p.Rb}},D:function(i,o){try{if(o===0)return-28;var l=he("/")+1;return o"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},G:function(i,o){try{return i=i?j(C,i):"",et(qt,i,o)}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return-l.Rb}},A:function(i,o,l){try{return o=o?j(C,o):"",o=Fe(i,o),o=Se(o),o[o.length-1]==="/"&&(o=o.substr(0,o.length-1)),Re(o,l),0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},F:function(i,o,l,c){try{o=o?j(C,o):"";var p=c&256;return o=Fe(i,o,c&4096),et(p?qt:Xe,o,l)}catch(g){if(typeof ie>"u"||g.name!=="ErrnoError")throw g;return-g.Rb}},z:function(i,o,l,c){tt=c;try{o=o?j(C,o):"",o=Fe(i,o);var p=c?rt():0;return Ye(o,l,p).Zb}catch(g){if(typeof ie>"u"||g.name!=="ErrnoError")throw g;return-g.Rb}},w:function(i,o,l,c){try{if(o=o?j(C,o):"",o=Fe(i,o),0>=c)return-28;var p=Lt(o),g=Math.min(c,he(p)),_=v[l+g];return ue(p,C,l,c+1),v[l+g]=_,g}catch(k){if(typeof ie>"u"||k.name!=="ErrnoError")throw k;return-k.Rb}},v:function(i){try{return i=i?j(C,i):"",At(i),0}catch(o){if(typeof ie>"u"||o.name!=="ErrnoError")throw o;return-o.Rb}},H:function(i,o){try{return i=i?j(C,i):"",et(Xe,i,o)}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return-l.Rb}},r:function(i,o,l){try{if(o=o?j(C,o):"",o=Fe(i,o),l===0){i=o;var c=Ee(i,{parent:!0}).node;if(!c)throw new L(44);var p=ze(i),g=Be(c,p),_=Rt(c,p,!1);if(_)throw new L(_);if(!c.Fb.rc)throw new L(63);if(g.cc)throw new L(10);c.Fb.rc(c,p),It(g)}else l===512?At(o):te("Invalid flags passed to unlinkat");return 0}catch(k){if(typeof ie>"u"||k.name!=="ErrnoError")throw k;return-k.Rb}},q:function(i,o,l){try{if(o=o?j(C,o):"",o=Fe(i,o,!0),l){var c=q[l>>2]+4294967296*T[l+4>>2],p=T[l+8>>2];g=1e3*c+p/1e6,l+=16,c=q[l>>2]+4294967296*T[l+4>>2],p=T[l+8>>2],_=1e3*c+p/1e6}else var g=Date.now(),_=g;i=g;var k=Ee(o,{ac:!0}).node;return k.Fb.Tb(k,{timestamp:Math.max(i,_)}),0}catch(O){if(typeof ie>"u"||O.name!=="ErrnoError")throw O;return-O.Rb}},k:function(i,o,l){i=new Date(1e3*Je(i,o)),T[l>>2]=i.getSeconds(),T[l+4>>2]=i.getMinutes(),T[l+8>>2]=i.getHours(),T[l+12>>2]=i.getDate(),T[l+16>>2]=i.getMonth(),T[l+20>>2]=i.getFullYear()-1900,T[l+24>>2]=i.getDay(),o=i.getFullYear(),T[l+28>>2]=(o%4!==0||o%100===0&&o%400!==0?tn:en)[i.getMonth()]+i.getDate()-1|0,T[l+36>>2]=-(60*i.getTimezoneOffset()),o=new Date(i.getFullYear(),6,1).getTimezoneOffset();var c=new Date(i.getFullYear(),0,1).getTimezoneOffset();T[l+32>>2]=(o!=c&&i.getTimezoneOffset()==Math.min(c,o))|0},i:function(i,o,l,c,p,g,_,k){p=Je(p,g);try{if(isNaN(p))return 61;var O=we(c);if(o&2&&!(l&2)&&(O.flags&2097155)!==2)throw new L(2);if((O.flags&2097155)===1)throw new L(2);if(!O.Pb.nc)throw new L(43);var S=O.Pb.nc(O,i,p,o,l),D=S.Rc;return T[_>>2]=S.Fc,q[k>>2]=D,0}catch(x){if(typeof ie>"u"||x.name!=="ErrnoError")throw x;return-x.Rb}},j:function(i,o,l,c,p,g,_){g=Je(g,_);try{if(isNaN(g))return 61;var k=we(p);if(l&2){if((k.node.mode&61440)!==32768)throw new L(43);c&2||k.Pb.oc&&k.Pb.oc(k,C.slice(i,i+o),g,o,c)}}catch(O){if(typeof ie>"u"||O.name!=="ErrnoError")throw O;return-O.Rb}},s:(i,o,l)=>{function c(O){return(O=O.toTimeString().match(/\(([A-Za-z ]+)\)$/))?O[1]:"GMT"}var p=new Date().getFullYear(),g=new Date(p,0,1),_=new Date(p,6,1);p=g.getTimezoneOffset();var k=_.getTimezoneOffset();q[i>>2]=60*Math.max(p,k),T[o>>2]=+(p!=k),i=c(g),o=c(_),i=zt(i),o=zt(o),k>2]=i,q[l+4>>2]=o):(q[l>>2]=o,q[l+4>>2]=i)},e:()=>Date.now(),d:()=>performance.now(),t:(i,o,l)=>C.copyWithin(i,o,o+l),o:i=>{var o=C.length;if(i>>>=0,2147483648=l;l*=2){var c=o*(1+.2/l);c=Math.min(c,i+100663296);var p=Math;c=Math.max(i,c);e:{p=(p.min.call(p,2147483648,c+(65536-c%65536)%65536)-N.buffer.byteLength+65535)/65536;try{N.grow(p),M();var g=1;break e}catch{}g=void 0}if(g)return!0}return!1},B:(i,o)=>{var l=0;return Qt().forEach((c,p)=>{var g=o+l;for(p=q[i+4*p>>2]=g,g=0;g>0]=c.charCodeAt(g);v[p>>0]=0,l+=c.length+1}),0},C:(i,o)=>{var l=Qt();q[i>>2]=l.length;var c=0;return l.forEach(p=>c+=p.length+1),q[o>>2]=c,0},f:function(i){try{var o=we(i);if(o.Zb===null)throw new L(8);o.sc&&(o.sc=null);try{o.Pb.close&&o.Pb.close(o)}catch(l){throw l}finally{Me[o.Zb]=null}return o.Zb=null,0}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return l.Rb}},p:function(i,o){try{var l=we(i);return v[o>>0]=l.Vb?2:Ie(l.mode)?3:(l.mode&61440)===40960?7:4,$[o+2>>1]=0,ne=[0,(U=0,1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[o+8>>2]=ne[0],T[o+12>>2]=ne[1],ne=[0,(U=0,1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[o+16>>2]=ne[0],T[o+20>>2]=ne[1],0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return c.Rb}},y:function(i,o,l,c){try{e:{var p=we(i);i=o;for(var g,_=o=0;_>2],O=q[i+4>>2];i+=8;var S=p,D=k,x=O,B=g,H=v;if(0>x||0>B)throw new L(28);if(S.Zb===null)throw new L(8);if((S.flags&2097155)===1)throw new L(8);if(Ie(S.node.mode))throw new L(31);if(!S.Pb.read)throw new L(28);var ee=typeof B<"u";if(!ee)B=S.position;else if(!S.seekable)throw new L(70);var fe=S.Pb.read(S,H,D,x,B);ee||(S.position+=fe);var ce=fe;if(0>ce){var _e=-1;break e}if(o+=ce,ce>2]=_e,0}catch(pe){if(typeof ie>"u"||pe.name!=="ErrnoError")throw pe;return pe.Rb}},l:function(i,o,l,c,p){o=Je(o,l);try{if(isNaN(o))return 61;var g=we(i);return Bt(g,o,c),ne=[g.position>>>0,(U=g.position,1<=+Math.abs(U)?0>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],T[p>>2]=ne[0],T[p+4>>2]=ne[1],g.sc&&o===0&&c===0&&(g.sc=null),0}catch(_){if(typeof ie>"u"||_.name!=="ErrnoError")throw _;return _.Rb}},E:function(i){try{var o=we(i);return Ar(l=>{var c=o.node.Xb;c.type.Tc?c.type.Tc(c,!1,p=>{l(p?29:0)}):l(0)})}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return l.Rb}},u:function(i,o,l,c){try{e:{var p=we(i);i=o;for(var g,_=o=0;_>2],O=q[i+4>>2];i+=8;var S=p,D=k,x=O,B=g,H=v;if(0>x||0>B)throw new L(28);if(S.Zb===null)throw new L(8);if(!(S.flags&2097155))throw new L(8);if(Ie(S.node.mode))throw new L(31);if(!S.Pb.write)throw new L(28);S.seekable&&S.flags&1024&&Bt(S,0,2);var ee=typeof B<"u";if(!ee)B=S.position;else if(!S.seekable)throw new L(70);var fe=S.Pb.write(S,H,D,x,B,void 0);ee||(S.position+=fe);var ce=fe;if(0>ce){var _e=-1;break e}o+=ce,typeof g<"u"&&(g+=ce)}_e=o}return q[c>>2]=_e,0}catch(pe){if(typeof ie>"u"||pe.name!=="ErrnoError")throw pe;return pe.Rb}},ta:Ut,P:Mt,ia:$t,da:Vt,_:Jt,I:Ht,ma:jt,x:Kt,g:Gt,pa:Xt,ka:Yt,fa:Zt,ga:er,h:tr,m:rr,qa:nr,sa:ir,ra:sr,ea:or,ha:ar,ja:lr,oa:ur,c:cr,la:dr,na:fr,ba:hr,W:pr,aa:mr,ca:Nr,T:yr,V:br,Z:wr,Y:Er,S:_r,R:gr,U:Or,$:Tr,O:Ir,X:Sr,Q:vr},F=function(){function i(l){if(l=l.exports,F=l=rn(l),N=F.ua,M(),V.unshift(F.va),P--,r.monitorRunDependencies&&r.monitorRunDependencies(P),P==0&&J){var c=J;J=null,c()}return l}var o={a:ln};if(P++,r.monitorRunDependencies&&r.monitorRunDependencies(P),r.instantiateWasm)try{return r.instantiateWasm(o,i)}catch(l){R(`Module.instantiateWasm callback failed with error: ${l}`),s(l)}return Ae(o,function(l){i(l.instance)}).catch(s),{}}();r._sqlite3_step=i=>(r._sqlite3_step=F.wa)(i),r._sqlite3_malloc=i=>(r._sqlite3_malloc=F.xa)(i),r._sqlite3_free=i=>(r._sqlite3_free=F.ya)(i),r._sqlite3_bind_blob=(i,o,l,c,p)=>(r._sqlite3_bind_blob=F.za)(i,o,l,c,p),r._sqlite3_bind_int=(i,o,l)=>(r._sqlite3_bind_int=F.Aa)(i,o,l),r._sqlite3_bind_int64=(i,o,l,c)=>(r._sqlite3_bind_int64=F.Ba)(i,o,l,c),r._sqlite3_bind_double=(i,o,l)=>(r._sqlite3_bind_double=F.Ca)(i,o,l),r._sqlite3_bind_null=(i,o)=>(r._sqlite3_bind_null=F.Da)(i,o),r._sqlite3_clear_bindings=i=>(r._sqlite3_clear_bindings=F.Ea)(i),r._sqlite3_bind_text=(i,o,l,c,p)=>(r._sqlite3_bind_text=F.Fa)(i,o,l,c,p),r._sqlite3_close=i=>(r._sqlite3_close=F.Ga)(i),r._sqlite3_column_type=(i,o)=>(r._sqlite3_column_type=F.Ha)(i,o),r._sqlite3_column_count=i=>(r._sqlite3_column_count=F.Ia)(i),r._sqlite3_column_text=(i,o)=>(r._sqlite3_column_text=F.Ja)(i,o),r._sqlite3_column_blob=(i,o)=>(r._sqlite3_column_blob=F.Ka)(i,o),r._sqlite3_column_bytes=(i,o)=>(r._sqlite3_column_bytes=F.La)(i,o),r._sqlite3_column_double=(i,o)=>(r._sqlite3_column_double=F.Ma)(i,o),r._sqlite3_column_int=(i,o)=>(r._sqlite3_column_int=F.Na)(i,o),r._sqlite3_column_int64=(i,o)=>(r._sqlite3_column_int64=F.Oa)(i,o),r._sqlite3_column_name=(i,o)=>(r._sqlite3_column_name=F.Pa)(i,o),r._sqlite3_declare_vtab=(i,o)=>(r._sqlite3_declare_vtab=F.Qa)(i,o),r._sqlite3_errmsg=i=>(r._sqlite3_errmsg=F.Ra)(i),r._sqlite3_exec=(i,o,l,c,p)=>(r._sqlite3_exec=F.Sa)(i,o,l,c,p),r._sqlite3_finalize=i=>(r._sqlite3_finalize=F.Ta)(i),r._sqlite3_prepare_v2=(i,o,l,c,p)=>(r._sqlite3_prepare_v2=F.Ua)(i,o,l,c,p),r._sqlite3_result_int=(i,o)=>(r._sqlite3_result_int=F.Va)(i,o),r._sqlite3_result_blob=(i,o,l,c)=>(r._sqlite3_result_blob=F.Wa)(i,o,l,c),r._sqlite3_result_int64=(i,o,l)=>(r._sqlite3_result_int64=F.Xa)(i,o,l),r._sqlite3_result_double=(i,o)=>(r._sqlite3_result_double=F.Ya)(i,o),r._sqlite3_result_null=i=>(r._sqlite3_result_null=F.Za)(i),r._sqlite3_result_error=(i,o,l)=>(r._sqlite3_result_error=F._a)(i,o,l),r._sqlite3_result_text=(i,o,l,c)=>(r._sqlite3_result_text=F.$a)(i,o,l,c),r._sqlite3_sql=i=>(r._sqlite3_sql=F.ab)(i),r._sqlite3_reset=i=>(r._sqlite3_reset=F.bb)(i),r._sqlite3_value_text=i=>(r._sqlite3_value_text=F.cb)(i),r._sqlite3_value_type=i=>(r._sqlite3_value_type=F.db)(i),r._sqlite3_value_bytes=i=>(r._sqlite3_value_bytes=F.eb)(i),r._sqlite3_value_blob=i=>(r._sqlite3_value_blob=F.fb)(i),r._sqlite3_value_int=i=>(r._sqlite3_value_int=F.gb)(i),r._sqlite3_value_int64=i=>(r._sqlite3_value_int64=F.hb)(i),r._sqlite3_value_double=i=>(r._sqlite3_value_double=F.ib)(i),r._sqlite3_get_autocommit=i=>(r._sqlite3_get_autocommit=F.jb)(i),r._sqlite3_vfs_find=i=>(r._sqlite3_vfs_find=F.kb)(i),r._sqlite3_data_count=i=>(r._sqlite3_data_count=F.lb)(i),r._sqlite3_bind_parameter_count=i=>(r._sqlite3_bind_parameter_count=F.mb)(i),r._sqlite3_bind_parameter_name=(i,o)=>(r._sqlite3_bind_parameter_name=F.nb)(i,o),r._sqlite3_libversion=()=>(r._sqlite3_libversion=F.ob)(),r._sqlite3_libversion_number=()=>(r._sqlite3_libversion_number=F.pb)(),r._sqlite3_changes=i=>(r._sqlite3_changes=F.qb)(i),r._sqlite3_limit=(i,o,l)=>(r._sqlite3_limit=F.rb)(i,o,l),r._sqlite3_open_v2=(i,o,l,c)=>(r._sqlite3_open_v2=F.sb)(i,o,l,c);var Wr=()=>(Wr=F.tb)(),Et=r._malloc=i=>(Et=r._malloc=F.ub)(i),Br=r._free=i=>(Br=r._free=F.vb)(i);r._RegisterExtensionFunctions=i=>(r._RegisterExtensionFunctions=F.wb)(i),r._set_authorizer=i=>(r._set_authorizer=F.xb)(i),r._create_function=(i,o,l,c,p,g)=>(r._create_function=F.yb)(i,o,l,c,p,g),r._update_hook=(i,o)=>(r._update_hook=F.zb)(i,o),r._create_module=(i,o,l,c)=>(r._create_module=F.Ab)(i,o,l,c),r._progress_handler=(i,o)=>(r._progress_handler=F.Bb)(i,o),r._register_vfs=(i,o,l,c)=>(r._register_vfs=F.Cb)(i,o,l,c),r._getSqliteFree=()=>(r._getSqliteFree=F.Db)();var Fr=r._main=(i,o)=>(Fr=r._main=F.Eb)(i,o),Pr=(i,o)=>(Pr=F.Gb)(i,o),zr=()=>(zr=F.Hb)(),Qr=()=>(Qr=F.Ib)(),Ur=i=>(Ur=F.Jb)(i),_t=i=>(_t=F.Kb)(i),Mr=i=>(Mr=F.Lb)(i),$r=()=>($r=F.Mb)(),Vr=i=>(Vr=F.Nb)(i),Jr=()=>(Jr=F.Ob)();r.getTempRet0=zr,r.ccall=ve,r.cwrap=(i,o,l,c)=>{var p=!l||l.every(g=>g==="number"||g==="boolean");return o!=="string"&&p&&!c?r["_"+i]:function(){return ve(i,o,l,arguments,c)}},r.setValue=de,r.getValue=se,r.UTF8ToString=(i,o)=>i?j(C,i,o):"",r.stringToUTF8=(i,o,l)=>ue(i,C,o,l),r.lengthBytesUTF8=he;var st;J=function i(){st||Hr(),st||(J=i)};function Hr(){function i(){if(!st&&(st=!0,r.calledRun=!0,!m)){if(r.noFSInit||Pt||(Pt=!0,Ft(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?$e("stdin",r.stdin):pt("/dev/tty","/dev/stdin"),r.stdout?$e("stdout",null,r.stdout):pt("/dev/tty","/dev/stdout"),r.stderr?$e("stderr",null,r.stderr):pt("/dev/tty1","/dev/stderr"),Ye("/dev/stdin",0),Ye("/dev/stdout",1),Ye("/dev/stderr",1)),Tt=!1,Pe(V),Pe(ae),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),jr){var o=Fr;try{var l=o(0,0);E=l,Cr(l)}catch(c){bt(c)}}if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)o=r.postRun.shift(),G.unshift(o);Pe(G)}}if(!(0>32n,N=BigInt(Number.MIN_SAFE_INTEGER)>>32n;return function(m,E){return E>h||E2147483647||v<-2147483648)return SQLITE_RANGE;const C=N(m,E,v);return I(h,C,b.get(m))}}(),e.bind_int64=function(){const h="sqlite3_bind_int64",N=t.cwrap(h,...decl("nnnn:n"));return function(m,E,v){if(w(m),v>MAX_INT64||v>32n,T=N(m,E,Number(C),Number($));return I(h,T,b.get(m))}}(),e.bind_null=function(){const h="sqlite3_bind_null",N=t.cwrap(h,...decl("nn:n"));return function(m,E){w(m);const v=N(m,E);return I(h,v,b.get(m))}}(),e.bind_parameter_name=function(){const N=t.cwrap("sqlite3_bind_parameter_name",...decl("n:s"));return function(m,E){return w(m),N(m,E)}}(),e.bind_text=function(){const h="sqlite3_bind_text",N=t.cwrap(h,...decl("nnnnn:n"));return function(m,E,v){w(m);const C=a(v),$=N(m,E,C,-1,r);return I(h,$,b.get(m))}}(),e.changes=function(){const N=t.cwrap("sqlite3_changes",...decl("n:n"));return function(m){return y(m),N(m)}}(),e.close=function(){const h="sqlite3_close",N=t.cwrap(h,...decl("n:n"),{async});return async function(m){y(m);const E=await N(m);return f.delete(m),I(h,E,m)}}(),e.column=function(h,N){w(h);const m=e.column_type(h,N);switch(m){case SQLITE_BLOB:return e.column_blob(h,N);case SQLITE_FLOAT:return e.column_double(h,N);case SQLITE_INTEGER:const E=e.column_int(h,N),v=t.getTempRet0();return d(E,v);case SQLITE_NULL:return null;case SQLITE_TEXT:return e.column_text(h,N);default:throw new SQLiteError("unknown type",m)}},e.column_blob=function(){const N=t.cwrap("sqlite3_column_blob",...decl("nn:n"));return function(m,E){w(m);const v=e.column_bytes(m,E),C=N(m,E),$=t.HEAPU8.subarray(C,C+v),T=new ArrayBuffer($.byteLength),q=new Uint8Array(T);return q.set($),q}}(),e.column_bytes=function(){const N=t.cwrap("sqlite3_column_bytes",...decl("nn:n"));return function(m,E){return w(m),N(m,E)}}(),e.column_count=function(){const N=t.cwrap("sqlite3_column_count",...decl("n:n"));return function(m){return w(m),N(m)}}(),e.column_double=function(){const N=t.cwrap("sqlite3_column_double",...decl("nn:n"));return function(m,E){return w(m),N(m,E)}}(),e.column_int=function(){const N=t.cwrap("sqlite3_column_int64",...decl("nn:n"));return function(m,E){return w(m),N(m,E)}}(),e.column_int64=function(){const N=t.cwrap("sqlite3_column_int64",...decl("nn:n"));return function(m,E){w(m);const v=N(m,E),C=t.getTempRet0();return u(v,C)}}(),e.column_name=function(){const N=t.cwrap("sqlite3_column_name",...decl("nn:s"));return function(m,E){return w(m),N(m,E)}}(),e.column_names=function(h){const N=[],m=e.column_count(h);for(let E=0;EMAX_INT64||E>32n;N(m,Number(v),Number(C))}}(),e.result_null=function(){const N=t.cwrap("sqlite3_result_null",...decl("n:n"));return function(m){N(m)}}(),e.result_text=function(){const N=t.cwrap("sqlite3_result_text",...decl("nnnn:n"));return function(m,E){const v=a(E);N(m,v,-1,r)}}(),e.row=function(h){const N=[],m=e.data_count(h);for(let E=0;Ee.call(this,n);return await(this.#r=this.#r.then(s,s)),this.#e=n,SQLITE_OK}catch(s){return s.name==="AbortError"?SQLITE_BUSY:(console.error(s),SQLITE_IOERR_LOCK)}}async#i(e){if(e===this.#e)return SQLITE_OK;switch(this.#e){case SQLITE_LOCK_NONE:switch(e){case SQLITE_LOCK_SHARED:return this._NONEtoSHARED();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_SHARED:switch(e){case SQLITE_LOCK_RESERVED:return this._SHAREDtoRESERVED();case SQLITE_LOCK_EXCLUSIVE:return this._SHAREDtoEXCLUSIVE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_RESERVED:switch(e){case SQLITE_LOCK_EXCLUSIVE:return this._RESERVEDtoEXCLUSIVE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}}async#s(e){if(e===this.#e)return SQLITE_OK;switch(this.#e){case SQLITE_LOCK_EXCLUSIVE:switch(e){case SQLITE_LOCK_SHARED:return this._EXCLUSIVEtoSHARED();case SQLITE_LOCK_NONE:return this._EXCLUSIVEtoNONE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_RESERVED:switch(e){case SQLITE_LOCK_SHARED:return this._RESERVEDtoSHARED();case SQLITE_LOCK_NONE:return this._RESERVEDtoNONE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_SHARED:switch(e){case SQLITE_LOCK_NONE:return this._SHAREDtoNONE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}}async _NONEtoSHARED(){}async _SHAREDtoEXCLUSIVE(){await this._SHAREDtoRESERVED(),await this._RESERVEDtoEXCLUSIVE()}async _SHAREDtoRESERVED(){}async _RESERVEDtoEXCLUSIVE(){}async _EXCLUSIVEtoRESERVED(){}async _EXCLUSIVEtoSHARED(){await this._EXCLUSIVEtoRESERVED(),await this._RESERVEDtoSHARED()}async _EXCLUSIVEtoNONE(){await this._EXCLUSIVEtoRESERVED(),await this._RESERVEDtoSHARED(),await this._SHAREDtoNONE()}async _RESERVEDtoSHARED(){}async _RESERVEDtoNONE(){await this._RESERVEDtoSHARED(),await this._SHAREDtoNONE()}async _SHAREDtoNONE(){}_acquireWebLock(e,r){return new Promise(async(n,s)=>{try{await navigator.locks.request(e,r,a=>{if(n(a),a)return new Promise(u=>this.#t.set(e,u))})}catch(a){s(a)}})}_releaseWebLock(e){this.#t.get(e)?.(),this.#t.delete(e)}async _pollWebLock(e){return(await navigator.locks.query()).held.find(({name:n})=>n===e)?.mode}_getTimeoutSignal(){if(this.timeoutMillis){const e=new AbortController;return setTimeout(()=>e.abort(),this.timeoutMillis),e.signal}}}class WebLocksExclusive extends WebLocksBase{constructor(e){super(),this._lockName=e+"-outer",this._reservedName=e+"-reserved"}async isSomewhereReserved(){return await this._pollWebLock(this._reservedName)==="exclusive"}async _NONEtoSHARED(){await this._acquireWebLock(this._lockName,{mode:"exclusive",signal:this._getTimeoutSignal()})}async _SHAREDtoRESERVED(){await this._acquireWebLock(this._reservedName,{mode:"exclusive",signal:this._getTimeoutSignal()})}async _RESERVEDtoSHARED(){this._releaseWebLock(this._reservedName)}async _SHAREDtoNONE(){this._releaseWebLock(this._lockName)}}const MAX_TRANSACTION_LIFETIME_MILLIS=5e3;let nextTxId=0;const mapTxToId=new WeakMap;function log$2(...t){}class IDBContext{#e;#t;#r;#n=null;#i=0;#s=Promise.resolve();#o=Promise.resolve();constructor(e,r={durability:"default"}){this.#t=Promise.resolve(e).then(n=>this.#e=n),this.#r=r}async close(){const e=this.#e??await this.#t;await this.#s,await this.sync(),e.close()}async run(e,r){const n=this.#s.then(()=>this.#a(e,r));return this.#s=n.catch(()=>{}),n}async#a(e,r){const n=this.#e??await this.#t;if(e==="readwrite"&&this.#n?.mode==="readonly")this.#n=null;else if(performance.now()-this.#i>MAX_TRANSACTION_LIFETIME_MILLIS){try{this.#n?.commit()}catch(s){if(s.name!=="InvalidStateError")throw s}await new Promise(s=>setTimeout(s)),this.#n=null}for(let s=0;s<2;++s){if(!this.#n){this.#n=n.transaction(n.objectStoreNames,e,this.#r);const a=this.#i=performance.now();this.#o=this.#o.then(()=>new Promise((u,d)=>{this.#n.addEventListener("complete",f=>{u(),this.#n===f.target&&(this.#n=null),log$2(`transaction ${mapTxToId.get(f.target)} complete`)}),this.#n.addEventListener("abort",f=>{console.warn("tx abort",(performance.now()-a)/1e3);const y=f.target.error;d(y),this.#n===f.target&&(this.#n=null),log$2(`transaction ${mapTxToId.get(f.target)} aborted`,y)})})),mapTxToId.set(this.#n,nextTxId++)}try{const a=Object.fromEntries(Array.from(n.objectStoreNames,u=>[u,new ObjectStore(this.#n.objectStore(u))]));return await r(a)}catch(a){if(this.#n=null,s)throw a}}}async sync(){await this.#s,await this.#o,this.#o=Promise.resolve()}}function wrapRequest(t){return new Promise((e,r)=>{t.addEventListener("success",()=>e(t.result)),t.addEventListener("error",()=>r(t.error))})}class ObjectStore{#e;constructor(e){this.#e=e}get(e){log$2(`get ${this.#e.name}`,e);const r=this.#e.get(e);return wrapRequest(r)}getAll(e,r){log$2(`getAll ${this.#e.name}`,e,r);const n=this.#e.getAll(e,r);return wrapRequest(n)}getKey(e){log$2(`getKey ${this.#e.name}`,e);const r=this.#e.getKey(e);return wrapRequest(r)}getAllKeys(e,r){log$2(`getAllKeys ${this.#e.name}`,e,r);const n=this.#e.getAllKeys(e,r);return wrapRequest(n)}put(e,r){log$2(`put ${this.#e.name}`,e,r);const n=this.#e.put(e,r);return wrapRequest(n)}delete(e){log$2(`delete ${this.#e.name}`,e);const r=this.#e.delete(e);return wrapRequest(r)}clear(){log$2(`clear ${this.#e.name}`);const e=this.#e.clear();return wrapRequest(e)}index(e){return new Index(this.#e.index(e))}}class Index{#e;constructor(e){this.#e=e}getAllKeys(e,r){log$2(`IDBIndex.getAllKeys ${this.#e.objectStore.name}<${this.#e.name}>`,e,r);const n=this.#e.getAllKeys(e,r);return wrapRequest(n)}}const SECTOR_SIZE=512,MAX_TASK_MILLIS=3e3,DEFAULT_OPTIONS={durability:"default",purge:"deferred",purgeAtLeast:16};function log$1(...t){}class IDBBatchAtomicVFS extends Base{#e;#t=new Map;#r;#n=new Set;#i=performance.now();#s=new Set;constructor(e="wa-sqlite",r=DEFAULT_OPTIONS){super(),this.name=e,this.#e=Object.assign({},DEFAULT_OPTIONS,r),this.#r=new IDBContext(openDatabase(e),{durability:this.#e.durability})}async close(){for(const e of this.#t.keys())await this.xClose(e);await this.#r?.close(),this.#r=null}xOpen(e,r,n,s){return this.handleAsync(async()=>{e===null&&(e=`null_${r}`),log$1(`xOpen ${e} 0x${r.toString(16)} 0x${n.toString(16)}`);try{const a=new URL(e,"http://localhost/"),u={path:a.pathname,flags:n,block0:null,isMetadataChanged:!0,locks:new WebLocksExclusive(a.pathname)};return this.#t.set(r,u),await this.#r.run("readwrite",async({blocks:d})=>{if(u.block0=await d.get(this.#l(u,0)),!u.block0)if(n&SQLITE_OPEN_CREATE)u.block0={path:u.path,offset:0,version:0,data:new Uint8Array(0),fileSize:0},d.put(u.block0);else throw new Error(`file not found: ${u.path}`)}),s.setInt32(0,n&SQLITE_OPEN_READONLY,!0),SQLITE_OK}catch(a){return console.error(a),SQLITE_CANTOPEN}})}xClose(e){return this.handleAsync(async()=>{try{const r=this.#t.get(e);return r&&(log$1(`xClose ${r.path}`),this.#t.delete(e),r.flags&SQLITE_OPEN_DELETEONCLOSE&&this.#r.run("readwrite",({blocks:n})=>{n.delete(IDBKeyRange.bound([r.path],[r.path,[]]))})),SQLITE_OK}catch(r){return console.error(r),SQLITE_IOERR}})}xRead(e,r,n){return this.handleAsync(async()=>{const s=this.#t.get(e);log$1(`xRead ${s.path} ${r.byteLength} ${n}`);try{return await this.#r.run("readonly",async({blocks:u})=>{let d=0;for(;dMAX_TASK_MILLIS){const a=this.handleAsync(async()=>{this.handleAsync!==super.handleAsync&&this.#s.add(e),await new Promise(d=>setTimeout(d));const u=this.#o(e,r,n);return this.#i=performance.now(),u});return s&&this.#s.delete(e),a}return this.#o(e,r,n)}#o(e,r,n){const s=this.#t.get(e);log$1(`xWrite ${s.path} ${r.byteLength} ${n}`);try{const a=s.block0.fileSize;s.block0.fileSized.put(u))):this.#r.run("readwrite",({blocks:d})=>d.put(u)),s.isMetadataChanged=n===0?!1:s.isMetadataChanged,SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}}xTruncate(e,r){const n=this.#t.get(e);log$1(`xTruncate ${n.path} ${r}`);try{Object.assign(n.block0,{fileSize:r,data:n.block0.data.slice(0,r)});const s=Object.assign({},n.block0);return this.#r.run("readwrite",({blocks:a})=>{a.delete(this.#l(n,-1/0,-r)),a.put(s)}),SQLITE_OK}catch(s){return console.error(s),SQLITE_IOERR}}xSync(e,r){const n=this.#s.has(e);if(n||this.#e.durability!=="relaxed"||performance.now()-this.#i>MAX_TASK_MILLIS){const a=this.handleAsync(async()=>{this.handleAsync!==super.handleAsync&&this.#s.add(e);const u=await this.#a(e,r);return this.#i=performance.now(),u});return n&&this.#s.delete(e),a}const s=this.#t.get(e);return log$1(`xSync ${s.path} ${r}`),SQLITE_OK}async#a(e,r){const n=this.#t.get(e);log$1(`xSync ${n.path} ${r}`);try{n.isMetadataChanged&&(this.#r.run("readwrite",async({blocks:s})=>{await s.put(n.block0)}),n.isMetadataChanged=!1),await this.#r.sync()}catch(s){return console.error(s),SQLITE_IOERR}return SQLITE_OK}xFileSize(e,r){const n=this.#t.get(e);return log$1(`xFileSize ${n.path}`),r.setBigInt64(0,BigInt(n.block0.fileSize),!0),SQLITE_OK}xLock(e,r){return this.handleAsync(async()=>{const n=this.#t.get(e);log$1(`xLock ${n.path} ${r}`);try{const s=await n.locks.lock(r);return s===SQLITE_OK&&n.locks.state===SQLITE_LOCK_SHARED&&(n.block0=await this.#r.run("readonly",({blocks:a})=>a.get(this.#l(n,0)))),s}catch(s){return console.error(s),SQLITE_IOERR}})}xUnlock(e,r){return this.handleAsync(async()=>{const n=this.#t.get(e);log$1(`xUnlock ${n.path} ${r}`);try{return n.locks.unlock(r)}catch(s){return console.error(s),SQLITE_IOERR}})}xCheckReservedLock(e,r){return this.handleAsync(async()=>{const n=this.#t.get(e);log$1(`xCheckReservedLock ${n.path}`);const s=await n.locks.isSomewhereReserved();return r.setInt32(0,s?1:0,!0),SQLITE_OK})}xSectorSize(e){return SECTOR_SIZE}xDeviceCharacteristics(e){return SQLITE_IOCAP_BATCH_ATOMIC|SQLITE_IOCAP_SAFE_APPEND|SQLITE_IOCAP_SEQUENTIAL|SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN}xFileControl(e,r,n){const s=this.#t.get(e);switch(log$1(`xFileControl ${s.path} ${r}`),r){case 11:return s.overwrite=!0,SQLITE_OK;case 21:if(s.overwrite)try{return this.handleAsync(async()=>(await this.#c(s),SQLITE_OK))}catch(a){return console.error(a),SQLITE_IOERR}if(s.isMetadataChanged)try{this.#r.run("readwrite",async({blocks:a})=>{await a.put(s.block0)}),s.isMetadataChanged=!1}catch(a){return console.error(a),SQLITE_IOERR}return SQLITE_OK;case 22:return s.overwrite=!1,SQLITE_OK;case 31:return this.handleAsync(async()=>{try{return s.block0.version--,s.changedPages=new Set,this.#r.run("readwrite",async({blocks:a})=>{const u=await a.index("version").getAllKeys(IDBKeyRange.bound([s.path],[s.path,s.block0.version]));for(const d of u)a.delete(d)}),SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}});case 32:try{const a=Object.assign({},s.block0);a.data=a.data.slice();const u=s.changedPages;return s.changedPages=null,s.isMetadataChanged=!1,this.#r.run("readwrite",async({blocks:d})=>{d.put(a);const f=await d.get([s.path,"purge",0])??{path:s.path,offset:"purge",version:0,data:new Map,count:0};f.count+=u.size;for(const y of u)f.data.set(y,a.version);d.put(f),this.#u(s.path,f.count)}),SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}case 33:return this.handleAsync(async()=>{try{return s.changedPages=null,s.isMetadataChanged=!1,s.block0=await this.#r.run("readonly",({blocks:a})=>a.get([s.path,0,s.block0.version+1])),SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}});default:return SQLITE_NOTFOUND}}xAccess(e,r,n){return this.handleAsync(async()=>{try{const s=new URL(e,"file://localhost/").pathname;log$1(`xAccess ${s} ${r}`);const a=await this.#r.run("readonly",({blocks:u})=>u.getKey(this.#l({path:s},0)));return n.setInt32(0,a?1:0,!0),SQLITE_OK}catch(s){return console.error(s),SQLITE_IOERR}})}xDelete(e,r){return this.handleAsync(async()=>{const n=new URL(e,"file://localhost/").pathname;try{return this.#r.run("readwrite",({blocks:s})=>s.delete(IDBKeyRange.bound([n],[n,[]]))),r&&await this.#r.sync(),SQLITE_OK}catch(s){return console.error(s),SQLITE_IOERR}})}async purge(e){const r=Date.now();await this.#r.run("readwrite",async({blocks:n})=>{const s=await n.get([e,"purge",0]);if(s){for(const[a,u]of s.data)n.delete(IDBKeyRange.bound([e,a,u],[e,a,1/0],!0,!1));await n.delete([e,"purge",0])}log$1(`purge ${e} ${s?.data.size??0} pages in ${Date.now()-r} ms`)})}#u(e,r){this.#e.purge==="manual"||this.#n.has(e)||r{this.purge(e),this.#n.delete(e)}):setTimeout(()=>{this.purge(e),this.#n.delete(e)}),this.#n.add(e))}#l(e,r,n=0){const s=!r||-r{const A=await w.index("version").getAllKeys(IDBKeyRange.bound([e.path,b+1],[e.path,1/0]));for(const R of A)w.delete(R);w.delete([e.path,"purge",0]);for(let R=0;R=y)break;const E={path:h.path,offset:m,version:b,data:h.data.subarray(N*s,(N+1)*s)};E.offset===0&&(E.fileSize=y,e.block0=E),w.put(E)}}}})}}function openDatabase(t){return new Promise((e,r)=>{const n=globalThis.indexedDB.open(t,5);n.addEventListener("upgradeneeded",function(){n.result.createObjectStore("blocks",{keyPath:["path","offset","version"]}).createIndex("version",["path","version"])}),n.addEventListener("success",()=>{e(n.result)}),n.addEventListener("error",()=>{r(n.error)})})}const E_CANCELED=new Error("request for lock canceled");var __awaiter$2=function(t,e,r,n){function s(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function d(b){try{y(n.next(b))}catch(w){u(w)}}function f(b){try{y(n.throw(b))}catch(w){u(w)}}function y(b){b.done?a(b.value):s(b.value).then(d,f)}y((n=n.apply(t,e||[])).next())})};class Semaphore{constructor(e,r=E_CANCELED){this._value=e,this._cancelError=r,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((r,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:r,reject:n}),this._dispatch()})}runExclusive(e,r=1){return __awaiter$2(this,void 0,void 0,function*(){const[n,s]=yield this.acquire(r);try{return yield e(n)}finally{s()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(r=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(r),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(r=>r.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let r=this._value;r>0;r--){const n=(e=this._weightedQueues[r-1])===null||e===void 0?void 0:e.shift();if(!n)continue;const s=this._value,a=r;this._value-=r,r=this._value+1,n.resolve([s,this._newReleaser(a)])}this._drainUnlockWaiters()}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)this._weightedWaiters[e-1]&&(this._weightedWaiters[e-1].forEach(r=>r()),this._weightedWaiters[e-1]=[])}}var __awaiter$1=function(t,e,r,n){function s(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function d(b){try{y(n.next(b))}catch(w){u(w)}}function f(b){try{y(n.throw(b))}catch(w){u(w)}}function y(b){b.done?a(b.value):s(b.value).then(d,f)}y((n=n.apply(t,e||[])).next())})};class Mutex{constructor(e){this._semaphore=new Semaphore(1,e)}acquire(){return __awaiter$1(this,void 0,void 0,function*(){const[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const isDebug=globalThis.__vlcn_wa_crsqlite_dbg;function log(...t){isDebug&&console.log("crsqlite-wasm: ",...t)}const re=/insert\s|update\s|delete\s/,txRe=/begin\s|commit\s|rollback\s|savepoint\s/;function computeCacheKey(t,e,r){const n=t.toLowerCase();if(txRe.exec(n)==null)return re.exec(n)!=null?(log("received write"),null):r!=null?n+"|"+e+"|"+r.map(a=>a!=null?a.toString():"null").join("|"):n}class Stmt{originDB;stmtFinalizer;cache;api;base;str;sql;mode="o";finalized=!1;bindings=[];constructor(e,r,n,s,a,u,d){this.originDB=e,this.stmtFinalizer=r,this.cache=n,this.api=s,this.base=a,this.str=u,this.sql=d,r.set(a,this)}run(e,...r){return serialize(this.cache,computeCacheKey(this.sql,this.mode,r.length>0?r:this.bindings),()=>(r.length>0&&this.bind(r),this.api.step(this.base).then(()=>this.api.reset(this.base))),e?.__mutex||this.originDB.__mutex)}get(e,...r){return serialize(this.cache,computeCacheKey(this.sql,this.mode,r.length>0?r:this.bindings),async()=>{r.length>0&&this.bind(r);let n=null,s=this.mode==="o"?this.api.column_names(this.base):null;if(await this.api.step(this.base)==SQLITE_ROW){const a=this.api.row(this.base);if(s!=null){const u={};for(let d=0;d0?r:this.bindings),async()=>{r.length>0&&this.bind(r);const n=[];let s=this.mode==="o"?this.api.column_names(this.base):null;for(;await this.api.step(this.base)==SQLITE_ROW;)if(s!=null){const a={};for(let u=0;uthis.api.step(this.base),e?.__mutex||this.originDB.__mutex)==SQLITE_ROW;)yield this.api.row(this.base);await serialize(this.cache,void 0,()=>this.api.reset(this.base),e?.__mutex||this.originDB.__mutex)}raw(e){return e?this.mode="a":this.mode="o",this}bind(e){this.bindings=e;for(let r=0;r{if(!this.finalized)return this.finalized=!0,this.api.str_finish(this.str),this.stmtFinalizer.delete(this.base),this.api.finalize(this.base)},e?.__mutex||this.originDB.__mutex)}}class TX{api;db;__mutex;assertOpen;stmtFinalizer;cache=new Map;constructor(e,r,n,s,a){this.api=e,this.db=r,this.__mutex=n,this.assertOpen=s,this.stmtFinalizer=a}execMany(e){return this.assertOpen(),serialize(this.cache,null,()=>this.api.exec(this.db,e.join("")),this.__mutex)}exec(e,r){return this.assertOpen(),serialize(this.cache,computeCacheKey(e,"a",r),()=>this.statements(e,!1,r),this.__mutex)}execO(e,r){return this.assertOpen(),serialize(this.cache,computeCacheKey(e,"o",r),()=>this.statements(e,!0,r),this.__mutex)}execA(e,r){return this.assertOpen(),serialize(this.cache,computeCacheKey(e,"a",r),()=>this.statements(e,!1,r),this.__mutex)}prepare(e){return this.assertOpen(),serialize(this.cache,void 0,async()=>{const r=this.api.str_new(this.db,e),n=await this.api.prepare_v2(this.db,this.api.str_value(r));if(n==null)throw this.api.str_finish(r),new Error(`Could not prepare ${e}`);return new Stmt(this,this.stmtFinalizer,this.cache,this.api,n.stmt,r,e)},this.__mutex)}tx(e){this.assertOpen();const r="crsql"+crypto.randomUUID().replaceAll("-","");return serializeTx(async n=>{await n.exec("SAVEPOINT "+r);try{await e(n)}catch(s){throw await n.exec("ROLLBACK TO "+r),await n.exec("RELEASE "+r),s}await n.exec("RELEASE "+r)},this.__mutex,this)}imperativeTx(){return this.__mutex.acquire().then(e=>{const r=new Mutex;return[e,new TX(this.api,this.db,r,this.assertOpen,this.stmtFinalizer)]})}async statements(e,r,n){const s=[],a=this.api.str_new(this.db,e);let u={stmt:null,sql:this.api.str_value(a)};try{for(;u=await this.api.prepare_v2(this.db,u.sql);){const y=u.stmt,b=[],w=this.api.column_names(y);for(n&&this.bind(y,n);await this.api.step(y)===SQLITE_ROW;){const A=this.api.row(y);b.push(A)}w.length&&s.push({columns:w,rows:b}),this.api.finalize(u.stmt),u.stmt=null}}catch(y){throw console.error(`Failed running ${e}`,y),y}finally{u?.stmt&&this.api.finalize(u.stmt),this.api.str_finish(a)}const d=s[0];if(d==null)return null;if(!r)return d.rows;const f=[];for(const y of d.rows){const b={};for(let w=0;wt?.delete(e)).catch(a=>{console.error(a)})),s}function serializeTx(t,e,r){return e.runExclusive(()=>{const n=new Mutex,s=new TX(r.api,r.db,n,r.assertOpen,r.stmtFinalizer);return t(s)})}function cryb64(t,e=0){let r=3735928559^e,n=1103547991^e;for(let s=0,a;s>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),4294967296n*BigInt(n)+BigInt(r)}function firstPick(t){const e=t[0];if(e!=null)return e[Object.keys(e)[0]]}class DB{api;db;filename;__mutex=topLevelMutex;stmtFinalizer=new Map;#e=null;#t=null;cache=new Map;#r=null;#n=!1;#i;constructor(e,r,n){this.api=e,this.db=r,this.filename=n,this.#i=new TX(e,r,topLevelMutex,this.#s,this.stmtFinalizer)}get siteid(){return this.#e}_setSiteid(e){if(this.#e)throw new Error("Site id already set");this.#e=e}_setTablesUsedStmt(e){this.#t=e}get tablesUsedStmt(){if(this.#t==null)throw new Error("tablesUsedStmt not set");return this.#t}async automigrateTo(e,r){const n=cryb64(r),s=firstPick(await this.execA("SELECT value FROM crsql_master WHERE key = 'schema_name'")),a=firstPick(await this.execA("SELECT value FROM crsql_master WHERE key = 'schema_version'"));if(s===e&&BigInt(a||0)===n)return"noop";const u=s===void 0||s!==e?"apply":"migrate";return await this.tx(async d=>{if(a==null||s!==e){if(s!==e){const f=await d.execA("SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'crsql_%'");for(const y of f)await d.exec(`DROP TABLE [${y[0]}]`)}await d.exec(r)}else await d.exec("SELECT crsql_automigrate(?, 'SELECT crsql_finalize();')",[r]);await d.exec("INSERT OR REPLACE INTO crsql_master (key, value) VALUES (?, ?)",["schema_version",n]),await d.exec("INSERT OR REPLACE INTO crsql_master (key, value) VALUES (?, ?)",["schema_name",e])}),await this.exec("VACUUM;"),u}execMany(e){return this.#i.execMany(e)}exec(e,r){return this.#i.exec(e,r)}#s=()=>{if(this.#n)throw new Error("The DB is closed")};execO(e,r){return this.#i.execO(e,r)}execA(e,r){return this.#i.execA(e,r)}prepare(e){return this.#i.prepare(e)}tx(e){return this.#i.tx(e)}imperativeTx(){return this.#i.imperativeTx()}async close(){for(const e of this.stmtFinalizer.values())await e.finalize(this);return this.#t?.finalize(this),this.exec("SELECT crsql_finalize()").then(()=>(this.#n=!0,serialize(this.cache,void 0,()=>this.api.close(this.db),this.__mutex)))}createFunction(e,r,n){this.#s(),this.api.create_function(this.db,e,r.length,SQLITE_UTF8,0,(s,a)=>{const u=[];for(let f=0;fthis.#r?.delete(e)}#o=(e,r,n,s)=>{this.#r!=null&&this.#r.forEach(a=>{try{a(e,r,n,s)}catch(u){console.error("Failed notifying a DB update listener"),console.error(u)}})}}let api=null;class SQLite3{base;constructor(e){this.base=e}open(e,r="c"){return serialize(null,void 0,()=>this.base.open_v2(e||":memory:",SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_URI,e!=null?"idb-batch-atomic":void 0),topLevelMutex).then(n=>{const s=new DB(this.base,n,e||":memory:");return s.prepare(`SELECT tbl_name FROM tables_used(?) AS u +`)),!i){var o=null;break e}o=Array(he(i)+1),i=ue(i,o,0,o.length),o.length=i,me=o}o=me.shift()}return o},uc(i,o){o===null||o===10?(A(K(i.Ub,0)),i.Ub=[]):o!=0&&i.Ub.push(o)},lc(i){i.Ub&&0=o||(o=Math.max(o,l*(1048576>l?2:1.125)>>>0),l!=0&&(o=Math.max(o,256)),l=i.Qb,i.Qb=new Uint8Array(o),0=i.node.Sb)return 0;if(i=Math.min(i.node.Sb-p,c),8o)throw new L(28);return o},xc(i,o,l){gt(i.node,o+l),i.node.Sb=Math.max(i.node.Sb,o+l)},nc(i,o,l,c,p){if((i.node.mode&61440)!==32768)throw new L(43);if(i=i.node.Qb,p&2||i.buffer!==v.buffer){if((0{var l=0;return i&&(l|=365),o&&(l|=146),l},ut=null,Ot={},$e=[],Xr=1,Le=null,Tt=!0,L=null,ct={};function we(i,o={}){if(i=oe(i),!i)return{path:"",node:null};if(o=Object.assign({zc:!0,vc:0},o),8!!_);for(var l=ut,c="/",p=0;p>>0)%Le.length}function St(i){var o=dt(i.parent.id,i.name);if(Le[o]===i)Le[o]=i.dc;else for(o=Le[o];o;){if(o.dc===i){o.dc=i.dc;break}o=o.dc}}function Be(i,o){var l;if(l=(l=Qe(i,"x"))?l:i.Fb.fc?0:2)throw new L(l,i);for(l=Le[dt(i.id,o)];l;l=l.dc){var c=l.name;if(l.parent.id===i.id&&c===o)return l}return i.Fb.fc(i,o)}function It(i,o,l,c){return i=new Dr(i,o,l,c),o=dt(i.parent.id,i.name),i.dc=Le[o],Le[o]=i}function Se(i){return(i&61440)===16384}function vt(i){var o=["r","w","rw"][i&3];return i&512&&(o+="w"),o}function Qe(i,o){if(Tt)return 0;if(!o.includes("r")||i.mode&292){if(o.includes("w")&&!(i.mode&146)||o.includes("x")&&!(i.mode&73))return 2}else return 2;return 0}function Ct(i,o){try{return Be(i,o),20}catch{}return Qe(i,"wx")}function Rt(i,o,l){try{var c=Be(i,o)}catch(p){return p.Rb}if(i=Qe(i,"wx"))return i;if(l){if(!Se(c.mode))return 54;if(c===c.parent||Ke(c)==="/")return 10}else if(Se(c.mode))return 31;return 0}function Yr(){for(var i=0;4096>=i;i++)if(!$e[i])return i;throw new L(33)}function be(i){if(i=$e[i],!i)throw new L(8);return i}function xt(i,o=-1){return Ve||(Ve=function(){this.kc={}},Ve.prototype={},Object.defineProperties(Ve.prototype,{object:{get(){return this.node},set(l){this.node=l}},flags:{get(){return this.kc.flags},set(l){this.kc.flags=l}},position:{get(){return this.kc.position},set(l){this.kc.position=l}}})),i=Object.assign(new Ve,i),o==-1&&(o=Yr()),i.Zb=o,$e[o]=i}var Zr={open(i){i.Pb=Ot[i.node.ic].Pb,i.Pb.open&&i.Pb.open(i)},bc(){throw new L(70)}};function ft(i,o){Ot[i]={Pb:o}}function kt(i,o){var l=o==="/",c=!o;if(l&&ut)throw new L(10);if(!l&&!c){var p=we(o,{zc:!1});if(o=p.path,p=p.node,p.cc)throw new L(10);if(!Se(p.mode))throw new L(54)}o={type:i,ed:{},Cc:o,Oc:[]},i=i.Xb(o),i.Xb=o,o.root=i,l?ut=i:p&&(p.cc=o,p.Xb&&p.Xb.Oc.push(o))}function ht(i,o,l){var c=we(i,{parent:!0}).node;if(i=ze(i),!i||i==="."||i==="..")throw new L(28);var p=Ct(c,i);if(p)throw new L(p);if(!c.Fb.mc)throw new L(63);return c.Fb.mc(c,i,o,l)}function Re(i,o){return ht(i,(o!==void 0?o:511)&1023|16384,0)}function Ge(i,o,l){typeof l>"u"&&(l=o,o=438),ht(i,o|8192,l)}function pt(i,o){if(!oe(i))throw new L(44);var l=we(o,{parent:!0}).node;if(!l)throw new L(44);o=ze(o);var c=Ct(l,o);if(c)throw new L(c);if(!l.Fb.qc)throw new L(63);l.Fb.qc(l,o,i)}function At(i){var o=we(i,{parent:!0}).node;i=ze(i);var l=Be(o,i),c=Rt(o,i,!0);if(c)throw new L(c);if(!o.Fb.pc)throw new L(63);if(l.cc)throw new L(10);o.Fb.pc(o,i),St(l)}function Lt(i){if(i=we(i).node,!i)throw new L(44);if(!i.Fb.jc)throw new L(28);return oe(Ke(i.parent),i.Fb.jc(i))}function Xe(i,o){if(i=we(i,{ac:!o}).node,!i)throw new L(44);if(!i.Fb.Wb)throw new L(63);return i.Fb.Wb(i)}function qt(i){return Xe(i,!0)}function Dt(i,o){if(i=typeof i=="string"?we(i,{ac:!0}).node:i,!i.Fb.Tb)throw new L(63);i.Fb.Tb(i,{mode:o&4095|i.mode&-4096,timestamp:Date.now()})}function Wt(i,o){if(0>o)throw new L(28);if(i=typeof i=="string"?we(i,{ac:!0}).node:i,!i.Fb.Tb)throw new L(63);if(Se(i.mode))throw new L(31);if((i.mode&61440)!==32768)throw new L(28);var l=Qe(i,"w");if(l)throw new L(l);i.Fb.Tb(i,{size:o,timestamp:Date.now()})}function Ye(i,o,l){if(i==="")throw new L(44);if(typeof o=="string"){var c={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[o];if(typeof c>"u")throw Error(`Unknown file open mode: ${o}`);o=c}if(l=o&64?(typeof l>"u"?438:l)&4095|32768:0,typeof i=="object")var p=i;else{i=Ie(i);try{p=we(i,{ac:!(o&131072)}).node}catch{}}if(c=!1,o&64)if(p){if(o&128)throw new L(20)}else p=ht(i,l,0),c=!0;if(!p)throw new L(44);if((p.mode&61440)===8192&&(o&=-513),o&65536&&!Se(p.mode))throw new L(54);if(!c&&(l=p?(p.mode&61440)===40960?32:Se(p.mode)&&(vt(o)!=="r"||o&512)?31:Qe(p,vt(o)):44))throw new L(l);return o&512&&!c&&Wt(p,0),o&=-131713,p=xt({node:p,path:Ke(p),flags:o,seekable:!0,position:0,Pb:p.Pb,Uc:[],error:!1}),p.Pb.open&&p.Pb.open(p),!r.logReadFiles||o&1||(Ze||(Ze={}),i in Ze||(Ze[i]=1)),p}function Bt(i,o,l){if(i.Zb===null)throw new L(8);if(!i.seekable||!i.Pb.bc)throw new L(70);if(l!=0&&l!=1&&l!=2)throw new L(28);i.position=i.Pb.bc(i,o,l),i.Uc=[]}function Ft(){L||(L=function(i,o){this.name="ErrnoError",this.node=o,this.Sc=function(l){this.Rb=l},this.Sc(i),this.message="FS error"},L.prototype=Error(),L.prototype.constructor=L,[44].forEach(i=>{ct[i]=new L(i),ct[i].stack=""}))}var Pt;function Me(i,o,l){i=Ie("/dev/"+i);var c=Gr(!!o,!!l);mt||(mt=64);var p=mt++<<8|0;ft(p,{open(g){g.seekable=!1},close(){l&&l.buffer&&l.buffer.length&&l(10)},read(g,_,k,O){for(var I=0,D=0;D>2]=c.Kc,T[l+4>>2]=c.mode,q[l+8>>2]=c.Qc,T[l+12>>2]=c.uid,T[l+16>>2]=c.Nc,T[l+20>>2]=c.ic,ne=[c.size>>>0,(Q=c.size,1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[l+24>>2]=ne[0],T[l+28>>2]=ne[1],T[l+32>>2]=4096,T[l+36>>2]=c.Ic,i=c.Gc.getTime(),o=c.Pc.getTime();var p=c.Jc.getTime();return ne=[Math.floor(i/1e3)>>>0,(Q=Math.floor(i/1e3),1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[l+40>>2]=ne[0],T[l+44>>2]=ne[1],q[l+48>>2]=i%1e3*1e3,ne=[Math.floor(o/1e3)>>>0,(Q=Math.floor(o/1e3),1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[l+56>>2]=ne[0],T[l+60>>2]=ne[1],q[l+64>>2]=o%1e3*1e3,ne=[Math.floor(p/1e3)>>>0,(Q=Math.floor(p/1e3),1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[l+72>>2]=ne[0],T[l+76>>2]=ne[1],q[l+80>>2]=p%1e3*1e3,ne=[c.Bc>>>0,(Q=c.Bc,1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[l+88>>2]=ne[0],T[l+92>>2]=ne[1],0}var tt=void 0;function rt(){var i=T[tt>>2];return tt+=4,i}var Je=(i,o)=>o+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*o:NaN,en=[0,31,60,91,121,152,182,213,244,274,305,335],tn=[0,31,59,90,120,151,181,212,243,273,304,334],zt=i=>{var o=he(i)+1,l=Et(o);return l&&ue(i,C,l,o),l},Nt={},Qt=()=>{if(!yt){var i={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"},o;for(o in Nt)Nt[o]===void 0?delete i[o]:i[o]=Nt[o];var l=[];for(o in i)l.push(`${o}=${i[o]}`);yt=l}return yt},yt;function Ut(){}function $t(){}function Mt(){}function Vt(){}function Jt(){}function Ht(){}function jt(){}function Kt(){}function Gt(){}function Xt(){}function Yt(){}function Zt(){}function er(){}function tr(){}function rr(){}function nr(){}function ir(){}function sr(){}function or(){}function ar(){}function lr(){}function ur(){}function cr(){}function dr(){}function fr(){}function hr(){}function pr(){}function mr(){}function Nr(){}function yr(){}function br(){}function wr(){}function Er(){}function _r(){}function gr(){}function Or(){}function Tr(){}function Sr(){}function Ir(){}function vr(){}var Cr=i=>{E=i,h||0{i instanceof He||i=="unwind"||d(1,i)},nt=i=>{try{i()}catch(o){te(o)}};function rn(i){var o={},l;for(l in i)(function(c){var p=i[c];o[c]=typeof p=="function"?function(){it.push(c);try{return p.apply(null,arguments)}finally{m||(it.pop()===c||te(),xe&&qe===1&&it.length===0&&(qe=0,nt(Mr),typeof Fibers<"u"&&Fibers.fd()))}}:p})(l);return o}var qe=0,xe=null,Rr=0,it=[],xr={},kr={},nn=0,wt=null,sn=[];function on(){return new Promise((i,o)=>{wt={resolve:i,reject:o}})}function an(){var i=Et(16396),o=i+12;q[i>>2]=o,q[i+4>>2]=o+16384,o=it[0];var l=xr[o];return l===void 0&&(l=nn++,xr[o]=l,kr[l]=o),T[i+8>>2]=l,i}function Ar(i){if(!m){if(qe===0){var o=!1,l=!1;i((c=0)=>{if(!m&&(Rr=c,o=!0,l)){qe=2,nt(()=>Vr(xe)),typeof Browser<"u"&&Browser.tc.Mc&&Browser.tc.resume(),c=!1;try{var p=(0,B[kr[T[xe+8>>2]]])()}catch(k){p=k,c=!0}var g=!1;if(!xe){var _=wt;_&&(wt=null,(c?_.reject:_.resolve)(p),g=!0)}if(c&&!g)throw p}}),l=!0,o||(qe=1,xe=an(),typeof Browser<"u"&&Browser.tc.Mc&&Browser.tc.pause(),nt(()=>$r(xe)))}else qe===2?(qe=0,nt(Jr),Br(xe),xe=null,sn.forEach(c=>{if(!m)try{if(c(),!(h||0{i().then(o)})}var qr={},ve=(i,o,l,c,p)=>{function g(x){return--ge,O!==0&&Ur(O),o==="string"?x?K(C,x):"":o==="boolean"?!!x:x}var _={string:x=>{var W=0;if(x!=null&&x!==0){W=he(x)+1;var j=_t(W);ue(x,C,j,W),W=j}return W},array:x=>{var W=_t(x.length);return v.set(x,W),W}};i=r["_"+i];var k=[],O=0;if(c)for(var I=0;I0,write:(c,p,g,_)=>_}),Ge("/dev/null",259),Te(1280,lt),Te(1536,Kr),Ge("/dev/tty",1280),Ge("/dev/tty1",1536);var i=new Uint8Array(1024),o=0,l=()=>(o===0&&(o=Y(i).byteLength),i[--o]);Me("random",l),Me("urandom",l),Re("/dev/shm"),Re("/dev/shm/tmp")}(),function(){Re("/proc");var i=Re("/proc/self");Re("/proc/self/fd"),kt({Xb(){var o=It(i,"fd",16895,73);return o.Fb={fc(l,c){var p=be(+c);return l={parent:null,Xb:{Cc:"fake"},Fb:{jc:()=>p.path}},l.parent=l}},o}},"/proc/self/fd")}(),function(){const i=new Map;r.setAuthorizer=function(o,l,c){return l?i.set(o,{f:l,wc:c}):i.delete(o),ve("set_authorizer","number",["number"],[o])},Ut=function(o,l,c,p,g,_){if(i.has(o)){const{f:k,wc:O}=i.get(o);return k(O,l,c?c?K(C,c):"":null,p?p?K(C,p):"":null,g?g?K(C,g):"":null,_?_?K(C,_):"":null)}return 0}}(),function(){function i(c,p){const g=[];for(let _=0;c[p+_]!=0;++_){if(1e3<_)throw Error("C-string never terminated after 1k characters");g.push(c[p+_])}return String.fromCharCode(...g)}const o=new Map,l=new Map;r.updateHook=function(c,p){const g=o.size;return o.set(g,p),ve("update_hook","void",["number","number"],[c,g])},r.createFunction=function(c,p,g,_,k,O){const I=o.size;return o.set(I,{f:O,$b:k}),ve("create_function","number","number string number number number number".split(" "),[c,p,g,_,I,0])},r.createAggregate=function(c,p,g,_,k,O,I){const D=o.size;return o.set(D,{step:O,Lc:I,$b:k}),ve("create_function","number","number string number number number number".split(" "),[c,p,g,_,D,1])},r.getFunctionUserData=function(c){return l.get(c)},Ht=function(c,p,g,_,k,O){c=o.get(c);const I=C;k=BigInt(O)<<32n|BigInt(k)&4294967295n,c(p,i(I,g),i(I,_),k)},Mt=function(c,p,g,_){c=o.get(c),l.set(p,c.$b),c.f(p,new Uint32Array(C.buffer,_,g)),l.delete(p)},Jt=function(c,p,g,_){c=o.get(c),l.set(p,c.$b),c.step(p,new Uint32Array(C.buffer,_,g)),l.delete(p)},$t=function(c,p){c=o.get(c),l.set(p,c.$b),c.Lc(p),l.delete(p)}}(),function(){const i=new Map;r.progressHandler=function(o,l,c,p){return c?i.set(o,{f:c,wc:p}):i.delete(o),ve("progress_handler",null,["number","number"],[o,l])},Vt=function(o){if(i.has(o)){const{f:l,wc:c}=i.get(o);return l(c)}return 0}}(),function(){function i(O,I){const D=`get${O}`,x=`set${O}`;return new Proxy(new DataView(C.buffer,I,O==="Int32"?4:8),{get(W,j){if(j===D)return function(Z,fe){if(!fe)throw Error("must be little endian");return W[j](Z,fe)};if(j===x)return function(Z,fe,ce){if(!ce)throw Error("must be little endian");return W[j](Z,fe,ce)};if(typeof j=="string"&&j.match(/^(get)|(set)/))throw Error("invalid type");return W[j]}})}const o=typeof qr=="object",l=new Map,c=new Map,p=new Map,g=o?new Set:null,_=o?new Set:null,k=new Map;cr=function(O,I,D,x){k.set(O?K(C,O):"",{size:I,hc:Array.from(new Uint32Array(C.buffer,x,D))})},r.createModule=function(O,I,D,x){o&&(D.handleAsync=Lr);const W=l.size;return l.set(W,{module:D,$b:x}),x=0,D.xCreate&&(x|=1),D.xConnect&&(x|=2),D.xBestIndex&&(x|=4),D.xDisconnect&&(x|=8),D.xDestroy&&(x|=16),D.xOpen&&(x|=32),D.xClose&&(x|=64),D.xFilter&&(x|=128),D.xNext&&(x|=256),D.xEof&&(x|=512),D.xColumn&&(x|=1024),D.xRowid&&(x|=2048),D.xUpdate&&(x|=4096),D.xBegin&&(x|=8192),D.xSync&&(x|=16384),D.xCommit&&(x|=32768),D.xRollback&&(x|=65536),D.xFindFunction&&(x|=131072),D.xRename&&(x|=262144),ve("create_module","number",["number","string","number","number"],[O,I,W,x])},er=function(O,I,D,x,W,j){if(I=l.get(I),c.set(W,I),o){g.delete(W);for(const Z of g)c.delete(Z)}return x=Array.from(new Uint32Array(C.buffer,x,D)).map(Z=>Z?K(C,Z):""),I.module.xCreate(O,I.$b,x,W,i("Int32",j))},Zt=function(O,I,D,x,W,j){if(I=l.get(I),c.set(W,I),o){g.delete(W);for(const Z of g)c.delete(Z)}return x=Array.from(new Uint32Array(C.buffer,x,D)).map(Z=>Z?K(C,Z):""),I.module.xConnect(O,I.$b,x,W,i("Int32",j))},Kt=function(O,I){var D=c.get(O),x=k.get("sqlite3_index_info").hc;const W={};W.nConstraint=se(I+x[0],"i32"),W.aConstraint=[];for(var j=se(I+x[1],"*"),Z=k.get("sqlite3_index_constraint").size,fe=0;fe>=2,q[_]+q[_+1]*2**32}const l=typeof qr=="object",c=new Map,p=new Map;r.registerVFS=function(_,k){if(ve("sqlite3_vfs_find","number",["string"],[_.name]))throw Error(`VFS '${_.name}' already registered`);l&&(_.handleAsync=Lr);var O=_.dd??64;const I=r._malloc(4);return k=ve("register_vfs","number",["string","number","number","number"],[_.name,O,k?1:0,I]),k||(O=se(I,"*"),c.set(O,_)),r._free(I),k};const g=l?new Set:null;mr=function(_){const k=p.get(_);return l?g.add(_):p.delete(_),k.xClose(_)},gr=function(_,k,O,I){return p.get(_).xRead(_,C.subarray(k,k+O),o(I))},vr=function(_,k,O,I){return p.get(_).xWrite(_,C.subarray(k,k+O),o(I))},Sr=function(_,k){return p.get(_).xTruncate(_,o(k))},Tr=function(_,k){return p.get(_).xSync(_,k)},wr=function(_,k){const O=p.get(_);return k=i("BigInt64",k),O.xFileSize(_,k)},Er=function(_,k){return p.get(_).xLock(_,k)},Ir=function(_,k){return p.get(_).xUnlock(_,k)},pr=function(_,k){const O=p.get(_);return k=i("Int32",k),O.xCheckReservedLock(_,k)},br=function(_,k,O){const I=p.get(_);return O=new DataView(C.buffer,O),I.xFileControl(_,k,O)},Or=function(_){return p.get(_).xSectorSize(_)},yr=function(_){return p.get(_).xDeviceCharacteristics(_)},_r=function(_,k,O,I,D){if(_=c.get(_),p.set(O,_),l){g.delete(O);for(var x of g)p.delete(x)}if(x=null,I&64){x=1;const W=[];for(;x;){const j=C[k++];if(j)W.push(j);else switch(C[k]||(x=null),x){case 1:W.push(63),x=2;break;case 2:W.push(61),x=3;break;case 3:W.push(38),x=2}}x=new TextDecoder().decode(new Uint8Array(W))}else k&&(x=k?K(C,k):"");return D=i("Int32",D),_.xOpen(x,O,I,D)},Nr=function(_,k,O){return c.get(_).xDelete(k?K(C,k):"",O)},hr=function(_,k,O,I){return _=c.get(_),I=i("Int32",I),_.xAccess(k?K(C,k):"",O,I)}}();var ln={a:(i,o,l,c)=>{te(`Assertion failed: ${i?K(C,i):""}, at: `+[o?o?K(C,o):"":"unknown filename",l,c?c?K(C,c):"":"unknown function"])},L:function(i,o){try{return i=i?K(C,i):"",Dt(i,o),0}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return-l.Rb}},N:function(i,o,l){try{if(o=o?K(C,o):"",o=Fe(i,o),l&-8)return-28;var c=we(o,{ac:!0}).node;return c?(i="",l&4&&(i+="r"),l&2&&(i+="w"),l&1&&(i+="x"),i&&Qe(c,i)?-2:0):-44}catch(p){if(typeof ie>"u"||p.name!=="ErrnoError")throw p;return-p.Rb}},M:function(i,o){try{var l=be(i);return Dt(l.node,o),0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},K:function(i){try{var o=be(i).node,l=typeof o=="string"?we(o,{ac:!0}).node:o;if(!l.Fb.Tb)throw new L(63);return l.Fb.Tb(l,{timestamp:Date.now()}),0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},b:function(i,o,l){tt=l;try{var c=be(i);switch(o){case 0:var p=rt();if(0>p)return-28;for(;$e[p];)p++;return xt(c,p).Zb;case 1:case 2:return 0;case 3:return c.flags;case 4:return p=rt(),c.flags|=p,0;case 5:return p=rt(),V[p+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return T[Wr()>>2]=28,-1;default:return-28}}catch(g){if(typeof ie>"u"||g.name!=="ErrnoError")throw g;return-g.Rb}},J:function(i,o){try{var l=be(i);return et(Xe,l.path,o)}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},n:function(i,o,l){o=Je(o,l);try{if(isNaN(o))return 61;var c=be(i);if(!(c.flags&2097155))throw new L(28);return Wt(c.node,o),0}catch(p){if(typeof ie>"u"||p.name!=="ErrnoError")throw p;return-p.Rb}},D:function(i,o){try{if(o===0)return-28;var l=he("/")+1;return o"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},G:function(i,o){try{return i=i?K(C,i):"",et(qt,i,o)}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return-l.Rb}},A:function(i,o,l){try{return o=o?K(C,o):"",o=Fe(i,o),o=Ie(o),o[o.length-1]==="/"&&(o=o.substr(0,o.length-1)),Re(o,l),0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return-c.Rb}},F:function(i,o,l,c){try{o=o?K(C,o):"";var p=c&256;return o=Fe(i,o,c&4096),et(p?qt:Xe,o,l)}catch(g){if(typeof ie>"u"||g.name!=="ErrnoError")throw g;return-g.Rb}},z:function(i,o,l,c){tt=c;try{o=o?K(C,o):"",o=Fe(i,o);var p=c?rt():0;return Ye(o,l,p).Zb}catch(g){if(typeof ie>"u"||g.name!=="ErrnoError")throw g;return-g.Rb}},w:function(i,o,l,c){try{if(o=o?K(C,o):"",o=Fe(i,o),0>=c)return-28;var p=Lt(o),g=Math.min(c,he(p)),_=v[l+g];return ue(p,C,l,c+1),v[l+g]=_,g}catch(k){if(typeof ie>"u"||k.name!=="ErrnoError")throw k;return-k.Rb}},v:function(i){try{return i=i?K(C,i):"",At(i),0}catch(o){if(typeof ie>"u"||o.name!=="ErrnoError")throw o;return-o.Rb}},H:function(i,o){try{return i=i?K(C,i):"",et(Xe,i,o)}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return-l.Rb}},r:function(i,o,l){try{if(o=o?K(C,o):"",o=Fe(i,o),l===0){i=o;var c=we(i,{parent:!0}).node;if(!c)throw new L(44);var p=ze(i),g=Be(c,p),_=Rt(c,p,!1);if(_)throw new L(_);if(!c.Fb.rc)throw new L(63);if(g.cc)throw new L(10);c.Fb.rc(c,p),St(g)}else l===512?At(o):te("Invalid flags passed to unlinkat");return 0}catch(k){if(typeof ie>"u"||k.name!=="ErrnoError")throw k;return-k.Rb}},q:function(i,o,l){try{if(o=o?K(C,o):"",o=Fe(i,o,!0),l){var c=q[l>>2]+4294967296*T[l+4>>2],p=T[l+8>>2];g=1e3*c+p/1e6,l+=16,c=q[l>>2]+4294967296*T[l+4>>2],p=T[l+8>>2],_=1e3*c+p/1e6}else var g=Date.now(),_=g;i=g;var k=we(o,{ac:!0}).node;return k.Fb.Tb(k,{timestamp:Math.max(i,_)}),0}catch(O){if(typeof ie>"u"||O.name!=="ErrnoError")throw O;return-O.Rb}},k:function(i,o,l){i=new Date(1e3*Je(i,o)),T[l>>2]=i.getSeconds(),T[l+4>>2]=i.getMinutes(),T[l+8>>2]=i.getHours(),T[l+12>>2]=i.getDate(),T[l+16>>2]=i.getMonth(),T[l+20>>2]=i.getFullYear()-1900,T[l+24>>2]=i.getDay(),o=i.getFullYear(),T[l+28>>2]=(o%4!==0||o%100===0&&o%400!==0?tn:en)[i.getMonth()]+i.getDate()-1|0,T[l+36>>2]=-(60*i.getTimezoneOffset()),o=new Date(i.getFullYear(),6,1).getTimezoneOffset();var c=new Date(i.getFullYear(),0,1).getTimezoneOffset();T[l+32>>2]=(o!=c&&i.getTimezoneOffset()==Math.min(c,o))|0},i:function(i,o,l,c,p,g,_,k){p=Je(p,g);try{if(isNaN(p))return 61;var O=be(c);if(o&2&&!(l&2)&&(O.flags&2097155)!==2)throw new L(2);if((O.flags&2097155)===1)throw new L(2);if(!O.Pb.nc)throw new L(43);var I=O.Pb.nc(O,i,p,o,l),D=I.Rc;return T[_>>2]=I.Fc,q[k>>2]=D,0}catch(x){if(typeof ie>"u"||x.name!=="ErrnoError")throw x;return-x.Rb}},j:function(i,o,l,c,p,g,_){g=Je(g,_);try{if(isNaN(g))return 61;var k=be(p);if(l&2){if((k.node.mode&61440)!==32768)throw new L(43);c&2||k.Pb.oc&&k.Pb.oc(k,C.slice(i,i+o),g,o,c)}}catch(O){if(typeof ie>"u"||O.name!=="ErrnoError")throw O;return-O.Rb}},s:(i,o,l)=>{function c(O){return(O=O.toTimeString().match(/\(([A-Za-z ]+)\)$/))?O[1]:"GMT"}var p=new Date().getFullYear(),g=new Date(p,0,1),_=new Date(p,6,1);p=g.getTimezoneOffset();var k=_.getTimezoneOffset();q[i>>2]=60*Math.max(p,k),T[o>>2]=+(p!=k),i=c(g),o=c(_),i=zt(i),o=zt(o),k>2]=i,q[l+4>>2]=o):(q[l>>2]=o,q[l+4>>2]=i)},e:()=>Date.now(),d:()=>performance.now(),t:(i,o,l)=>C.copyWithin(i,o,o+l),o:i=>{var o=C.length;if(i>>>=0,2147483648=l;l*=2){var c=o*(1+.2/l);c=Math.min(c,i+100663296);var p=Math;c=Math.max(i,c);e:{p=(p.min.call(p,2147483648,c+(65536-c%65536)%65536)-y.buffer.byteLength+65535)/65536;try{y.grow(p),M();var g=1;break e}catch{}g=void 0}if(g)return!0}return!1},B:(i,o)=>{var l=0;return Qt().forEach((c,p)=>{var g=o+l;for(p=q[i+4*p>>2]=g,g=0;g>0]=c.charCodeAt(g);v[p>>0]=0,l+=c.length+1}),0},C:(i,o)=>{var l=Qt();q[i>>2]=l.length;var c=0;return l.forEach(p=>c+=p.length+1),q[o>>2]=c,0},f:function(i){try{var o=be(i);if(o.Zb===null)throw new L(8);o.sc&&(o.sc=null);try{o.Pb.close&&o.Pb.close(o)}catch(l){throw l}finally{$e[o.Zb]=null}return o.Zb=null,0}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return l.Rb}},p:function(i,o){try{var l=be(i);return v[o>>0]=l.Vb?2:Se(l.mode)?3:(l.mode&61440)===40960?7:4,V[o+2>>1]=0,ne=[0,(Q=0,1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[o+8>>2]=ne[0],T[o+12>>2]=ne[1],ne=[0,(Q=0,1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[o+16>>2]=ne[0],T[o+20>>2]=ne[1],0}catch(c){if(typeof ie>"u"||c.name!=="ErrnoError")throw c;return c.Rb}},y:function(i,o,l,c){try{e:{var p=be(i);i=o;for(var g,_=o=0;_>2],O=q[i+4>>2];i+=8;var I=p,D=k,x=O,W=g,j=v;if(0>x||0>W)throw new L(28);if(I.Zb===null)throw new L(8);if((I.flags&2097155)===1)throw new L(8);if(Se(I.node.mode))throw new L(31);if(!I.Pb.read)throw new L(28);var Z=typeof W<"u";if(!Z)W=I.position;else if(!I.seekable)throw new L(70);var fe=I.Pb.read(I,j,D,x,W);Z||(I.position+=fe);var ce=fe;if(0>ce){var Ee=-1;break e}if(o+=ce,ce>2]=Ee,0}catch(pe){if(typeof ie>"u"||pe.name!=="ErrnoError")throw pe;return pe.Rb}},l:function(i,o,l,c,p){o=Je(o,l);try{if(isNaN(o))return 61;var g=be(i);return Bt(g,o,c),ne=[g.position>>>0,(Q=g.position,1<=+Math.abs(Q)?0>>0:~~+Math.ceil((Q-+(~~Q>>>0))/4294967296)>>>0:0)],T[p>>2]=ne[0],T[p+4>>2]=ne[1],g.sc&&o===0&&c===0&&(g.sc=null),0}catch(_){if(typeof ie>"u"||_.name!=="ErrnoError")throw _;return _.Rb}},E:function(i){try{var o=be(i);return Ar(l=>{var c=o.node.Xb;c.type.Tc?c.type.Tc(c,!1,p=>{l(p?29:0)}):l(0)})}catch(l){if(typeof ie>"u"||l.name!=="ErrnoError")throw l;return l.Rb}},u:function(i,o,l,c){try{e:{var p=be(i);i=o;for(var g,_=o=0;_>2],O=q[i+4>>2];i+=8;var I=p,D=k,x=O,W=g,j=v;if(0>x||0>W)throw new L(28);if(I.Zb===null)throw new L(8);if(!(I.flags&2097155))throw new L(8);if(Se(I.node.mode))throw new L(31);if(!I.Pb.write)throw new L(28);I.seekable&&I.flags&1024&&Bt(I,0,2);var Z=typeof W<"u";if(!Z)W=I.position;else if(!I.seekable)throw new L(70);var fe=I.Pb.write(I,j,D,x,W,void 0);Z||(I.position+=fe);var ce=fe;if(0>ce){var Ee=-1;break e}o+=ce,typeof g<"u"&&(g+=ce)}Ee=o}return q[c>>2]=Ee,0}catch(pe){if(typeof ie>"u"||pe.name!=="ErrnoError")throw pe;return pe.Rb}},ta:Ut,P:$t,ia:Mt,da:Vt,_:Jt,I:Ht,ma:jt,x:Kt,g:Gt,pa:Xt,ka:Yt,fa:Zt,ga:er,h:tr,m:rr,qa:nr,sa:ir,ra:sr,ea:or,ha:ar,ja:lr,oa:ur,c:cr,la:dr,na:fr,ba:hr,W:pr,aa:mr,ca:Nr,T:yr,V:br,Z:wr,Y:Er,S:_r,R:gr,U:Or,$:Tr,O:Sr,X:Ir,Q:vr},B=function(){function i(l){if(l=l.exports,B=l=rn(l),y=B.ua,M(),J.unshift(B.va),P--,r.monitorRunDependencies&&r.monitorRunDependencies(P),P==0&&H){var c=H;H=null,c()}return l}var o={a:ln};if(P++,r.monitorRunDependencies&&r.monitorRunDependencies(P),r.instantiateWasm)try{return r.instantiateWasm(o,i)}catch(l){R(`Module.instantiateWasm callback failed with error: ${l}`),s(l)}return Ae(o,function(l){i(l.instance)}).catch(s),{}}();r._sqlite3_step=i=>(r._sqlite3_step=B.wa)(i),r._sqlite3_malloc=i=>(r._sqlite3_malloc=B.xa)(i),r._sqlite3_free=i=>(r._sqlite3_free=B.ya)(i),r._sqlite3_bind_blob=(i,o,l,c,p)=>(r._sqlite3_bind_blob=B.za)(i,o,l,c,p),r._sqlite3_bind_int=(i,o,l)=>(r._sqlite3_bind_int=B.Aa)(i,o,l),r._sqlite3_bind_int64=(i,o,l,c)=>(r._sqlite3_bind_int64=B.Ba)(i,o,l,c),r._sqlite3_bind_double=(i,o,l)=>(r._sqlite3_bind_double=B.Ca)(i,o,l),r._sqlite3_bind_null=(i,o)=>(r._sqlite3_bind_null=B.Da)(i,o),r._sqlite3_clear_bindings=i=>(r._sqlite3_clear_bindings=B.Ea)(i),r._sqlite3_bind_text=(i,o,l,c,p)=>(r._sqlite3_bind_text=B.Fa)(i,o,l,c,p),r._sqlite3_close=i=>(r._sqlite3_close=B.Ga)(i),r._sqlite3_column_type=(i,o)=>(r._sqlite3_column_type=B.Ha)(i,o),r._sqlite3_column_count=i=>(r._sqlite3_column_count=B.Ia)(i),r._sqlite3_column_text=(i,o)=>(r._sqlite3_column_text=B.Ja)(i,o),r._sqlite3_column_blob=(i,o)=>(r._sqlite3_column_blob=B.Ka)(i,o),r._sqlite3_column_bytes=(i,o)=>(r._sqlite3_column_bytes=B.La)(i,o),r._sqlite3_column_double=(i,o)=>(r._sqlite3_column_double=B.Ma)(i,o),r._sqlite3_column_int=(i,o)=>(r._sqlite3_column_int=B.Na)(i,o),r._sqlite3_column_int64=(i,o)=>(r._sqlite3_column_int64=B.Oa)(i,o),r._sqlite3_column_name=(i,o)=>(r._sqlite3_column_name=B.Pa)(i,o),r._sqlite3_declare_vtab=(i,o)=>(r._sqlite3_declare_vtab=B.Qa)(i,o),r._sqlite3_errmsg=i=>(r._sqlite3_errmsg=B.Ra)(i),r._sqlite3_exec=(i,o,l,c,p)=>(r._sqlite3_exec=B.Sa)(i,o,l,c,p),r._sqlite3_finalize=i=>(r._sqlite3_finalize=B.Ta)(i),r._sqlite3_prepare_v2=(i,o,l,c,p)=>(r._sqlite3_prepare_v2=B.Ua)(i,o,l,c,p),r._sqlite3_result_int=(i,o)=>(r._sqlite3_result_int=B.Va)(i,o),r._sqlite3_result_blob=(i,o,l,c)=>(r._sqlite3_result_blob=B.Wa)(i,o,l,c),r._sqlite3_result_int64=(i,o,l)=>(r._sqlite3_result_int64=B.Xa)(i,o,l),r._sqlite3_result_double=(i,o)=>(r._sqlite3_result_double=B.Ya)(i,o),r._sqlite3_result_null=i=>(r._sqlite3_result_null=B.Za)(i),r._sqlite3_result_error=(i,o,l)=>(r._sqlite3_result_error=B._a)(i,o,l),r._sqlite3_result_text=(i,o,l,c)=>(r._sqlite3_result_text=B.$a)(i,o,l,c),r._sqlite3_sql=i=>(r._sqlite3_sql=B.ab)(i),r._sqlite3_reset=i=>(r._sqlite3_reset=B.bb)(i),r._sqlite3_value_text=i=>(r._sqlite3_value_text=B.cb)(i),r._sqlite3_value_type=i=>(r._sqlite3_value_type=B.db)(i),r._sqlite3_value_bytes=i=>(r._sqlite3_value_bytes=B.eb)(i),r._sqlite3_value_blob=i=>(r._sqlite3_value_blob=B.fb)(i),r._sqlite3_value_int=i=>(r._sqlite3_value_int=B.gb)(i),r._sqlite3_value_int64=i=>(r._sqlite3_value_int64=B.hb)(i),r._sqlite3_value_double=i=>(r._sqlite3_value_double=B.ib)(i),r._sqlite3_get_autocommit=i=>(r._sqlite3_get_autocommit=B.jb)(i),r._sqlite3_vfs_find=i=>(r._sqlite3_vfs_find=B.kb)(i),r._sqlite3_data_count=i=>(r._sqlite3_data_count=B.lb)(i),r._sqlite3_bind_parameter_count=i=>(r._sqlite3_bind_parameter_count=B.mb)(i),r._sqlite3_bind_parameter_name=(i,o)=>(r._sqlite3_bind_parameter_name=B.nb)(i,o),r._sqlite3_libversion=()=>(r._sqlite3_libversion=B.ob)(),r._sqlite3_libversion_number=()=>(r._sqlite3_libversion_number=B.pb)(),r._sqlite3_changes=i=>(r._sqlite3_changes=B.qb)(i),r._sqlite3_limit=(i,o,l)=>(r._sqlite3_limit=B.rb)(i,o,l),r._sqlite3_open_v2=(i,o,l,c)=>(r._sqlite3_open_v2=B.sb)(i,o,l,c);var Wr=()=>(Wr=B.tb)(),Et=r._malloc=i=>(Et=r._malloc=B.ub)(i),Br=r._free=i=>(Br=r._free=B.vb)(i);r._RegisterExtensionFunctions=i=>(r._RegisterExtensionFunctions=B.wb)(i),r._set_authorizer=i=>(r._set_authorizer=B.xb)(i),r._create_function=(i,o,l,c,p,g)=>(r._create_function=B.yb)(i,o,l,c,p,g),r._update_hook=(i,o)=>(r._update_hook=B.zb)(i,o),r._create_module=(i,o,l,c)=>(r._create_module=B.Ab)(i,o,l,c),r._progress_handler=(i,o)=>(r._progress_handler=B.Bb)(i,o),r._register_vfs=(i,o,l,c)=>(r._register_vfs=B.Cb)(i,o,l,c),r._getSqliteFree=()=>(r._getSqliteFree=B.Db)();var Fr=r._main=(i,o)=>(Fr=r._main=B.Eb)(i,o),Pr=(i,o)=>(Pr=B.Gb)(i,o),zr=()=>(zr=B.Hb)(),Qr=()=>(Qr=B.Ib)(),Ur=i=>(Ur=B.Jb)(i),_t=i=>(_t=B.Kb)(i),$r=i=>($r=B.Lb)(i),Mr=()=>(Mr=B.Mb)(),Vr=i=>(Vr=B.Nb)(i),Jr=()=>(Jr=B.Ob)();r.getTempRet0=zr,r.ccall=ve,r.cwrap=(i,o,l,c)=>{var p=!l||l.every(g=>g==="number"||g==="boolean");return o!=="string"&&p&&!c?r["_"+i]:function(){return ve(i,o,l,arguments,c)}},r.setValue=de,r.getValue=se,r.UTF8ToString=(i,o)=>i?K(C,i,o):"",r.stringToUTF8=(i,o,l)=>ue(i,C,o,l),r.lengthBytesUTF8=he;var st;H=function i(){st||Hr(),st||(H=i)};function Hr(){function i(){if(!st&&(st=!0,r.calledRun=!0,!m)){if(r.noFSInit||Pt||(Pt=!0,Ft(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Me("stdin",r.stdin):pt("/dev/tty","/dev/stdin"),r.stdout?Me("stdout",null,r.stdout):pt("/dev/tty","/dev/stdout"),r.stderr?Me("stderr",null,r.stderr):pt("/dev/tty1","/dev/stderr"),Ye("/dev/stdin",0),Ye("/dev/stdout",1),Ye("/dev/stderr",1)),Tt=!1,Pe(J),Pe(ae),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),jr){var o=Fr;try{var l=o(0,0);E=l,Cr(l)}catch(c){bt(c)}}if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)o=r.postRun.shift(),ee.unshift(o);Pe(ee)}}if(!(0>32n,y=BigInt(Number.MIN_SAFE_INTEGER)>>32n;return function(m,E){return E>h||E2147483647||v<-2147483648)return SQLITE_RANGE;const C=y(m,E,v);return S(h,C,b.get(m))}}(),e.bind_int64=function(){const h="sqlite3_bind_int64",y=t.cwrap(h,...decl("nnnn:n"));return function(m,E,v){if(w(m),v>MAX_INT64||v>32n,T=y(m,E,Number(C),Number(V));return S(h,T,b.get(m))}}(),e.bind_null=function(){const h="sqlite3_bind_null",y=t.cwrap(h,...decl("nn:n"));return function(m,E){w(m);const v=y(m,E);return S(h,v,b.get(m))}}(),e.bind_parameter_name=function(){const y=t.cwrap("sqlite3_bind_parameter_name",...decl("n:s"));return function(m,E){return w(m),y(m,E)}}(),e.bind_text=function(){const h="sqlite3_bind_text",y=t.cwrap(h,...decl("nnnnn:n"));return function(m,E,v){w(m);const C=a(v),V=y(m,E,C,-1,r);return S(h,V,b.get(m))}}(),e.changes=function(){const y=t.cwrap("sqlite3_changes",...decl("n:n"));return function(m){return N(m),y(m)}}(),e.close=function(){const h="sqlite3_close",y=t.cwrap(h,...decl("n:n"),{async});return async function(m){N(m);const E=await y(m);return f.delete(m),S(h,E,m)}}(),e.column=function(h,y){w(h);const m=e.column_type(h,y);switch(m){case SQLITE_BLOB:return e.column_blob(h,y);case SQLITE_FLOAT:return e.column_double(h,y);case SQLITE_INTEGER:const E=e.column_int(h,y),v=t.getTempRet0();return d(E,v);case SQLITE_NULL:return null;case SQLITE_TEXT:return e.column_text(h,y);default:throw new SQLiteError("unknown type",m)}},e.column_blob=function(){const y=t.cwrap("sqlite3_column_blob",...decl("nn:n"));return function(m,E){w(m);const v=e.column_bytes(m,E),C=y(m,E),V=t.HEAPU8.subarray(C,C+v),T=new ArrayBuffer(V.byteLength),q=new Uint8Array(T);return q.set(V),q}}(),e.column_bytes=function(){const y=t.cwrap("sqlite3_column_bytes",...decl("nn:n"));return function(m,E){return w(m),y(m,E)}}(),e.column_count=function(){const y=t.cwrap("sqlite3_column_count",...decl("n:n"));return function(m){return w(m),y(m)}}(),e.column_double=function(){const y=t.cwrap("sqlite3_column_double",...decl("nn:n"));return function(m,E){return w(m),y(m,E)}}(),e.column_int=function(){const y=t.cwrap("sqlite3_column_int64",...decl("nn:n"));return function(m,E){return w(m),y(m,E)}}(),e.column_int64=function(){const y=t.cwrap("sqlite3_column_int64",...decl("nn:n"));return function(m,E){w(m);const v=y(m,E),C=t.getTempRet0();return u(v,C)}}(),e.column_name=function(){const y=t.cwrap("sqlite3_column_name",...decl("nn:s"));return function(m,E){return w(m),y(m,E)}}(),e.column_names=function(h){const y=[],m=e.column_count(h);for(let E=0;EMAX_INT64||E>32n;y(m,Number(v),Number(C))}}(),e.result_null=function(){const y=t.cwrap("sqlite3_result_null",...decl("n:n"));return function(m){y(m)}}(),e.result_text=function(){const y=t.cwrap("sqlite3_result_text",...decl("nnnn:n"));return function(m,E){const v=a(E);y(m,v,-1,r)}}(),e.row=function(h){const y=[],m=e.data_count(h);for(let E=0;Ee.call(this,n);return await(this.#r=this.#r.then(s,s)),this.#e=n,SQLITE_OK}catch(s){return s.name==="AbortError"?SQLITE_BUSY:(console.error(s),SQLITE_IOERR_LOCK)}}async#i(e){if(e===this.#e)return SQLITE_OK;switch(this.#e){case SQLITE_LOCK_NONE:switch(e){case SQLITE_LOCK_SHARED:return this._NONEtoSHARED();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_SHARED:switch(e){case SQLITE_LOCK_RESERVED:return this._SHAREDtoRESERVED();case SQLITE_LOCK_EXCLUSIVE:return this._SHAREDtoEXCLUSIVE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_RESERVED:switch(e){case SQLITE_LOCK_EXCLUSIVE:return this._RESERVEDtoEXCLUSIVE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}}async#s(e){if(e===this.#e)return SQLITE_OK;switch(this.#e){case SQLITE_LOCK_EXCLUSIVE:switch(e){case SQLITE_LOCK_SHARED:return this._EXCLUSIVEtoSHARED();case SQLITE_LOCK_NONE:return this._EXCLUSIVEtoNONE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_RESERVED:switch(e){case SQLITE_LOCK_SHARED:return this._RESERVEDtoSHARED();case SQLITE_LOCK_NONE:return this._RESERVEDtoNONE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}case SQLITE_LOCK_SHARED:switch(e){case SQLITE_LOCK_NONE:return this._SHAREDtoNONE();default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}default:throw new Error(`unexpected transition ${this.#e} -> ${e}`)}}async _NONEtoSHARED(){}async _SHAREDtoEXCLUSIVE(){await this._SHAREDtoRESERVED(),await this._RESERVEDtoEXCLUSIVE()}async _SHAREDtoRESERVED(){}async _RESERVEDtoEXCLUSIVE(){}async _EXCLUSIVEtoRESERVED(){}async _EXCLUSIVEtoSHARED(){await this._EXCLUSIVEtoRESERVED(),await this._RESERVEDtoSHARED()}async _EXCLUSIVEtoNONE(){await this._EXCLUSIVEtoRESERVED(),await this._RESERVEDtoSHARED(),await this._SHAREDtoNONE()}async _RESERVEDtoSHARED(){}async _RESERVEDtoNONE(){await this._RESERVEDtoSHARED(),await this._SHAREDtoNONE()}async _SHAREDtoNONE(){}_acquireWebLock(e,r){return new Promise(async(n,s)=>{try{await navigator.locks.request(e,r,a=>{if(n(a),a)return new Promise(u=>this.#t.set(e,u))})}catch(a){s(a)}})}_releaseWebLock(e){this.#t.get(e)?.(),this.#t.delete(e)}async _pollWebLock(e){return(await navigator.locks.query()).held.find(({name:n})=>n===e)?.mode}_getTimeoutSignal(){if(this.timeoutMillis){const e=new AbortController;return setTimeout(()=>e.abort(),this.timeoutMillis),e.signal}}}class WebLocksExclusive extends WebLocksBase{constructor(e){super(),this._lockName=e+"-outer",this._reservedName=e+"-reserved"}async isSomewhereReserved(){return await this._pollWebLock(this._reservedName)==="exclusive"}async _NONEtoSHARED(){await this._acquireWebLock(this._lockName,{mode:"exclusive",signal:this._getTimeoutSignal()})}async _SHAREDtoRESERVED(){await this._acquireWebLock(this._reservedName,{mode:"exclusive",signal:this._getTimeoutSignal()})}async _RESERVEDtoSHARED(){this._releaseWebLock(this._reservedName)}async _SHAREDtoNONE(){this._releaseWebLock(this._lockName)}}const MAX_TRANSACTION_LIFETIME_MILLIS=5e3;let nextTxId=0;const mapTxToId=new WeakMap;function log$2(...t){}class IDBContext{#e;#t;#r;#n=null;#i=0;#s=Promise.resolve();#o=Promise.resolve();constructor(e,r={durability:"default"}){this.#t=Promise.resolve(e).then(n=>this.#e=n),this.#r=r}async close(){const e=this.#e??await this.#t;await this.#s,await this.sync(),e.close()}async run(e,r){const n=this.#s.then(()=>this.#a(e,r));return this.#s=n.catch(()=>{}),n}async#a(e,r){const n=this.#e??await this.#t;if(e==="readwrite"&&this.#n?.mode==="readonly")this.#n=null;else if(performance.now()-this.#i>MAX_TRANSACTION_LIFETIME_MILLIS){try{this.#n?.commit()}catch(s){if(s.name!=="InvalidStateError")throw s}await new Promise(s=>setTimeout(s)),this.#n=null}for(let s=0;s<2;++s){if(!this.#n){this.#n=n.transaction(n.objectStoreNames,e,this.#r);const a=this.#i=performance.now();this.#o=this.#o.then(()=>new Promise((u,d)=>{this.#n.addEventListener("complete",f=>{u(),this.#n===f.target&&(this.#n=null),log$2(`transaction ${mapTxToId.get(f.target)} complete`)}),this.#n.addEventListener("abort",f=>{console.warn("tx abort",(performance.now()-a)/1e3);const N=f.target.error;d(N),this.#n===f.target&&(this.#n=null),log$2(`transaction ${mapTxToId.get(f.target)} aborted`,N)})})),mapTxToId.set(this.#n,nextTxId++)}try{const a=Object.fromEntries(Array.from(n.objectStoreNames,u=>[u,new ObjectStore(this.#n.objectStore(u))]));return await r(a)}catch(a){if(this.#n=null,s)throw a}}}async sync(){await this.#s,await this.#o,this.#o=Promise.resolve()}}function wrapRequest(t){return new Promise((e,r)=>{t.addEventListener("success",()=>e(t.result)),t.addEventListener("error",()=>r(t.error))})}class ObjectStore{#e;constructor(e){this.#e=e}get(e){log$2(`get ${this.#e.name}`,e);const r=this.#e.get(e);return wrapRequest(r)}getAll(e,r){log$2(`getAll ${this.#e.name}`,e,r);const n=this.#e.getAll(e,r);return wrapRequest(n)}getKey(e){log$2(`getKey ${this.#e.name}`,e);const r=this.#e.getKey(e);return wrapRequest(r)}getAllKeys(e,r){log$2(`getAllKeys ${this.#e.name}`,e,r);const n=this.#e.getAllKeys(e,r);return wrapRequest(n)}put(e,r){log$2(`put ${this.#e.name}`,e,r);const n=this.#e.put(e,r);return wrapRequest(n)}delete(e){log$2(`delete ${this.#e.name}`,e);const r=this.#e.delete(e);return wrapRequest(r)}clear(){log$2(`clear ${this.#e.name}`);const e=this.#e.clear();return wrapRequest(e)}index(e){return new Index(this.#e.index(e))}}class Index{#e;constructor(e){this.#e=e}getAllKeys(e,r){log$2(`IDBIndex.getAllKeys ${this.#e.objectStore.name}<${this.#e.name}>`,e,r);const n=this.#e.getAllKeys(e,r);return wrapRequest(n)}}const SECTOR_SIZE=512,MAX_TASK_MILLIS=3e3,DEFAULT_OPTIONS={durability:"default",purge:"deferred",purgeAtLeast:16};function log$1(...t){}class IDBBatchAtomicVFS extends Base{#e;#t=new Map;#r;#n=new Set;#i=performance.now();#s=new Set;constructor(e="wa-sqlite",r=DEFAULT_OPTIONS){super(),this.name=e,this.#e=Object.assign({},DEFAULT_OPTIONS,r),this.#r=new IDBContext(openDatabase(e),{durability:this.#e.durability})}async close(){for(const e of this.#t.keys())await this.xClose(e);await this.#r?.close(),this.#r=null}xOpen(e,r,n,s){return this.handleAsync(async()=>{e===null&&(e=`null_${r}`),log$1(`xOpen ${e} 0x${r.toString(16)} 0x${n.toString(16)}`);try{const a=new URL(e,"http://localhost/"),u={path:a.pathname,flags:n,block0:null,isMetadataChanged:!0,locks:new WebLocksExclusive(a.pathname)};return this.#t.set(r,u),await this.#r.run("readwrite",async({blocks:d})=>{if(u.block0=await d.get(this.#l(u,0)),!u.block0)if(n&SQLITE_OPEN_CREATE)u.block0={path:u.path,offset:0,version:0,data:new Uint8Array(0),fileSize:0},d.put(u.block0);else throw new Error(`file not found: ${u.path}`)}),s.setInt32(0,n&SQLITE_OPEN_READONLY,!0),SQLITE_OK}catch(a){return console.error(a),SQLITE_CANTOPEN}})}xClose(e){return this.handleAsync(async()=>{try{const r=this.#t.get(e);return r&&(log$1(`xClose ${r.path}`),this.#t.delete(e),r.flags&SQLITE_OPEN_DELETEONCLOSE&&this.#r.run("readwrite",({blocks:n})=>{n.delete(IDBKeyRange.bound([r.path],[r.path,[]]))})),SQLITE_OK}catch(r){return console.error(r),SQLITE_IOERR}})}xRead(e,r,n){return this.handleAsync(async()=>{const s=this.#t.get(e);log$1(`xRead ${s.path} ${r.byteLength} ${n}`);try{return await this.#r.run("readonly",async({blocks:u})=>{let d=0;for(;dMAX_TASK_MILLIS){const a=this.handleAsync(async()=>{this.handleAsync!==super.handleAsync&&this.#s.add(e),await new Promise(d=>setTimeout(d));const u=this.#o(e,r,n);return this.#i=performance.now(),u});return s&&this.#s.delete(e),a}return this.#o(e,r,n)}#o(e,r,n){const s=this.#t.get(e);log$1(`xWrite ${s.path} ${r.byteLength} ${n}`);try{const a=s.block0.fileSize;s.block0.fileSized.put(u))):this.#r.run("readwrite",({blocks:d})=>d.put(u)),s.isMetadataChanged=n===0?!1:s.isMetadataChanged,SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}}xTruncate(e,r){const n=this.#t.get(e);log$1(`xTruncate ${n.path} ${r}`);try{Object.assign(n.block0,{fileSize:r,data:n.block0.data.slice(0,r)});const s=Object.assign({},n.block0);return this.#r.run("readwrite",({blocks:a})=>{a.delete(this.#l(n,-1/0,-r)),a.put(s)}),SQLITE_OK}catch(s){return console.error(s),SQLITE_IOERR}}xSync(e,r){const n=this.#s.has(e);if(n||this.#e.durability!=="relaxed"||performance.now()-this.#i>MAX_TASK_MILLIS){const a=this.handleAsync(async()=>{this.handleAsync!==super.handleAsync&&this.#s.add(e);const u=await this.#a(e,r);return this.#i=performance.now(),u});return n&&this.#s.delete(e),a}const s=this.#t.get(e);return log$1(`xSync ${s.path} ${r}`),SQLITE_OK}async#a(e,r){const n=this.#t.get(e);log$1(`xSync ${n.path} ${r}`);try{n.isMetadataChanged&&(this.#r.run("readwrite",async({blocks:s})=>{await s.put(n.block0)}),n.isMetadataChanged=!1),await this.#r.sync()}catch(s){return console.error(s),SQLITE_IOERR}return SQLITE_OK}xFileSize(e,r){const n=this.#t.get(e);return log$1(`xFileSize ${n.path}`),r.setBigInt64(0,BigInt(n.block0.fileSize),!0),SQLITE_OK}xLock(e,r){return this.handleAsync(async()=>{const n=this.#t.get(e);log$1(`xLock ${n.path} ${r}`);try{const s=await n.locks.lock(r);return s===SQLITE_OK&&n.locks.state===SQLITE_LOCK_SHARED&&(n.block0=await this.#r.run("readonly",({blocks:a})=>a.get(this.#l(n,0)))),s}catch(s){return console.error(s),SQLITE_IOERR}})}xUnlock(e,r){return this.handleAsync(async()=>{const n=this.#t.get(e);log$1(`xUnlock ${n.path} ${r}`);try{return n.locks.unlock(r)}catch(s){return console.error(s),SQLITE_IOERR}})}xCheckReservedLock(e,r){return this.handleAsync(async()=>{const n=this.#t.get(e);log$1(`xCheckReservedLock ${n.path}`);const s=await n.locks.isSomewhereReserved();return r.setInt32(0,s?1:0,!0),SQLITE_OK})}xSectorSize(e){return SECTOR_SIZE}xDeviceCharacteristics(e){return SQLITE_IOCAP_BATCH_ATOMIC|SQLITE_IOCAP_SAFE_APPEND|SQLITE_IOCAP_SEQUENTIAL|SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN}xFileControl(e,r,n){const s=this.#t.get(e);switch(log$1(`xFileControl ${s.path} ${r}`),r){case 11:return s.overwrite=!0,SQLITE_OK;case 21:if(s.overwrite)try{return this.handleAsync(async()=>(await this.#c(s),SQLITE_OK))}catch(a){return console.error(a),SQLITE_IOERR}if(s.isMetadataChanged)try{this.#r.run("readwrite",async({blocks:a})=>{await a.put(s.block0)}),s.isMetadataChanged=!1}catch(a){return console.error(a),SQLITE_IOERR}return SQLITE_OK;case 22:return s.overwrite=!1,SQLITE_OK;case 31:return this.handleAsync(async()=>{try{return s.block0.version--,s.changedPages=new Set,this.#r.run("readwrite",async({blocks:a})=>{const u=await a.index("version").getAllKeys(IDBKeyRange.bound([s.path],[s.path,s.block0.version]));for(const d of u)a.delete(d)}),SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}});case 32:try{const a=Object.assign({},s.block0);a.data=a.data.slice();const u=s.changedPages;return s.changedPages=null,s.isMetadataChanged=!1,this.#r.run("readwrite",async({blocks:d})=>{d.put(a);const f=await d.get([s.path,"purge",0])??{path:s.path,offset:"purge",version:0,data:new Map,count:0};f.count+=u.size;for(const N of u)f.data.set(N,a.version);d.put(f),this.#u(s.path,f.count)}),SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}case 33:return this.handleAsync(async()=>{try{return s.changedPages=null,s.isMetadataChanged=!1,s.block0=await this.#r.run("readonly",({blocks:a})=>a.get([s.path,0,s.block0.version+1])),SQLITE_OK}catch(a){return console.error(a),SQLITE_IOERR}});default:return SQLITE_NOTFOUND}}xAccess(e,r,n){return this.handleAsync(async()=>{try{const s=new URL(e,"file://localhost/").pathname;log$1(`xAccess ${s} ${r}`);const a=await this.#r.run("readonly",({blocks:u})=>u.getKey(this.#l({path:s},0)));return n.setInt32(0,a?1:0,!0),SQLITE_OK}catch(s){return console.error(s),SQLITE_IOERR}})}xDelete(e,r){return this.handleAsync(async()=>{const n=new URL(e,"file://localhost/").pathname;try{return this.#r.run("readwrite",({blocks:s})=>s.delete(IDBKeyRange.bound([n],[n,[]]))),r&&await this.#r.sync(),SQLITE_OK}catch(s){return console.error(s),SQLITE_IOERR}})}async purge(e){const r=Date.now();await this.#r.run("readwrite",async({blocks:n})=>{const s=await n.get([e,"purge",0]);if(s){for(const[a,u]of s.data)n.delete(IDBKeyRange.bound([e,a,u],[e,a,1/0],!0,!1));await n.delete([e,"purge",0])}log$1(`purge ${e} ${s?.data.size??0} pages in ${Date.now()-r} ms`)})}#u(e,r){this.#e.purge==="manual"||this.#n.has(e)||r{this.purge(e),this.#n.delete(e)}):setTimeout(()=>{this.purge(e),this.#n.delete(e)}),this.#n.add(e))}#l(e,r,n=0){const s=!r||-r{const A=await w.index("version").getAllKeys(IDBKeyRange.bound([e.path,b+1],[e.path,1/0]));for(const R of A)w.delete(R);w.delete([e.path,"purge",0]);for(let R=0;R=N)break;const E={path:h.path,offset:m,version:b,data:h.data.subarray(y*s,(y+1)*s)};E.offset===0&&(E.fileSize=N,e.block0=E),w.put(E)}}}})}}function openDatabase(t){return new Promise((e,r)=>{const n=globalThis.indexedDB.open(t,5);n.addEventListener("upgradeneeded",function(){n.result.createObjectStore("blocks",{keyPath:["path","offset","version"]}).createIndex("version",["path","version"])}),n.addEventListener("success",()=>{e(n.result)}),n.addEventListener("error",()=>{r(n.error)})})}const E_CANCELED=new Error("request for lock canceled");var __awaiter$2=function(t,e,r,n){function s(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function d(b){try{N(n.next(b))}catch(w){u(w)}}function f(b){try{N(n.throw(b))}catch(w){u(w)}}function N(b){b.done?a(b.value):s(b.value).then(d,f)}N((n=n.apply(t,e||[])).next())})};class Semaphore{constructor(e,r=E_CANCELED){this._value=e,this._cancelError=r,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((r,n)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:r,reject:n}),this._dispatch()})}runExclusive(e,r=1){return __awaiter$2(this,void 0,void 0,function*(){const[n,s]=yield this.acquire(r);try{return yield e(n)}finally{s()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(r=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(r),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(r=>r.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let r=this._value;r>0;r--){const n=(e=this._weightedQueues[r-1])===null||e===void 0?void 0:e.shift();if(!n)continue;const s=this._value,a=r;this._value-=r,r=this._value+1,n.resolve([s,this._newReleaser(a)])}this._drainUnlockWaiters()}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)this._weightedWaiters[e-1]&&(this._weightedWaiters[e-1].forEach(r=>r()),this._weightedWaiters[e-1]=[])}}var __awaiter$1=function(t,e,r,n){function s(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function d(b){try{N(n.next(b))}catch(w){u(w)}}function f(b){try{N(n.throw(b))}catch(w){u(w)}}function N(b){b.done?a(b.value):s(b.value).then(d,f)}N((n=n.apply(t,e||[])).next())})};class Mutex{constructor(e){this._semaphore=new Semaphore(1,e)}acquire(){return __awaiter$1(this,void 0,void 0,function*(){const[,e]=yield this._semaphore.acquire();return e})}runExclusive(e){return this._semaphore.runExclusive(()=>e())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const isDebug=globalThis.__vlcn_wa_crsqlite_dbg;function log(...t){isDebug&&console.log("crsqlite-wasm: ",...t)}const re=/insert\s|update\s|delete\s/,txRe=/begin\s|commit\s|rollback\s|savepoint\s/;function computeCacheKey(t,e,r){const n=t.toLowerCase();if(txRe.exec(n)==null)return re.exec(n)!=null?(log("received write"),null):r!=null?n+"|"+e+"|"+r.map(a=>a!=null?a.toString():"null").join("|"):n}class Stmt{originDB;stmtFinalizer;cache;api;base;str;sql;mode="o";finalized=!1;bindings=[];constructor(e,r,n,s,a,u,d){this.originDB=e,this.stmtFinalizer=r,this.cache=n,this.api=s,this.base=a,this.str=u,this.sql=d,r.set(a,this)}run(e,...r){return serialize(this.cache,computeCacheKey(this.sql,this.mode,r.length>0?r:this.bindings),()=>(r.length>0&&this.bind(r),this.api.step(this.base).then(()=>this.api.reset(this.base))),e?.__mutex||this.originDB.__mutex)}get(e,...r){return serialize(this.cache,computeCacheKey(this.sql,this.mode,r.length>0?r:this.bindings),async()=>{r.length>0&&this.bind(r);let n=null,s=this.mode==="o"?this.api.column_names(this.base):null;if(await this.api.step(this.base)==SQLITE_ROW){const a=this.api.row(this.base);if(s!=null){const u={};for(let d=0;d0?r:this.bindings),async()=>{r.length>0&&this.bind(r);const n=[];let s=this.mode==="o"?this.api.column_names(this.base):null;for(;await this.api.step(this.base)==SQLITE_ROW;)if(s!=null){const a={};for(let u=0;uthis.api.step(this.base),e?.__mutex||this.originDB.__mutex)==SQLITE_ROW;)yield this.api.row(this.base);await serialize(this.cache,void 0,()=>this.api.reset(this.base),e?.__mutex||this.originDB.__mutex)}raw(e){return e?this.mode="a":this.mode="o",this}bind(e){this.bindings=e;for(let r=0;r{if(!this.finalized)return this.finalized=!0,this.api.str_finish(this.str),this.stmtFinalizer.delete(this.base),this.api.finalize(this.base)},e?.__mutex||this.originDB.__mutex)}}class TX{api;db;__mutex;assertOpen;stmtFinalizer;cache=new Map;constructor(e,r,n,s,a){this.api=e,this.db=r,this.__mutex=n,this.assertOpen=s,this.stmtFinalizer=a}execMany(e){return this.assertOpen(),serialize(this.cache,null,()=>this.api.exec(this.db,e.join("")),this.__mutex)}exec(e,r){return this.assertOpen(),serialize(this.cache,computeCacheKey(e,"a",r),()=>this.statements(e,!1,r),this.__mutex)}execO(e,r){return this.assertOpen(),serialize(this.cache,computeCacheKey(e,"o",r),()=>this.statements(e,!0,r),this.__mutex)}execA(e,r){return this.assertOpen(),serialize(this.cache,computeCacheKey(e,"a",r),()=>this.statements(e,!1,r),this.__mutex)}prepare(e){return this.assertOpen(),serialize(this.cache,void 0,async()=>{const r=this.api.str_new(this.db,e),n=await this.api.prepare_v2(this.db,this.api.str_value(r));if(n==null)throw this.api.str_finish(r),new Error(`Could not prepare ${e}`);return new Stmt(this,this.stmtFinalizer,this.cache,this.api,n.stmt,r,e)},this.__mutex)}tx(e){this.assertOpen();const r="crsql"+crypto.randomUUID().replaceAll("-","");return serializeTx(async n=>{await n.exec("SAVEPOINT "+r);try{await e(n)}catch(s){throw await n.exec("ROLLBACK TO "+r),await n.exec("RELEASE "+r),s}await n.exec("RELEASE "+r)},this.__mutex,this)}imperativeTx(){return this.__mutex.acquire().then(e=>{const r=new Mutex;return[e,new TX(this.api,this.db,r,this.assertOpen,this.stmtFinalizer)]})}async statements(e,r,n){const s=[],a=this.api.str_new(this.db,e);let u={stmt:null,sql:this.api.str_value(a)};try{for(;u=await this.api.prepare_v2(this.db,u.sql);){const N=u.stmt,b=[],w=this.api.column_names(N);for(n&&this.bind(N,n);await this.api.step(N)===SQLITE_ROW;){const A=this.api.row(N);b.push(A)}w.length&&s.push({columns:w,rows:b}),this.api.finalize(u.stmt),u.stmt=null}}catch(N){throw console.error(`Failed running ${e}`,N),N}finally{u?.stmt&&this.api.finalize(u.stmt),this.api.str_finish(a)}const d=s[0];if(d==null)return null;if(!r)return d.rows;const f=[];for(const N of d.rows){const b={};for(let w=0;wt?.delete(e)).catch(a=>{console.error(a)})),s}function serializeTx(t,e,r){return e.runExclusive(()=>{const n=new Mutex,s=new TX(r.api,r.db,n,r.assertOpen,r.stmtFinalizer);return t(s)})}function cryb64(t,e=0){let r=3735928559^e,n=1103547991^e;for(let s=0,a;s>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),4294967296n*BigInt(n)+BigInt(r)}function firstPick(t){const e=t[0];if(e!=null)return e[Object.keys(e)[0]]}class DB{api;db;filename;__mutex=topLevelMutex;stmtFinalizer=new Map;#e=null;#t=null;cache=new Map;#r=null;#n=!1;#i;constructor(e,r,n){this.api=e,this.db=r,this.filename=n,this.#i=new TX(e,r,topLevelMutex,this.#s,this.stmtFinalizer)}get siteid(){return this.#e}_setSiteid(e){if(this.#e)throw new Error("Site id already set");this.#e=e}_setTablesUsedStmt(e){this.#t=e}get tablesUsedStmt(){if(this.#t==null)throw new Error("tablesUsedStmt not set");return this.#t}async automigrateTo(e,r){const n=cryb64(r),s=firstPick(await this.execA("SELECT value FROM crsql_master WHERE key = 'schema_name'")),a=firstPick(await this.execA("SELECT value FROM crsql_master WHERE key = 'schema_version'"));if(s===e&&BigInt(a||0)===n)return"noop";const u=s===void 0||s!==e?"apply":"migrate";return await this.tx(async d=>{if(a==null||s!==e){if(s!==e){const f=await d.execA("SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'crsql_%'");for(const N of f)await d.exec(`DROP TABLE [${N[0]}]`)}await d.exec(r)}else await d.exec("SELECT crsql_automigrate(?, 'SELECT crsql_finalize();')",[r]);await d.exec("INSERT OR REPLACE INTO crsql_master (key, value) VALUES (?, ?)",["schema_version",n]),await d.exec("INSERT OR REPLACE INTO crsql_master (key, value) VALUES (?, ?)",["schema_name",e])}),await this.exec("VACUUM;"),u}execMany(e){return this.#i.execMany(e)}exec(e,r){return this.#i.exec(e,r)}#s=()=>{if(this.#n)throw new Error("The DB is closed")};execO(e,r){return this.#i.execO(e,r)}execA(e,r){return this.#i.execA(e,r)}prepare(e){return this.#i.prepare(e)}tx(e){return this.#i.tx(e)}imperativeTx(){return this.#i.imperativeTx()}async close(){for(const e of this.stmtFinalizer.values())await e.finalize(this);return this.#t?.finalize(this),this.exec("SELECT crsql_finalize()").then(()=>(this.#n=!0,serialize(this.cache,void 0,()=>this.api.close(this.db),this.__mutex)))}createFunction(e,r,n){this.#s(),this.api.create_function(this.db,e,r.length,SQLITE_UTF8,0,(s,a)=>{const u=[];for(let f=0;fthis.#r?.delete(e)}#o=(e,r,n,s)=>{this.#r!=null&&this.#r.forEach(a=>{try{a(e,r,n,s)}catch(u){console.error("Failed notifying a DB update listener"),console.error(u)}})}}let api=null;class SQLite3{base;constructor(e){this.base=e}open(e,r="c"){return serialize(null,void 0,()=>this.base.open_v2(e||":memory:",SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_URI,e!=null?"idb-batch-atomic":void 0),topLevelMutex).then(n=>{const s=new DB(this.base,n,e||":memory:");return s.prepare(`SELECT tbl_name FROM tables_used(?) AS u JOIN sqlite_master ON sqlite_master.name = u.name WHERE u.schema = 'main'`).then(a=>{a.raw(!0),s._setTablesUsedStmt(a)}).then(()=>s.execA("select quote(crsql_site_id());")).then(a=>(s._setSiteid(a[0][0].replace(/'|X/g,"")),s))})}}async function initWasm(t){if(api!=null)return api;const e=await Module({locateFile(n){return t?t(n):new URL(""+new URL("../assets/crsqlite.mmzGBJgt.wasm",import.meta.url).href,import.meta.url).href}}),r=Factory(e);return r.vfs_register(new IDBBatchAtomicVFS("idb-batch-atomic",{durability:"relaxed"})),api=new SQLite3(r),api}async function load(t,e){return{database:await(await initWasm(()=>e.wasm||wasmUrl)).open(t),browser:!0}}class CRDialect extends SqliteDialect{database;constructor(e){super(e),this.database=async()=>typeof e.database=="function"?e.database():e.database}createDriver(){const e=this.database,r=mutex();let n,s;return{async init(){n=await e(),s={async executeQuery(a){return{rows:await n.execO(a.sql,a.parameters)}},async*streamQuery(){throw new Error("Sqlite driver doesn't support streaming")}}},async acquireConnection(){return await r.lock(),s},async beginTransaction(a){await a.executeQuery(CompiledQuery.raw("begin"))},async commitTransaction(a){await a.executeQuery(CompiledQuery.raw("commit"))},async rollbackTransaction(a){await a.executeQuery(CompiledQuery.raw("rollback"))},async releaseConnection(){r.unlock()},async destroy(){n?.close()}}}}function mutex(){let t,e;return{async lock(){for(;t;)await t;t=new Promise(r=>e=r)},unlock(){const r=e;t=void 0,e=void 0,r?.()}}}function json(t,e){const r=Object.entries(e).flatMap(([n,s])=>[sql.lit(n),typeof s=="string"?t.ref(s):s]);return sql`json_object(${sql.join(r)})`.withPlugin({transformQuery({node:n}){return{...n,json:!0}}}).$castTo()}function group(t,e){const r=typeof e=="string"?t.ref(e).toOperationNode():e.toOperationNode();return new AggregateFunctionBuilder({aggregateFunctionNode:{...AggregateFunctionNode.create("json_group_array",[r]),json:!0}})}function groupJSON(t,e){return group(t,json(t,e))}class JSONPlugin{#e=new WeakMap;transformQuery({node:e,queryId:r}){return e.kind!=="SelectQueryNode"||this.#e.set(r,new Set(this.getColumns(e))),e}async transformResult({result:e,queryId:r}){if(!Array.isArray(e.rows))return e;const n=this.#e.get(r);return n&&e.rows.forEach(s=>this.parseObject(s,n)),e}getColumns(e){const r=[];for(const n in e)e[n]&&typeof e[n]=="object"&&(e[n].json===!0&&typeof e.alias?.name=="string"&&r.push(e.alias?.name),r.push(...this.getColumns(e[n])));return r}parseObject(e,r){for(const n in e)r.has(n)&&(e[n]=JSON.parse(String(e[n]))),typeof e[n]=="object"&&this.parseObject(e[n],r)}}function covert(t){const r={any:"blob",string:"text",number:"real",unknown:"blob",instance:"blob",bigint:"integer",integer:"integer",boolean:"boolean"}[t];if(r)return r;throw new Error(`Type "${t}" is not allowed in the database schema!`)}async function apply(t,{schema:e}){for(const r in e){const n=e[r];let s=t.schema.createTable(r).ifNotExists();for(const a in n.schema){const{type:u}=n.schema[a];s=s.addColumn(a,n.ordered?.find(([d])=>d===a)?"blob":covert(u),d=>n.primary?.includes(a)?d.notNull():d)}n.primary&&(s=s.addPrimaryKeyConstraint("primary_key",n.primary)),await s.execute();for(const a of n.indices||[])await t.schema.createIndex(`${r}_${a.join("_")}`).ifNotExists().on(r).columns(a).execute();n.crr&&await sql`SELECT crsql_as_crr(${r})`.execute(t);for(const a of n.ordered||[])await sql`SELECT crsql_fract_as_ordered(${r},${sql.join(a)})`.execute(t);await t.schema.createTable("__crstore_sync").ifNotExists().addColumn("version","integer").execute(),await sql`INSERT INTO __crstore_sync (version) SELECT 0 WHERE NOT EXISTS (SELECT * FROM __crstore_sync) - `.execute(t)}}function primary(t,...e){return t.primary=e,t}function crr(t){return t.crr=!0,t}function ordered(t,e,...r){return t.ordered||(t.ordered=[]),t.ordered.push([e,...r]),t}function index(t,...e){return t.indices||(t.indices=[]),t.indices.push(e),t}const connections$1=new Map,defaultPaths={};async function init(t,e,r=defaultPaths){if(connections$1.has(t))return connections$1.get(t);const{database:n,browser:s}=await load(t,r),a=s?CRDialect:SqliteDialect,u=new Kysely({dialect:new a({database:n}),plugins:[new JSONPlugin]}),d=u.destroy.bind(u);await u.transaction().execute(y=>apply(y,e));const f=Object.assign(u,{resolveChanges,applyOperation,insertChanges,updateVersion,selectVersion,selectClient,changesSince,async destroy(){return connections$1.delete(t),await finalize.bind(u)().execute(),d()}});return connections$1.set(t,f),f}const raf=globalThis.requestAnimationFrame||globalThis.setTimeout,error=Symbol("error");function queue(t,e){const r=new Map;let n;async function s(){return n||(n=new Promise(a=>raf(async()=>{const u=await t,d=new Map;await u.transaction().execute(async f=>{const y=e&&(await selectVersion.bind(f)().execute()).current;for(const[b,w]of r.entries()){const A=await w(f).catch(R=>({[error]:R}));d.set(b,A)}e?.(await changesSince.bind(f)(y).execute())}),r.clear(),n=void 0,a(d)})))}return{enqueue(a,u,...d){return r.set(a,f=>u(f,...d)),s().then(f=>f.get(a)).then(f=>{if(f&&typeof f=="object"&&error in f)throw f[error];return f})}}}const empty=[],ready=t=>t!==empty;function database(t,{ssr:e=!1,name:r="crstore.db",paths:n=defaultPaths,error:s=void 0,push:a=void 0,pull:u=void 0,online:d=()=>!!globalThis.navigator?.onLine}={}){const y=!e&&!1?new Promise(()=>{}):init(r,t,n),b="BroadcastChannel"in globalThis?new globalThis.BroadcastChannel(`${r}-sync`):null,w=z=>T(z.data,z.data[0]),A=queue(y,T),R=queue(y);b?.addEventListener("message",w),globalThis.addEventListener?.("online",v);const I=new Map;let h=()=>{};v();async function N(z,M){return R.enqueue(M,W=>W.getExecutor().executeQuery(z,M)).then(W=>W.rows)}function m(z,M,W){const V=async(ae,G)=>{try{if(W&&W.client===G)return;await M(ae,G)}catch(me){s?.(me)}};return z.forEach(ae=>{I.has(ae)||I.set(ae,new Set),I.get(ae)?.add(V)}),W?y.then(async ae=>{const G=await ae.changesSince(W.version,W.client).execute();G.length&&V(G)}):V([]),()=>z.forEach(ae=>I.get(ae)?.delete(V))}async function E(){if(!a||!d())return;const z=await y,{current:M,synced:W}=await z.selectVersion().execute();if(M<=W)return;const V=await z.changesSince(W,null).execute();await a(V),await z.updateVersion(M).execute()}async function v(){if(globalThis.removeEventListener?.("offline",h),h(),!u||!d())return;const z=await y,{synced:M}=await z.selectVersion().execute(),W=await z.selectClient().execute();await E(),h=u({version:M,client:W},{async onData(V){V.length&&(await z.insertChanges(V).execute(),await T(V,V[0]))}}).unsubscribe,globalThis.addEventListener?.("offline",h)}async function C(z,...M){return A.enqueue({},z,...M)}async function $(z){if(!z.length)return;const M=await y;await T(await M.resolveChanges(z).execute(),z[0])}async function T(z,M){if(!z.length)return;const W=new Set,V=affectedTables(z);I.get("*")?.forEach(G=>W.add(G)),V.forEach(G=>I.get(G)?.forEach(me=>W.add(me)));const ae=[...W].map(G=>G(z,M));M||(b?.postMessage(z),await E()),await Promise.all(ae)}async function q(){h(),b?.close(),I.clear(),globalThis.removeEventListener?.("online",v),globalThis.removeEventListener?.("offline",h),b?.removeEventListener("message",w),await y.then(z=>z.destroy())}const Y=Object.assign(store.bind({connection:y,subscribe:m,update:C,refresh:N},[]),{with:(...z)=>store.bind({connection:y,subscribe:m,update:C,refresh:N},z)});return{close:q,merge:$,update:C,subscribe:m,connection:y,store:Y}}function store(t,e,r={}){const{connection:n,update:s,refresh:a}=this,u=derived(t,R=>R);let d=null,f=null;const{subscribe:y,set:b}=writable(empty,()=>{let R=()=>{};return n.then(I=>{if(!R)return;let h=()=>{};const N=u.subscribe(m=>{const E=e(I,...m).toOperationNode(),v=affectedTables(E),C=I.getExecutor();f={queryId:Math.random().toString(36).slice(2)},d=C.compileQuery(C.transformQuery(E,f),f),h(),h=this.subscribe(v,w)});R=()=>(N(),h())}),()=>(R?.(),R=null)});async function w(){await n,!(!d||!f)&&b(await a(d,f))}const A={};for(const R in r)A[R]=(...I)=>s(r[R],...I);return{...A,set:b,subscribe:y,update(R,...I){return R?s(R,...I):w()},then(R,I){let h=[];const N=y(m=>h=m);return w().then(()=>(N(),R(h)),I)}}}const APPEND=1,source=t=>t.selectFrom(e=>e.selectFrom("sources").select(["owner","source"]).orderBy("sources.primary","desc").as("ordered")).select(["owner",e=>group(e,"source").as("sources")]).groupBy("owner").$castTo(),asset=t=>t.selectFrom(e=>e.selectFrom("assets").select(["owner","art","thumbnail"]).orderBy("assets.primary","desc").as("ordered")).select(["owner",e=>group(e,"art").as("arts"),e=>group(e,"thumbnail").as("thumbnails")]).groupBy("owner").$castTo(),artist$1=t=>t.selectFrom("artists").leftJoin("source","source.owner","artists.id").leftJoin("asset","asset.owner","artists.id").select(["artists.id","artists.title","artists.following",e=>e.fn.coalesce("asset.arts",e.val("[]")).as("arts"),e=>e.fn.coalesce("asset.thumbnails",e.val("[]")).as("thumbnails"),e=>e.fn.coalesce("source.sources",e.val("[]")).as("sources")]).$castTo(),album$1=t=>t.selectFrom("albums").leftJoin("source","source.owner","albums.id").leftJoin("asset","asset.owner","albums.id").leftJoin("attribution","attribution.album","albums.id").innerJoin("artist","artist.id","attribution.artist").select(["albums.id","albums.title","albums.year",e=>e.fn.coalesce("asset.arts",e.val("[]")).as("arts"),e=>e.fn.coalesce("asset.thumbnails",e.val("[]")).as("thumbnails"),e=>e.fn.coalesce("source.sources",e.val("[]")).as("sources"),e=>groupJSON(e,{id:"artist.id",title:"artist.title",arts:"artist.arts",thumbnails:"artist.thumbnails",sources:"artist.sources"}).filterWhere("artist.id","is not",null).as("artists")]).groupBy("albums.id").$castTo(),track$2=t=>t.selectFrom("tracks").leftJoin("source","source.owner","tracks.id").innerJoin("album","album.id","tracks.album").select(["tracks.id","tracks.title","tracks.duration","album.artists",e=>e.fn.coalesce("source.sources",e.val("[]")).as("sources"),e=>json(e,{id:"album.id",title:"album.title",year:"album.year",arts:"album.arts",thumbnails:"album.thumbnails",sources:"album.sources"}).as("album")]).$castTo(),localDevice=sql`crsql_site_id()`,uuid=()=>Math.random()*2**32>>>0,sanitize=t=>t.replace(/-/g," ").split(/\s+/g).map(e=>`"${e.replace(/"/g,'""')}"`).join(" "),position={first:null,before:t=>t.selectFrom("queue").select("id").where("position","=",1).limit(1),shift:t=>e=>e.selectFrom("queue").select("id").whereRef(r=>r.selectFrom("queue").select(sql`position + 1`.as("position")).where("id","=",t),"=","position").limit(1),next:t=>t.selectFrom("devices").select("playback").where("id","=",localDevice).limit(1),last:t=>t.selectFrom("playback").select("id").where("device","=",localDevice).orderBy("order","desc").orderBy("id","desc").limit(1),random:t=>e=>e.selectFrom(r=>r.selectFrom("queue").select(["id","position"]).$if(!!t.length,n=>n.unionAll(sql`VALUES ${sql.raw(t.map(s=>`(${s}, 1)`).join(","))}`)).unionAll(sql`SELECT null,1 WHERE NOT EXISTS (SELECT 1 FROM queue WHERE position >= 0)`).as("data")).select("id").where("position",">=",0).orderBy(sql`random()`).limit(1)};async function pushTracks(t,e){e.length&&(await pushAlbums(t,e.map(r=>({...r.album,artists:r.artists}))),await t.insertInto("tracks").onConflict(r=>r.doNothing()).values(e.map(r=>({id:r.id,title:r.title,duration:r.duration,album:r.album.id}))).execute(),await pushResources(t,e))}async function pushAlbums(t,e){e.length&&(await pushArtists(t,e.flatMap(r=>r.artists)),e.find(r=>r.artists.length)&&await t.insertInto("attribution").onConflict(r=>r.doNothing()).values(e.flatMap(r=>r.artists.map(({id:n})=>({album:r.id,artist:n})))).execute(),await t.insertInto("albums").onConflict(r=>r.doNothing()).values(e.map(r=>({id:r.id,title:r.title,year:r.year}))).execute(),await pushResources(t,e))}async function pushArtists(t,e){e.length&&(await t.insertInto("artists").onConflict(r=>r.doNothing()).values(e.map(r=>({id:r.id,title:r.title,following:0}))).execute(),await pushResources(t,e))}async function pushResources(t,e){e.length&&(e.find(r=>r.sources.length)&&await t.insertInto("sources").onConflict(r=>r.doNothing()).values(e.flatMap(({id:r,sources:n})=>n.map((s,a)=>({owner:r,source:s,primary:+!a&&sql`NOT EXISTS (SELECT 1 FROM sources WHERE owner = ${r} AND "primary" = 1)`})))).execute(),e.find(r=>r.arts?.length)&&await t.insertInto("assets").onConflict(r=>r.doNothing()).values(e.flatMap(({id:r,arts:n,thumbnails:s})=>{if(!n)return[];const a=n.find((u,d)=>!!s?.[d])||n[0];return n.map((u,d)=>({owner:r,art:u,thumbnail:s?.[d],primary:+(u===a)&&sql`NOT EXISTS (SELECT 1 FROM assets WHERE owner = ${r} AND "primary" = 1)`}))})).execute())}const preceding$1=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).with("update",r=>r.selectFrom("playback").select(n=>n.selectFrom("devices").select("id").as("_"))).selectFrom("queue").innerJoin("track","track.id","queue.track").where("position","<",0).select("queue.id as entry").select(fields).$castTo()),upcoming$1=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).with("update",r=>r.selectFrom("playback").select(n=>n.selectFrom("devices").select("id").as("_"))).selectFrom("queue").innerJoin("track","track.id","queue.track").where("position",">",0).select("queue.id as entry").select(fields).$castTo()),playback$2=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("devices").innerJoin("playback","playback.id","devices.playback").innerJoin("track","track.id","playback.track").select(["direction","repeat","infinite","device","progress"]).select(r=>json(r,{entry:"playback.id",id:"track.id",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).as("track")).select(sql`device = crsql_site_id()`.as("local")).select(fields).$castTo(),{async push(e,r,n="next"){if(!r.length)return;await pushTracks(e,r);const{direction:s,playback:a}=await e.selectFrom("devices").where("id","=",localDevice).select(["direction","playback"]).executeTakeFirstOrThrow(),u=r.map(uuid),d=s!=1?Number.isInteger(n)?n:n==="first"?position.first:n==="next"?position.next:position.last:Number.isInteger(n)?position.shift(+n):n==="first"?position.last:n==="next"?position.before:position.first;await e.insertInto("playback_fractindex").values(r.map((f,y)=>({id:u[y],track:f.id,device:localDevice,after_id:n==="random"?position.random(u.slice(0,y)):y>0&&s!=1?u[y-1]:d}))).execute(),!~a&&n==="random"&&await e.updateTable("devices").set({playback:f=>f.selectFrom("queue").select("id").$castTo().limit(1)}).execute()},async purge(e,r){r.length&&await e.deleteFrom("playback").where("id","in",r).execute()},async clear(e,r=localDevice){await e.deleteFrom("playback").where("device","=",r).execute(),await e.updateTable("devices").set({playback:-1,progress:0}).where("id","=",r).execute()},async sync(e,r){await e.updateTable("devices").where("id","=",localDevice).set({progress:r}).execute()},async rearrange(e,r,n=null){const{direction:s}=await e.selectFrom("devices").where("id","=",localDevice).select(["direction"]).executeTakeFirstOrThrow(),a=s!=1?n:n!=null?position.shift(n):position.last;await e.updateTable("playback_fractindex").set({after_id:a}).where("id","=",r).execute()},async redirect(e,r){const n=["forward","backward","shuffled"],{direction:s}=await e.selectFrom("devices").select("direction").where("id","=",localDevice).executeTakeFirstOrThrow(),a=n.indexOf(r);s!==a&&await e.updateTable("devices").set({direction:a}).where("id","=",localDevice).execute()},async repeat(e,r){const n=["none","single","all"];await e.updateTable("devices").set({repeat:n.indexOf(r)}).where("id","=",localDevice).execute()},async infinite(e,r){await e.updateTable("devices").set({infinite:r==null?sql`!infinite`:+r}).where("id","=",localDevice).execute()},async replicate(e,r){const n=uuid();await e.updateTable("devices").where("id","=",localDevice).set({playback:n,progress:s=>s.selectFrom("devices").where("id","=",r).select("progress")}).execute(),await e.deleteFrom("playback").where("device","=",localDevice).execute(),await e.insertInto("playback").expression(s=>s.selectFrom("playback").select(a=>a.case().when(u=>u.selectFrom("devices").whereRef("id","=","playback.device").select("devices.playback"),"=",a.ref("playback.id")).then(n).else(sql`ABS(RANDOM() % 4294967296)`).end().as("id")).select(sql`${localDevice}`.as("device")).select(["track","order","temp"]).where("device","=",r)).execute()}}),fields=["track.id","track.title","track.duration","track.album","track.artists","track.sources"];class StructError extends TypeError{constructor(e,r){let n;const{message:s,explanation:a,...u}=e,{path:d}=e,f=d.length===0?s:`At path: ${d.join(".")} -- ${s}`;super(a??f),a!=null&&(this.cause=f),Object.assign(this,u),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function isIterable(t){return isObject$2(t)&&typeof t[Symbol.iterator]=="function"}function isObject$2(t){return typeof t=="object"&&t!=null}function print(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function shiftIterator(t){const{done:e,value:r}=t.next();return e?void 0:r}function toFailure(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:s,branch:a}=e,{type:u}=r,{refinement:d,message:f=`Expected a value of type \`${u}\`${d?` with refinement \`${d}\``:""}, but received: \`${print(n)}\``}=t;return{value:n,type:u,refinement:d,key:s[s.length-1],path:s,branch:a,...t,message:f}}function*toFailures(t,e,r,n){isIterable(t)||(t=[t]);for(const s of t){const a=toFailure(s,e,r,n);a&&(yield a)}}function*run(t,e,r={}){const{path:n=[],branch:s=[t],coerce:a=!1,mask:u=!1}=r,d={path:n,branch:s};if(a&&(t=e.coercer(t,d),u&&e.type!=="type"&&isObject$2(e.schema)&&isObject$2(t)&&!Array.isArray(t)))for(const y in t)e.schema[y]===void 0&&delete t[y];let f="valid";for(const y of e.validator(t,d))y.explanation=r.message,f="not_valid",yield[y,void 0];for(let[y,b,w]of e.entries(t,d)){const A=run(b,w,{path:y===void 0?n:[...n,y],branch:y===void 0?s:[...s,b],coerce:a,mask:u,message:r.message});for(const R of A)R[0]?(f=R[0].refinement!=null?"not_refined":"not_valid",yield[R[0],void 0]):a&&(b=R[1],y===void 0?t=b:t instanceof Map?t.set(y,b):t instanceof Set?t.add(b):isObject$2(t)&&(b!==void 0||y in t)&&(t[y]=b))}if(f!=="not_valid")for(const y of e.refiner(t,d))y.explanation=r.message,f="not_refined",yield[y,void 0];f==="valid"&&(yield[void 0,t])}class Struct{constructor(e){const{type:r,schema:n,validator:s,refiner:a,coercer:u=f=>f,entries:d=function*(){}}=e;this.type=r,this.schema=n,this.entries=d,this.coercer=u,s?this.validator=(f,y)=>{const b=s(f,y);return toFailures(b,y,this,f)}:this.validator=()=>[],a?this.refiner=(f,y)=>{const b=a(f,y);return toFailures(b,y,this,f)}:this.refiner=()=>[]}assert(e,r){return assert(e,this,r)}create(e,r){return create(e,this,r)}is(e){return is(e,this)}mask(e,r){return mask(e,this,r)}validate(e,r={}){return validate(e,this,r)}}function assert(t,e,r){const n=validate(t,e,{message:r});if(n[0])throw n[0]}function create(t,e,r){const n=validate(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function mask(t,e,r){const n=validate(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function is(t,e){return!validate(t,e)[0]}function validate(t,e,r={}){const n=run(t,e,r),s=shiftIterator(n);return s[0]?[new StructError(s[0],function*(){for(const u of n)u[0]&&(yield u[0])}),void 0]:[void 0,s[1]]}function assign(...t){const e=t[0].type==="type",r=t.map(s=>s.schema),n=Object.assign({},...r);return e?type(n):object(n)}function define(t,e){return new Struct({type:t,schema:null,validator:e})}function omit(t,e){const{schema:r}=t,n={...r};for(const s of e)delete n[s];switch(t.type){case"type":return type(n);default:return object(n)}}function any(){return define("any",()=>!0)}function array(t){return new Struct({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${print(e)}`}})}function instance$1(t){return define("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${print(e)}`)}function integer(){return define("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${print(t)}`)}function literal(t){const e=print(t),r=typeof t;return new Struct({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${print(n)}`}})}function never(){return define("never",()=>!1)}function nullable(t){return new Struct({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function number(){return define("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${print(t)}`)}function object(t){const e=t?Object.keys(t):[],r=never();return new Struct({type:"object",schema:t||null,*entries(n){if(t&&isObject$2(n)){const s=new Set(Object.keys(n));for(const a of e)s.delete(a),yield[a,n[a],t[a]];for(const a of s)yield[a,n[a],r]}},validator(n){return isObject$2(n)||`Expected an object, but received: ${print(n)}`},coercer(n){return isObject$2(n)?{...n}:n}})}function optional(t){return new Struct({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function string(){return define("string",t=>typeof t=="string"||`Expected a string, but received: ${print(t)}`)}function type(t){const e=Object.keys(t);return new Struct({type:"type",schema:t,*entries(r){if(isObject$2(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return isObject$2(r)||`Expected an object, but received: ${print(r)}`},coercer(r){return isObject$2(r)?{...r}:r}})}function union(t){const e=t.map(r=>r.type).join(" | ");return new Struct({type:"union",schema:null,coercer(r){for(const n of t){const[s,a]=n.validate(r,{coerce:!0});if(!s)return a}return r},validator(r,n){const s=[];for(const a of t){const[...u]=run(r,a,n),[d]=u;if(d[0])for(const[f]of u)f&&s.push(f);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${print(r)}`,...s]}})}const track$1=object({title:string(),duration:number()}),album=object({title:string(),year:integer()}),artist=object({title:string()}),playlist=object({title:string(),relevancy:number(),shared:nullable(string()),remote:nullable(string())});type({title:optional(string()),album:optional(type({title:optional(string())})),artists:optional(array(type({title:optional(string())})))});const media=object({sources:array(string()),arts:optional(array(string())),thumbnails:optional(array(nullable(string())))}),collection=t=>object({size:integer(),duration:number(),tracks:array(t)}),unique=t=>assign(t,object({id:integer()})),artistInfo=assign(artist,media),albumInfo=assign(album,assign(media,object({artists:array(artistInfo)}))),trackInfo=assign(track$1,assign(omit(media,["arts","thumbnails"]),object({album:omit(albumInfo,["artists"]),artists:array(artistInfo)}))),playlistInfo=playlist,track=assign(unique(trackInfo),object({entry:optional(number()),album:unique(trackInfo.schema.album),artists:array(unique(trackInfo.schema.artists.schema))}));assign(unique(albumInfo),object({artists:array(unique(albumInfo.schema.artists.schema)),collection:optional(collection(track))}));assign(unique(artistInfo),object({following:optional(union([literal(0),literal(1)])),collection:optional(collection(track))}));assign(unique(playlistInfo),object({collection:optional(collection(track))}));function has(t,e){return t!==null&&typeof t=="object"&&e in t&&t[e]!==void 0}function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var murmurhash={exports:{}};(function(t){(function(){const e=a=>new TextEncoder().encode(a);function r(a,u){typeof a=="string"&&(a=e(a));let d=a.length,f=u^d,y=0,b;for(;d>=4;)b=a[y]&255|(a[++y]&255)<<8|(a[++y]&255)<<16|(a[++y]&255)<<24,b=(b&65535)*1540483477+(((b>>>16)*1540483477&65535)<<16),b^=b>>>24,b=(b&65535)*1540483477+(((b>>>16)*1540483477&65535)<<16),f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)^b,d-=4,++y;switch(d){case 3:f^=(a[y+2]&255)<<16;case 2:f^=(a[y+1]&255)<<8;case 1:f^=a[y]&255,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)}return f^=f>>>13,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16),f^=f>>>15,f>>>0}function n(a,u){typeof a=="string"&&(a=e(a));let d,f,y,b,w,A,R,I;for(d=a.length&3,f=a.length-d,y=u,w=3432918353,A=461845907,I=0;I>>16)*w&65535)<<16)&4294967295,R=R<<15|R>>>17,R=(R&65535)*A+(((R>>>16)*A&65535)<<16)&4294967295,y^=R,y=y<<13|y>>>19,b=(y&65535)*5+(((y>>>16)*5&65535)<<16)&4294967295,y=(b&65535)+27492+(((b>>>16)+58964&65535)<<16);switch(R=0,d){case 3:R^=(a[I+2]&255)<<16;case 2:R^=(a[I+1]&255)<<8;case 1:R^=a[I]&255,R=(R&65535)*w+(((R>>>16)*w&65535)<<16)&4294967295,R=R<<15|R>>>17,R=(R&65535)*A+(((R>>>16)*A&65535)<<16)&4294967295,y^=R}return y^=a.length,y^=y>>>16,y=(y&65535)*2246822507+(((y>>>16)*2246822507&65535)<<16)&4294967295,y^=y>>>13,y=(y&65535)*3266489909+(((y>>>16)*3266489909&65535)<<16)&4294967295,y^=y>>>16,y>>>0}const s=n;s.v2=r,s.v3=n,t.exports=s})()})(murmurhash);var murmurhashExports=murmurhash.exports;const hash=getDefaultExportFromCjs(murmurhashExports);function titled(t){return has(t,"title")?t.title:t}function compare$1(t,e){return typeof t=="string"&&typeof e=="string"?t.localeCompare(e):typeof t=="number"&&typeof e=="number"?t-e:has(t,"title")&&has(e,"title")?compare$1(clean(titled(t)),clean(titled(e))):0}function normalize(t){if(typeof t=="string")return clean(t);if(typeof t!="object")return t;const e={...t};for(const r in e)Array.isArray(e[r])?e[r]=e[r].map(normalize).sort(compare$1):e[r]=normalize(e[r]);return e}function stringify(t){return t=normalize(t),typeof t=="string"?t:typeof t!="object"?clean(String(t)):has(t,"artists")&&has(t,"title")&&has(t,"album")?`${t.artists.map(titled)} - ${t.title} - ${titled(t.album)}`:has(t,"artists")&&has(t,"title")?`${t.artists.map(titled)} - ${t.title}`:has(t,"title")?t.title:Array.isArray(t)?t.map(titled).toString():JSON.stringify(t)}function identify(t){return has(t,"id")?+t.id:hash(stringify(t))}const playlists$2=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",r=>track$2(r).innerJoin("library","library.track","tracks.id").select(["library.playlist","library.id as entry"]).orderBy("library.order").orderBy("library.id")).selectFrom("track").fullJoin("playlists","playlists.id","track.playlist").where("playlists.id",">=",0).select(["playlists.id","playlists.title","playlists.relevancy","playlists.shared","playlists.remote",r=>json(r,{size:r.fn.count("track.duration"),duration:r.fn.coalesce(r.fn.sum("track.duration"),r.val(0)),tracks:groupJSON(r,{id:"track.id",entry:"track.entry",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).filterWhere("track.id","is not",null)}).as("collection")]).groupBy("playlists.id").orderBy("playlists.order").orderBy("playlists.id").$castTo(),{async create(e,r){await e.insertInto("playlists").onConflict(n=>n.doNothing()).values({id:identify(r),order:APPEND,relevancy:1,...r}).execute()},async edit(e,r,n){await e.updateTable("playlists").where("id","=",r).set(n).execute()},async rearrange(e,r,n){await e.updateTable("playlists_fractindex").set({after_id:n||null}).where("id","=",r).execute()},async delete(e,r){await e.deleteFrom("playlists").where("id","=",r).execute()},get(e,r){return e.selectFrom("playlists").selectAll().where("id","=",r).executeTakeFirstOrThrow()}}),resources$1=({store:t})=>t(e=>e.with("source",source).with("asset",asset).selectFrom("source").leftJoin("asset","asset.owner","source.owner").select([r=>r.fn.coalesce("asset.arts",r.val("[]")).as("arts"),r=>r.fn.coalesce("asset.thumbnails",r.val("[]")).as("thumbnails"),r=>r.fn.coalesce("source.sources",r.val("[]")).as("sources")]).$castTo(),{async prioritize(e,r,n){const s=r==="art"?"assets":"sources";await e.updateTable(s).set({primary:sql`${sql.ref(r)} = ${n}`}).where("owner","=",a=>a.selectFrom(s).where(r,"=",n).select("owner")).execute()},get(e,r){return e.with("source",source).with("asset",asset).selectFrom("source").leftJoin("asset","asset.owner","source.owner").select([n=>n.fn.coalesce("asset.arts",n.val("[]")).as("arts"),n=>n.fn.coalesce("asset.thumbnails",n.val("[]")).as("thumbnails"),n=>n.fn.coalesce("source.sources",n.val("[]")).as("sources")]).where("source.owner","=",r).$castTo().executeTakeFirstOrThrow()}}),settings$2=({store:t})=>t(e=>e.selectFrom("settings").select(["key",sql`json_extract(value, '$')`.as("value")]),{async store(e,r,n,s="settings"){s!=="settings"&&(await e.schema.createTable(s).ifNotExists().addColumn("key","text",a=>a.primaryKey().notNull()).addColumn("value","text").execute(),await e.schema.createIndex(s+"_value").ifNotExists().on(s).column("value").execute()),await e.insertInto(s).onConflict(a=>a.doUpdateSet({value:JSON.stringify(n)})).values({key:r,value:JSON.stringify(n)}).execute()},async extract(e,r,n="settings"){return e.selectFrom(n).select("value").where("key","=",r).executeTakeFirstOrThrow().then(s=>JSON.parse(s.value))},async lookup(e,r,n="settings"){return e.selectFrom(n).select("key").where("value","=",JSON.stringify(r)).executeTakeFirstOrThrow().then(s=>s.key)}}),history$2=({store:t})=>t(e=>e.selectFrom("history").orderBy("date","desc").selectAll(),{async log(e,r){r.trim()&&await e.insertInto("history").onConflict(n=>n.doUpdateSet({date:Date.now()})).values({query:r,date:Date.now()}).execute()},async clear(e){await e.deleteFrom("history").execute()},get(e){return e.selectFrom("history").selectAll().orderBy("date","desc").execute()}}),artists$2=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("artist").leftJoin("attribution","attribution.artist","artist.id").leftJoin("albums","albums.id","attribution.album").leftJoin("tracks","tracks.album","albums.id").leftJoin("track","track.id","tracks.id").select(["artist.id","artist.title","artist.following","artist.arts","artist.thumbnails","artist.sources",r=>json(r,{size:r.fn.count("track.duration"),duration:r.fn.coalesce(r.fn.sum("track.duration"),r.val(0)),tracks:groupJSON(r,{id:"track.id",entry:"track.id",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).filterWhere("track.id","is not",null)}).as("collection")]).groupBy("artist.id").orderBy(r=>r.fn.count("track.duration"),"desc").orderBy("artist.title").$castTo(),{async push(e,r){await pushArtists(e,r)},async edit(e,r,n){await e.updateTable("artists").where("id","=",r).set(n)},async follow(e,r){await e.updateTable("artists").set({following:1}).where("id","=",r).execute()},async unfollow(e,r){await e.updateTable("artists").set({following:0}).where("id","=",r).execute()},async search(e,r,n=10,s=0){return r?e.with("source",source).with("asset",asset).with("artist",artist$1).selectFrom("artists_fts").where("artists_fts","match",sanitize(r)).orderBy("rank").innerJoin("artist","artist.id","artists_fts.rowid").selectAll().limit(n).offset(s).$castTo().execute():[]},get(e,r){return e.with("source",source).with("asset",asset).with("artist",artist$1).selectFrom("artist").where("artist.id","=",r).selectAll().$castTo().executeTakeFirstOrThrow()}}),library$2=({store:t})=>t(e=>e.selectFrom("library").selectAll(),{async push(e,r,n){r.length&&(await pushTracks(e,r),n!=null&&await e.insertInto("library").onConflict(s=>s.doNothing()).values(r.map(({id:s})=>({id:uuid(),order:APPEND,date:~~(Date.now()/1e3),track:s,playlist:n}))).execute())},async rearrange(e,r,n){await e.updateTable("library_fractindex").set({after_id:n||null}).where("id","=",r).execute()},async purge(e,r){const n=r.map(s=>e.deleteFrom("library").where("id","=",s).execute());await Promise.all(n)},async get(e,r){return r.length?e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("library").innerJoin("track","track.id","library.track").select(["track.id","track.title","track.duration","track.album","track.artists","track.sources","library.id as entry"]).where("library.id","in",r).$castTo().execute():[]},async sample(e,r){const n=r,s=n*Math.sqrt(2*Math.PI)/2,a=sql`POW(ABS(RANDOM()) / 9223372036854775808, + `.execute(t)}}function primary(t,...e){return t.primary=e,t}function crr(t){return t.crr=!0,t}function ordered(t,e,...r){return t.ordered||(t.ordered=[]),t.ordered.push([e,...r]),t}function index(t,...e){return t.indices||(t.indices=[]),t.indices.push(e),t}const connections$1=new Map,defaultPaths={};async function init(t,e,r=defaultPaths){if(connections$1.has(t))return connections$1.get(t);const{database:n,browser:s}=await load(t,r),a=s?CRDialect:SqliteDialect,u=new Kysely({dialect:new a({database:n}),plugins:[new JSONPlugin]}),d=u.destroy.bind(u);await u.transaction().execute(N=>apply(N,e));const f=Object.assign(u,{resolveChanges,applyOperation,insertChanges,updateVersion,selectVersion,selectClient,changesSince,async destroy(){return connections$1.delete(t),await finalize.bind(u)().execute(),d()}});return connections$1.set(t,f),f}const empty=[],ready=t=>t!==empty;function reactive(t,e=[]){const r=new Set,n={stop:void 0,start:void 0};let s,a=empty;function u(b){a=b,s&&r.forEach(w=>w(a))}function d(b){return r.add(b),r.size===1&&(s=t(...e),n.stop=n.start?.(N)),b(a),()=>{r.delete(b),r.size===0&&s&&(Promise.resolve(s).then(w=>w()),s=void 0,n.stop?.(),n.stop=void 0)}}function f(b){if(Array.isArray(b))return N(b);n.stop?.(),n.start=b,s&&(n.stop=n.start(N))}function N(b){JSON.stringify(b)!==JSON.stringify(e)&&(e=b.slice(),s&&(Promise.resolve(s).then(w=>w()),s=t(...e)))}return{set:u,subscribe:d,bind:f}}const raf=globalThis.requestAnimationFrame||globalThis.setTimeout,error=Symbol("error");function queue(t,e){const r=new Map;let n;async function s(){return n||(n=new Promise(a=>raf(async()=>{const u=await t,d=new Map;await u.transaction().execute(async f=>{const N=e&&(await selectVersion.bind(f)().execute()).current;for(const[b,w]of r.entries()){const A=await w(f).catch(R=>({[error]:R}));d.set(b,A)}e?.(await changesSince.bind(f)(N).execute())}).catch(f=>{if(!String(f).includes("driver has already been destroyed"))throw f}),r.clear(),n=void 0,a(d)})))}return{enqueue(a,u,...d){return r.set(a,f=>u(f,...d)),s().then(f=>f.get(a)).then(f=>{if(f&&typeof f=="object"&&error in f)throw f[error];return f})}}}function database$1(t,{ssr:e=!1,name:r="crstore.db",paths:n=defaultPaths,error:s=void 0,push:a=void 0,pull:u=void 0,online:d=()=>!!globalThis.navigator?.onLine}={}){const N=!e&&!1?new Promise(()=>{}):init(r,t,n),b="BroadcastChannel"in globalThis?new globalThis.BroadcastChannel(`${r}-sync`):null,w=$=>T($.data,$.data[0]),A=queue(N,T),R=queue(N);b?.addEventListener("message",w),globalThis.addEventListener?.("online",v);const S=new Map;let h=()=>{};v();async function y($,U){return R.enqueue(U,M=>M.getExecutor().executeQuery($,U)).then(M=>M.rows)}function m($,U,M){const F=async(J,ae)=>{try{if(M&&M.client===ae)return;await U(J,ae)}catch(ee){s?.(ee)}};return $.forEach(J=>{S.has(J)||S.set(J,new Set),S.get(J)?.add(F)}),M?N.then(async J=>{const ae=await J.changesSince(M.version,M.client).execute();ae.length&&F(ae)}):F([]),()=>$.forEach(J=>S.get(J)?.delete(F))}async function E(){if(!a||!d())return;const $=await N,{current:U,synced:M}=await $.selectVersion().execute();if(U<=M)return;const F=await $.changesSince(M,null).execute();await a(F),await $.updateVersion(U).execute()}async function v(){if(globalThis.removeEventListener?.("offline",h),h(),!u||!d())return;const $=await N,{synced:U}=await $.selectVersion().execute(),M=await $.selectClient().execute();await E(),h=u({version:U,client:M},{async onData(F){F.length&&(await $.insertChanges(F).execute(),await T(F,F[0]))}}).unsubscribe,globalThis.addEventListener?.("offline",h)}async function C($,...U){return A.enqueue({},$,...U)}async function V($){if(!$.length)return;const U=await N;await T(await U.resolveChanges($).execute(),$[0])}async function T($,U){if(!$.length)return;const M=new Set,F=affectedTables($);S.get("*")?.forEach(ae=>M.add(ae)),F.forEach(ae=>S.get(ae)?.forEach(ee=>M.add(ee)));const J=[...M].map(ae=>ae($,U));U||(b?.postMessage($),await E()),await Promise.all(J)}async function q(){h(),b?.close(),S.clear(),globalThis.removeEventListener?.("online",v),globalThis.removeEventListener?.("offline",h),b?.removeEventListener("message",w),await N.then($=>$.destroy())}return{close:q,merge:V,update:C,subscribe:m,connection:N,replica:store.bind({connection:N,subscribe:m,update:C,refresh:y})}}function store(t,e={},r=[]){const{connection:n,update:s,refresh:a}=this;let u=null,d=null;const{subscribe:f,set:N,bind:b}=reactive(async(...R)=>{const S=await n,h=t(S,...R).toOperationNode(),y=affectedTables(h),m=S.getExecutor();return d={queryId:Math.random().toString(36).slice(2)},u=m.compileQuery(m.transformQuery(h,d),d),this.subscribe(y,w)},r);async function w(){await n,!(!u||!d)&&N(await a(u,d))}const A={};for(const R in e)A[R]=(...S)=>s(e[R],...S);return{...A,subscribe:f,bind:b,update(R,...S){return R?s(R,...S):w()},then(R,S){let h=[];const y=f(m=>h=m);return w().then(()=>(y(),R?.(h)),S)}}}const APPEND=1,source=t=>t.selectFrom(e=>e.selectFrom("sources").select(["owner","source"]).orderBy("sources.primary","desc").as("ordered")).select(["owner",e=>group(e,"source").as("sources")]).groupBy("owner").$castTo(),asset=t=>t.selectFrom(e=>e.selectFrom("assets").select(["owner","art","thumbnail"]).orderBy("assets.primary","desc").as("ordered")).select(["owner",e=>group(e,"art").as("arts"),e=>group(e,"thumbnail").as("thumbnails")]).groupBy("owner").$castTo(),artist$1=t=>t.selectFrom("artists").leftJoin("source","source.owner","artists.id").leftJoin("asset","asset.owner","artists.id").select(["artists.id","artists.title","artists.following",e=>e.fn.coalesce("asset.arts",e.val("[]")).as("arts"),e=>e.fn.coalesce("asset.thumbnails",e.val("[]")).as("thumbnails"),e=>e.fn.coalesce("source.sources",e.val("[]")).as("sources")]).$castTo(),album$1=t=>t.selectFrom("albums").leftJoin("source","source.owner","albums.id").leftJoin("asset","asset.owner","albums.id").leftJoin("attribution","attribution.album","albums.id").innerJoin("artist","artist.id","attribution.artist").select(["albums.id","albums.title","albums.year",e=>e.fn.coalesce("asset.arts",e.val("[]")).as("arts"),e=>e.fn.coalesce("asset.thumbnails",e.val("[]")).as("thumbnails"),e=>e.fn.coalesce("source.sources",e.val("[]")).as("sources"),e=>groupJSON(e,{id:"artist.id",title:"artist.title",arts:"artist.arts",thumbnails:"artist.thumbnails",sources:"artist.sources"}).filterWhere("artist.id","is not",null).as("artists")]).groupBy("albums.id").$castTo(),track$2=t=>t.selectFrom("tracks").leftJoin("source","source.owner","tracks.id").innerJoin("album","album.id","tracks.album").select(["tracks.id","tracks.title","tracks.duration","album.artists",e=>e.fn.coalesce("source.sources",e.val("[]")).as("sources"),e=>json(e,{id:"album.id",title:"album.title",year:"album.year",arts:"album.arts",thumbnails:"album.thumbnails",sources:"album.sources"}).as("album")]).$castTo(),localDevice=sql`crsql_site_id()`,uuid=()=>Math.random()*2**32>>>0,sanitize=t=>t.replace(/-/g," ").split(/\s+/g).map(e=>`"${e.replace(/"/g,'""')}"`).join(" "),position={first:null,before:t=>t.selectFrom("queue").select("id").where("position","=",1).limit(1),shift:t=>e=>e.selectFrom("queue").select("id").whereRef(r=>r.selectFrom("queue").select(sql`position + 1`.as("position")).where("id","=",t),"=","position").limit(1),next:t=>t.selectFrom("devices").select("playback").where("id","=",localDevice).limit(1),last:t=>t.selectFrom("playback").select("id").where("device","=",localDevice).orderBy("order","desc").orderBy("id","desc").limit(1),random:t=>e=>e.selectFrom(r=>r.selectFrom("queue").select(["id","position"]).$if(!!t.length,n=>n.unionAll(sql`VALUES ${sql.raw(t.map(s=>`(${s}, 1)`).join(","))}`)).unionAll(sql`SELECT null,1 WHERE NOT EXISTS (SELECT 1 FROM queue WHERE position >= 0)`).as("data")).select("id").where("position",">=",0).orderBy(sql`random()`).limit(1)};async function pushTracks(t,e){e.length&&(await pushAlbums(t,e.map(r=>({...r.album,artists:r.artists}))),await t.insertInto("tracks").onConflict(r=>r.doNothing()).values(e.map(r=>({id:r.id,title:r.title,duration:r.duration,album:r.album.id}))).execute(),await pushResources(t,e))}async function pushAlbums(t,e){e.length&&(await pushArtists(t,e.flatMap(r=>r.artists)),e.find(r=>r.artists.length)&&await t.insertInto("attribution").onConflict(r=>r.doNothing()).values(e.flatMap(r=>r.artists.map(({id:n})=>({album:r.id,artist:n})))).execute(),await t.insertInto("albums").onConflict(r=>r.doNothing()).values(e.map(r=>({id:r.id,title:r.title,year:r.year}))).execute(),await pushResources(t,e))}async function pushArtists(t,e){e.length&&(await t.insertInto("artists").onConflict(r=>r.doNothing()).values(e.map(r=>({id:r.id,title:r.title,following:0}))).execute(),await pushResources(t,e))}async function pushResources(t,e){e.length&&(e.find(r=>r.sources.length)&&await t.insertInto("sources").onConflict(r=>r.doNothing()).values(e.flatMap(({id:r,sources:n})=>n.map((s,a)=>({owner:r,source:s,primary:+!a&&sql`NOT EXISTS (SELECT 1 FROM sources WHERE owner = ${r} AND "primary" = 1)`})))).execute(),e.find(r=>r.arts?.length)&&await t.insertInto("assets").onConflict(r=>r.doNothing()).values(e.flatMap(({id:r,arts:n,thumbnails:s})=>{if(!n)return[];const a=n.find((u,d)=>!!s?.[d])||n[0];return n.map((u,d)=>({owner:r,art:u,thumbnail:s?.[d],primary:+(u===a)&&sql`NOT EXISTS (SELECT 1 FROM assets WHERE owner = ${r} AND "primary" = 1)`}))})).execute())}const preceding$1=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).with("update",r=>r.selectFrom("playback").select(n=>n.selectFrom("devices").select("id").as("_"))).selectFrom("queue").innerJoin("track","track.id","queue.track").where("position","<",0).select("queue.id as entry").select(fields).$castTo()),upcoming$1=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).with("update",r=>r.selectFrom("playback").select(n=>n.selectFrom("devices").select("id").as("_"))).selectFrom("queue").innerJoin("track","track.id","queue.track").where("position",">",0).select("queue.id as entry").select(fields).$castTo()),playback$2=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("devices").innerJoin("playback","playback.id","devices.playback").innerJoin("track","track.id","playback.track").select(["direction","repeat","infinite","device","progress"]).select(r=>json(r,{entry:"playback.id",id:"track.id",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).as("track")).select(sql`device = crsql_site_id()`.as("local")).select(fields).$castTo(),{async push(e,r,n="next"){if(!r.length)return;await pushTracks(e,r);const{direction:s,playback:a}=await e.selectFrom("devices").where("id","=",localDevice).select(["direction","playback"]).executeTakeFirstOrThrow(),u=r.map(uuid),d=s!=1?Number.isInteger(n)?n:n==="first"?position.first:n==="next"?position.next:position.last:Number.isInteger(n)?position.shift(+n):n==="first"?position.last:n==="next"?position.before:position.first;await e.insertInto("playback_fractindex").values(r.map((f,N)=>({id:u[N],track:f.id,device:localDevice,after_id:n==="random"?position.random(u.slice(0,N)):N>0&&s!=1?u[N-1]:d}))).execute(),!~a&&n==="random"&&await e.updateTable("devices").set({playback:f=>f.selectFrom("queue").select("id").$castTo().limit(1)}).execute()},async purge(e,r){r.length&&await e.deleteFrom("playback").where("id","in",r).execute()},async clear(e,r=localDevice){await e.deleteFrom("playback").where("device","=",r).execute(),await e.updateTable("devices").set({playback:-1,progress:0}).where("id","=",r).execute()},async sync(e,r){await e.updateTable("devices").where("id","=",localDevice).set({progress:r}).execute()},async rearrange(e,r,n=null){const{direction:s}=await e.selectFrom("devices").where("id","=",localDevice).select(["direction"]).executeTakeFirstOrThrow(),a=s!=1?n:n!=null?position.shift(n):position.last;await e.updateTable("playback_fractindex").set({after_id:a}).where("id","=",r).execute()},async redirect(e,r){const n=["forward","backward","shuffled"],{direction:s}=await e.selectFrom("devices").select("direction").where("id","=",localDevice).executeTakeFirstOrThrow(),a=n.indexOf(r);s!==a&&await e.updateTable("devices").set({direction:a}).where("id","=",localDevice).execute()},async repeat(e,r){const n=["none","single","all"];await e.updateTable("devices").set({repeat:n.indexOf(r)}).where("id","=",localDevice).execute()},async infinite(e,r){await e.updateTable("devices").set({infinite:r==null?sql`!infinite`:+r}).where("id","=",localDevice).execute()},async replicate(e,r){const n=uuid();await e.updateTable("devices").where("id","=",localDevice).set({playback:n,progress:s=>s.selectFrom("devices").where("id","=",r).select("progress")}).execute(),await e.deleteFrom("playback").where("device","=",localDevice).execute(),await e.insertInto("playback").expression(s=>s.selectFrom("playback").select(a=>a.case().when(u=>u.selectFrom("devices").whereRef("id","=","playback.device").select("devices.playback"),"=",a.ref("playback.id")).then(n).else(sql`ABS(RANDOM() % 4294967296)`).end().as("id")).select(sql`${localDevice}`.as("device")).select(["track","order","temp"]).where("device","=",r)).execute()}}),fields=["track.id","track.title","track.duration","track.album","track.artists","track.sources"];class StructError extends TypeError{constructor(e,r){let n;const{message:s,explanation:a,...u}=e,{path:d}=e,f=d.length===0?s:`At path: ${d.join(".")} -- ${s}`;super(a??f),a!=null&&(this.cause=f),Object.assign(this,u),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function isIterable(t){return isObject$2(t)&&typeof t[Symbol.iterator]=="function"}function isObject$2(t){return typeof t=="object"&&t!=null}function print(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function shiftIterator(t){const{done:e,value:r}=t.next();return e?void 0:r}function toFailure(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:s,branch:a}=e,{type:u}=r,{refinement:d,message:f=`Expected a value of type \`${u}\`${d?` with refinement \`${d}\``:""}, but received: \`${print(n)}\``}=t;return{value:n,type:u,refinement:d,key:s[s.length-1],path:s,branch:a,...t,message:f}}function*toFailures(t,e,r,n){isIterable(t)||(t=[t]);for(const s of t){const a=toFailure(s,e,r,n);a&&(yield a)}}function*run(t,e,r={}){const{path:n=[],branch:s=[t],coerce:a=!1,mask:u=!1}=r,d={path:n,branch:s};if(a&&(t=e.coercer(t,d),u&&e.type!=="type"&&isObject$2(e.schema)&&isObject$2(t)&&!Array.isArray(t)))for(const N in t)e.schema[N]===void 0&&delete t[N];let f="valid";for(const N of e.validator(t,d))N.explanation=r.message,f="not_valid",yield[N,void 0];for(let[N,b,w]of e.entries(t,d)){const A=run(b,w,{path:N===void 0?n:[...n,N],branch:N===void 0?s:[...s,b],coerce:a,mask:u,message:r.message});for(const R of A)R[0]?(f=R[0].refinement!=null?"not_refined":"not_valid",yield[R[0],void 0]):a&&(b=R[1],N===void 0?t=b:t instanceof Map?t.set(N,b):t instanceof Set?t.add(b):isObject$2(t)&&(b!==void 0||N in t)&&(t[N]=b))}if(f!=="not_valid")for(const N of e.refiner(t,d))N.explanation=r.message,f="not_refined",yield[N,void 0];f==="valid"&&(yield[void 0,t])}class Struct{constructor(e){const{type:r,schema:n,validator:s,refiner:a,coercer:u=f=>f,entries:d=function*(){}}=e;this.type=r,this.schema=n,this.entries=d,this.coercer=u,s?this.validator=(f,N)=>{const b=s(f,N);return toFailures(b,N,this,f)}:this.validator=()=>[],a?this.refiner=(f,N)=>{const b=a(f,N);return toFailures(b,N,this,f)}:this.refiner=()=>[]}assert(e,r){return assert(e,this,r)}create(e,r){return create(e,this,r)}is(e){return is(e,this)}mask(e,r){return mask(e,this,r)}validate(e,r={}){return validate(e,this,r)}}function assert(t,e,r){const n=validate(t,e,{message:r});if(n[0])throw n[0]}function create(t,e,r){const n=validate(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function mask(t,e,r){const n=validate(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function is(t,e){return!validate(t,e)[0]}function validate(t,e,r={}){const n=run(t,e,r),s=shiftIterator(n);return s[0]?[new StructError(s[0],function*(){for(const u of n)u[0]&&(yield u[0])}),void 0]:[void 0,s[1]]}function assign(...t){const e=t[0].type==="type",r=t.map(s=>s.schema),n=Object.assign({},...r);return e?type(n):object(n)}function define(t,e){return new Struct({type:t,schema:null,validator:e})}function omit(t,e){const{schema:r}=t,n={...r};for(const s of e)delete n[s];switch(t.type){case"type":return type(n);default:return object(n)}}function any(){return define("any",()=>!0)}function array(t){return new Struct({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${print(e)}`}})}function instance$1(t){return define("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${print(e)}`)}function integer(){return define("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${print(t)}`)}function literal(t){const e=print(t),r=typeof t;return new Struct({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${print(n)}`}})}function never(){return define("never",()=>!1)}function nullable(t){return new Struct({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function number(){return define("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${print(t)}`)}function object(t){const e=t?Object.keys(t):[],r=never();return new Struct({type:"object",schema:t||null,*entries(n){if(t&&isObject$2(n)){const s=new Set(Object.keys(n));for(const a of e)s.delete(a),yield[a,n[a],t[a]];for(const a of s)yield[a,n[a],r]}},validator(n){return isObject$2(n)||`Expected an object, but received: ${print(n)}`},coercer(n){return isObject$2(n)?{...n}:n}})}function optional(t){return new Struct({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function string(){return define("string",t=>typeof t=="string"||`Expected a string, but received: ${print(t)}`)}function type(t){const e=Object.keys(t);return new Struct({type:"type",schema:t,*entries(r){if(isObject$2(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return isObject$2(r)||`Expected an object, but received: ${print(r)}`},coercer(r){return isObject$2(r)?{...r}:r}})}function union(t){const e=t.map(r=>r.type).join(" | ");return new Struct({type:"union",schema:null,coercer(r){for(const n of t){const[s,a]=n.validate(r,{coerce:!0});if(!s)return a}return r},validator(r,n){const s=[];for(const a of t){const[...u]=run(r,a,n),[d]=u;if(d[0])for(const[f]of u)f&&s.push(f);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${print(r)}`,...s]}})}const track$1=object({title:string(),duration:number()}),album=object({title:string(),year:integer()}),artist=object({title:string()}),playlist=object({title:string(),relevancy:number(),shared:nullable(string()),remote:nullable(string())});type({title:optional(string()),album:optional(type({title:optional(string())})),artists:optional(array(type({title:optional(string())})))});const media=object({sources:array(string()),arts:optional(array(string())),thumbnails:optional(array(nullable(string())))}),collection=t=>object({size:integer(),duration:number(),tracks:array(t)}),unique=t=>assign(t,object({id:integer()})),artistInfo=assign(artist,media),albumInfo=assign(album,assign(media,object({artists:array(artistInfo)}))),trackInfo=assign(track$1,assign(omit(media,["arts","thumbnails"]),object({album:omit(albumInfo,["artists"]),artists:array(artistInfo)}))),playlistInfo=playlist,track=assign(unique(trackInfo),object({entry:optional(number()),album:unique(trackInfo.schema.album),artists:array(unique(trackInfo.schema.artists.schema))}));assign(unique(albumInfo),object({artists:array(unique(albumInfo.schema.artists.schema)),collection:optional(collection(track))}));assign(unique(artistInfo),object({following:optional(union([literal(0),literal(1)])),collection:optional(collection(track))}));assign(unique(playlistInfo),object({collection:optional(collection(track))}));function has(t,e){return t!==null&&typeof t=="object"&&e in t&&t[e]!==void 0}function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var murmurhash={exports:{}};(function(t){(function(){const e=a=>new TextEncoder().encode(a);function r(a,u){typeof a=="string"&&(a=e(a));let d=a.length,f=u^d,N=0,b;for(;d>=4;)b=a[N]&255|(a[++N]&255)<<8|(a[++N]&255)<<16|(a[++N]&255)<<24,b=(b&65535)*1540483477+(((b>>>16)*1540483477&65535)<<16),b^=b>>>24,b=(b&65535)*1540483477+(((b>>>16)*1540483477&65535)<<16),f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)^b,d-=4,++N;switch(d){case 3:f^=(a[N+2]&255)<<16;case 2:f^=(a[N+1]&255)<<8;case 1:f^=a[N]&255,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16)}return f^=f>>>13,f=(f&65535)*1540483477+(((f>>>16)*1540483477&65535)<<16),f^=f>>>15,f>>>0}function n(a,u){typeof a=="string"&&(a=e(a));let d,f,N,b,w,A,R,S;for(d=a.length&3,f=a.length-d,N=u,w=3432918353,A=461845907,S=0;S>>16)*w&65535)<<16)&4294967295,R=R<<15|R>>>17,R=(R&65535)*A+(((R>>>16)*A&65535)<<16)&4294967295,N^=R,N=N<<13|N>>>19,b=(N&65535)*5+(((N>>>16)*5&65535)<<16)&4294967295,N=(b&65535)+27492+(((b>>>16)+58964&65535)<<16);switch(R=0,d){case 3:R^=(a[S+2]&255)<<16;case 2:R^=(a[S+1]&255)<<8;case 1:R^=a[S]&255,R=(R&65535)*w+(((R>>>16)*w&65535)<<16)&4294967295,R=R<<15|R>>>17,R=(R&65535)*A+(((R>>>16)*A&65535)<<16)&4294967295,N^=R}return N^=a.length,N^=N>>>16,N=(N&65535)*2246822507+(((N>>>16)*2246822507&65535)<<16)&4294967295,N^=N>>>13,N=(N&65535)*3266489909+(((N>>>16)*3266489909&65535)<<16)&4294967295,N^=N>>>16,N>>>0}const s=n;s.v2=r,s.v3=n,t.exports=s})()})(murmurhash);var murmurhashExports=murmurhash.exports;const hash=getDefaultExportFromCjs(murmurhashExports);function titled(t){return has(t,"title")?t.title:t}function compare$1(t,e){return typeof t=="string"&&typeof e=="string"?t.localeCompare(e):typeof t=="number"&&typeof e=="number"?t-e:has(t,"title")&&has(e,"title")?compare$1(clean(titled(t)),clean(titled(e))):0}function normalize(t){if(typeof t=="string")return clean(t);if(typeof t!="object")return t;const e={...t};for(const r in e)Array.isArray(e[r])?e[r]=e[r].map(normalize).sort(compare$1):e[r]=normalize(e[r]);return e}function stringify(t){return t=normalize(t),typeof t=="string"?t:typeof t!="object"?clean(String(t)):has(t,"artists")&&has(t,"title")&&has(t,"album")?`${t.artists.map(titled)} - ${t.title} - ${titled(t.album)}`:has(t,"artists")&&has(t,"title")?`${t.artists.map(titled)} - ${t.title}`:has(t,"title")?t.title:Array.isArray(t)?t.map(titled).toString():JSON.stringify(t)}function identify(t){return has(t,"id")?+t.id:hash(stringify(t))}const playlists$2=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",r=>track$2(r).innerJoin("library","library.track","tracks.id").select(["library.playlist","library.id as entry"]).orderBy("library.order").orderBy("library.id")).selectFrom("track").fullJoin("playlists","playlists.id","track.playlist").where("playlists.id",">=",0).select(["playlists.id","playlists.title","playlists.relevancy","playlists.shared","playlists.remote",r=>json(r,{size:r.fn.count("track.duration"),duration:r.fn.coalesce(r.fn.sum("track.duration"),r.val(0)),tracks:groupJSON(r,{id:"track.id",entry:"track.entry",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).filterWhere("track.id","is not",null)}).as("collection")]).groupBy("playlists.id").orderBy("playlists.order").orderBy("playlists.id").$castTo(),{async create(e,r){await e.insertInto("playlists").onConflict(n=>n.doNothing()).values({id:identify(r),order:APPEND,relevancy:1,...r}).execute()},async edit(e,r,n){await e.updateTable("playlists").where("id","=",r).set(n).execute()},async rearrange(e,r,n){await e.updateTable("playlists_fractindex").set({after_id:n||null}).where("id","=",r).execute()},async delete(e,r){await e.deleteFrom("playlists").where("id","=",r).execute()},get(e,r){return e.selectFrom("playlists").selectAll().where("id","=",r).executeTakeFirstOrThrow()}}),resources$1=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).selectFrom("source").leftJoin("asset","asset.owner","source.owner").select([r=>r.fn.coalesce("asset.arts",r.val("[]")).as("arts"),r=>r.fn.coalesce("asset.thumbnails",r.val("[]")).as("thumbnails"),r=>r.fn.coalesce("source.sources",r.val("[]")).as("sources")]).$castTo(),{async prioritize(e,r,n){const s=r==="art"?"assets":"sources";await e.updateTable(s).set({primary:sql`${sql.ref(r)} = ${n}`}).where("owner","=",a=>a.selectFrom(s).where(r,"=",n).select("owner")).execute()},get(e,r){return e.with("source",source).with("asset",asset).selectFrom("source").leftJoin("asset","asset.owner","source.owner").select([n=>n.fn.coalesce("asset.arts",n.val("[]")).as("arts"),n=>n.fn.coalesce("asset.thumbnails",n.val("[]")).as("thumbnails"),n=>n.fn.coalesce("source.sources",n.val("[]")).as("sources")]).where("source.owner","=",r).$castTo().executeTakeFirstOrThrow()}}),settings$2=({replicated:t})=>t(e=>e.selectFrom("settings").select(["key",sql`json_extract(value, '$')`.as("value")]),{async store(e,r,n,s="settings"){s!=="settings"&&(await e.schema.createTable(s).ifNotExists().addColumn("key","text",a=>a.primaryKey().notNull()).addColumn("value","text").execute(),await e.schema.createIndex(s+"_value").ifNotExists().on(s).column("value").execute()),await e.insertInto(s).onConflict(a=>a.doUpdateSet({value:JSON.stringify(n)})).values({key:r,value:JSON.stringify(n)}).execute()},async extract(e,r,n="settings"){return e.selectFrom(n).select("value").where("key","=",r).executeTakeFirstOrThrow().then(s=>JSON.parse(s.value))},async lookup(e,r,n="settings"){return e.selectFrom(n).select("key").where("value","=",JSON.stringify(r)).executeTakeFirstOrThrow().then(s=>s.key)}}),history$2=({replicated:t})=>t(e=>e.selectFrom("history").orderBy("date","desc").selectAll(),{async log(e,r){r.trim()&&await e.insertInto("history").onConflict(n=>n.doUpdateSet({date:Date.now()})).values({query:r,date:Date.now()}).execute()},async clear(e){await e.deleteFrom("history").execute()},get(e){return e.selectFrom("history").selectAll().orderBy("date","desc").execute()}}),artists$2=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("artist").leftJoin("attribution","attribution.artist","artist.id").leftJoin("albums","albums.id","attribution.album").leftJoin("tracks","tracks.album","albums.id").leftJoin("track","track.id","tracks.id").select(["artist.id","artist.title","artist.following","artist.arts","artist.thumbnails","artist.sources",r=>json(r,{size:r.fn.count("track.duration"),duration:r.fn.coalesce(r.fn.sum("track.duration"),r.val(0)),tracks:groupJSON(r,{id:"track.id",entry:"track.id",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).filterWhere("track.id","is not",null)}).as("collection")]).groupBy("artist.id").orderBy(r=>r.fn.count("track.duration"),"desc").orderBy("artist.title").$castTo(),{async push(e,r){await pushArtists(e,r)},async edit(e,r,n){await e.updateTable("artists").where("id","=",r).set(n)},async follow(e,r){await e.updateTable("artists").set({following:1}).where("id","=",r).execute()},async unfollow(e,r){await e.updateTable("artists").set({following:0}).where("id","=",r).execute()},async search(e,r,n=10,s=0){return r?e.with("source",source).with("asset",asset).with("artist",artist$1).selectFrom("artists_fts").where("artists_fts","match",sanitize(r)).orderBy("rank").innerJoin("artist","artist.id","artists_fts.rowid").selectAll().limit(n).offset(s).$castTo().execute():[]},get(e,r){return e.with("source",source).with("asset",asset).with("artist",artist$1).selectFrom("artist").where("artist.id","=",r).selectAll().$castTo().executeTakeFirstOrThrow()}}),library$2=({replicated:t})=>t(e=>e.selectFrom("library").selectAll(),{async push(e,r,n){r.length&&(await pushTracks(e,r),n!=null&&await e.insertInto("library").onConflict(s=>s.doNothing()).values(r.map(({id:s})=>({id:uuid(),order:APPEND,date:~~(Date.now()/1e3),track:s,playlist:n}))).execute())},async rearrange(e,r,n){await e.updateTable("library_fractindex").set({after_id:n||null}).where("id","=",r).execute()},async purge(e,r){const n=r.map(s=>e.deleteFrom("library").where("id","=",s).execute());await Promise.all(n)},async get(e,r){return r.length?e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("library").innerJoin("track","track.id","library.track").select(["track.id","track.title","track.duration","track.album","track.artists","track.sources","library.id as entry"]).where("library.id","in",r).$castTo().execute():[]},async sample(e,r){const n=r,s=n*Math.sqrt(2*Math.PI)/2,a=sql`POW(ABS(RANDOM()) / 9223372036854775808, ${s} / EXP(-0.5 * POW(row_number() OVER (ORDER BY date DESC) / ${n},2)) * playlists.relevancy - )`;return await e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("library").innerJoin("playlists","playlists.id","library.playlist").innerJoin("track","track.id","library.track").select(["track.id","track.title","track.duration","track.album","track.artists","track.sources"]).where("relevancy",">",0).orderBy(a,"desc").limit(r).execute()},async banned(e){return await e.selectFrom("library").leftJoin("playlists","playlists.id","library.playlist").select("library.track").where("relevancy","<",0).execute().then(r=>r.map(n=>n.track))}}),id=integer,boolean=integer,tracks$2=assign(unique(track$1),object({album:id()}));crr(tracks$2);index(tracks$2,"album");primary(tracks$2,"id");const albums$2=unique(album);crr(albums$2);primary(albums$2,"id");const artists$1=assign(unique(artist),object({following:boolean()}));crr(artists$1);primary(artists$1,"id");const attribution=object({album:id(),artist:id()});crr(attribution);index(attribution,"artist");primary(attribution,"album","artist");const sources=object({source:string(),owner:id(),primary:boolean()});crr(sources);primary(sources,"owner","source");const assets=object({art:string(),thumbnail:nullable(string()),owner:id(),primary:boolean()});crr(assets);primary(assets,"owner","art");const playlists$1=assign(unique(playlist),object({order:string()}));crr(playlists$1);primary(playlists$1,"id");ordered(playlists$1,"order");index(playlists$1,"order","id");const library$1=object({id:id(),playlist:id(),track:id(),date:integer(),order:string()});crr(library$1);primary(library$1,"id");index(library$1,"date");index(library$1,"track");index(library$1,"playlist");index(library$1,"order","id");ordered(library$1,"order","playlist");const playback$1=object({id:id(),device:instance$1(Uint8Array),track:id(),order:string(),temp:any()});crr(playback$1);primary(playback$1,"id");index(playback$1,"device");index(playback$1,"order","id");ordered(playback$1,"order","device");const devices=object({id:instance$1(Uint8Array),playback:id(),direction:integer(),infinite:integer(),progress:number(),repeat:integer()});crr(devices);primary(devices,"id");const settings$1=object({key:string(),value:string()});crr(settings$1);index(settings$1,"value");primary(settings$1,"key");const history$1=object({query:string(),date:integer()});crr(history$1);index(history$1,"date");primary(history$1,"query");const schema=object({tracks:tracks$2,albums:albums$2,attribution,artists:artists$1,sources,assets,library:library$1,playlists:playlists$1,playback:playback$1,devices,settings:settings$1,history:history$1}),tracks$1=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("library").where("playlist",">=",0).innerJoin("track","track.id","library.track").select(["track.id","track.title","track.duration","track.album","track.artists","track.sources","library.id as entry","library.date"]).orderBy("library.date","desc").orderBy("library.id").$castTo(),{async edit(e,r,n){const s=await e.updateTable("tracks").where("id","=",r).set({...n,album:void 0}).returning("album").executeTakeFirst();s?.album&&n.album&&await e.updateTable("albums").where("id","=",s.album).set(n.album).execute()},async search(e,r,n=10,s=0){return r?e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("tracks_fts").where("tracks_fts","match",sanitize(r)).orderBy("rank").innerJoin("track","track.id","rowid").selectAll().limit(n).offset(s).$castTo().execute():[]},get(e,r){return e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("track").selectAll().where("id","=",r).$castTo().executeTakeFirstOrThrow()}}),albums$1=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).selectFrom("album").selectAll().orderBy("album.title"),{async push(e,r){await pushAlbums(e,r)},async search(e,r,n=10,s=0){return r?e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).selectFrom("albums_fts").where("albums_fts","match",sanitize(r)).orderBy("rank").innerJoin("album","album.id","albums_fts.rowid").selectAll().limit(n).offset(s).$castTo().execute():[]},get(e,r){return e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).selectFrom("album").selectAll().where("album.id","=",r).$castTo().executeTakeFirstOrThrow()}}),feed$1=({store:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",r=>track$2(r).innerJoin("library","library.track","tracks.id").select(["library.playlist","library.id as entry"]).orderBy("library.order").orderBy("library.id")).selectFrom("track").fullJoin("playlists","playlists.id","track.playlist").where("playlists.id","<",0).select(["playlists.id","playlists.title","playlists.relevancy","playlists.shared","playlists.remote",r=>json(r,{size:r.fn.count("track.duration"),duration:r.fn.coalesce(r.fn.sum("track.duration"),r.val(0)),tracks:groupJSON(r,{id:"track.id",entry:"track.entry",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).filterWhere("track.id","is not",null)}).as("collection")]).groupBy("playlists.id").orderBy("playlists.order").orderBy("playlists.id").$castTo(),{async clear(e,r){await e.deleteFrom("library").where("playlist","=",r).execute()},async get(e,r,n=-1){return e.selectFrom("library").where("playlist","=",r).select("id").limit(n).execute().then(s=>s.map(a=>a.id))}}),connections=new Map,stores=t=>({playlists:playlists$2(t),resources:resources$1(t),preceding:preceding$1(t),playback:playback$2(t),upcoming:upcoming$1(t),settings:settings$2(t),history:history$2(t),artists:artists$2(t),library:library$2(t),albums:albums$1(t),tracks:tracks$1(t),feed:feed$1(t)});function connect(t){if(!connections.has(t.name)){const e=database(t.local?nocrr(schema):schema,t);connections.set(t.name,{...e,...stores(e)});const r=Object.assign({"../sql/cascade.sql":__vite_glob_0_0,"../sql/fts.sql":__vite_glob_0_1,"../sql/playback.sql":__vite_glob_0_2,"../sql/playlists.sql":__vite_glob_0_3});t.local&&delete r["../sql/fts.sql"];const n=Object.values(r).flatMap(s=>s.split(/\r?\n\r?\n/)).map(s=>sql.raw(s));e.update(s=>Promise.all(n.map(a=>a.execute(s))))}return connections.get(t.name)}function nocrr(t){return{...t,schema:Object.fromEntries(Object.entries(t.schema).map(([e,r])=>[e,{...r,crr:!1}]))}}function identity(t){return t}function pipeFromArray(t){return t.length===0?identity:t.length===1?t[0]:function(r){return t.reduce((n,s)=>s(n),r)}}function observable(t){const e={subscribe(r){let n=null,s=!1,a=!1,u=!1;function d(){if(n===null){u=!0;return}a||(a=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=t({next(f){s||r.next?.(f)},error(f){s||(s=!0,r.error?.(f),d())},complete(){s||(s=!0,r.complete?.(),d())}}),u&&d(),{unsubscribe:d}},pipe(...r){return pipeFromArray(r)(e)}};return e}function share(t){return e=>{let r=0,n=null;const s=[];function a(){n||(n=e.subscribe({next(d){for(const f of s)f.next?.(d)},error(d){for(const f of s)f.error?.(d)},complete(){for(const d of s)d.complete?.()}}))}function u(){if(r===0&&n){const d=n;n=null,d.unsubscribe()}}return{subscribe(d){return r++,s.push(d),a(),{unsubscribe(){r--,u();const f=s.findIndex(y=>y===d);f>-1&&s.splice(f,1)}}}}}}class ObservableAbortError extends Error{constructor(e){super(e),this.name="ObservableAbortError",Object.setPrototypeOf(this,ObservableAbortError.prototype)}}function observableToPromise(t){let e;return{promise:new Promise((n,s)=>{let a=!1;function u(){a||(a=!0,s(new ObservableAbortError("This operation was aborted.")),d.unsubscribe())}const d=t.subscribe({next(f){a=!0,n(f),u()},error(f){a=!0,s(f),u()},complete(){a=!0,u()}});e=u}),abort:e}}function createChain(t){return observable(e=>{function r(s=0,a=t.op){const u=t.links[s];if(!u)throw new Error("No more links to execute - did you forget to add an ending link?");return u({op:a,next(f){return r(s+1,f)}})}return r().subscribe(e)})}function invert(t){const e=Object.create(null);for(const r in t){const n=t[r];e[n]=r}return e}const TRPC_ERROR_CODES_BY_KEY={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};invert(TRPC_ERROR_CODES_BY_KEY);invert(TRPC_ERROR_CODES_BY_KEY);const noop=()=>{};function createInnerProxy(t,e){return new Proxy(noop,{get(n,s){if(!(typeof s!="string"||s==="then"))return createInnerProxy(t,[...e,s])},apply(n,s,a){const u=e[e.length-1]==="apply";return t({args:u?a.length>=2?a[1]:[]:a,path:u?e.slice(0,-1):e})}})}const createRecursiveProxy=t=>createInnerProxy(t,[]),createFlatProxy=t=>new Proxy(noop,{get(e,r){if(!(typeof r!="string"||r==="then"))return t(r)}});function isObject$1(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}class UnknownCauseError extends Error{}function getCauseFromUnknown(t){if(t instanceof Error)return t;const e=typeof t;if(!(e==="undefined"||e==="function"||t===null)){if(e!=="object")return new Error(String(t));if(isObject$1(t)){const r=new UnknownCauseError;for(const n in t)r[n]=t[n];return r}}}function isObject(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function transformResultInner(t,e){if("error"in t){const n=e.transformer.deserialize(t.error);return{ok:!1,error:{...t,error:n}}}return{ok:!0,result:{...t.result,...(!t.result.type||t.result.type==="data")&&{type:"data",data:e.transformer.deserialize(t.result.data)}}}}class TransformResultError extends Error{constructor(){super("Unable to transform response from server")}}function transformResult(t,e){let r;try{r=transformResultInner(t,e)}catch{throw new TransformResultError}if(!r.ok&&(!isObject(r.error.error)||typeof r.error.error.code!="number"))throw new TransformResultError;if(r.ok&&!isObject(r.result))throw new TransformResultError;return r}function isTRPCClientError(t){return t instanceof TRPCClientError||t instanceof Error&&t.name==="TRPCClientError"}function isTRPCErrorResponse(t){return isObject(t)&&isObject(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}class TRPCClientError extends Error{static from(e,r={}){const n=e;return isTRPCClientError(n)?(r.meta&&(n.meta={...n.meta,...r.meta}),n):isTRPCErrorResponse(n)?new TRPCClientError(n.error.message,{...r,result:n}):n instanceof Error?new TRPCClientError(n.message,{...r,cause:getCauseFromUnknown(n)}):new TRPCClientError("Unknown error",{...r,cause:n})}constructor(e,r){const n=r?.cause;super(e,{cause:n}),this.meta=r?.meta,this.cause=n,this.shape=r?.result?.error,this.data=r?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,TRPCClientError.prototype)}}/* istanbul ignore next -- @preserve */const retryDelay=t=>t===0?0:Math.min(1e3*2**t,3e4);function createWSClient(t){const{url:e,WebSocket:r=WebSocket,retryDelayMs:n=retryDelay,onOpen:s,onClose:a}=t;/* istanbul ignore next -- @preserve */if(!r)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");let u=[];const d=Object.create(null);let f=0,y=null,b=null,w=C(),A="connecting";function R(){A!=="open"||y||(y=setTimeout(()=>{y=null,u.length===1?w.send(JSON.stringify(u.pop())):w.send(JSON.stringify(u)),u=[]}))}function I(){if(b!==null||A==="closed")return;const T=n(f++);N(T)}function h(){A="connecting";const T=w;w=C(),m(T)}function N(T){b||(A="connecting",b=setTimeout(h,T))}function m(T){Object.values(d).some(Y=>Y.ws===T)||T.close()}function E(){Object.values(d).forEach(T=>{T.type==="subscription"&&T.callbacks.complete()})}function v(T){u.some(q=>q.id===T.op.id)||$(T.op,T.callbacks)}function C(){const T=typeof e=="function"?e():e,q=new r(T);clearTimeout(b),b=null,q.addEventListener("open",()=>{/* istanbul ignore next -- @preserve */q===w&&(f=0,A="open",s?.(),R())}),q.addEventListener("error",()=>{q===w&&I()});const Y=M=>{if(M.method==="reconnect"&&q===w){A==="open"&&a?.(),h();for(const W of Object.values(d))W.type==="subscription"&&v(W)}},z=M=>{const W=M.id!==null&&d[M.id];if(W){if(W.callbacks.next?.(M),W.ws!==w&&q===w){const V=W.ws;W.ws=w,m(V)}"result"in M&&M.result.type==="stopped"&&q===w&&W.callbacks.complete()}};return q.addEventListener("message",({data:M})=>{const W=JSON.parse(M);"method"in W?Y(W):z(W),(q!==w||A==="closed")&&m(q)}),q.addEventListener("close",({code:M})=>{A==="open"&&a?.({code:M}),w===q&&I();for(const[W,V]of Object.entries(d))if(V.ws===q){if(A==="closed"){delete d[W],V.callbacks.complete?.();continue}V.type==="subscription"?v(V):(delete d[W],V.callbacks.error?.(TRPCClientError.from(new TRPCWebSocketClosedError("WebSocket closed prematurely"))))}}),q}function $(T,q){const{type:Y,input:z,path:M,id:W}=T,V={id:W,method:Y,params:{input:z,path:M}};return d[W]={ws:w,type:Y,callbacks:q,op:T},u.push(V),R(),()=>{const ae=d[W]?.callbacks;delete d[W],u=u.filter(G=>G.id!==W),ae?.complete?.(),w.readyState===r.OPEN&&T.type==="subscription"&&(u.push({id:W,method:"subscription.stop"}),R())}}return{close:()=>{A="closed",a?.(),E(),m(w),clearTimeout(b),b=null},request:$,getConnection(){return w}}}class TRPCWebSocketClosedError extends Error{constructor(e){super(e),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,TRPCWebSocketClosedError.prototype)}}function wsLink(t){return e=>{const{client:r}=t;return({op:n})=>observable(s=>{const{type:a,path:u,id:d,context:f}=n,y=e.transformer.serialize(n.input),b=r.request({type:a,path:u,input:y,id:d,context:f},{error(w){s.error(w),b()},complete(){s.complete()},next(w){const A=transformResult(w,e);if(!A.ok){s.error(TRPCClientError.from(A.error));return}s.next({result:A.result}),n.type!=="subscription"&&(b(),s.complete())}});return()=>{b()}})}}class TRPCUntypedClient{$request({type:e,input:r,path:n,context:s={}}){return createChain({links:this.links,op:{id:++this.requestId,type:e,path:n,input:r,context:s}}).pipe(share())}requestAsPromise(e){const r=this.$request(e),{promise:n,abort:s}=observableToPromise(r);return new Promise((u,d)=>{e.signal?.addEventListener("abort",s),n.then(f=>{u(f.result.data)}).catch(f=>{d(TRPCClientError.from(f))})})}query(e,r,n){return this.requestAsPromise({type:"query",path:e,input:r,context:n?.context,signal:n?.signal})}mutation(e,r,n){return this.requestAsPromise({type:"mutation",path:e,input:r,context:n?.context,signal:n?.signal})}subscription(e,r,n){return this.$request({type:"subscription",path:e,input:r,context:n?.context}).subscribe({next(a){a.result.type==="started"?n.onStarted?.():a.result.type==="stopped"?n.onStopped?.():n.onData?.(a.result.data)},error(a){n.onError?.(a)},complete(){n.onComplete?.()}})}constructor(e){this.requestId=0;const r=(()=>{const n=e.transformer;return n?"input"in n?e.transformer:{input:n,output:n}:{input:{serialize:s=>s,deserialize:s=>s},output:{serialize:s=>s,deserialize:s=>s}}})();this.runtime={transformer:{serialize:n=>r.input.serialize(n),deserialize:n=>r.output.deserialize(n)},combinedTransformer:r},this.links=e.links.map(n=>n(this.runtime))}}const clientCallTypeMap={query:"query",mutate:"mutation",subscribe:"subscription"},clientCallTypeToProcedureType=t=>clientCallTypeMap[t];function createTRPCClientProxy(t){return createFlatProxy(e=>t.hasOwnProperty(e)?t[e]:e==="__untypedClient"?t:createRecursiveProxy(({path:r,args:n})=>{const s=[e,...r],a=clientCallTypeToProcedureType(s.pop()),u=s.join(".");return t[a](u,...n)}))}function createTRPCProxyClient(t){const e=new TRPCUntypedClient(t);return createTRPCClientProxy(e)}const{sync,search:search$1,streams,expand,desource,transcribe}=createTRPCProxyClient({links:[globalThis.localStorage?.getItem("remote")?wsLink({client:createWSClient({url:()=>localStorage.getItem("remote")})}):()=>()=>observable(()=>{})]}),{playlists,resources,preceding,playback,upcoming,settings,history,artists,library,albums,tracks,update,feed}=connect({name:"library.db",push:sync.push.mutate,pull:sync.pull.subscribe}),search=writable(""),extra=writable(null);function format(t,e=!1){if(!e){t=Math.round(+t),t<=0&&(t=0);const d=~~(t/3600);t-=d*3600;const f=~~(t/60);t-=f*60;const y=t,b=w=>w.toString().padStart(2,"0");return d?`${d}:${b(f)}:${b(y)}`:`${f}:${b(y)}`}const r=new Intl.RelativeTimeFormat("en"),n=Math.floor((Date.now()-+t)/1e3),s=Math.floor(n/60),a=Math.floor(s/60),u=Math.floor(a/24);return n<=1?"just now":n<60?r.format(-n,"seconds"):s<60?r.format(-s,"minutes"):a<24?r.format(-a,"hours"):r.format(-u,"days")}function compare(t){const e=new Date;return+t>+e?"In The Future":t.getFullYear()===e.getFullYear()?t.getMonth()===e.getMonth()?e.getDate()-t.getDate()===0?"Today":e.getDate()-t.getDate()===1?"Yesterday":e.getDate()-t.getDate()<7&&e.getDay()>t.getDay()?"This Week":e.getDate()-t.getDate()<7||e.getDate()-t.getDate()<14&&e.getDay()>=t.getDay()?"Last Week":"This Month":e.getMonth()-t.getMonth()===1?"Last Month":`In ${t.toLocaleString("default",{month:"long"})}`:t.getFullYear().toString()}const get_default_slot_changes=t=>({}),get_default_slot_context=t=>({slot:"after"});function create_default_slot_6(t){let e;return{c(){e=text(t[4])},l(r){e=claim_text(r,t[4])},m(r,n){insert_hydration(r,e,n)},p(r,n){n&16&&set_data(e,r[4])},d(r){r&&detach(e)}}}function create_default_slot_5(t){let e,r,n,s;return n=new Text({props:{secondary:!0,$$slots:{default:[create_default_slot_6]},$$scope:{ctx:t}}}),{c(){e=text(t[5]),r=space(),create_component(n.$$.fragment)},l(a){e=claim_text(a,t[5]),r=claim_space(a),claim_component(n.$$.fragment,a)},m(a,u){insert_hydration(a,e,u),insert_hydration(a,r,u),mount_component(n,a,u),s=!0},p(a,u){(!s||u&32)&&set_data(e,a[5]);const d={};u&1040&&(d.$$scope={dirty:u,ctx:a}),n.$set(d)},i(a){s||(transition_in(n.$$.fragment,a),s=!0)},o(a){transition_out(n.$$.fragment,a),s=!1},d(a){a&&(detach(e),detach(r)),destroy_component(n,a)}}}function create_default_slot_4(t){let e=t[3]?.artists.map(func).join(", ")+"",r;return{c(){r=text(e)},l(n){r=claim_text(n,e)},m(n,s){insert_hydration(n,r,s)},p(n,s){s&8&&e!==(e=n[3]?.artists.map(func).join(", ")+"")&&set_data(r,e)},d(n){n&&detach(r)}}}function create_if_block(t){let e,r;return e=new When({props:{lg:!0,$$slots:{default:[create_default_slot_2]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s&1032&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_default_slot_3(t){let e=t[3]?.album.title+"",r;return{c(){r=text(e)},l(n){r=claim_text(n,e)},m(n,s){insert_hydration(n,r,s)},p(n,s){s&8&&e!==(e=n[3]?.album.title+"")&&set_data(r,e)},d(n){n&&detach(r)}}}function create_default_slot_2(t){let e,r;return e=new Text({props:{secondary:!0,sm:!0,loading:!t[3],$$slots:{default:[create_default_slot_3]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s&8&&(a.loading=!n[3]),s&1032&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_default_slot_1(t){let e,r,n,s,a,u,d=`scaleX(${t[1]})`,f;e=new Text({props:{accent:!0,loading:!t[3],$$slots:{default:[create_default_slot_5]},$$scope:{ctx:t}}}),n=new Text({props:{secondary:!0,sm:!0,loading:!t[3],$$slots:{default:[create_default_slot_4]},$$scope:{ctx:t}}});let y=!t[0]&&create_if_block(t);return{c(){create_component(e.$$.fragment),r=space(),create_component(n.$$.fragment),s=space(),y&&y.c(),a=space(),u=element("div"),this.h()},l(b){claim_component(e.$$.fragment,b),r=claim_space(b),claim_component(n.$$.fragment,b),s=claim_space(b),y&&y.l(b),a=claim_space(b),u=claim_element(b,"DIV",{class:!0}),children(u).forEach(detach),this.h()},h(){attr(u,"class","absolute bottom-0 left-0 h-0.5 w-full origin-left transform-gpu bg-highlight-200 transition-transform duration-1000"),set_style(u,"transform",d)},m(b,w){mount_component(e,b,w),insert_hydration(b,r,w),mount_component(n,b,w),insert_hydration(b,s,w),y&&y.m(b,w),insert_hydration(b,a,w),insert_hydration(b,u,w),f=!0},p(b,w){const A={};w&8&&(A.loading=!b[3]),w&1072&&(A.$$scope={dirty:w,ctx:b}),e.$set(A);const R={};w&8&&(R.loading=!b[3]),w&1032&&(R.$$scope={dirty:w,ctx:b}),n.$set(R),b[0]?y&&(group_outros(),transition_out(y,1,1,()=>{y=null}),check_outros()):y?(y.p(b,w),w&1&&transition_in(y,1)):(y=create_if_block(b),y.c(),transition_in(y,1),y.m(a.parentNode,a)),w&2&&d!==(d=`scaleX(${b[1]})`)&&set_style(u,"transform",d)},i(b){f||(transition_in(e.$$.fragment,b),transition_in(n.$$.fragment,b),transition_in(y),f=!0)},o(b){transition_out(e.$$.fragment,b),transition_out(n.$$.fragment,b),transition_out(y),f=!1},d(b){b&&(detach(r),detach(s),detach(a),detach(u)),destroy_component(e,b),destroy_component(n,b),y&&y.d(b)}}}function create_default_slot(t){let e,r,n=`hue-rotate(${t[3]?.id||0}deg)`,s;return r=new Icon({props:{name:"note"}}),{c(){e=element("div"),create_component(r.$$.fragment),this.h()},l(a){e=claim_element(a,"DIV",{class:!0});var u=children(e);claim_component(r.$$.fragment,u),u.forEach(detach),this.h()},h(){attr(e,"class","flex h-full w-full items-center justify-center bg-gradient-to-r from-rose-400 to-red-400 text-white"),set_style(e,"filter",n)},m(a,u){insert_hydration(a,e,u),mount_component(r,e,null),s=!0},p(a,u){u&8&&n!==(n=`hue-rotate(${a[3]?.id||0}deg)`)&&set_style(e,"filter",n)},i(a){s||(transition_in(r.$$.fragment,a),s=!0)},o(a){transition_out(r.$$.fragment,a),s=!1},d(a){a&&detach(e),destroy_component(r)}}}function create_before_slot(t){let e,r;return e=new Image({props:{src:t[3]?t[3].album.arts?.[0]||"":void 0,thumbnail:t[3]?t[3].album.thumbnails?.[0]||"":void 0,slot:"before",$$slots:{default:[create_default_slot]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s&8&&(a.src=n[3]?n[3].album.arts?.[0]||"":void 0),s&8&&(a.thumbnail=n[3]?n[3].album.thumbnails?.[0]||"":void 0),s&1032&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_after_slot(t){let e;const r=t[7].default,n=create_slot(r,t,t[10],get_default_slot_context);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,a){n&&n.p&&(!e||a&1024)&&update_slot_base(n,r,s,s[10],e?get_slot_changes(r,s[10],a,get_default_slot_changes):get_all_dirty_from_scope(s[10]),get_default_slot_context)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}function create_fragment(t){let e,r;return e=new Card({props:{sm:!0,flat:!0,flow:!t[0],interactive:!0,selected:t[2],$$slots:{after:[create_after_slot],before:[create_before_slot],default:[create_default_slot_1]},$$scope:{ctx:t}}}),e.$on("contextmenu",t[8]),e.$on("click",t[9]),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,[s]){const a={};s&1&&(a.flow=!n[0]),s&4&&(a.selected=n[2]),s&1083&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}const func=t=>t.title;function instance(t,e,r){let n,s,a,{$$slots:u={},$$scope:d}=e,{sm:f=!1}=e,{progress:y=0}=e,{selected:b=!1}=e,{track:w=void 0}=e;function A(I){bubble.call(this,t,I)}function R(I){bubble.call(this,t,I)}return t.$$set=I=>{"sm"in I&&r(0,f=I.sm),"progress"in I&&r(1,y=I.progress),"selected"in I&&r(2,b=I.selected),"track"in I&&r(3,w=I.track),"$$scope"in I&&r(10,d=I.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&r(5,[n=void 0,...s]=w?.title.split("(")||[],n,(r(6,s),r(3,w))),t.$$.dirty&64&&r(4,a=s.length?"("+s.join("("):"")},[f,y,b,w,a,n,s,u,A,R,d]}class Track extends SvelteComponent{constructor(e){super(),init$1(this,e,instance,create_fragment,safe_not_equal,{sm:0,progress:1,selected:2,track:3})}}export{Card as C,Image as I,Portal as P,Realm as R,Track as T,Virtual as V,When as W,extra as a,streams as b,capitalize as c,search$1 as d,ensure_array_like as e,albums as f,artists as g,history as h,initRealm as i,expand as j,playback as k,library as l,feed as m,Text as n,outro_and_destroy_block as o,playlists as p,format as q,ready as r,search as s,tracks as t,update_keyed_each as u,hold as v,compare as w,upcoming as x,desource as y}; + )`;return await e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("library").innerJoin("playlists","playlists.id","library.playlist").innerJoin("track","track.id","library.track").select(["track.id","track.title","track.duration","track.album","track.artists","track.sources"]).where("relevancy",">",0).orderBy(a,"desc").limit(r).execute()},async banned(e){return await e.selectFrom("library").leftJoin("playlists","playlists.id","library.playlist").select("library.track").where("relevancy","<",0).execute().then(r=>r.map(n=>n.track))}});function database(t,e={}){const{replica:r,...n}=database$1(t,e);function s(...a){return function(u,d){const f=a.length?derived(a,A=>A):void 0,N=f&&get_store_value(f),{bind:b,...w}=r(u,d,N);return b(A=>f?.subscribe(A)),w}}return{replicated:Object.assign(s(),{with:s}),...n}}const id=integer,boolean=integer,tracks$2=assign(unique(track$1),object({album:id()}));crr(tracks$2);index(tracks$2,"album");primary(tracks$2,"id");const albums$2=unique(album);crr(albums$2);primary(albums$2,"id");const artists$1=assign(unique(artist),object({following:boolean()}));crr(artists$1);primary(artists$1,"id");const attribution=object({album:id(),artist:id()});crr(attribution);index(attribution,"artist");primary(attribution,"album","artist");const sources=object({source:string(),owner:id(),primary:boolean()});crr(sources);primary(sources,"owner","source");const assets=object({art:string(),thumbnail:nullable(string()),owner:id(),primary:boolean()});crr(assets);primary(assets,"owner","art");const playlists$1=assign(unique(playlist),object({order:string()}));crr(playlists$1);primary(playlists$1,"id");ordered(playlists$1,"order");index(playlists$1,"order","id");const library$1=object({id:id(),playlist:id(),track:id(),date:integer(),order:string()});crr(library$1);primary(library$1,"id");index(library$1,"date");index(library$1,"track");index(library$1,"playlist");index(library$1,"order","id");ordered(library$1,"order","playlist");const playback$1=object({id:id(),device:instance$1(Uint8Array),track:id(),order:string(),temp:any()});crr(playback$1);primary(playback$1,"id");index(playback$1,"device");index(playback$1,"order","id");ordered(playback$1,"order","device");const devices=object({id:instance$1(Uint8Array),playback:id(),direction:integer(),infinite:integer(),progress:number(),repeat:integer()});crr(devices);primary(devices,"id");const settings$1=object({key:string(),value:string()});crr(settings$1);index(settings$1,"value");primary(settings$1,"key");const history$1=object({query:string(),date:integer()});crr(history$1);index(history$1,"date");primary(history$1,"query");const schema=object({tracks:tracks$2,albums:albums$2,attribution,artists:artists$1,sources,assets,library:library$1,playlists:playlists$1,playback:playback$1,devices,settings:settings$1,history:history$1}),tracks$1=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("library").where("playlist",">=",0).innerJoin("track","track.id","library.track").select(["track.id","track.title","track.duration","track.album","track.artists","track.sources","library.id as entry","library.date"]).orderBy("library.date","desc").orderBy("library.id").$castTo(),{async edit(e,r,n){const s=await e.updateTable("tracks").where("id","=",r).set({...n,album:void 0}).returning("album").executeTakeFirst();s?.album&&n.album&&await e.updateTable("albums").where("id","=",s.album).set(n.album).execute()},async search(e,r,n=10,s=0){return r?e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("tracks_fts").where("tracks_fts","match",sanitize(r)).orderBy("rank").innerJoin("track","track.id","rowid").selectAll().limit(n).offset(s).$castTo().execute():[]},get(e,r){return e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",track$2).selectFrom("track").selectAll().where("id","=",r).$castTo().executeTakeFirstOrThrow()}}),albums$1=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).selectFrom("album").selectAll().orderBy("album.title"),{async push(e,r){await pushAlbums(e,r)},async search(e,r,n=10,s=0){return r?e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).selectFrom("albums_fts").where("albums_fts","match",sanitize(r)).orderBy("rank").innerJoin("album","album.id","albums_fts.rowid").selectAll().limit(n).offset(s).$castTo().execute():[]},get(e,r){return e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).selectFrom("album").selectAll().where("album.id","=",r).$castTo().executeTakeFirstOrThrow()}}),feed$1=({replicated:t})=>t(e=>e.with("source",source).with("asset",asset).with("artist",artist$1).with("album",album$1).with("track",r=>track$2(r).innerJoin("library","library.track","tracks.id").select(["library.playlist","library.id as entry"]).orderBy("library.order").orderBy("library.id")).selectFrom("track").fullJoin("playlists","playlists.id","track.playlist").where("playlists.id","<",0).select(["playlists.id","playlists.title","playlists.relevancy","playlists.shared","playlists.remote",r=>json(r,{size:r.fn.count("track.duration"),duration:r.fn.coalesce(r.fn.sum("track.duration"),r.val(0)),tracks:groupJSON(r,{id:"track.id",entry:"track.entry",title:"track.title",duration:"track.duration",album:"track.album",artists:"track.artists",sources:"track.sources"}).filterWhere("track.id","is not",null)}).as("collection")]).groupBy("playlists.id").orderBy("playlists.order").orderBy("playlists.id").$castTo(),{async clear(e,r){await e.deleteFrom("library").where("playlist","=",r).execute()},async get(e,r,n=-1){return e.selectFrom("library").where("playlist","=",r).select("id").limit(n).execute().then(s=>s.map(a=>a.id))}}),connections=new Map,stores=t=>({playlists:playlists$2(t),resources:resources$1(t),preceding:preceding$1(t),playback:playback$2(t),upcoming:upcoming$1(t),settings:settings$2(t),history:history$2(t),artists:artists$2(t),library:library$2(t),albums:albums$1(t),tracks:tracks$1(t),feed:feed$1(t)});function connect(t){if(!connections.has(t.name)){const e=database(t.local?nocrr(schema):schema,t);connections.set(t.name,{...e,...stores(e)});const r=Object.assign({"../sql/cascade.sql":__vite_glob_0_0,"../sql/fts.sql":__vite_glob_0_1,"../sql/playback.sql":__vite_glob_0_2,"../sql/playlists.sql":__vite_glob_0_3});t.local&&delete r["../sql/fts.sql"];const n=Object.values(r).flatMap(s=>s.split(/\r?\n\r?\n/)).map(s=>sql.raw(s));e.update(s=>Promise.all(n.map(a=>a.execute(s))))}return connections.get(t.name)}function nocrr(t){return{...t,schema:Object.fromEntries(Object.entries(t.schema).map(([e,r])=>[e,{...r,crr:!1}]))}}function identity(t){return t}function pipeFromArray(t){return t.length===0?identity:t.length===1?t[0]:function(r){return t.reduce((n,s)=>s(n),r)}}function observable(t){const e={subscribe(r){let n=null,s=!1,a=!1,u=!1;function d(){if(n===null){u=!0;return}a||(a=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=t({next(f){s||r.next?.(f)},error(f){s||(s=!0,r.error?.(f),d())},complete(){s||(s=!0,r.complete?.(),d())}}),u&&d(),{unsubscribe:d}},pipe(...r){return pipeFromArray(r)(e)}};return e}function share(t){return e=>{let r=0,n=null;const s=[];function a(){n||(n=e.subscribe({next(d){for(const f of s)f.next?.(d)},error(d){for(const f of s)f.error?.(d)},complete(){for(const d of s)d.complete?.()}}))}function u(){if(r===0&&n){const d=n;n=null,d.unsubscribe()}}return{subscribe(d){return r++,s.push(d),a(),{unsubscribe(){r--,u();const f=s.findIndex(N=>N===d);f>-1&&s.splice(f,1)}}}}}}class ObservableAbortError extends Error{constructor(e){super(e),this.name="ObservableAbortError",Object.setPrototypeOf(this,ObservableAbortError.prototype)}}function observableToPromise(t){let e;return{promise:new Promise((n,s)=>{let a=!1;function u(){a||(a=!0,s(new ObservableAbortError("This operation was aborted.")),d.unsubscribe())}const d=t.subscribe({next(f){a=!0,n(f),u()},error(f){a=!0,s(f),u()},complete(){a=!0,u()}});e=u}),abort:e}}function createChain(t){return observable(e=>{function r(s=0,a=t.op){const u=t.links[s];if(!u)throw new Error("No more links to execute - did you forget to add an ending link?");return u({op:a,next(f){return r(s+1,f)}})}return r().subscribe(e)})}function invert(t){const e=Object.create(null);for(const r in t){const n=t[r];e[n]=r}return e}const TRPC_ERROR_CODES_BY_KEY={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};invert(TRPC_ERROR_CODES_BY_KEY);invert(TRPC_ERROR_CODES_BY_KEY);const noop=()=>{};function createInnerProxy(t,e){return new Proxy(noop,{get(n,s){if(!(typeof s!="string"||s==="then"))return createInnerProxy(t,[...e,s])},apply(n,s,a){const u=e[e.length-1]==="apply";return t({args:u?a.length>=2?a[1]:[]:a,path:u?e.slice(0,-1):e})}})}const createRecursiveProxy=t=>createInnerProxy(t,[]),createFlatProxy=t=>new Proxy(noop,{get(e,r){if(!(typeof r!="string"||r==="then"))return t(r)}});function isObject$1(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}class UnknownCauseError extends Error{}function getCauseFromUnknown(t){if(t instanceof Error)return t;const e=typeof t;if(!(e==="undefined"||e==="function"||t===null)){if(e!=="object")return new Error(String(t));if(isObject$1(t)){const r=new UnknownCauseError;for(const n in t)r[n]=t[n];return r}}}function isObject(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function transformResultInner(t,e){if("error"in t){const n=e.transformer.deserialize(t.error);return{ok:!1,error:{...t,error:n}}}return{ok:!0,result:{...t.result,...(!t.result.type||t.result.type==="data")&&{type:"data",data:e.transformer.deserialize(t.result.data)}}}}class TransformResultError extends Error{constructor(){super("Unable to transform response from server")}}function transformResult(t,e){let r;try{r=transformResultInner(t,e)}catch{throw new TransformResultError}if(!r.ok&&(!isObject(r.error.error)||typeof r.error.error.code!="number"))throw new TransformResultError;if(r.ok&&!isObject(r.result))throw new TransformResultError;return r}function isTRPCClientError(t){return t instanceof TRPCClientError||t instanceof Error&&t.name==="TRPCClientError"}function isTRPCErrorResponse(t){return isObject(t)&&isObject(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}class TRPCClientError extends Error{static from(e,r={}){const n=e;return isTRPCClientError(n)?(r.meta&&(n.meta={...n.meta,...r.meta}),n):isTRPCErrorResponse(n)?new TRPCClientError(n.error.message,{...r,result:n}):n instanceof Error?new TRPCClientError(n.message,{...r,cause:getCauseFromUnknown(n)}):new TRPCClientError("Unknown error",{...r,cause:n})}constructor(e,r){const n=r?.cause;super(e,{cause:n}),this.meta=r?.meta,this.cause=n,this.shape=r?.result?.error,this.data=r?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,TRPCClientError.prototype)}}/* istanbul ignore next -- @preserve */const retryDelay=t=>t===0?0:Math.min(1e3*2**t,3e4);function createWSClient(t){const{url:e,WebSocket:r=WebSocket,retryDelayMs:n=retryDelay,onOpen:s,onClose:a}=t;/* istanbul ignore next -- @preserve */if(!r)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");let u=[];const d=Object.create(null);let f=0,N=null,b=null,w=C(),A="connecting";function R(){A!=="open"||N||(N=setTimeout(()=>{N=null,u.length===1?w.send(JSON.stringify(u.pop())):w.send(JSON.stringify(u)),u=[]}))}function S(){if(b!==null||A==="closed")return;const T=n(f++);y(T)}function h(){A="connecting";const T=w;w=C(),m(T)}function y(T){b||(A="connecting",b=setTimeout(h,T))}function m(T){Object.values(d).some($=>$.ws===T)||T.close()}function E(){Object.values(d).forEach(T=>{T.type==="subscription"&&T.callbacks.complete()})}function v(T){u.some(q=>q.id===T.op.id)||V(T.op,T.callbacks)}function C(){const T=typeof e=="function"?e():e,q=new r(T);clearTimeout(b),b=null,q.addEventListener("open",()=>{/* istanbul ignore next -- @preserve */q===w&&(f=0,A="open",s?.(),R())}),q.addEventListener("error",()=>{q===w&&S()});const $=M=>{if(M.method==="reconnect"&&q===w){A==="open"&&a?.(),h();for(const F of Object.values(d))F.type==="subscription"&&v(F)}},U=M=>{const F=M.id!==null&&d[M.id];if(F){if(F.callbacks.next?.(M),F.ws!==w&&q===w){const J=F.ws;F.ws=w,m(J)}"result"in M&&M.result.type==="stopped"&&q===w&&F.callbacks.complete()}};return q.addEventListener("message",({data:M})=>{const F=JSON.parse(M);"method"in F?$(F):U(F),(q!==w||A==="closed")&&m(q)}),q.addEventListener("close",({code:M})=>{A==="open"&&a?.({code:M}),w===q&&S();for(const[F,J]of Object.entries(d))if(J.ws===q){if(A==="closed"){delete d[F],J.callbacks.complete?.();continue}J.type==="subscription"?v(J):(delete d[F],J.callbacks.error?.(TRPCClientError.from(new TRPCWebSocketClosedError("WebSocket closed prematurely"))))}}),q}function V(T,q){const{type:$,input:U,path:M,id:F}=T,J={id:F,method:$,params:{input:U,path:M}};return d[F]={ws:w,type:$,callbacks:q,op:T},u.push(J),R(),()=>{const ae=d[F]?.callbacks;delete d[F],u=u.filter(ee=>ee.id!==F),ae?.complete?.(),w.readyState===r.OPEN&&T.type==="subscription"&&(u.push({id:F,method:"subscription.stop"}),R())}}return{close:()=>{A="closed",a?.(),E(),m(w),clearTimeout(b),b=null},request:V,getConnection(){return w}}}class TRPCWebSocketClosedError extends Error{constructor(e){super(e),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,TRPCWebSocketClosedError.prototype)}}function wsLink(t){return e=>{const{client:r}=t;return({op:n})=>observable(s=>{const{type:a,path:u,id:d,context:f}=n,N=e.transformer.serialize(n.input),b=r.request({type:a,path:u,input:N,id:d,context:f},{error(w){s.error(w),b()},complete(){s.complete()},next(w){const A=transformResult(w,e);if(!A.ok){s.error(TRPCClientError.from(A.error));return}s.next({result:A.result}),n.type!=="subscription"&&(b(),s.complete())}});return()=>{b()}})}}class TRPCUntypedClient{$request({type:e,input:r,path:n,context:s={}}){return createChain({links:this.links,op:{id:++this.requestId,type:e,path:n,input:r,context:s}}).pipe(share())}requestAsPromise(e){const r=this.$request(e),{promise:n,abort:s}=observableToPromise(r);return new Promise((u,d)=>{e.signal?.addEventListener("abort",s),n.then(f=>{u(f.result.data)}).catch(f=>{d(TRPCClientError.from(f))})})}query(e,r,n){return this.requestAsPromise({type:"query",path:e,input:r,context:n?.context,signal:n?.signal})}mutation(e,r,n){return this.requestAsPromise({type:"mutation",path:e,input:r,context:n?.context,signal:n?.signal})}subscription(e,r,n){return this.$request({type:"subscription",path:e,input:r,context:n?.context}).subscribe({next(a){a.result.type==="started"?n.onStarted?.():a.result.type==="stopped"?n.onStopped?.():n.onData?.(a.result.data)},error(a){n.onError?.(a)},complete(){n.onComplete?.()}})}constructor(e){this.requestId=0;const r=(()=>{const n=e.transformer;return n?"input"in n?e.transformer:{input:n,output:n}:{input:{serialize:s=>s,deserialize:s=>s},output:{serialize:s=>s,deserialize:s=>s}}})();this.runtime={transformer:{serialize:n=>r.input.serialize(n),deserialize:n=>r.output.deserialize(n)},combinedTransformer:r},this.links=e.links.map(n=>n(this.runtime))}}const clientCallTypeMap={query:"query",mutate:"mutation",subscribe:"subscription"},clientCallTypeToProcedureType=t=>clientCallTypeMap[t];function createTRPCClientProxy(t){return createFlatProxy(e=>t.hasOwnProperty(e)?t[e]:e==="__untypedClient"?t:createRecursiveProxy(({path:r,args:n})=>{const s=[e,...r],a=clientCallTypeToProcedureType(s.pop()),u=s.join(".");return t[a](u,...n)}))}function createTRPCProxyClient(t){const e=new TRPCUntypedClient(t);return createTRPCClientProxy(e)}const{sync,search:search$1,streams,expand,desource,transcribe}=createTRPCProxyClient({links:[globalThis.localStorage?.getItem("remote")?wsLink({client:createWSClient({url:()=>localStorage.getItem("remote")})}):()=>()=>observable(()=>{})]}),{playlists,resources,preceding,playback,upcoming,settings,history,artists,library,albums,tracks,update,feed}=connect({name:"library.db",push:sync.push.mutate,pull:sync.pull.subscribe}),search=writable(""),extra=writable(null);function format(t,e=!1){if(!e){t=Math.round(+t),t<=0&&(t=0);const d=~~(t/3600);t-=d*3600;const f=~~(t/60);t-=f*60;const N=t,b=w=>w.toString().padStart(2,"0");return d?`${d}:${b(f)}:${b(N)}`:`${f}:${b(N)}`}const r=new Intl.RelativeTimeFormat("en"),n=Math.floor((Date.now()-+t)/1e3),s=Math.floor(n/60),a=Math.floor(s/60),u=Math.floor(a/24);return n<=1?"just now":n<60?r.format(-n,"seconds"):s<60?r.format(-s,"minutes"):a<24?r.format(-a,"hours"):r.format(-u,"days")}function compare(t){const e=new Date;return+t>+e?"In The Future":t.getFullYear()===e.getFullYear()?t.getMonth()===e.getMonth()?e.getDate()-t.getDate()===0?"Today":e.getDate()-t.getDate()===1?"Yesterday":e.getDate()-t.getDate()<7&&e.getDay()>t.getDay()?"This Week":e.getDate()-t.getDate()<7||e.getDate()-t.getDate()<14&&e.getDay()>=t.getDay()?"Last Week":"This Month":e.getMonth()-t.getMonth()===1?"Last Month":`In ${t.toLocaleString("default",{month:"long"})}`:t.getFullYear().toString()}const get_default_slot_changes=t=>({}),get_default_slot_context=t=>({slot:"after"});function create_default_slot_6(t){let e;return{c(){e=text(t[4])},l(r){e=claim_text(r,t[4])},m(r,n){insert_hydration(r,e,n)},p(r,n){n&16&&set_data(e,r[4])},d(r){r&&detach(e)}}}function create_default_slot_5(t){let e,r,n,s;return n=new Text({props:{secondary:!0,$$slots:{default:[create_default_slot_6]},$$scope:{ctx:t}}}),{c(){e=text(t[5]),r=space(),create_component(n.$$.fragment)},l(a){e=claim_text(a,t[5]),r=claim_space(a),claim_component(n.$$.fragment,a)},m(a,u){insert_hydration(a,e,u),insert_hydration(a,r,u),mount_component(n,a,u),s=!0},p(a,u){(!s||u&32)&&set_data(e,a[5]);const d={};u&1040&&(d.$$scope={dirty:u,ctx:a}),n.$set(d)},i(a){s||(transition_in(n.$$.fragment,a),s=!0)},o(a){transition_out(n.$$.fragment,a),s=!1},d(a){a&&(detach(e),detach(r)),destroy_component(n,a)}}}function create_default_slot_4(t){let e=t[3]?.artists.map(func).join(", ")+"",r;return{c(){r=text(e)},l(n){r=claim_text(n,e)},m(n,s){insert_hydration(n,r,s)},p(n,s){s&8&&e!==(e=n[3]?.artists.map(func).join(", ")+"")&&set_data(r,e)},d(n){n&&detach(r)}}}function create_if_block(t){let e,r;return e=new When({props:{lg:!0,$$slots:{default:[create_default_slot_2]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s&1032&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_default_slot_3(t){let e=t[3]?.album.title+"",r;return{c(){r=text(e)},l(n){r=claim_text(n,e)},m(n,s){insert_hydration(n,r,s)},p(n,s){s&8&&e!==(e=n[3]?.album.title+"")&&set_data(r,e)},d(n){n&&detach(r)}}}function create_default_slot_2(t){let e,r;return e=new Text({props:{secondary:!0,sm:!0,loading:!t[3],$$slots:{default:[create_default_slot_3]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s&8&&(a.loading=!n[3]),s&1032&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_default_slot_1(t){let e,r,n,s,a,u,d=`scaleX(${t[1]})`,f;e=new Text({props:{accent:!0,loading:!t[3],$$slots:{default:[create_default_slot_5]},$$scope:{ctx:t}}}),n=new Text({props:{secondary:!0,sm:!0,loading:!t[3],$$slots:{default:[create_default_slot_4]},$$scope:{ctx:t}}});let N=!t[0]&&create_if_block(t);return{c(){create_component(e.$$.fragment),r=space(),create_component(n.$$.fragment),s=space(),N&&N.c(),a=space(),u=element("div"),this.h()},l(b){claim_component(e.$$.fragment,b),r=claim_space(b),claim_component(n.$$.fragment,b),s=claim_space(b),N&&N.l(b),a=claim_space(b),u=claim_element(b,"DIV",{class:!0}),children(u).forEach(detach),this.h()},h(){attr(u,"class","absolute bottom-0 left-0 h-0.5 w-full origin-left transform-gpu bg-highlight-200 transition-transform duration-1000"),set_style(u,"transform",d)},m(b,w){mount_component(e,b,w),insert_hydration(b,r,w),mount_component(n,b,w),insert_hydration(b,s,w),N&&N.m(b,w),insert_hydration(b,a,w),insert_hydration(b,u,w),f=!0},p(b,w){const A={};w&8&&(A.loading=!b[3]),w&1072&&(A.$$scope={dirty:w,ctx:b}),e.$set(A);const R={};w&8&&(R.loading=!b[3]),w&1032&&(R.$$scope={dirty:w,ctx:b}),n.$set(R),b[0]?N&&(group_outros(),transition_out(N,1,1,()=>{N=null}),check_outros()):N?(N.p(b,w),w&1&&transition_in(N,1)):(N=create_if_block(b),N.c(),transition_in(N,1),N.m(a.parentNode,a)),w&2&&d!==(d=`scaleX(${b[1]})`)&&set_style(u,"transform",d)},i(b){f||(transition_in(e.$$.fragment,b),transition_in(n.$$.fragment,b),transition_in(N),f=!0)},o(b){transition_out(e.$$.fragment,b),transition_out(n.$$.fragment,b),transition_out(N),f=!1},d(b){b&&(detach(r),detach(s),detach(a),detach(u)),destroy_component(e,b),destroy_component(n,b),N&&N.d(b)}}}function create_default_slot(t){let e,r,n=`hue-rotate(${t[3]?.id||0}deg)`,s;return r=new Icon({props:{name:"note"}}),{c(){e=element("div"),create_component(r.$$.fragment),this.h()},l(a){e=claim_element(a,"DIV",{class:!0});var u=children(e);claim_component(r.$$.fragment,u),u.forEach(detach),this.h()},h(){attr(e,"class","flex h-full w-full items-center justify-center bg-gradient-to-r from-rose-400 to-red-400 text-white"),set_style(e,"filter",n)},m(a,u){insert_hydration(a,e,u),mount_component(r,e,null),s=!0},p(a,u){u&8&&n!==(n=`hue-rotate(${a[3]?.id||0}deg)`)&&set_style(e,"filter",n)},i(a){s||(transition_in(r.$$.fragment,a),s=!0)},o(a){transition_out(r.$$.fragment,a),s=!1},d(a){a&&detach(e),destroy_component(r)}}}function create_before_slot(t){let e,r;return e=new Image({props:{src:t[3]?t[3].album.arts?.[0]||"":void 0,thumbnail:t[3]?t[3].album.thumbnails?.[0]||"":void 0,slot:"before",$$slots:{default:[create_default_slot]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,s){const a={};s&8&&(a.src=n[3]?n[3].album.arts?.[0]||"":void 0),s&8&&(a.thumbnail=n[3]?n[3].album.thumbnails?.[0]||"":void 0),s&1032&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}function create_after_slot(t){let e;const r=t[7].default,n=create_slot(r,t,t[10],get_default_slot_context);return{c(){n&&n.c()},l(s){n&&n.l(s)},m(s,a){n&&n.m(s,a),e=!0},p(s,a){n&&n.p&&(!e||a&1024)&&update_slot_base(n,r,s,s[10],e?get_slot_changes(r,s[10],a,get_default_slot_changes):get_all_dirty_from_scope(s[10]),get_default_slot_context)},i(s){e||(transition_in(n,s),e=!0)},o(s){transition_out(n,s),e=!1},d(s){n&&n.d(s)}}}function create_fragment(t){let e,r;return e=new Card({props:{sm:!0,flat:!0,flow:!t[0],interactive:!0,selected:t[2],$$slots:{after:[create_after_slot],before:[create_before_slot],default:[create_default_slot_1]},$$scope:{ctx:t}}}),e.$on("contextmenu",t[8]),e.$on("click",t[9]),{c(){create_component(e.$$.fragment)},l(n){claim_component(e.$$.fragment,n)},m(n,s){mount_component(e,n,s),r=!0},p(n,[s]){const a={};s&1&&(a.flow=!n[0]),s&4&&(a.selected=n[2]),s&1083&&(a.$$scope={dirty:s,ctx:n}),e.$set(a)},i(n){r||(transition_in(e.$$.fragment,n),r=!0)},o(n){transition_out(e.$$.fragment,n),r=!1},d(n){destroy_component(e,n)}}}const func=t=>t.title;function instance(t,e,r){let n,s,a,{$$slots:u={},$$scope:d}=e,{sm:f=!1}=e,{progress:N=0}=e,{selected:b=!1}=e,{track:w=void 0}=e;function A(S){bubble.call(this,t,S)}function R(S){bubble.call(this,t,S)}return t.$$set=S=>{"sm"in S&&r(0,f=S.sm),"progress"in S&&r(1,N=S.progress),"selected"in S&&r(2,b=S.selected),"track"in S&&r(3,w=S.track),"$$scope"in S&&r(10,d=S.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&r(5,[n=void 0,...s]=w?.title.split("(")||[],n,(r(6,s),r(3,w))),t.$$.dirty&64&&r(4,a=s.length?"("+s.join("("):"")},[f,N,b,w,a,n,s,u,A,R,d]}class Track extends SvelteComponent{constructor(e){super(),init$1(this,e,instance,create_fragment,safe_not_equal,{sm:0,progress:1,selected:2,track:3})}}export{Card as C,Image as I,Portal as P,Realm as R,Track as T,Virtual as V,When as W,extra as a,streams as b,capitalize as c,search$1 as d,ensure_array_like as e,albums as f,artists as g,history as h,initRealm as i,expand as j,playback as k,library as l,feed as m,Text as n,outro_and_destroy_block as o,playlists as p,format as q,ready as r,search as s,tracks as t,update_keyed_each as u,hold as v,compare as w,upcoming as x,desource as y}; diff --git a/_app/immutable/chunks/autoscroll.ckBVSgbF.js b/_app/immutable/chunks/autoscroll.sHJkSdr1.js similarity index 89% rename from _app/immutable/chunks/autoscroll.ckBVSgbF.js rename to _app/immutable/chunks/autoscroll.sHJkSdr1.js index 5ec58c5c..59e52f6c 100644 --- a/_app/immutable/chunks/autoscroll.ckBVSgbF.js +++ b/_app/immutable/chunks/autoscroll.sHJkSdr1.js @@ -1 +1 @@ -import{p as M}from"./Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";function E(l,{trigger:u="auto",axis:c="both",enabled:a=!1,threshold:o=64}={}){let n;const i={x:0,y:0},m=()=>f(!0),p=()=>f(!1);function y({x:t,y:e}){if(!a)return;let r=0,s=0;if(tn.right||en.bottom)return;c!=="x"&&(e-n.topn.bottom-o&&(s=e-n.bottom+o)),c!=="y"&&(t-n.leftn.right-o&&(r=t-n.right+o)),s/=o,r/=o;const v=!i.x&&!i.y,w=r||s;i.x=b(r),i.y=b(s),v&&w&&d()}function b(t){if(!t)return 0;let e=Math.abs(t);return e<1?e=(Math.cos(Math.PI*(e+1))+1)/2:e=Math.log(e)/3+1,e*Math.sign(t)}function d(){let t=Date.now();const e=()=>{if(!a||!i.x&&!i.y)return;const r=Date.now(),s=r-t;t=r,l.scrollBy(i.x*s,i.y*s),requestAnimationFrame(e)};requestAnimationFrame(e)}let g=()=>{};function f(t=a){a=t||u==="always",a?(l.style.scrollBehavior="auto",n=l.getBoundingClientRect(),g=M.subscribe(y)):(l.style.scrollBehavior="",i.x=0,i.y=0,g())}return u==="auto"&&(addEventListener("dragstart",m),addEventListener("dragend",p)),f(),{update(t){t.enabled!=null&&f(t.enabled)},destroy(){removeEventListener("dragstart",m),removeEventListener("dragend",p),u="none",f(!1)}}}export{E as a}; +import{p as M}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";function E(l,{trigger:u="auto",axis:c="both",enabled:a=!1,threshold:o=64}={}){let n;const i={x:0,y:0},m=()=>f(!0),p=()=>f(!1);function y({x:t,y:e}){if(!a)return;let r=0,s=0;if(tn.right||en.bottom)return;c!=="x"&&(e-n.topn.bottom-o&&(s=e-n.bottom+o)),c!=="y"&&(t-n.leftn.right-o&&(r=t-n.right+o)),s/=o,r/=o;const v=!i.x&&!i.y,w=r||s;i.x=b(r),i.y=b(s),v&&w&&d()}function b(t){if(!t)return 0;let e=Math.abs(t);return e<1?e=(Math.cos(Math.PI*(e+1))+1)/2:e=Math.log(e)/3+1,e*Math.sign(t)}function d(){let t=Date.now();const e=()=>{if(!a||!i.x&&!i.y)return;const r=Date.now(),s=r-t;t=r,l.scrollBy(i.x*s,i.y*s),requestAnimationFrame(e)};requestAnimationFrame(e)}let g=()=>{};function f(t=a){a=t||u==="always",a?(l.style.scrollBehavior="auto",n=l.getBoundingClientRect(),g=M.subscribe(y)):(l.style.scrollBehavior="",i.x=0,i.y=0,g())}return u==="auto"&&(addEventListener("dragstart",m),addEventListener("dragend",p)),f(),{update(t){t.enabled!=null&&f(t.enabled)},destroy(){removeEventListener("dragstart",m),removeEventListener("dragend",p),u="none",f(!1)}}}export{E as a}; diff --git a/_app/immutable/chunks/paths.G112lh3q.js b/_app/immutable/chunks/paths.G112lh3q.js new file mode 100644 index 00000000..938d7a67 --- /dev/null +++ b/_app/immutable/chunks/paths.G112lh3q.js @@ -0,0 +1 @@ +import{G as l,N as w,T as y,s as m,a8 as q}from"./scheduler.yhBzS9E6.js";const c=[];function T(e,i){return{subscribe:k(e,i).subscribe}}function k(e,i=l){let r;const n=new Set;function a(t){if(m(e,t)&&(e=t,r)){const o=!c.length;for(const s of n)s[1](),c.push(s,e);if(o){for(let s=0;s{n.delete(s),n.size===0&&r&&(r(),r=null)}}return{set:a,update:b,subscribe:f}}function A(e,i,r){const n=!Array.isArray(e),a=n?[e]:e;if(!a.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=i.length<2;return T(r,(f,t)=>{let o=!1;const s=[];let d=0,p=l;const g=()=>{if(d)return;p();const u=i(n?s[0]:s,f,t);b?f(u):p=q(u)?u:l},h=a.map((u,_)=>w(u,v=>{s[_]=v,d&=~(1<<_),o&&g()},()=>{d|=1<<_}));return o=!0,g(),function(){y(h),p(),o=!1}})}const x=globalThis.__sveltekit_1ovcwuv?.base??"",B=globalThis.__sveltekit_1ovcwuv?.assets??x;export{B as a,x as b,A as d,T as r,k as w}; diff --git a/_app/immutable/chunks/paths.k6rcf9P1.js b/_app/immutable/chunks/paths.k6rcf9P1.js deleted file mode 100644 index c14d5545..00000000 --- a/_app/immutable/chunks/paths.k6rcf9P1.js +++ /dev/null @@ -1 +0,0 @@ -import{G as l,N as y,T as m,s as w,a8 as q}from"./scheduler.yhBzS9E6.js";const c=[];function T(e,i){return{subscribe:k(e,i).subscribe}}function k(e,i=l){let n;const r=new Set;function a(t){if(w(e,t)&&(e=t,n)){const o=!c.length;for(const s of r)s[1](),c.push(s,e);if(o){for(let s=0;s{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:a,update:b,subscribe:f}}function A(e,i,n){const r=!Array.isArray(e),a=r?[e]:e;if(!a.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const b=i.length<2;return T(n,(f,t)=>{let o=!1;const s=[];let d=0,p=l;const g=()=>{if(d)return;p();const u=i(r?s[0]:s,f,t);b?f(u):p=q(u)?u:l},h=a.map((u,_)=>y(u,v=>{s[_]=v,d&=~(1<<_),o&&g()},()=>{d|=1<<_}));return o=!0,g(),function(){m(h),p(),o=!1}})}const x=globalThis.__sveltekit_1vr1mdv?.base??"",B=globalThis.__sveltekit_1vr1mdv?.assets??x;export{B as a,x as b,A as d,T as r,k as w}; diff --git a/_app/immutable/chunks/singletons.SU60C52I.js b/_app/immutable/chunks/singletons.jOGqwJDW.js similarity index 94% rename from _app/immutable/chunks/singletons.SU60C52I.js rename to _app/immutable/chunks/singletons.jOGqwJDW.js index 6eaff2a7..9ba0cfc7 100644 --- a/_app/immutable/chunks/singletons.SU60C52I.js +++ b/_app/immutable/chunks/singletons.jOGqwJDW.js @@ -1 +1 @@ -import{w as u,a as b}from"./paths.k6rcf9P1.js";const k="1704479236485",R="sveltekit:snapshot",w="sveltekit:scroll",I="sveltekit:states",S="sveltekit:pageurl",T="sveltekit:history",y="sveltekit:navigation",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},_=location.origin;function N(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function U(){return{x:pageXOffset,y:pageYOffset}}function c(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const d={...f,"":f.hover};function h(t){let e=t.assignedSlot??t.parentNode;return e?.nodeType===11&&(e=e.host),e}function L(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=h(t)}}function O(t,e){let n;try{n=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,r=!n||!!a||E(n,e)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),l=n?.origin===_&&t.hasAttribute("download");return{url:n,external:r,target:a,download:l}}function Y(t){let e=null,n=null,a=null,r=null,l=null,s=null,o=t;for(;o&&o!==document.documentElement;)a===null&&(a=c(o,"preload-code")),r===null&&(r=c(o,"preload-data")),e===null&&(e=c(o,"keepfocus")),n===null&&(n=c(o,"noscroll")),l===null&&(l=c(o,"reload")),s===null&&(s=c(o,"replacestate")),o=h(o);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:d[a??"off"],preload_data:d[r??"off"],keepfocus:i(e),noscroll:i(n),reload:i(l),replace_state:i(s)}}function p(t){const e=u(t);let n=!0;function a(){n=!0,e.update(s=>s)}function r(s){n=!1,e.set(s)}function l(s){let o;return e.subscribe(i=>{(o===void 0||n&&i!==o)&&s(o=i)})}return{notify:a,set:r,subscribe:l}}function m(){const{set:t,subscribe:e}=u(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const s=(await r.json()).version!==k;return s&&(t(!0),clearTimeout(n)),s}catch{return!1}}return{subscribe:e,check:a}}function E(t,e){return t.origin!==_||!t.pathname.startsWith(e)}let g;function x(t){g=t.client}function P(t){return(...e)=>g[t](...e)}const V={url:p({}),page:p({}),navigating:u(null),updated:m()};export{T as H,y as N,S as P,w as S,I as a,R as b,Y as c,V as d,f as e,L as f,O as g,x as h,E as i,P as j,_ as o,N as r,U as s}; +import{w as u,a as b}from"./paths.G112lh3q.js";const k="1704646009287",R="sveltekit:snapshot",w="sveltekit:scroll",I="sveltekit:states",S="sveltekit:pageurl",T="sveltekit:history",y="sveltekit:navigation",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},_=location.origin;function N(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function U(){return{x:pageXOffset,y:pageYOffset}}function c(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const d={...f,"":f.hover};function h(t){let e=t.assignedSlot??t.parentNode;return e?.nodeType===11&&(e=e.host),e}function L(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=h(t)}}function O(t,e){let n;try{n=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,r=!n||!!a||E(n,e)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),l=n?.origin===_&&t.hasAttribute("download");return{url:n,external:r,target:a,download:l}}function Y(t){let e=null,n=null,a=null,r=null,l=null,s=null,o=t;for(;o&&o!==document.documentElement;)a===null&&(a=c(o,"preload-code")),r===null&&(r=c(o,"preload-data")),e===null&&(e=c(o,"keepfocus")),n===null&&(n=c(o,"noscroll")),l===null&&(l=c(o,"reload")),s===null&&(s=c(o,"replacestate")),o=h(o);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:d[a??"off"],preload_data:d[r??"off"],keepfocus:i(e),noscroll:i(n),reload:i(l),replace_state:i(s)}}function p(t){const e=u(t);let n=!0;function a(){n=!0,e.update(s=>s)}function r(s){n=!1,e.set(s)}function l(s){let o;return e.subscribe(i=>{(o===void 0||n&&i!==o)&&s(o=i)})}return{notify:a,set:r,subscribe:l}}function m(){const{set:t,subscribe:e}=u(!1);let n;async function a(){clearTimeout(n);try{const r=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const s=(await r.json()).version!==k;return s&&(t(!0),clearTimeout(n)),s}catch{return!1}}return{subscribe:e,check:a}}function E(t,e){return t.origin!==_||!t.pathname.startsWith(e)}let g;function x(t){g=t.client}function P(t){return(...e)=>g[t](...e)}const V={url:p({}),page:p({}),navigating:u(null),updated:m()};export{T as H,y as N,S as P,w as S,I as a,R as b,Y as c,V as d,f as e,L as f,O as g,x as h,E as i,P as j,_ as o,N as r,U as s}; diff --git a/_app/immutable/chunks/stores.jWdOIcrH.js b/_app/immutable/chunks/stores.iu7Qu9dF.js similarity index 78% rename from _app/immutable/chunks/stores.jWdOIcrH.js rename to _app/immutable/chunks/stores.iu7Qu9dF.js index e33f8b97..3cc467b9 100644 --- a/_app/immutable/chunks/stores.jWdOIcrH.js +++ b/_app/immutable/chunks/stores.iu7Qu9dF.js @@ -1 +1 @@ -import{d as r}from"./singletons.SU60C52I.js";const e=()=>{const s=r;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},a={subscribe(s){return e().page.subscribe(s)}},i={subscribe(s){return e().navigating.subscribe(s)}};export{i as n,a as p}; +import{d as r}from"./singletons.jOGqwJDW.js";const e=()=>{const s=r;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},a={subscribe(s){return e().page.subscribe(s)}},i={subscribe(s){return e().navigating.subscribe(s)}};export{i as n,a as p}; diff --git a/_app/immutable/chunks/stream.M_jKrRc6.js b/_app/immutable/chunks/stream.ZDy3xr7S.js similarity index 86% rename from _app/immutable/chunks/stream.M_jKrRc6.js rename to _app/immutable/chunks/stream.ZDy3xr7S.js index 4af5eb90..262658c3 100644 --- a/_app/immutable/chunks/stream.M_jKrRc6.js +++ b/_app/immutable/chunks/stream.ZDy3xr7S.js @@ -1 +1 @@ -import{d as p}from"./Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import{w as m}from"./paths.k6rcf9P1.js";import{O as d}from"./scheduler.yhBzS9E6.js";function g(c,b){let n=()=>{},s=[],t=0;const{subscribe:o,set:i}=m(void 0,()=>()=>n()),l=p(u=>{n=c.subscribe(u,{onData(e){t=e.id,!(!e.results.length&&e.progress<1)&&(s[e.page]=e.results,i(Object.assign(s.flat(),{detail:e.detail})))},onError(e){console.error(e)}}).unsubscribe});function a(u){d({subscribe:o})&&i(void 0),s=[],n(),u&&l(u)}return{subscribe:o,update:a,next:()=>b.mutate(t)}}function j(c,b,n){let s=()=>{},t=null,o=null;const i=Object.fromEntries(Object.entries(c).map(([r,f])=>[r,g(f,b)])),{subscribe:l,set:a}=m({type:n,data:void 0},()=>()=>s());function u(r){t?.update(r),o=r}function e(r){s(),t=i[r],s=t?.subscribe(f=>a({type:r,data:f}))||(()=>{}),o&&t.update(o)}return e(n),{subscribe:l,update:u,choose:e,next:()=>t?.next()}}export{j as m,g as s}; +import{d as p}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import{w as m}from"./paths.G112lh3q.js";import{O as d}from"./scheduler.yhBzS9E6.js";function g(c,b){let n=()=>{},s=[],t=0;const{subscribe:o,set:i}=m(void 0,()=>()=>n()),l=p(u=>{n=c.subscribe(u,{onData(e){t=e.id,!(!e.results.length&&e.progress<1)&&(s[e.page]=e.results,i(Object.assign(s.flat(),{detail:e.detail})))},onError(e){console.error(e)}}).unsubscribe});function a(u){d({subscribe:o})&&i(void 0),s=[],n(),u&&l(u)}return{subscribe:o,update:a,next:()=>b.mutate(t)}}function j(c,b,n){let s=()=>{},t=null,o=null;const i=Object.fromEntries(Object.entries(c).map(([r,f])=>[r,g(f,b)])),{subscribe:l,set:a}=m({type:n,data:void 0},()=>()=>s());function u(r){t?.update(r),o=r}function e(r){s(),t=i[r],s=t?.subscribe(f=>a({type:r,data:f}))||(()=>{}),o&&t.update(o)}return e(n),{subscribe:l,update:u,choose:e,next:()=>t?.next()}}export{j as m,g as s}; diff --git a/_app/immutable/chunks/util.VvTXxVpP.js b/_app/immutable/chunks/util.2xyf67Ew.js similarity index 98% rename from _app/immutable/chunks/util.VvTXxVpP.js rename to _app/immutable/chunks/util.2xyf67Ew.js index 8d375469..6030bab6 100644 --- a/_app/immutable/chunks/util.VvTXxVpP.js +++ b/_app/immutable/chunks/util.2xyf67Ew.js @@ -1 +1 @@ -import{s as N,w as J,f as w,l as K,a as Q,g as y,h as I,m as W,d as _,c as Y,j as $,E as v,i as b,u as C,C as Z,n as q,x,y as ee,z as te,o as le,p as ne,e as E,G as se,X as ie,a1 as V,k as A,I as ae}from"./scheduler.yhBzS9E6.js";import{S as M,i as P,a as g,t as p,g as R,c as X,b as S,d as T,m as z,e as D}from"./index.f7836kWu.js";import{a as oe,g as re,I as fe}from"./Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import{I as F,e as B}from"./Track.LR7rfYB8.js";import"./paths.k6rcf9P1.js";function ue(s){let t,n,e,l,o,i,a,f,d;const c=s[5].default,h=J(c,s,s[4],null);return{c(){t=w("aside"),n=w("button"),e=w("h2"),l=K(s[1]),o=Q(),i=w("div"),h&&h.c(),this.h()},l(u){t=y(u,"ASIDE",{class:!0});var r=I(t);n=y(r,"BUTTON",{tabindex:!0,class:!0});var m=I(n);e=y(m,"H2",{});var k=I(e);l=W(k,s[1]),k.forEach(_),m.forEach(_),r.forEach(_),o=Y(u),i=y(u,"DIV",{class:!0});var U=I(i);h&&h.l(U),U.forEach(_),this.h()},h(){$(n,"tabindex","-1"),$(n,"class","fixed z-50 flex h-11 w-full origin-top scale-y-0 transform-gpu touch-manipulation select-none items-center justify-center border-b border-highlight bg-gradient-to-t from-surface/70 to-surface font-semibold opacity-0 backdrop-blur-md transition-composite will-change-transform sm:bg-inherit svelte-1vqfn9j"),v(n,"scale-y-100",s[0]),v(n,"opacity-100",s[0]),$(t,"class","absolute left-0 top-0"),$(i,"class","transition-composite"),v(i,"opacity-0",s[0])},m(u,r){b(u,t,r),C(t,n),C(n,e),C(e,l),b(u,o,r),b(u,i,r),h&&h.m(i,null),s[6](i),a=!0,f||(d=Z(n,"click",s[3]),f=!0)},p(u,[r]){(!a||r&2)&&q(l,u[1]),(!a||r&1)&&v(n,"scale-y-100",u[0]),(!a||r&1)&&v(n,"opacity-100",u[0]),h&&h.p&&(!a||r&16)&&x(h,c,u,u[4],a?te(c,u[4],r,null):ee(u[4]),null),(!a||r&1)&&v(i,"opacity-0",u[0])},i(u){a||(g(h,u),a=!0)},o(u){p(h,u),a=!1},d(u){u&&(_(t),_(o),_(i)),h&&h.d(u),s[6](null),f=!1,d()}}}function ce(s,t,n){let{$$slots:e={},$$scope:l}=t,{stuck:o=!1}=t,{title:i=""}=t,a;const f=()=>a.scrollIntoView({behavior:"smooth"});le(()=>{const c=new IntersectionObserver(([h])=>n(0,o=h.intersectionRatio<.8),{root:oe(a),threshold:.8});return c.observe(a),()=>c.disconnect()});function d(c){ne[c?"unshift":"push"](()=>{a=c,n(2,a)})}return s.$$set=c=>{"stuck"in c&&n(0,o=c.stuck),"title"in c&&n(1,i=c.title),"$$scope"in c&&n(4,l=c.$$scope)},[o,i,a,f,l,e,d]}class ye extends M{constructor(t){super(),P(this,t,ce,ue,N,{stuck:0,title:1})}}function O(s,t,n){const e=s.slice();return e[3]=t[n].album.arts,e[4]=t[n].album.thumbnails,e}function he(s){let t,n;return t=new F({props:{size:L,src:s[0]?s[0].arts?.[0]||"":void 0,thumbnail:s[0]?s[0].thumbnails?.[0]||"":void 0,$$slots:{default:[me]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},l(e){T(t.$$.fragment,e)},m(e,l){z(t,e,l),n=!0},p(e,l){const o={};l&1&&(o.src=e[0]?e[0].arts?.[0]||"":void 0),l&1&&(o.thumbnail=e[0]?e[0].thumbnails?.[0]||"":void 0),l&129&&(o.$$scope={dirty:l,ctx:e}),t.$set(o)},i(e){n||(g(t.$$.fragment,e),n=!0)},o(e){p(t.$$.fragment,e),n=!1},d(e){D(t,e)}}}function de(s){let t,n,e=B(s[0].collection.tracks.filter(H).slice(0,4)),l=[];for(let i=0;ip(l[i],1,1,()=>{l[i]=null});return{c(){for(let i=0;i{d[k]=null}),X(),e=d[n],e?e.p(r,m):(e=d[n]=f[n](r),e.c()),g(e,1),e.m(t,null)),V(r[2]?"a":"div")(t,u=re(h,[(!a||m&4)&&{href:r[2]},(!a||m&6&&l!==(l="grid shrink-0 grid-cols-2 gap-2 overflow-hidden shadow-lg contain-paint "+(r[1]?"rounded-full":"rounded-2xl")+" "+(r[2]?"outline outline-0 outline-highlight transition-[outline_transform] active:scale-95 hover:outline-8":"")))&&{class:l}])),v(t,"bg-highlight",Array.isArray(r[0])&&!r[0].length)},i(r){a||(g(e),a=!0)},o(r){p(e),a=!1},d(r){r&&_(t),d[n].d()}}}function _e(s){let t=s[2]?"a":"div",n,e=(s[2]?"a":"div")&&j(s);return{c(){e&&e.c(),n=E()},l(l){e&&e.l(l),n=E()},m(l,o){e&&e.m(l,o),b(l,n,o)},p(l,[o]){l[2],t?N(t,l[2]?"a":"div")?(e.d(1),e=j(l),t=l[2]?"a":"div",e.c(),e.m(n.parentNode,n)):e.p(l,o):(e=j(l),t=l[2]?"a":"div",e.c(),e.m(n.parentNode,n))},i:se,o(l){p(e,l)},d(l){l&&_(n),e&&e.d(l)}}}const L=104,H=s=>s.album.arts?.length;function ge(s,t,n){let{of:e=void 0}=t,{round:l=!1}=t,{href:o=void 0}=t;return s.$$set=i=>{"of"in i&&n(0,e=i.of),"round"in i&&n(1,l=i.round),"href"in i&&n(2,o=i.href)},[e,l,o]}class Ie extends M{constructor(t){super(),P(this,t,ge,_e,N,{of:0,round:1,href:2})}}function $e(s){return s=s.toLowerCase(),t=>s?t?!!t.title?.toLowerCase().includes(s)||!!t.artists?.find(n=>n.title?.toLowerCase().includes(s))||!!t.album?.title?.toLowerCase().includes(s):!1:!0}export{Ie as A,ye as T,$e as m}; +import{s as N,w as J,f as w,l as K,a as Q,g as y,h as I,m as W,d as _,c as Y,j as $,E as v,i as b,u as C,C as Z,n as q,x,y as ee,z as te,o as le,p as ne,e as E,G as se,X as ie,a1 as V,k as A,I as ae}from"./scheduler.yhBzS9E6.js";import{S as M,i as P,a as g,t as p,g as R,c as X,b as S,d as T,m as z,e as D}from"./index.f7836kWu.js";import{a as oe,g as re,I as fe}from"./Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import{I as F,e as B}from"./Track.oiOqwbPY.js";import"./paths.G112lh3q.js";function ue(s){let t,n,e,l,o,i,a,f,d;const c=s[5].default,h=J(c,s,s[4],null);return{c(){t=w("aside"),n=w("button"),e=w("h2"),l=K(s[1]),o=Q(),i=w("div"),h&&h.c(),this.h()},l(u){t=y(u,"ASIDE",{class:!0});var r=I(t);n=y(r,"BUTTON",{tabindex:!0,class:!0});var m=I(n);e=y(m,"H2",{});var k=I(e);l=W(k,s[1]),k.forEach(_),m.forEach(_),r.forEach(_),o=Y(u),i=y(u,"DIV",{class:!0});var U=I(i);h&&h.l(U),U.forEach(_),this.h()},h(){$(n,"tabindex","-1"),$(n,"class","fixed z-50 flex h-11 w-full origin-top scale-y-0 transform-gpu touch-manipulation select-none items-center justify-center border-b border-highlight bg-gradient-to-t from-surface/70 to-surface font-semibold opacity-0 backdrop-blur-md transition-composite will-change-transform sm:bg-inherit svelte-1vqfn9j"),v(n,"scale-y-100",s[0]),v(n,"opacity-100",s[0]),$(t,"class","absolute left-0 top-0"),$(i,"class","transition-composite"),v(i,"opacity-0",s[0])},m(u,r){b(u,t,r),C(t,n),C(n,e),C(e,l),b(u,o,r),b(u,i,r),h&&h.m(i,null),s[6](i),a=!0,f||(d=Z(n,"click",s[3]),f=!0)},p(u,[r]){(!a||r&2)&&q(l,u[1]),(!a||r&1)&&v(n,"scale-y-100",u[0]),(!a||r&1)&&v(n,"opacity-100",u[0]),h&&h.p&&(!a||r&16)&&x(h,c,u,u[4],a?te(c,u[4],r,null):ee(u[4]),null),(!a||r&1)&&v(i,"opacity-0",u[0])},i(u){a||(g(h,u),a=!0)},o(u){p(h,u),a=!1},d(u){u&&(_(t),_(o),_(i)),h&&h.d(u),s[6](null),f=!1,d()}}}function ce(s,t,n){let{$$slots:e={},$$scope:l}=t,{stuck:o=!1}=t,{title:i=""}=t,a;const f=()=>a.scrollIntoView({behavior:"smooth"});le(()=>{const c=new IntersectionObserver(([h])=>n(0,o=h.intersectionRatio<.8),{root:oe(a),threshold:.8});return c.observe(a),()=>c.disconnect()});function d(c){ne[c?"unshift":"push"](()=>{a=c,n(2,a)})}return s.$$set=c=>{"stuck"in c&&n(0,o=c.stuck),"title"in c&&n(1,i=c.title),"$$scope"in c&&n(4,l=c.$$scope)},[o,i,a,f,l,e,d]}class ye extends M{constructor(t){super(),P(this,t,ce,ue,N,{stuck:0,title:1})}}function O(s,t,n){const e=s.slice();return e[3]=t[n].album.arts,e[4]=t[n].album.thumbnails,e}function he(s){let t,n;return t=new F({props:{size:L,src:s[0]?s[0].arts?.[0]||"":void 0,thumbnail:s[0]?s[0].thumbnails?.[0]||"":void 0,$$slots:{default:[me]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},l(e){T(t.$$.fragment,e)},m(e,l){z(t,e,l),n=!0},p(e,l){const o={};l&1&&(o.src=e[0]?e[0].arts?.[0]||"":void 0),l&1&&(o.thumbnail=e[0]?e[0].thumbnails?.[0]||"":void 0),l&129&&(o.$$scope={dirty:l,ctx:e}),t.$set(o)},i(e){n||(g(t.$$.fragment,e),n=!0)},o(e){p(t.$$.fragment,e),n=!1},d(e){D(t,e)}}}function de(s){let t,n,e=B(s[0].collection.tracks.filter(H).slice(0,4)),l=[];for(let i=0;ip(l[i],1,1,()=>{l[i]=null});return{c(){for(let i=0;i{d[k]=null}),X(),e=d[n],e?e.p(r,m):(e=d[n]=f[n](r),e.c()),g(e,1),e.m(t,null)),V(r[2]?"a":"div")(t,u=re(h,[(!a||m&4)&&{href:r[2]},(!a||m&6&&l!==(l="grid shrink-0 grid-cols-2 gap-2 overflow-hidden shadow-lg contain-paint "+(r[1]?"rounded-full":"rounded-2xl")+" "+(r[2]?"outline outline-0 outline-highlight transition-[outline_transform] active:scale-95 hover:outline-8":"")))&&{class:l}])),v(t,"bg-highlight",Array.isArray(r[0])&&!r[0].length)},i(r){a||(g(e),a=!0)},o(r){p(e),a=!1},d(r){r&&_(t),d[n].d()}}}function _e(s){let t=s[2]?"a":"div",n,e=(s[2]?"a":"div")&&j(s);return{c(){e&&e.c(),n=E()},l(l){e&&e.l(l),n=E()},m(l,o){e&&e.m(l,o),b(l,n,o)},p(l,[o]){l[2],t?N(t,l[2]?"a":"div")?(e.d(1),e=j(l),t=l[2]?"a":"div",e.c(),e.m(n.parentNode,n)):e.p(l,o):(e=j(l),t=l[2]?"a":"div",e.c(),e.m(n.parentNode,n))},i:se,o(l){p(e,l)},d(l){l&&_(n),e&&e.d(l)}}}const L=104,H=s=>s.album.arts?.length;function ge(s,t,n){let{of:e=void 0}=t,{round:l=!1}=t,{href:o=void 0}=t;return s.$$set=i=>{"of"in i&&n(0,e=i.of),"round"in i&&n(1,l=i.round),"href"in i&&n(2,o=i.href)},[e,l,o]}class Ie extends M{constructor(t){super(),P(this,t,ge,_e,N,{of:0,round:1,href:2})}}function $e(s){return s=s.toLowerCase(),t=>s?t?!!t.title?.toLowerCase().includes(s)||!!t.artists?.find(n=>n.title?.toLowerCase().includes(s))||!!t.album?.title?.toLowerCase().includes(s):!1:!0}export{Ie as A,ye as T,$e as m}; diff --git a/_app/immutable/entry/app.bQ640Oms.js b/_app/immutable/entry/app.6ArcEPHP.js similarity index 79% rename from _app/immutable/entry/app.bQ640Oms.js rename to _app/immutable/entry/app.6ArcEPHP.js index cd1a0399..b2d6d151 100644 --- a/_app/immutable/entry/app.bQ640Oms.js +++ b/_app/immutable/entry/app.6ArcEPHP.js @@ -1,7 +1,7 @@ -import{s as q,a as B,e as h,c as U,i as b,d as g,b as j,o as M,f as W,g as z,h as F,j as D,k as d,l as G,m as H,n as J,t as K,p as I,q as v}from"../chunks/scheduler.yhBzS9E6.js";import{S as Q,i as X,t as w,c as y,a as E,g as L,b as k,d as O,m as R,e as P}from"../chunks/index.f7836kWu.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},T={},m=function(e,i,n){let r=Promise.resolve();if(i&&i.length>0){const _=document.getElementsByTagName("link");r=Promise.all(i.map(t=>{if(t=Z(t,n),t in T)return;T[t]=!0;const s=t.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!n)for(let u=_.length-1;u>=0;u--){const p=_[u];if(p.href===t&&(!s||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=s?"stylesheet":Y,s||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),s)return new Promise((u,p)=>{o.addEventListener("load",u),o.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${t}`)))})}))}return r.then(()=>e()).catch(_=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=_,window.dispatchEvent(t),!t.defaultPrevented)throw _})},se={};function $(a){let e,i,n;var r=a[1][0];function _(t,s){return{props:{data:t[3],form:t[2]}}}return r&&(e=v(r,_(a)),a[12](e)),{c(){e&&k(e.$$.fragment),i=h()},l(t){e&&O(e.$$.fragment,t),i=h()},m(t,s){e&&R(e,t,s),b(t,i,s),n=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){L();const l=e;w(l.$$.fragment,1,0,()=>{P(l,1)}),y()}r?(e=v(r,_(t)),t[12](e),k(e.$$.fragment),E(e.$$.fragment,1),R(e,i.parentNode,i)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){n||(e&&E(e.$$.fragment,t),n=!0)},o(t){e&&w(e.$$.fragment,t),n=!1},d(t){t&&g(i),a[12](null),e&&P(e,t)}}}function x(a){let e,i,n;var r=a[1][0];function _(t,s){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=v(r,_(a)),a[11](e)),{c(){e&&k(e.$$.fragment),i=h()},l(t){e&&O(e.$$.fragment,t),i=h()},m(t,s){e&&R(e,t,s),b(t,i,s),n=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){L();const l=e;w(l.$$.fragment,1,0,()=>{P(l,1)}),y()}r?(e=v(r,_(t)),t[11](e),k(e.$$.fragment),E(e.$$.fragment,1),R(e,i.parentNode,i)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&8215&&(l.$$scope={dirty:s,ctx:t}),e.$set(l)}},i(t){n||(e&&E(e.$$.fragment,t),n=!0)},o(t){e&&w(e.$$.fragment,t),n=!1},d(t){t&&g(i),a[11](null),e&&P(e,t)}}}function ee(a){let e,i,n;var r=a[1][1];function _(t,s){return{props:{data:t[4],form:t[2]}}}return r&&(e=v(r,_(a)),a[10](e)),{c(){e&&k(e.$$.fragment),i=h()},l(t){e&&O(e.$$.fragment,t),i=h()},m(t,s){e&&R(e,t,s),b(t,i,s),n=!0},p(t,s){if(s&2&&r!==(r=t[1][1])){if(e){L();const l=e;w(l.$$.fragment,1,0,()=>{P(l,1)}),y()}r?(e=v(r,_(t)),t[10](e),k(e.$$.fragment),E(e.$$.fragment,1),R(e,i.parentNode,i)):e=null}else if(r){const l={};s&16&&(l.data=t[4]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){n||(e&&E(e.$$.fragment,t),n=!0)},o(t){e&&w(e.$$.fragment,t),n=!1},d(t){t&&g(i),a[10](null),e&&P(e,t)}}}function V(a){let e,i=a[6]&&A(a);return{c(){e=W("div"),i&&i.c(),this.h()},l(n){e=z(n,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=F(e);i&&i.l(r),r.forEach(g),this.h()},h(){D(e,"id","svelte-announcer"),D(e,"aria-live","assertive"),D(e,"aria-atomic","true"),d(e,"position","absolute"),d(e,"left","0"),d(e,"top","0"),d(e,"clip","rect(0 0 0 0)"),d(e,"clip-path","inset(50%)"),d(e,"overflow","hidden"),d(e,"white-space","nowrap"),d(e,"width","1px"),d(e,"height","1px")},m(n,r){b(n,e,r),i&&i.m(e,null)},p(n,r){n[6]?i?i.p(n,r):(i=A(n),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(n){n&&g(e),i&&i.d()}}}function A(a){let e;return{c(){e=G(a[7])},l(i){e=H(i,a[7])},m(i,n){b(i,e,n)},p(i,n){n&128&&J(e,i[7])},d(i){i&&g(e)}}}function te(a){let e,i,n,r,_;const t=[x,$],s=[];function l(o,u){return o[1][1]?0:1}e=l(a),i=s[e]=t[e](a);let c=a[5]&&V(a);return{c(){i.c(),n=B(),c&&c.c(),r=h()},l(o){i.l(o),n=U(o),c&&c.l(o),r=h()},m(o,u){s[e].m(o,u),b(o,n,u),c&&c.m(o,u),b(o,r,u),_=!0},p(o,[u]){let p=e;e=l(o),e===p?s[e].p(o,u):(L(),w(s[p],1,1,()=>{s[p]=null}),y(),i=s[e],i?i.p(o,u):(i=s[e]=t[e](o),i.c()),E(i,1),i.m(n.parentNode,n)),o[5]?c?c.p(o,u):(c=V(o),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},i(o){_||(E(i),_=!0)},o(o){w(i),_=!1},d(o){o&&(g(n),g(r)),s[e].d(o),c&&c.d(o)}}}function ie(a,e,i){let{stores:n}=e,{page:r}=e,{constructors:_}=e,{components:t=[]}=e,{form:s}=e,{data_0:l=null}=e,{data_1:c=null}=e;j(n.page.notify);let o=!1,u=!1,p=null;M(()=>{const f=n.page.subscribe(()=>{o&&(i(6,u=!0),K().then(()=>{i(7,p=document.title||"untitled page")}))});return i(5,o=!0),f});function N(f){I[f?"unshift":"push"](()=>{t[1]=f,i(0,t)})}function S(f){I[f?"unshift":"push"](()=>{t[0]=f,i(0,t)})}function C(f){I[f?"unshift":"push"](()=>{t[0]=f,i(0,t)})}return a.$$set=f=>{"stores"in f&&i(8,n=f.stores),"page"in f&&i(9,r=f.page),"constructors"in f&&i(1,_=f.constructors),"components"in f&&i(0,t=f.components),"form"in f&&i(2,s=f.form),"data_0"in f&&i(3,l=f.data_0),"data_1"in f&&i(4,c=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&n.page.set(r)},[t,_,s,l,c,o,u,p,n,r,N,S,C]}class oe extends Q{constructor(e){super(),X(this,e,ie,te,q,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>m(()=>import("../nodes/0.PbakYmpN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),()=>m(()=>import("../nodes/1.hmCh84a7.js"),__vite__mapDeps([14,1,2,9,8,4]),import.meta.url),()=>m(()=>import("../nodes/2.AyR7r7ZM.js"),__vite__mapDeps([15,16]),import.meta.url),()=>m(()=>import("../nodes/3.8QmKai-d.js"),__vite__mapDeps([17,1,2,5,4,6,3,9,8,12,10,11,18,19,20,13]),import.meta.url),()=>m(()=>import("../nodes/4.VR3ziamF.js"),__vite__mapDeps([21,1,2,22,5,4,6,13,3,18,10,11,9,8,19]),import.meta.url),()=>m(()=>import("../nodes/5.IMsjhbl6.js"),__vite__mapDeps([23,1,2,22,5,4,6,13,3,18,10,11,9,8,19]),import.meta.url),()=>m(()=>import("../nodes/6.M-At1isD.js"),__vite__mapDeps([24,1,2,3,4,5,6,18,20]),import.meta.url),()=>m(()=>import("../nodes/7.YHXThGsn.js"),__vite__mapDeps([25,1,2,22,5,4,6,13,3,18,10,11,9,8]),import.meta.url),()=>m(()=>import("../nodes/8.Ow38-iKz.js"),__vite__mapDeps([26,1,2,3,4,5,6,10,11,7,18,20]),import.meta.url),()=>m(()=>import("../nodes/9.oqKgscox.js"),__vite__mapDeps([27,1,2,22,5,4,6,13,3,18,10,11,9,8]),import.meta.url),()=>m(()=>import("../nodes/10.E6IsHE3D.js"),__vite__mapDeps([28,1,2,5,4,6,9,8,3,22,13,18,10,11]),import.meta.url),()=>m(()=>import("../nodes/11.RfDk6xuo.js"),__vite__mapDeps([29,1,2,5,4,6,12]),import.meta.url)],le=[],fe={"/":[2],"/explore":[3],"/explore/album":[4],"/explore/artist":[5],"/home":[6],"/home/playlist":[7],"/library":[8],"/library/artist":[9],"/library/playlist":[10],"/settings":[11]},_e={handleError:({error:a})=>{console.error(a)}};export{fe as dictionary,_e as hooks,se as matchers,ae as nodes,oe as root,le as server_loads}; +import{s as q,a as B,e as h,c as U,i as b,d as g,b as j,o as M,f as W,g as z,h as F,j as D,k as d,l as G,m as H,n as J,t as K,p as I,q as v}from"../chunks/scheduler.yhBzS9E6.js";import{S as Q,i as X,t as w,c as y,a as E,g as L,b as k,d as O,m as R,e as P}from"../chunks/index.f7836kWu.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},T={},m=function(e,i,n){let r=Promise.resolve();if(i&&i.length>0){const _=document.getElementsByTagName("link");r=Promise.all(i.map(t=>{if(t=Z(t,n),t in T)return;T[t]=!0;const s=t.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!n)for(let u=_.length-1;u>=0;u--){const p=_[u];if(p.href===t&&(!s||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=s?"stylesheet":Y,s||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),s)return new Promise((u,p)=>{o.addEventListener("load",u),o.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${t}`)))})}))}return r.then(()=>e()).catch(_=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=_,window.dispatchEvent(t),!t.defaultPrevented)throw _})},se={};function $(a){let e,i,n;var r=a[1][0];function _(t,s){return{props:{data:t[3],form:t[2]}}}return r&&(e=v(r,_(a)),a[12](e)),{c(){e&&k(e.$$.fragment),i=h()},l(t){e&&O(e.$$.fragment,t),i=h()},m(t,s){e&&R(e,t,s),b(t,i,s),n=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){L();const l=e;w(l.$$.fragment,1,0,()=>{P(l,1)}),y()}r?(e=v(r,_(t)),t[12](e),k(e.$$.fragment),E(e.$$.fragment,1),R(e,i.parentNode,i)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){n||(e&&E(e.$$.fragment,t),n=!0)},o(t){e&&w(e.$$.fragment,t),n=!1},d(t){t&&g(i),a[12](null),e&&P(e,t)}}}function x(a){let e,i,n;var r=a[1][0];function _(t,s){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=v(r,_(a)),a[11](e)),{c(){e&&k(e.$$.fragment),i=h()},l(t){e&&O(e.$$.fragment,t),i=h()},m(t,s){e&&R(e,t,s),b(t,i,s),n=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){L();const l=e;w(l.$$.fragment,1,0,()=>{P(l,1)}),y()}r?(e=v(r,_(t)),t[11](e),k(e.$$.fragment),E(e.$$.fragment,1),R(e,i.parentNode,i)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&8215&&(l.$$scope={dirty:s,ctx:t}),e.$set(l)}},i(t){n||(e&&E(e.$$.fragment,t),n=!0)},o(t){e&&w(e.$$.fragment,t),n=!1},d(t){t&&g(i),a[11](null),e&&P(e,t)}}}function ee(a){let e,i,n;var r=a[1][1];function _(t,s){return{props:{data:t[4],form:t[2]}}}return r&&(e=v(r,_(a)),a[10](e)),{c(){e&&k(e.$$.fragment),i=h()},l(t){e&&O(e.$$.fragment,t),i=h()},m(t,s){e&&R(e,t,s),b(t,i,s),n=!0},p(t,s){if(s&2&&r!==(r=t[1][1])){if(e){L();const l=e;w(l.$$.fragment,1,0,()=>{P(l,1)}),y()}r?(e=v(r,_(t)),t[10](e),k(e.$$.fragment),E(e.$$.fragment,1),R(e,i.parentNode,i)):e=null}else if(r){const l={};s&16&&(l.data=t[4]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){n||(e&&E(e.$$.fragment,t),n=!0)},o(t){e&&w(e.$$.fragment,t),n=!1},d(t){t&&g(i),a[10](null),e&&P(e,t)}}}function V(a){let e,i=a[6]&&A(a);return{c(){e=W("div"),i&&i.c(),this.h()},l(n){e=z(n,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=F(e);i&&i.l(r),r.forEach(g),this.h()},h(){D(e,"id","svelte-announcer"),D(e,"aria-live","assertive"),D(e,"aria-atomic","true"),d(e,"position","absolute"),d(e,"left","0"),d(e,"top","0"),d(e,"clip","rect(0 0 0 0)"),d(e,"clip-path","inset(50%)"),d(e,"overflow","hidden"),d(e,"white-space","nowrap"),d(e,"width","1px"),d(e,"height","1px")},m(n,r){b(n,e,r),i&&i.m(e,null)},p(n,r){n[6]?i?i.p(n,r):(i=A(n),i.c(),i.m(e,null)):i&&(i.d(1),i=null)},d(n){n&&g(e),i&&i.d()}}}function A(a){let e;return{c(){e=G(a[7])},l(i){e=H(i,a[7])},m(i,n){b(i,e,n)},p(i,n){n&128&&J(e,i[7])},d(i){i&&g(e)}}}function te(a){let e,i,n,r,_;const t=[x,$],s=[];function l(o,u){return o[1][1]?0:1}e=l(a),i=s[e]=t[e](a);let c=a[5]&&V(a);return{c(){i.c(),n=B(),c&&c.c(),r=h()},l(o){i.l(o),n=U(o),c&&c.l(o),r=h()},m(o,u){s[e].m(o,u),b(o,n,u),c&&c.m(o,u),b(o,r,u),_=!0},p(o,[u]){let p=e;e=l(o),e===p?s[e].p(o,u):(L(),w(s[p],1,1,()=>{s[p]=null}),y(),i=s[e],i?i.p(o,u):(i=s[e]=t[e](o),i.c()),E(i,1),i.m(n.parentNode,n)),o[5]?c?c.p(o,u):(c=V(o),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},i(o){_||(E(i),_=!0)},o(o){w(i),_=!1},d(o){o&&(g(n),g(r)),s[e].d(o),c&&c.d(o)}}}function ie(a,e,i){let{stores:n}=e,{page:r}=e,{constructors:_}=e,{components:t=[]}=e,{form:s}=e,{data_0:l=null}=e,{data_1:c=null}=e;j(n.page.notify);let o=!1,u=!1,p=null;M(()=>{const f=n.page.subscribe(()=>{o&&(i(6,u=!0),K().then(()=>{i(7,p=document.title||"untitled page")}))});return i(5,o=!0),f});function N(f){I[f?"unshift":"push"](()=>{t[1]=f,i(0,t)})}function S(f){I[f?"unshift":"push"](()=>{t[0]=f,i(0,t)})}function C(f){I[f?"unshift":"push"](()=>{t[0]=f,i(0,t)})}return a.$$set=f=>{"stores"in f&&i(8,n=f.stores),"page"in f&&i(9,r=f.page),"constructors"in f&&i(1,_=f.constructors),"components"in f&&i(0,t=f.components),"form"in f&&i(2,s=f.form),"data_0"in f&&i(3,l=f.data_0),"data_1"in f&&i(4,c=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&n.page.set(r)},[t,_,s,l,c,o,u,p,n,r,N,S,C]}class oe extends Q{constructor(e){super(),X(this,e,ie,te,q,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>m(()=>import("../nodes/0.ow-t_F9E.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),()=>m(()=>import("../nodes/1.THNaTtoM.js"),__vite__mapDeps([14,1,2,9,8,4]),import.meta.url),()=>m(()=>import("../nodes/2.AyR7r7ZM.js"),__vite__mapDeps([15,16]),import.meta.url),()=>m(()=>import("../nodes/3.JaftQo5l.js"),__vite__mapDeps([17,1,2,5,4,6,3,9,8,12,10,11,18,19,20,13]),import.meta.url),()=>m(()=>import("../nodes/4.zI7EMXNC.js"),__vite__mapDeps([21,1,2,22,5,4,6,13,3,18,10,11,9,8,19]),import.meta.url),()=>m(()=>import("../nodes/5.6E1Dv1RD.js"),__vite__mapDeps([23,1,2,22,5,4,6,13,3,18,10,11,9,8,19]),import.meta.url),()=>m(()=>import("../nodes/6.w3KI7Lna.js"),__vite__mapDeps([24,1,2,3,4,5,6,18,20]),import.meta.url),()=>m(()=>import("../nodes/7.FeXnvpF2.js"),__vite__mapDeps([25,1,2,22,5,4,6,13,3,18,10,11,9,8]),import.meta.url),()=>m(()=>import("../nodes/8.UPr0t3xw.js"),__vite__mapDeps([26,1,2,3,4,5,6,10,11,7,18,20]),import.meta.url),()=>m(()=>import("../nodes/9.py_ynymV.js"),__vite__mapDeps([27,1,2,22,5,4,6,13,3,18,10,11,9,8]),import.meta.url),()=>m(()=>import("../nodes/10.rMwDKcDJ.js"),__vite__mapDeps([28,1,2,5,4,6,9,8,3,22,13,18,10,11]),import.meta.url),()=>m(()=>import("../nodes/11.wOQFq_L3.js"),__vite__mapDeps([29,1,2,5,4,6,12]),import.meta.url)],le=[],fe={"/":[2],"/explore":[3],"/explore/album":[4],"/explore/artist":[5],"/home":[6],"/home/playlist":[7],"/library":[8],"/library/artist":[9],"/library/playlist":[10],"/settings":[11]},_e={handleError:({error:a})=>{console.error(a)}};export{fe as dictionary,_e as hooks,se as matchers,ae as nodes,oe as root,le as server_loads}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["../nodes/0.PbakYmpN.js","../chunks/scheduler.yhBzS9E6.js","../chunks/index.f7836kWu.js","../chunks/Track.LR7rfYB8.js","../chunks/paths.k6rcf9P1.js","../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js","../assets/Spinner.Gammt8NE.css","../chunks/autoscroll.ckBVSgbF.js","../chunks/singletons.SU60C52I.js","../chunks/stores.jWdOIcrH.js","../chunks/Player.J8CE-V80.js","../assets/Player.UHZ5Zq04.css","../chunks/Input.hoDY5QId.js","../chunks/Spacer.tcMPZ3eG.js","../nodes/1.hmCh84a7.js","../nodes/2.AyR7r7ZM.js","../chunks/control.pJ1mnnAb.js","../nodes/3.8QmKai-d.js","../chunks/util.VvTXxVpP.js","../chunks/stream.M_jKrRc6.js","../chunks/Overview.T1RnAS_v.js","../nodes/4.VR3ziamF.js","../chunks/Collection.NWTCPfm4.js","../nodes/5.IMsjhbl6.js","../nodes/6.M-At1isD.js","../nodes/7.YHXThGsn.js","../nodes/8.Ow38-iKz.js","../nodes/9.oqKgscox.js","../nodes/10.E6IsHE3D.js","../nodes/11.RfDk6xuo.js"] + __vite__mapDeps.viteFileDeps = ["../nodes/0.ow-t_F9E.js","../chunks/scheduler.yhBzS9E6.js","../chunks/index.f7836kWu.js","../chunks/Track.oiOqwbPY.js","../chunks/paths.G112lh3q.js","../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js","../assets/Spinner.y9ukOJz4.css","../chunks/autoscroll.sHJkSdr1.js","../chunks/singletons.jOGqwJDW.js","../chunks/stores.iu7Qu9dF.js","../chunks/Player.4gabUvVV.js","../assets/Player.UHZ5Zq04.css","../chunks/Input.UuPw_Vot.js","../chunks/Spacer.tcMPZ3eG.js","../nodes/1.THNaTtoM.js","../nodes/2.AyR7r7ZM.js","../chunks/control.pJ1mnnAb.js","../nodes/3.JaftQo5l.js","../chunks/util.2xyf67Ew.js","../chunks/stream.ZDy3xr7S.js","../chunks/Overview.bs2WCKrP.js","../nodes/4.zI7EMXNC.js","../chunks/Collection.skwpo2VZ.js","../nodes/5.6E1Dv1RD.js","../nodes/6.w3KI7Lna.js","../nodes/7.FeXnvpF2.js","../nodes/8.UPr0t3xw.js","../nodes/9.py_ynymV.js","../nodes/10.rMwDKcDJ.js","../nodes/11.wOQFq_L3.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/_app/immutable/entry/start.iOjyZDAK.js b/_app/immutable/entry/start.E31lhqZi.js similarity index 99% rename from _app/immutable/entry/start.iOjyZDAK.js rename to _app/immutable/entry/start.E31lhqZi.js index c770ae74..a491ee00 100644 --- a/_app/immutable/entry/start.iOjyZDAK.js +++ b/_app/immutable/entry/start.E31lhqZi.js @@ -1,4 +1,4 @@ -import{o as Se,t as ke}from"../chunks/scheduler.yhBzS9E6.js";import{S as ct,a as lt,b as ft,H as B,N as K,r as ne,o as Ae,P as Oe,f as Qe,g as Re,c as de,i as $e,s as Te,d as q,e as et,h as bt}from"../chunks/singletons.SU60C52I.js";import{b as F}from"../chunks/paths.k6rcf9P1.js";import{H as _e,S as Ce,R as tt}from"../chunks/control.pJ1mnnAb.js";new URL("sveltekit-internal://");function Et(e,a){return e==="/"||a==="ignore"?e:a==="never"?e.endsWith("/")?e.slice(0,-1):e:a==="always"&&!e.endsWith("/")?e+"/":e}function St(e){return e.split("%25").map(decodeURI).join("%25")}function kt(e){for(const a in e)e[a]=decodeURIComponent(e[a]);return e}function Ie({href:e}){return e.split("#")[0]}const At=["href","pathname","search","toString","toJSON"];function Ot(e,a,u){const o=new URL(e);Object.defineProperty(o,"searchParams",{value:new Proxy(o.searchParams,{get(f,l){if(l==="get"||l==="getAll"||l==="has")return c=>(u(c),f[l](c));a();const w=Reflect.get(f,l);return typeof w=="function"?w.bind(f):w}}),enumerable:!0,configurable:!0});for(const f of At)Object.defineProperty(o,f,{get(){return a(),e[f]},enumerable:!0,configurable:!0});return Rt(o),o}function Rt(e){Object.defineProperty(e,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const $t="/__data.json",It=".html__data.json";function Pt(e){return e.endsWith(".html")?e.replace(/\.html$/,It):e.replace(/\/$/,"")+$t}function jt(...e){let a=5381;for(const u of e)if(typeof u=="string"){let o=u.length;for(;o;)a=a*33^u.charCodeAt(--o)}else if(ArrayBuffer.isView(u)){const o=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);let f=o.length;for(;f;)a=a*33^o[--f]}else throw new TypeError("value must be a string or TypedArray");return(a>>>0).toString(36)}const ut=window.fetch;window.fetch=(e,a)=>((e instanceof Request?e.method:a?.method||"GET")!=="GET"&&ae.delete(De(e)),ut(e,a));const ae=new Map;function xt(e){const a=atob(e),u=new Uint8Array(a.length);for(let o=0;o0){const o=De(e,u),f=ae.get(o);if(f){if(performance.now(){const f=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(o);if(f)return a.push({name:f[1],matcher:f[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const l=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(o);if(l)return a.push({name:l[1],matcher:l[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!o)return;const w=o.split(/\[(.+?)\](?!\])/);return"/"+w.map((g,s)=>{if(s%2){if(g.startsWith("x+"))return Pe(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return Pe(String.fromCharCode(...g.slice(2).split("-").map(O=>parseInt(O,16))));const h=Ut.exec(g);if(!h)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,v,I,E,$]=h;return a.push({name:E,matcher:$,optional:!!v,rest:!!I,chained:I?s===1&&w[0]==="":!1}),I?"(.*?)":v?"([^/]*)?":"([^/]+?)"}return Pe(g)}).join("")}).join("")}/?$`),params:a}}function Ct(e){return!/^\([^)]+\)$/.test(e)}function Dt(e){return e.slice(1).split("/").filter(Ct)}function Mt(e,a,u){const o={},f=e.slice(1),l=f.filter(c=>c!==void 0);let w=0;for(let c=0;ch).join("/"),w=0),s===void 0){g.rest&&(o[g.name]="");continue}if(!g.matcher||u[g.matcher](s)){o[g.name]=s;const h=a[c+1],v=f[c+1];h&&!h.rest&&h.optional&&v&&g.chained&&(w=0),!h&&!v&&Object.keys(o).length===l.length&&(w=0);continue}if(g.optional&&g.chained){w++;continue}return}if(!w)return o}function Pe(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ft({nodes:e,server_loads:a,dictionary:u,matchers:o}){const f=new Set(a);return Object.entries(u).map(([c,[g,s,h]])=>{const{pattern:v,params:I}=Tt(c),E={id:c,exec:$=>{const O=v.exec($);if(O)return Mt(O,I,o)},errors:[1,...h||[]].map($=>e[$]),layouts:[0,...s||[]].map(w),leaf:l(g)};return E.errors.length=E.layouts.length=Math.max(E.errors.length,E.layouts.length),E});function l(c){const g=c<0;return g&&(c=~c),[g,e[c]]}function w(c){return c===void 0?c:[f.has(c),e[c]]}}function Me(e,a=JSON.parse){try{return a(sessionStorage[e])}catch{}}function je(e,a,u=JSON.stringify){const o=u(a);try{sessionStorage[e]=o}catch{}}class xe extends Error{constructor(a,u){super(a),this.name="DevalueError",this.path=u.join("")}}function nt(e){return Object(e)!==e}const Ht=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Vt(e){const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===Ht}function Bt(e){return Object.prototype.toString.call(e).slice(8,-1)}function qt(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case` +import{o as Se,t as ke}from"../chunks/scheduler.yhBzS9E6.js";import{S as ct,a as lt,b as ft,H as B,N as K,r as ne,o as Ae,P as Oe,f as Qe,g as Re,c as de,i as $e,s as Te,d as q,e as et,h as bt}from"../chunks/singletons.jOGqwJDW.js";import{b as F}from"../chunks/paths.G112lh3q.js";import{H as _e,S as Ce,R as tt}from"../chunks/control.pJ1mnnAb.js";new URL("sveltekit-internal://");function Et(e,a){return e==="/"||a==="ignore"?e:a==="never"?e.endsWith("/")?e.slice(0,-1):e:a==="always"&&!e.endsWith("/")?e+"/":e}function St(e){return e.split("%25").map(decodeURI).join("%25")}function kt(e){for(const a in e)e[a]=decodeURIComponent(e[a]);return e}function Ie({href:e}){return e.split("#")[0]}const At=["href","pathname","search","toString","toJSON"];function Ot(e,a,u){const o=new URL(e);Object.defineProperty(o,"searchParams",{value:new Proxy(o.searchParams,{get(f,l){if(l==="get"||l==="getAll"||l==="has")return c=>(u(c),f[l](c));a();const w=Reflect.get(f,l);return typeof w=="function"?w.bind(f):w}}),enumerable:!0,configurable:!0});for(const f of At)Object.defineProperty(o,f,{get(){return a(),e[f]},enumerable:!0,configurable:!0});return Rt(o),o}function Rt(e){Object.defineProperty(e,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const $t="/__data.json",It=".html__data.json";function Pt(e){return e.endsWith(".html")?e.replace(/\.html$/,It):e.replace(/\/$/,"")+$t}function jt(...e){let a=5381;for(const u of e)if(typeof u=="string"){let o=u.length;for(;o;)a=a*33^u.charCodeAt(--o)}else if(ArrayBuffer.isView(u)){const o=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);let f=o.length;for(;f;)a=a*33^o[--f]}else throw new TypeError("value must be a string or TypedArray");return(a>>>0).toString(36)}const ut=window.fetch;window.fetch=(e,a)=>((e instanceof Request?e.method:a?.method||"GET")!=="GET"&&ae.delete(De(e)),ut(e,a));const ae=new Map;function xt(e){const a=atob(e),u=new Uint8Array(a.length);for(let o=0;o0){const o=De(e,u),f=ae.get(o);if(f){if(performance.now(){const f=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(o);if(f)return a.push({name:f[1],matcher:f[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const l=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(o);if(l)return a.push({name:l[1],matcher:l[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!o)return;const w=o.split(/\[(.+?)\](?!\])/);return"/"+w.map((g,s)=>{if(s%2){if(g.startsWith("x+"))return Pe(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return Pe(String.fromCharCode(...g.slice(2).split("-").map(O=>parseInt(O,16))));const h=Ut.exec(g);if(!h)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,v,I,E,$]=h;return a.push({name:E,matcher:$,optional:!!v,rest:!!I,chained:I?s===1&&w[0]==="":!1}),I?"(.*?)":v?"([^/]*)?":"([^/]+?)"}return Pe(g)}).join("")}).join("")}/?$`),params:a}}function Ct(e){return!/^\([^)]+\)$/.test(e)}function Dt(e){return e.slice(1).split("/").filter(Ct)}function Mt(e,a,u){const o={},f=e.slice(1),l=f.filter(c=>c!==void 0);let w=0;for(let c=0;ch).join("/"),w=0),s===void 0){g.rest&&(o[g.name]="");continue}if(!g.matcher||u[g.matcher](s)){o[g.name]=s;const h=a[c+1],v=f[c+1];h&&!h.rest&&h.optional&&v&&g.chained&&(w=0),!h&&!v&&Object.keys(o).length===l.length&&(w=0);continue}if(g.optional&&g.chained){w++;continue}return}if(!w)return o}function Pe(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ft({nodes:e,server_loads:a,dictionary:u,matchers:o}){const f=new Set(a);return Object.entries(u).map(([c,[g,s,h]])=>{const{pattern:v,params:I}=Tt(c),E={id:c,exec:$=>{const O=v.exec($);if(O)return Mt(O,I,o)},errors:[1,...h||[]].map($=>e[$]),layouts:[0,...s||[]].map(w),leaf:l(g)};return E.errors.length=E.layouts.length=Math.max(E.errors.length,E.layouts.length),E});function l(c){const g=c<0;return g&&(c=~c),[g,e[c]]}function w(c){return c===void 0?c:[f.has(c),e[c]]}}function Me(e,a=JSON.parse){try{return a(sessionStorage[e])}catch{}}function je(e,a,u=JSON.stringify){const o=u(a);try{sessionStorage[e]=o}catch{}}class xe extends Error{constructor(a,u){super(a),this.name="DevalueError",this.path=u.join("")}}function nt(e){return Object(e)!==e}const Ht=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Vt(e){const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===Ht}function Bt(e){return Object.prototype.toString.call(e).slice(8,-1)}function qt(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case` `:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return e<" "?`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function X(e){let a="",u=0;const o=e.length;for(let f=0;f0&&(v+=","),O in s?(l.push(`[${O}]`),v+=c(s[O]),l.pop()):v+=dt;v+="]";break;case"Set":v='["Set"';for(const O of s)v+=`,${c(O)}`;v+="]";break;case"Map":v='["Map"';for(const[O,D]of s)l.push(`.get(${nt(O)?Le(O):"..."})`),v+=`,${c(O)},${c(D)}`;v+="]";break;default:if(!Vt(s))throw new xe("Cannot stringify arbitrary non-POJOs",l);if(Object.getOwnPropertySymbols(s).length>0)throw new xe("Cannot stringify POJOs with symbolic keys",l);if(Object.getPrototypeOf(s)===null){v='["null"';for(const O in s)l.push(`.${O}`),v+=`,${X(O)},${c(s[O])}`,l.pop();v+="]"}else{v="{";let O=!1;for(const D in s)O&&(v+=","),O=!0,l.push(`.${D}`),v+=`${X(D)}:${c(s[D])}`,l.pop();v+="}"}}return u[h]=v,h}const g=c(e);return g<0?`${g}`:`[${u.join(",")}]`}function Le(e){const a=typeof e;return a==="string"?X(e):e instanceof String?X(e.toString()):e===void 0?Fe.toString():e===0&&1/e<0?He.toString():a==="bigint"?`["BigInt","${e}"]`:String(e)}const mt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...mt];const Kt=new Set([...mt]);[...Kt];function Yt(e){return e.filter(a=>a!=null)}const zt="x-sveltekit-invalidated",Wt="x-sveltekit-trailing-slash";function pe(e){return e instanceof _e||e instanceof Ce?e.status:500}function Xt(e){return e instanceof Ce?e.text:"Internal Error"}const Y=Me(ct)??{},re=Me(lt,Gt)??{},oe=Me(ft)??{},rt=history.pushState,he=history.replaceState;function Ne(e){Y[e]=Te()}function at(e,a){let u=e+1;for(;Y[u];)delete Y[u],u+=1;for(u=a+1;oe[u];)delete oe[u],u+=1}function W(e){return location.href=e.href,new Promise(()=>{})}function ot(){}function Zt(e,a){const u=Ft(e),o=e.nodes[0],f=e.nodes[1];o(),f();const l=document.documentElement,w=[],c=[];let g=null;const s={before_navigate:[],on_navigate:[],after_navigate:[]};let h={branch:[],error:null,url:null},v=!1,I=!1,E=!0,$=!1,O=!1,D=!1,Z=!1,se=!1,H,L=history.state?.[B],M=history.state?.[K];L||(L=M=Date.now(),he.call(history,{...history.state,[B]:L,[K]:M},"",location.href));const ge=Y[L];ge&&(history.scrollRestoration="manual",scrollTo(ge.x,ge.y));let j,z,me;async function Ve(){if(await(me||=Promise.resolve()),!me)return;me=null;const n=ee(h.url,!0);g=null;const t=z={},r=n&&await ve(n);t===z&&(r&&(r.type==="redirect"?await ie(new URL(r.location,h.url).href,{},1,t):(r.props.page!==void 0&&(j=r.props.page),H.$set(r.props))),w.length=0)}function Be(n){c.some(t=>t?.snapshot)&&(oe[n]=c.map(t=>t?.snapshot?.capture()))}function qe(n){oe[n]?.forEach((t,r)=>{c[r]?.snapshot?.restore(t)})}function Ge(){Ne(L),je(ct,Y),Be(M),je(ft,oe),je(lt,re,Jt)}async function ie(n,t,r,i){return fe({type:"goto",url:ne(n),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,redirect_count:r,state:t.state,nav_token:i,accept:()=>{t.invalidateAll&&(se=!0)}})}async function Je(n){return g={id:n.id,promise:ve(n).then(t=>(t.type==="loaded"&&t.state.error&&(g=null),t))},g.promise}async function ce(n){const t=u.find(r=>r.exec(We(n)));t&&await Promise.all([...t.layouts,t.leaf].map(r=>r?.[1]()))}function Ke(n){h=n.state;const t=document.querySelector("style[data-sveltekit]");t&&t.remove(),j=n.props.page,H=new e.root({target:a,props:{...n.props,stores:q,components:c},hydrate:!0}),qe(M);const r={from:null,to:{params:h.params,route:{id:h.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};s.after_navigate.forEach(i=>i(r)),I=!0}async function Q({url:n,params:t,branch:r,status:i,error:d,route:p,form:_}){let y="never";for(const A of r)A?.slash!==void 0&&(y=A.slash);n.pathname=Et(n.pathname,y),n.search=n.search;const S={type:"loaded",state:{url:n,params:t,branch:r,error:d,route:p},props:{constructors:Yt(r).map(A=>A.node.component),page:j}};_!==void 0&&(S.props.form=_);let b={},N=!j,U=0;for(let A=0;A(y&&(S.route=!0),m[A])}),params:new Proxy(i,{get:(m,A)=>(y&&S.params.add(A),m[A])}),data:p?.data??null,url:Ot(r,()=>{y&&(S.url=!0)},m=>{y&&S.search_params.add(m)}),async fetch(m,A){let x;m instanceof Request?(x=m.url,A={body:m.method==="GET"||m.method==="HEAD"?void 0:await m.blob(),cache:m.cache,credentials:m.credentials,headers:m.headers,integrity:m.integrity,keepalive:m.keepalive,method:m.method,mode:m.mode,redirect:m.redirect,referrer:m.referrer,referrerPolicy:m.referrerPolicy,signal:m.signal,...A}):x=m;const R=new URL(x,r);return y&&N(R.href),R.origin===r.origin&&(x=R.href.slice(r.origin.length)),I?Nt(x,R.href,A):Lt(x,A)},setHeaders:()=>{},depends:N,parent(){return y&&(S.parent=!0),t()},untrack(m){y=!1;try{return m()}finally{y=!0}}};_=await b.universal.load.call(null,U)??null}return{node:b,loader:n,server:p,universal:b.universal?.load?{type:"data",data:_,uses:S}:null,data:_??p?.data??null,slash:F&&(r.pathname===F||r.pathname===F+"/")?"always":b.universal?.trailingSlash??p?.slash}}function Ye(n,t,r,i,d,p){if(se)return!0;if(!d)return!1;if(d.parent&&n||d.route&&t||d.url&&r)return!0;for(const _ of d.search_params)if(i.has(_))return!0;for(const _ of d.params)if(p[_]!==h.params[_])return!0;for(const _ of d.dependencies)if(w.some(y=>y(new URL(_))))return!0;return!1}function we(n,t){return n?.type==="data"?n:n?.type==="skip"?t??null:null}function wt(n,t){if(!n)return new Set(t.searchParams.keys());const r=new Set([...n.searchParams.keys(),...t.searchParams.keys()]);for(const i of r){const d=n.searchParams.getAll(i),p=t.searchParams.getAll(i);d.every(_=>p.includes(_))&&p.every(_=>d.includes(_))&&r.delete(i)}return r}async function ve({id:n,invalidating:t,url:r,params:i,route:d}){if(g?.id===n)return g.promise;const{errors:p,layouts:_,leaf:y}=d,S=[..._,y];p.forEach(k=>k?.().catch(()=>{})),S.forEach(k=>k?.[1]().catch(()=>{}));let b=null;const N=h.url?n!==h.url.pathname+h.url.search:!1,U=h.route?d.id!==h.route.id:!1,m=wt(h.url,r);let A=!1;const x=S.map((k,P)=>{const T=h.branch[P],C=!!k?.[0]&&(T?.loader!==k[1]||Ye(A,U,N,m,T.server?.uses,i));return C&&(A=!0),C});if(x.some(Boolean)){try{b=await st(r,x)}catch(k){return le({status:pe(k),error:await te(k,{url:r,params:i,route:{id:d.id}}),url:r,route:d})}if(b.type==="redirect")return b}const R=b?.nodes;let V=!1;const G=S.map(async(k,P)=>{if(!k)return;const T=h.branch[P],C=R?.[P];if((!C||C.type==="skip")&&k[1]===T?.loader&&!Ye(V,U,N,m,T.universal?.uses,i))return T;if(V=!0,C?.type==="error")throw C;return ye({loader:k[1],url:r,params:i,route:d,parent:async()=>{const be={};for(let Ee=0;Ee{});const J=[];for(let k=0;kPromise.resolve({}),server_data_node:we(p)}),S={node:await f(),loader:f,universal:null,server:null,data:null};return await Q({url:r,params:d,branch:[y,S],status:n,error:t,route:null})}function ee(n,t){if($e(n,F))return;const r=We(n.pathname);for(const i of u){const d=i.exec(r);if(d)return{id:n.pathname+n.search,invalidating:t,route:i,params:kt(d),url:n}}}function We(n){return St(n.slice(F.length)||"/")}function Xe({url:n,type:t,intent:r,delta:i}){let d=!1;const p=it(h,r,n,t);i!==void 0&&(p.navigation.delta=i);const _={...p.navigation,cancel:()=>{d=!0,p.reject(new Error("navigation was cancelled"))}};return O||s.before_navigate.forEach(y=>y(_)),d?null:p}async function fe({type:n,url:t,popped:r,keepfocus:i,noscroll:d,replace_state:p,state:_={},redirect_count:y=0,nav_token:S={},accept:b=ot,block:N=ot}){const U=ee(t,!1),m=Xe({url:t,type:n,delta:r?.delta,intent:U});if(!m){N();return}const A=L,x=M;b(),O=!0,I&&q.navigating.set(m.navigation),z=S;let R=U&&await ve(U);if(!R){if($e(t,F))return await W(t);R=await Ze(t,{id:null},await te(new Ce(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404)}if(t=U?.url||t,z!==S)return m.reject(new Error("navigation was aborted")),!1;if(R.type==="redirect")if(y>=20)R=await le({status:500,error:await te(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}});else return ie(new URL(R.location,t).href,{},y+1,S),!1;else R.props.page.status>=400&&await q.updated.check()&&await W(t);if(w.length=0,se=!1,$=!0,Ne(A),Be(x),R.props.page.url.pathname!==t.pathname&&(t.pathname=R.props.page.url.pathname),_=r?r.state:_,!r){const k=p?0:1,P={[B]:L+=k,[K]:M+=k};(p?he:rt).call(history,P,"",t),p||at(L,M)}if(re[L]=_,g=null,R.props.page.state=_,I){h=R.state,R.props.page&&(R.props.page.url=t);const k=(await Promise.all(s.on_navigate.map(P=>P(m.navigation)))).filter(P=>typeof P=="function");if(k.length>0){let P=function(){s.after_navigate=s.after_navigate.filter(T=>!k.includes(T))};k.push(P),s.after_navigate.push(...k)}H.$set(R.props),Z=!0}else Ke(R);const{activeElement:V}=document;await ke();const G=r?r.scroll:d?Te():null;if(E){const k=t.hash&&document.getElementById(decodeURIComponent(t.hash.slice(1)));G?scrollTo(G.x,G.y):k?k.scrollIntoView():scrollTo(0,0)}const J=document.activeElement!==V&&document.activeElement!==document.body;!i&&!J&&Ue(),E=!0,R.props.page&&(j=R.props.page),O=!1,n==="popstate"&&qe(M),m.fulfil(void 0),s.after_navigate.forEach(k=>k(m.navigation)),q.navigating.set(null),$=!1}async function Ze(n,t,r,i){return n.origin===Ae&&n.pathname===location.pathname&&!v?await le({status:i,error:r,url:n,route:t}):await W(n)}function vt(){let n;l.addEventListener("mousemove",p=>{const _=p.target;clearTimeout(n),n=setTimeout(()=>{i(_,2)},20)});function t(p){i(p.composedPath()[0],1)}l.addEventListener("mousedown",t),l.addEventListener("touchstart",t,{passive:!0});const r=new IntersectionObserver(p=>{for(const _ of p)_.isIntersecting&&(ce(_.target.href),r.unobserve(_.target))},{threshold:0});function i(p,_){const y=Qe(p,l);if(!y)return;const{url:S,external:b,download:N}=Re(y,F);if(b||N)return;const U=de(y);if(!U.reload)if(_<=U.preload_data){const m=ee(S,!1);m&&Je(m)}else _<=U.preload_code&&ce(S.pathname)}function d(){r.disconnect();for(const p of l.querySelectorAll("a")){const{url:_,external:y,download:S}=Re(p,F);if(y||S)continue;const b=de(p);b.reload||(b.preload_code===et.viewport&&r.observe(p),b.preload_code===et.eager&&ce(_.pathname))}}s.after_navigate.push(d),d()}function te(n,t){if(n instanceof _e)return n.body;const r=pe(n),i=Xt(n);return e.hooks.handleError({error:n,event:t,status:r,message:i})??{message:i}}return{after_navigate:n=>{Se(()=>(s.after_navigate.push(n),()=>{const t=s.after_navigate.indexOf(n);s.after_navigate.splice(t,1)}))},before_navigate:n=>{Se(()=>(s.before_navigate.push(n),()=>{const t=s.before_navigate.indexOf(n);s.before_navigate.splice(t,1)}))},on_navigate:n=>{Se(()=>(s.on_navigate.push(n),()=>{const t=s.on_navigate.indexOf(n);s.on_navigate.splice(t,1)}))},disable_scroll_handling:()=>{($||!I)&&(E=!1)},goto:(n,t={})=>(n=ne(n),n.origin!==Ae?Promise.reject(new Error("goto: invalid URL")):ie(n,t,0)),invalidate:n=>{if(typeof n=="function")w.push(n);else{const{href:t}=new URL(n,location.href);w.push(r=>r.href===t)}return Ve()},invalidate_all:()=>(se=!0,Ve()),preload_data:async n=>{const t=ne(n),r=ee(t,!1);if(!r)throw new Error(`Attempted to preload a URL that does not belong to this app: ${t}`);const i=await Je(r);if(i.type==="redirect")return{type:i.type,location:i.location};const{status:d,data:p}=i.props.page??j;return{type:i.type,status:d,data:p}},preload_code:n=>ce(n),push_state:(n,t)=>{const r={[B]:L+=1,[K]:M,[Oe]:j.url.href};rt.call(history,r,"",ne(n)),j={...j,state:t},H.$set({page:j}),re[L]=t,at(L,M)},replace_state:(n,t)=>{const r={[B]:L,[K]:M,[Oe]:j.url.href};he.call(history,r,"",ne(n)),j={...j,state:t},H.$set({page:j}),re[L]=t},apply_action:async n=>{if(n.type==="error"){const t=new URL(location.href),{branch:r,route:i}=h;if(!i)return;const d=await ze(h.branch.length,r,i.errors);if(d){const p=await Q({url:t,params:h.params,branch:r.slice(0,d.idx).concat(d.node),status:n.status??500,error:n.error,route:i});h=p.state,H.$set(p.props),ke().then(Ue)}}else n.type==="redirect"?ie(n.location,{invalidateAll:!0},0):(H.$set({form:null,page:{...j,form:n.data,status:n.status}}),await ke(),H.$set({form:n.data}),n.type==="success"&&Ue())},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let r=!1;if(Ge(),!O){const i=it(h,void 0,null,"leave"),d={...i.navigation,cancel:()=>{r=!0,i.reject(new Error("navigation was cancelled"))}};s.before_navigate.forEach(p=>p(d))}r?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ge()}),navigator.connection?.saveData||vt(),l.addEventListener("click",t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const r=Qe(t.composedPath()[0],l);if(!r)return;const{url:i,external:d,target:p,download:_}=Re(r,F);if(!i)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const y=de(r);if(!(r instanceof SVGAElement)&&i.protocol!==location.protocol&&!(i.protocol==="https:"||i.protocol==="http:")||_)return;if(d||y.reload){Xe({url:i,type:"link"})?O=!0:t.preventDefault();return}const[b,N]=i.href.split("#");if(N!==void 0&&b===Ie(location)){if(h.url.hash===i.hash){t.preventDefault(),r.ownerDocument.getElementById(N)?.scrollIntoView();return}if(D=!0,Ne(L),n(i),!y.replace_state)return;D=!1}t.preventDefault(),fe({type:"link",url:i,keepfocus:y.keepfocus,noscroll:y.noscroll,replace_state:y.replace_state??i.href===location.href})}),l.addEventListener("submit",t=>{if(t.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(t.target),i=t.submitter;if((i?.formMethod||r.method)!=="get")return;const p=new URL(i?.hasAttribute("formaction")&&i?.formAction||r.action);if($e(p,F))return;const _=t.target,y=de(_);if(y.reload)return;t.preventDefault(),t.stopPropagation();const S=new FormData(_),b=i?.getAttribute("name");b&&S.append(b,i?.getAttribute("value")??""),p.search=new URLSearchParams(S).toString(),fe({type:"form",url:p,keepfocus:y.keepfocus,noscroll:y.noscroll,replace_state:y.replace_state??p.href===location.href})}),addEventListener("popstate",async t=>{if(t.state?.[B]){const r=t.state[B];if(z={},r===L)return;const i=Y[r],d=re[r]??{},p=new URL(t.state[Oe]??location.href),_=t.state[K],y=Ie(location)===Ie(h.url);if(_===M&&(Z||y)){n(p),Y[L]=Te(),i&&scrollTo(i.x,i.y),d!==j.state&&(j={...j,state:d},H.$set({page:j})),L=r;return}const b=r-L;await fe({type:"popstate",url:p,popped:{state:d,scroll:i,delta:b},accept:()=>{L=r,M=_},block:()=>{history.go(-b)},nav_token:z})}else if(!D){const r=new URL(location.href);n(r)}}),addEventListener("hashchange",()=>{D&&(D=!1,he.call(history,{...history.state,[B]:++L,[K]:M},"",location.href))});for(const t of document.querySelectorAll("link"))t.rel==="icon"&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&q.navigating.set(null)});function n(t){h.url=t,q.page.set({...j,url:t}),q.page.notify()}},_hydrate:async({status:n=200,error:t,node_ids:r,params:i,route:d,data:p,form:_})=>{v=!0;const y=new URL(location.href);({params:i={},route:d={id:null}}=ee(y,!1)||{});let S;try{const b=r.map(async(m,A)=>{const x=p[A];return x?.uses&&(x.uses=yt(x.uses)),ye({loader:e.nodes[m],url:y,params:i,route:d,parent:async()=>{const R={};for(let V=0;Vm===d.id);if(U){const m=U.layouts;for(let A=0;Af?"1":"0").join(""));const o=await ut(u.href);if(!o.ok){let f;throw o.headers.get("content-type")?.includes("application/json")?f=await o.json():o.status===404?f="Not Found":o.status===500&&(f="Internal Error"),new _e(o.status,f)}return new Promise(async f=>{const l=new Map,w=o.body.getReader(),c=new TextDecoder;function g(h){return gt(h,{Promise:v=>new Promise((I,E)=>{l.set(v,{fulfil:I,reject:E})})})}let s="";for(;;){const{done:h,value:v}=await w.read();if(h&&!s)break;for(s+=!v&&s?` `:c.decode(v);;){const I=s.indexOf(` `);if(I===-1)break;const E=JSON.parse(s.slice(0,I));if(s=s.slice(I+1),E.type==="redirect")return f(E);if(E.type==="data")E.nodes?.forEach($=>{$?.type==="data"&&($.uses=yt($.uses),$.data=g($.data))}),f(E);else if(E.type==="chunk"){const{id:$,data:O,error:D}=E,Z=l.get($);l.delete($),D?Z.reject(g(D)):Z.fulfil(g(O))}}}})}function yt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}function Ue(){const e=document.querySelector("[autofocus]");if(e)e.focus();else{const a=document.body,u=a.getAttribute("tabindex");a.tabIndex=-1,a.focus({preventScroll:!0,focusVisible:!1}),u!==null?a.setAttribute("tabindex",u):a.removeAttribute("tabindex");const o=getSelection();if(o&&o.type!=="None"){const f=[];for(let l=0;l{if(o.rangeCount===f.length){for(let l=0;l{f=g,l=s});return w.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:u&&{params:a?.params??null,route:{id:a?.route?.id??null},url:u},willUnload:!a,type:o,complete:w},fulfil:f,reject:l}}async function rn(e,a,u){const o=Zt(e,a);bt({client:o}),u?await o._hydrate(u):o.goto(location.href,{replaceState:!0}),o._start_router()}export{rn as start}; diff --git a/_app/immutable/nodes/0.PbakYmpN.js b/_app/immutable/nodes/0.ow-t_F9E.js similarity index 98% rename from _app/immutable/nodes/0.PbakYmpN.js rename to _app/immutable/nodes/0.ow-t_F9E.js index a2cb3d38..cc5661b1 100644 --- a/_app/immutable/nodes/0.PbakYmpN.js +++ b/_app/immutable/nodes/0.ow-t_F9E.js @@ -1,3 +1,3 @@ -import{s as safe_not_equal,a as space,f as element,c as claim_space,r as head_selector,g as claim_element,d as detach,j as attr,i as insert_hydration,u as append_hydration,v as component_subscribe,o as onMount,w as create_slot,h as children,x as update_slot_base,y as get_all_dirty_from_scope,z as get_slot_changes,A as getContext,B as comment,t as tick,C as listen,D as get_svelte_dataset,E as toggle_class,F as set_store_value,G as noop,H as compute_slots,l as text,m as claim_text,n as set_data,e as empty,I as destroy_each,p as binding_callbacks,J as action_destroyer,K as add_flush_callback}from"../chunks/scheduler.yhBzS9E6.js";import{S as SvelteComponent,i as init,b as create_component,d as claim_component,m as mount_component,a as transition_in,t as transition_out,e as destroy_component,g as group_outros,c as check_outros,f as bind}from"../chunks/index.f7836kWu.js";import{R as Realm,i as initRealm,P as Portal,e as ensure_array_like,c as capitalize,a as extra,s as search,u as update_keyed_each,o as outro_and_destroy_block}from"../chunks/Track.LR7rfYB8.js";import{u as uuid,I as Icon,S as Stack,H as Header,B as Button}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import{a as autoscroll}from"../chunks/autoscroll.ckBVSgbF.js";import{j as client_method}from"../chunks/singletons.SU60C52I.js";import{p as page}from"../chunks/stores.jWdOIcrH.js";import{w as writable,b as base}from"../chunks/paths.k6rcf9P1.js";import{S as Separator,P as Player}from"../chunks/Player.J8CE-V80.js";import{I as Input}from"../chunks/Input.hoDY5QId.js";import{S as Spacer}from"../chunks/Spacer.tcMPZ3eG.js";const prerender=!0,_layout=Object.freeze(Object.defineProperty({__proto__:null,prerender},Symbol.toStringTag,{value:"Module"})),goto=client_method("goto"),preloadData=client_method("preload_data"),beforeNavigate=client_method("before_navigate");function create_default_slot$3(s){let e,o,t,n,a,r,c,l,i,_,m,p,u,d,$,f,g;e=new Gateway({props:{name:"start"}}),a=new Gateway({props:{name:"left"}});const k=s[1].default,b=create_slot(k,s,s[2],null);return _=new Gateway({props:{name:"bottom"}}),u=new Gateway({props:{name:"right"}}),f=new Gateway({props:{name:"overlay"}}),{c(){create_component(e.$$.fragment),o=space(),t=element("div"),n=element("aside"),create_component(a.$$.fragment),r=space(),c=element("div"),b&&b.c(),l=space(),i=element("footer"),create_component(_.$$.fragment),m=space(),p=element("aside"),create_component(u.$$.fragment),d=space(),$=element("div"),create_component(f.$$.fragment),this.h()},l(h){claim_component(e.$$.fragment,h),o=claim_space(h),t=claim_element(h,"DIV",{class:!0});var y=children(t);n=claim_element(y,"ASIDE",{});var w=children(n);claim_component(a.$$.fragment,w),w.forEach(detach),r=claim_space(y),c=claim_element(y,"DIV",{class:!0});var v=children(c);b&&b.l(v),l=claim_space(v),i=claim_element(v,"FOOTER",{class:!0});var S=children(i);claim_component(_.$$.fragment,S),S.forEach(detach),v.forEach(detach),m=claim_space(y),p=claim_element(y,"ASIDE",{});var E=children(p);claim_component(u.$$.fragment,E),E.forEach(detach),y.forEach(detach),d=claim_space(h),$=claim_element(h,"DIV",{class:!0});var I=children($);claim_component(f.$$.fragment,I),I.forEach(detach),this.h()},h(){attr(i,"class","fixed bottom-0 z-50 flex w-full touch-none flex-col-reverse items-center"),attr(c,"class","grow contain-layout"),attr(t,"class","flex h-full"),attr($,"class","pointer-events-none fixed inset-0 contain-strict")},m(h,y){mount_component(e,h,y),insert_hydration(h,o,y),insert_hydration(h,t,y),append_hydration(t,n),mount_component(a,n,null),append_hydration(t,r),append_hydration(t,c),b&&b.m(c,null),append_hydration(c,l),append_hydration(c,i),mount_component(_,i,null),append_hydration(t,m),append_hydration(t,p),mount_component(u,p,null),insert_hydration(h,d,y),insert_hydration(h,$,y),mount_component(f,$,null),g=!0},p(h,y){b&&b.p&&(!g||y&4)&&update_slot_base(b,k,h,h[2],g?get_slot_changes(k,h[2],y,null):get_all_dirty_from_scope(h[2]),null)},i(h){g||(transition_in(e.$$.fragment,h),transition_in(a.$$.fragment,h),transition_in(b,h),transition_in(_.$$.fragment,h),transition_in(u.$$.fragment,h),transition_in(f.$$.fragment,h),g=!0)},o(h){transition_out(e.$$.fragment,h),transition_out(a.$$.fragment,h),transition_out(b,h),transition_out(_.$$.fragment,h),transition_out(u.$$.fragment,h),transition_out(f.$$.fragment,h),g=!1},d(h){h&&(detach(o),detach(t),detach(d),detach($)),destroy_component(e,h),destroy_component(a),b&&b.d(h),destroy_component(_),destroy_component(u),destroy_component(f)}}}function create_fragment$6(s){let e,o,t,n,a,r,c,l,i,_,m;return e=new Realm({props:{$$slots:{default:[create_default_slot$3]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),o=space(),t=element("meta"),n=element("meta"),a=element("meta"),r=element("meta"),c=element("meta"),i=element("meta"),this.h()},l(p){claim_component(e.$$.fragment,p),o=claim_space(p);const u=head_selector("svelte-67su4t",document.head);t=claim_element(u,"META",{charset:!0}),n=claim_element(u,"META",{name:!0,content:!0}),a=claim_element(u,"META",{name:!0,content:!0}),r=claim_element(u,"META",{name:!0,content:!0}),c=claim_element(u,"META",{name:!0,content:!0,media:!0}),i=claim_element(u,"META",{name:!0,content:!0,media:!0}),u.forEach(detach),this.h()},h(){attr(t,"charset","utf-8"),attr(n,"name","apple-mobile-web-app-capable"),attr(n,"content","yes"),attr(a,"name","apple-mobile-web-app-status-bar-style"),attr(a,"content","default"),attr(r,"name","viewport"),attr(r,"content","width=device-width,height=device-height,initial-scale=1,user-scalable=no"),attr(c,"name","theme-color"),attr(c,"content",l="#"+(s[0]?"000000":"ffffff")),attr(c,"media","(prefers-color-scheme: light)"),attr(i,"name","theme-color"),attr(i,"content",_="#"+(s[0]?"ffffff":"000000")),attr(i,"media","(prefers-color-scheme: dark)")},m(p,u){mount_component(e,p,u),insert_hydration(p,o,u),append_hydration(document.head,t),append_hydration(document.head,n),append_hydration(document.head,a),append_hydration(document.head,r),append_hydration(document.head,c),append_hydration(document.head,i),m=!0},p(p,[u]){const d={};u&4&&(d.$$scope={dirty:u,ctx:p}),e.$set(d),(!m||u&1&&l!==(l="#"+(p[0]?"000000":"ffffff")))&&attr(c,"content",l),(!m||u&1&&_!==(_="#"+(p[0]?"ffffff":"000000")))&&attr(i,"content",_)},i(p){m||(transition_in(e.$$.fragment,p),m=!0)},o(p){transition_out(e.$$.fragment,p),m=!1},d(p){p&&detach(o),destroy_component(e,p),detach(t),detach(n),detach(a),detach(r),detach(c),detach(i)}}}function instance$6(s,e,o){let t,n;component_subscribe(s,page,c=>o(3,t=c)),component_subscribe(s,flipped,c=>o(0,n=c));let{$$slots:a={},$$scope:r}=e;return onMount(()=>{function c(){location.hash!==t.url.hash&&goto(location.hash,{replaceState:!0})}return addEventListener("popstate",c),()=>removeEventListener("popstate",c)}),s.$$set=c=>{"$$scope"in c&&o(2,r=c.$$scope)},[n,a,r]}class Wrapper extends SvelteComponent{constructor(e){super(),init(this,e,instance$6,create_fragment$6,safe_not_equal,{})}}function create_fragment$5(s){let e;const o=s[3].default,t=create_slot(o,s,s[2],null);return{c(){t&&t.c()},l(n){t&&t.l(n)},m(n,a){t&&t.m(n,a),e=!0},p(n,[a]){t&&t.p&&(!e||a&4)&&update_slot_base(t,o,n,n[2],e?get_slot_changes(o,n[2],a,null):get_all_dirty_from_scope(n[2]),null)},i(n){e||(transition_in(t,n),e=!0)},o(n){transition_out(t,n),e=!1},d(n){t&&t.d(n)}}}function findComment(s,e,o){for(let t=o;t({l:s=>{const e=findComment(s,``,0),o=findComment(s,``,e);if(e===o)return;const t=s.claim_info??={total_claimed:0,last_index:0},n=s.splice(e,o-e+1);detach(n.shift()),detach(n.pop());for(const a of n)a.claim_order=t.total_claimed,t.total_claimed+=1;realm[name].claim.forEach(a=>a(n)),n.forEach(detach)},m:async(s,e)=>{realm[name].mount.forEach(t=>t(s,e));const o=comment("");insert_hydration(s,o,e),await tick(),$$invalidate(1,realm[name].target=[o.parentNode,o.nextSibling],realm),detach(o)},d:s=>{realm[name].destroy.forEach(e=>e(s)),$$invalidate(1,realm[name]=initRealm(),realm)},c:()=>{}}),$$self.$$set=s=>{"name"in s&&$$invalidate(0,name=s.name),"$$scope"in s&&$$invalidate(2,$$scope=s.$$scope)},$$self.$$.update=()=>{$$self.$$.dirty&3&&(realm[name]||$$invalidate(1,realm[name]=initRealm(),realm))},[name,realm,$$scope,slots]}class Gateway extends SvelteComponent{constructor(e){super(),init(this,e,instance$5,create_fragment$5,safe_not_equal,{name:0})}}const get_after_slot_changes=s=>({}),get_after_slot_context=s=>({});function create_if_block$2(s){let e,o,t;return{c(){e=element("input"),this.h()},l(n){e=claim_element(n,"INPUT",{type:!0,class:!0,id:!0}),this.h()},h(){attr(e,"type","checkbox"),attr(e,"class","peer pointer-events-none absolute h-full w-full appearance-none rounded-2xl outline-2 outline-primary-600 focus-visible:outline"),attr(e,"id",s[2])},m(n,a){insert_hydration(n,e,a),e.checked=s[0],o||(t=listen(e,"change",s[5]),o=!0)},p(n,a){a&1&&(e.checked=n[0])},d(n){n&&detach(e),o=!1,t()}}}function create_fragment$4(s){let e,o,t,n,a,r,c,l;const i=s[4].default,_=create_slot(i,s,s[3],null);let m=!s[1]&&create_if_block$2(s);const p=s[4].after,u=create_slot(p,s,s[3],get_after_slot_context);return{c(){e=element("label"),_&&_.c(),o=space(),t=element("div"),m&&m.c(),n=space(),a=element("div"),c=space(),u&&u.c(),this.h()},l(d){e=claim_element(d,"LABEL",{class:!0,for:!0});var $=children(e);_&&_.l($),o=claim_space($),t=claim_element($,"DIV",{class:!0});var f=children(t);m&&m.l(f),n=claim_space(f),a=claim_element(f,"DIV",{class:!0}),children(a).forEach(detach),f.forEach(detach),c=claim_space($),u&&u.l($),$.forEach(detach),this.h()},h(){attr(a,"class",r="block w-[51px] cursor-pointer rounded-2xl bg-highlight p-0.5 shadow-inner after:block after:h-7 after:w-7 after:origin-left after:rounded-full after:bg-white after:shadow-sm after:transition-transform group-active:after:scale-x-110 peer-active:after:scale-x-110 "+(s[1]==="light-switch"?"outline-2 outline-offset-2 outline-primary-600 dark-focus:outline dark:bg-primary-600 dark:after:origin-right dark:after:translate-x-2/3":"peer-checked:bg-primary-600 peer-checked:after:origin-right peer-checked:after:translate-x-2/3")),attr(t,"class","relative"),attr(e,"class","group relative flex w-max cursor-pointer select-none items-center gap-2 p-[6px] text-content-200"),attr(e,"for",s[2])},m(d,$){insert_hydration(d,e,$),_&&_.m(e,null),append_hydration(e,o),append_hydration(e,t),m&&m.m(t,null),append_hydration(t,n),append_hydration(t,a),append_hydration(e,c),u&&u.m(e,null),l=!0},p(d,[$]){_&&_.p&&(!l||$&8)&&update_slot_base(_,i,d,d[3],l?get_slot_changes(i,d[3],$,null):get_all_dirty_from_scope(d[3]),null),d[1]?m&&(m.d(1),m=null):m?m.p(d,$):(m=create_if_block$2(d),m.c(),m.m(t,n)),(!l||$&2&&r!==(r="block w-[51px] cursor-pointer rounded-2xl bg-highlight p-0.5 shadow-inner after:block after:h-7 after:w-7 after:origin-left after:rounded-full after:bg-white after:shadow-sm after:transition-transform group-active:after:scale-x-110 peer-active:after:scale-x-110 "+(d[1]==="light-switch"?"outline-2 outline-offset-2 outline-primary-600 dark-focus:outline dark:bg-primary-600 dark:after:origin-right dark:after:translate-x-2/3":"peer-checked:bg-primary-600 peer-checked:after:origin-right peer-checked:after:translate-x-2/3")))&&attr(a,"class",r),u&&u.p&&(!l||$&8)&&update_slot_base(u,p,d,d[3],l?get_slot_changes(p,d[3],$,get_after_slot_changes):get_all_dirty_from_scope(d[3]),get_after_slot_context)},i(d){l||(transition_in(_,d),transition_in(u,d),l=!0)},o(d){transition_out(_,d),transition_out(u,d),l=!1},d(d){d&&detach(e),_&&_.d(d),m&&m.d(),u&&u.d(d)}}}function instance$4(s,e,o){let{$$slots:t={},$$scope:n}=e,{checked:a=!1}=e,{target:r=""}=e;const c=r||uuid();function l(){a=this.checked,o(0,a)}return s.$$set=i=>{"checked"in i&&o(0,a=i.checked),"target"in i&&o(1,r=i.target),"$$scope"in i&&o(3,n=i.$$scope)},[a,r,c,n,t,l]}class Checkbox extends SvelteComponent{constructor(e){super(),init(this,e,instance$4,create_fragment$4,safe_not_equal,{checked:0,target:1})}}function create_fragment$3(s){let e,o,t,n,a="madeus",r;return o=new Icon({props:{name:"amadeus",xl:!0}}),{c(){e=element("div"),create_component(o.$$.fragment),t=space(),n=element("span"),n.textContent=a,this.h()},l(c){e=claim_element(c,"DIV",{class:!0});var l=children(e);claim_component(o.$$.fragment,l),t=claim_space(l),n=claim_element(l,"SPAN",{class:!0,"data-svelte-h":!0}),get_svelte_dataset(n)!=="svelte-171rd2n"&&(n.textContent=a),l.forEach(detach),this.h()},h(){attr(n,"class","h-11 select-none text-2xl font-light"),toggle_class(n,"hidden",s[0]),toggle_class(n,"xl:block",s[0]==="auto"),attr(e,"class","flex items-center py-8 text-content-200")},m(c,l){insert_hydration(c,e,l),mount_component(o,e,null),append_hydration(e,t),append_hydration(e,n),r=!0},p(c,[l]){(!r||l&1)&&toggle_class(n,"hidden",c[0]),(!r||l&1)&&toggle_class(n,"xl:block",c[0]==="auto")},i(c){r||(transition_in(o.$$.fragment,c),r=!0)},o(c){transition_out(o.$$.fragment,c),r=!1},d(c){c&&detach(e),destroy_component(o)}}}function instance$3(s,e,o){let{sm:t=!1}=e;return s.$$set=n=>{"sm"in n&&o(0,t=n.sm)},[t]}class Logo extends SvelteComponent{constructor(e){super(),init(this,e,instance$3,create_fragment$3,safe_not_equal,{sm:0})}}function create_default_slot_1$2(s){let e,o;return e=new Icon({props:{name:"sun"}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p:noop,i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_after_slot(s){let e,o;return e=new Icon({props:{name:"moon",slot:"after"}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p:noop,i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot$2(s){let e;return{c(){e=element("input"),this.h()},l(o){e=claim_element(o,"INPUT",{class:!0,id:!0,type:!0}),this.h()},h(){attr(e,"class","absolute appearance-none"),attr(e,"id","light-switch"),attr(e,"type","checkbox")},m(o,t){insert_hydration(o,e,t)},p:noop,d(o){o&&detach(e)}}}function create_fragment$2(s){let e,o,t,n;return e=new Checkbox({props:{target:"light-switch",$$slots:{after:[create_after_slot],default:[create_default_slot_1$2]},$$scope:{ctx:s}}}),t=new Portal({props:{to:"start",unique:"light-switch",$$slots:{default:[create_default_slot$2]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),o=space(),create_component(t.$$.fragment)},l(a){claim_component(e.$$.fragment,a),o=claim_space(a),claim_component(t.$$.fragment,a)},m(a,r){mount_component(e,a,r),insert_hydration(a,o,r),mount_component(t,a,r),n=!0},p(a,[r]){const c={};r&128&&(c.$$scope={dirty:r,ctx:a}),e.$set(c);const l={};r&128&&(l.$$scope={dirty:r,ctx:a}),t.$set(l)},i(a){n||(transition_in(e.$$.fragment,a),transition_in(t.$$.fragment,a),n=!0)},o(a){transition_out(e.$$.fragment,a),transition_out(t.$$.fragment,a),n=!1},d(a){a&&detach(o),destroy_component(e,a),destroy_component(t,a)}}}const flipped=writable(!1);function instance$2(s,e,o){let t,n,a=noop;component_subscribe(s,flipped,m=>o(4,n=m)),s.$$.on_destroy.push(()=>a());const r=()=>"localStorage"in globalThis&&"dark"in localStorage,c=globalThis.matchMedia?.("(prefers-color-scheme: dark)");let{preference:l=c?.matches}=e,i=r()&&localStorage.dark==="true"!==l,{theme:_=t?"dark":"light"}=e;return c?.addEventListener("change",m=>{m.matches!==l&&(r()&&o(2,i=!i),o(0,l=m.matches))}),onMount(()=>{const m=p=>o(2,i=p.target?.checked);return tick().then(()=>{const p=document.getElementById("light-switch");p&&(p.checked=i,p.addEventListener("change",m))}),()=>document.getElementById("light-switch")?.removeEventListener("change",m)}),s.$$set=m=>{"preference"in m&&o(0,l=m.preference),"theme"in m&&o(1,_=m.theme)},s.$$.update=()=>{s.$$.dirty&5&&o(3,t=!!(+l^+i)),s.$$.dirty&12&&"localStorage"in globalThis&&(i||r())&&(localStorage.dark=t),s.$$.dirty&8&&o(1,_=t?"dark":"light"),s.$$.dirty&4&&set_store_value(flipped,n=i,n)},[l,_,i,t]}class LightSwitch extends SvelteComponent{constructor(e){super(),init(this,e,instance$2,create_fragment$2,safe_not_equal,{preference:0,theme:1})}}const get_bottom_section_slot_changes=s=>({}),get_bottom_section_slot_context=s=>({}),get_section_slot_changes=s=>({}),get_section_slot_context=s=>({}),get_bottom_slot_changes=s=>({}),get_bottom_slot_context=s=>({});function create_if_block_1(s){let e,o;return e=new Stack({props:{class:"gap-8 p-4",$$slots:{default:[create_default_slot_8]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p(t,n){const a={};n&8&&(a.$$scope={dirty:n,ctx:t}),e.$set(a)},i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot_8(s){let e,o,t,n;const a=s[2].default,r=create_slot(a,s,s[3],null);o=new Spacer({});const c=s[2].bottom,l=create_slot(c,s,s[3],get_bottom_slot_context);return{c(){r&&r.c(),e=space(),create_component(o.$$.fragment),t=space(),l&&l.c()},l(i){r&&r.l(i),e=claim_space(i),claim_component(o.$$.fragment,i),t=claim_space(i),l&&l.l(i)},m(i,_){r&&r.m(i,_),insert_hydration(i,e,_),mount_component(o,i,_),insert_hydration(i,t,_),l&&l.m(i,_),n=!0},p(i,_){r&&r.p&&(!n||_&8)&&update_slot_base(r,a,i,i[3],n?get_slot_changes(a,i[3],_,null):get_all_dirty_from_scope(i[3]),null),l&&l.p&&(!n||_&8)&&update_slot_base(l,c,i,i[3],n?get_slot_changes(c,i[3],_,get_bottom_slot_changes):get_all_dirty_from_scope(i[3]),get_bottom_slot_context)},i(i){n||(transition_in(r,i),transition_in(o.$$.fragment,i),transition_in(l,i),n=!0)},o(i){transition_out(r,i),transition_out(o.$$.fragment,i),transition_out(l,i),n=!1},d(i){i&&(detach(e),detach(t)),r&&r.d(i),destroy_component(o,i),l&&l.d(i)}}}function create_if_block$1(s){let e,o;return e=new Separator({}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot_7$1(s){let e;return{c(){e=text(s[0])},l(o){e=claim_text(o,s[0])},m(o,t){insert_hydration(o,e,t)},p(o,t){t&1&&set_data(e,o[0])},d(o){o&&detach(e)}}}function create_default_slot_6$1(s){let e;const o=s[2]["bottom-section"],t=create_slot(o,s,s[3],get_bottom_section_slot_context);return{c(){t&&t.c()},l(n){t&&t.l(n)},m(n,a){t&&t.m(n,a),e=!0},p(n,a){t&&t.p&&(!e||a&8)&&update_slot_base(t,o,n,n[3],e?get_slot_changes(o,n[3],a,get_bottom_section_slot_changes):get_all_dirty_from_scope(n[3]),get_bottom_section_slot_context)},i(n){e||(transition_in(t,n),e=!0)},o(n){transition_out(t,n),e=!1},d(n){t&&t.d(n)}}}function create_default_slot_5$1(s){let e,o,t,n,a,r,c;e=new Header({props:{sm:!0,$$slots:{default:[create_default_slot_7$1]},$$scope:{ctx:s}}});const l=s[2].section,i=create_slot(l,s,s[3],get_section_slot_context);return n=new Spacer({}),r=new Stack({props:{class:"place-items-center",$$slots:{default:[create_default_slot_6$1]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),o=space(),i&&i.c(),t=space(),create_component(n.$$.fragment),a=space(),create_component(r.$$.fragment)},l(_){claim_component(e.$$.fragment,_),o=claim_space(_),i&&i.l(_),t=claim_space(_),claim_component(n.$$.fragment,_),a=claim_space(_),claim_component(r.$$.fragment,_)},m(_,m){mount_component(e,_,m),insert_hydration(_,o,m),i&&i.m(_,m),insert_hydration(_,t,m),mount_component(n,_,m),insert_hydration(_,a,m),mount_component(r,_,m),c=!0},p(_,m){const p={};m&9&&(p.$$scope={dirty:m,ctx:_}),e.$set(p),i&&i.p&&(!c||m&8)&&update_slot_base(i,l,_,_[3],c?get_slot_changes(l,_[3],m,get_section_slot_changes):get_all_dirty_from_scope(_[3]),get_section_slot_context);const u={};m&8&&(u.$$scope={dirty:m,ctx:_}),r.$set(u)},i(_){c||(transition_in(e.$$.fragment,_),transition_in(i,_),transition_in(n.$$.fragment,_),transition_in(r.$$.fragment,_),c=!0)},o(_){transition_out(e.$$.fragment,_),transition_out(i,_),transition_out(n.$$.fragment,_),transition_out(r.$$.fragment,_),c=!1},d(_){_&&(detach(o),detach(t),detach(a)),destroy_component(e,_),i&&i.d(_),destroy_component(n,_),destroy_component(r,_)}}}function create_default_slot_4$1(s){let e,o,t,n,a,r=s[1]&&create_if_block_1(s),c=s[1]&&create_if_block$1();return n=new Stack({props:{class:"gap-1 p-4",$$slots:{default:[create_default_slot_5$1]},$$scope:{ctx:s}}}),{c(){r&&r.c(),e=space(),o=element("section"),c&&c.c(),t=space(),create_component(n.$$.fragment),this.h()},l(l){r&&r.l(l),e=claim_space(l),o=claim_element(l,"SECTION",{class:!0});var i=children(o);c&&c.l(i),t=claim_space(i),claim_component(n.$$.fragment,i),i.forEach(detach),this.h()},h(){attr(o,"class","min-w-[15rem] "+(s[1]?"hidden xl:flex":"flex"))},m(l,i){r&&r.m(l,i),insert_hydration(l,e,i),insert_hydration(l,o,i),c&&c.m(o,null),append_hydration(o,t),mount_component(n,o,null),a=!0},p(l,i){l[1]&&r.p(l,i);const _={};i&9&&(_.$$scope={dirty:i,ctx:l}),n.$set(_)},i(l){a||(transition_in(r),transition_in(c),transition_in(n.$$.fragment,l),a=!0)},o(l){transition_out(r),transition_out(c),transition_out(n.$$.fragment,l),a=!1},d(l){l&&(detach(e),detach(o)),r&&r.d(l),c&&c.d(),destroy_component(n)}}}function create_default_slot_3$1(s){let e,o,t,n,a,r,c;return o=new Logo({props:{sm:s[1]?"auto":!1}}),n=new Separator({}),r=new Stack({props:{x:!0,$$slots:{default:[create_default_slot_4$1]},$$scope:{ctx:s}}}),{c(){e=element("div"),create_component(o.$$.fragment),t=space(),create_component(n.$$.fragment),a=space(),create_component(r.$$.fragment),this.h()},l(l){e=claim_element(l,"DIV",{class:!0,"aria-hidden":!0});var i=children(e);claim_component(o.$$.fragment,i),t=claim_space(i),claim_component(n.$$.fragment,i),i.forEach(detach),a=claim_space(l),claim_component(r.$$.fragment,l),this.h()},h(){attr(e,"class","hidden w-full flex-col items-center tall:flex"),attr(e,"aria-hidden","true")},m(l,i){insert_hydration(l,e,i),mount_component(o,e,null),append_hydration(e,t),mount_component(n,e,null),insert_hydration(l,a,i),mount_component(r,l,i),c=!0},p(l,i){const _={};i&9&&(_.$$scope={dirty:i,ctx:l}),r.$set(_)},i(l){c||(transition_in(o.$$.fragment,l),transition_in(n.$$.fragment,l),transition_in(r.$$.fragment,l),c=!0)},o(l){transition_out(o.$$.fragment,l),transition_out(n.$$.fragment,l),transition_out(r.$$.fragment,l),c=!1},d(l){l&&(detach(e),detach(a)),destroy_component(o),destroy_component(n),destroy_component(r,l)}}}function create_default_slot_2$1(s){let e,o,t,n,a;return o=new Stack({props:{$$slots:{default:[create_default_slot_3$1]},$$scope:{ctx:s}}}),n=new Separator({props:{vertical:!0}}),{c(){e=element("nav"),create_component(o.$$.fragment),t=space(),create_component(n.$$.fragment),this.h()},l(r){e=claim_element(r,"NAV",{class:!0});var c=children(e);claim_component(o.$$.fragment,c),t=claim_space(c),claim_component(n.$$.fragment,c),c.forEach(detach),this.h()},h(){attr(e,"class","h-[100dvh] flex-shrink-0 overflow-y-auto overflow-x-hidden "+(s[1]?"hidden sm:flex":"flex"))},m(r,c){insert_hydration(r,e,c),mount_component(o,e,null),append_hydration(e,t),mount_component(n,e,null),a=!0},p(r,c){const l={};c&9&&(l.$$scope={dirty:c,ctx:r}),o.$set(l)},i(r){a||(transition_in(o.$$.fragment,r),transition_in(n.$$.fragment,r),a=!0)},o(r){transition_out(o.$$.fragment,r),transition_out(n.$$.fragment,r),a=!1},d(r){r&&detach(e),destroy_component(o),destroy_component(n)}}}function create_default_slot_1$1(s){let e;const o=s[2].default,t=create_slot(o,s,s[3],null);return{c(){t&&t.c()},l(n){t&&t.l(n)},m(n,a){t&&t.m(n,a),e=!0},p(n,a){t&&t.p&&(!e||a&8)&&update_slot_base(t,o,n,n[3],e?get_slot_changes(o,n[3],a,null):get_all_dirty_from_scope(n[3]),null)},i(n){e||(transition_in(t,n),e=!0)},o(n){transition_out(t,n),e=!1},d(n){t&&t.d(n)}}}function create_default_slot$1(s){let e,o,t,n,a;return o=new Separator({props:{vertical:!1}}),n=new Stack({props:{x:!0,class:"max-h-11",$$slots:{default:[create_default_slot_1$1]},$$scope:{ctx:s}}}),{c(){e=element("nav"),create_component(o.$$.fragment),t=space(),create_component(n.$$.fragment),this.h()},l(r){e=claim_element(r,"NAV",{class:!0});var c=children(e);claim_component(o.$$.fragment,c),t=claim_space(c),claim_component(n.$$.fragment,c),c.forEach(detach),this.h()},h(){attr(e,"class","h-12 w-full flex-col justify-between bg-surface-200 backdrop-blur-md "+(s[1]?"flex sm:hidden":"hidden"))},m(r,c){insert_hydration(r,e,c),mount_component(o,e,null),append_hydration(e,t),mount_component(n,e,null),a=!0},p(r,c){const l={};c&8&&(l.$$scope={dirty:c,ctx:r}),n.$set(l)},i(r){a||(transition_in(o.$$.fragment,r),transition_in(n.$$.fragment,r),a=!0)},o(r){transition_out(o.$$.fragment,r),transition_out(n.$$.fragment,r),a=!1},d(r){r&&detach(e),destroy_component(o),destroy_component(n)}}}function create_fragment$1(s){let e,o,t,n;return e=new Portal({props:{to:"left",$$slots:{default:[create_default_slot_2$1]},$$scope:{ctx:s}}}),t=new Portal({props:{to:"bottom",$$slots:{default:[create_default_slot$1]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),o=space(),create_component(t.$$.fragment)},l(a){claim_component(e.$$.fragment,a),o=claim_space(a),claim_component(t.$$.fragment,a)},m(a,r){mount_component(e,a,r),insert_hydration(a,o,r),mount_component(t,a,r),n=!0},p(a,[r]){const c={};r&9&&(c.$$scope={dirty:r,ctx:a}),e.$set(c);const l={};r&8&&(l.$$scope={dirty:r,ctx:a}),t.$set(l)},i(a){n||(transition_in(e.$$.fragment,a),transition_in(t.$$.fragment,a),n=!0)},o(a){transition_out(e.$$.fragment,a),transition_out(t.$$.fragment,a),n=!1},d(a){a&&detach(o),destroy_component(e,a),destroy_component(t,a)}}}function instance$1(s,e,o){let{$$slots:t={},$$scope:n}=e;const a=compute_slots(t);let{section:r}=e,c=a.default;return s.$$set=l=>{"section"in l&&o(0,r=l.section),"$$scope"in l&&o(3,n=l.$$scope)},[r,c,t,n]}class Nav extends SvelteComponent{constructor(e){super(),init(this,e,instance$1,create_fragment$1,safe_not_equal,{section:0})}}function get_each_context(s,e,o){const t=s.slice();return t[13]=e[o][0],t[14]=e[o][1],t[15]=e[o][2],t[16]=e[o][3],t}function get_each_context_2(s,e,o){const t=s.slice();return t[19]=e[o],t}function get_each_context_1(s,e,o){const t=s.slice();return t[19]=e[o],t}function create_default_slot_7(s){let e,o=s[19]+"",t,n,a;return e=new Icon({props:{md:!0,name:s[5][s[19]]}}),{c(){create_component(e.$$.fragment),t=text(o),n=space()},l(r){claim_component(e.$$.fragment,r),t=claim_text(r,o),n=claim_space(r)},m(r,c){mount_component(e,r,c),insert_hydration(r,t,c),insert_hydration(r,n,c),a=!0},p:noop,i(r){a||(transition_in(e.$$.fragment,r),a=!0)},o(r){transition_out(e.$$.fragment,r),a=!1},d(r){r&&(detach(t),detach(n)),destroy_component(e,r)}}}function create_each_block_2(s){let e,o;return e=new Button({props:{air:!0,compact:!0,stretch:!0,primary:s[19]===s[1],href:s[7](s[19]),$$slots:{default:[create_default_slot_7]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p(t,n){const a={};n&2&&(a.primary=t[19]===t[1]),n&2048&&(a.$$scope={dirty:n,ctx:t}),e.$set(a)},i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot_6(s){let e,o,t=ensure_array_like(Object.keys(s[6])),n=[];for(let r=0;rtransition_out(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;ri[1]+i[19];for(let i=0;i{l=null}),check_outros())},i(i){if(!a){for(let _=0;_o(3,t=c)),component_subscribe(s,flipped,c=>o(0,n=c));let{$$slots:a={},$$scope:r}=e;return onMount(()=>{function c(){location.hash!==t.url.hash&&goto(location.hash,{replaceState:!0})}return addEventListener("popstate",c),()=>removeEventListener("popstate",c)}),s.$$set=c=>{"$$scope"in c&&o(2,r=c.$$scope)},[n,a,r]}class Wrapper extends SvelteComponent{constructor(e){super(),init(this,e,instance$6,create_fragment$6,safe_not_equal,{})}}function create_fragment$5(s){let e;const o=s[3].default,t=create_slot(o,s,s[2],null);return{c(){t&&t.c()},l(n){t&&t.l(n)},m(n,a){t&&t.m(n,a),e=!0},p(n,[a]){t&&t.p&&(!e||a&4)&&update_slot_base(t,o,n,n[2],e?get_slot_changes(o,n[2],a,null):get_all_dirty_from_scope(n[2]),null)},i(n){e||(transition_in(t,n),e=!0)},o(n){transition_out(t,n),e=!1},d(n){t&&t.d(n)}}}function findComment(s,e,o){for(let t=o;t({l:s=>{const e=findComment(s,``,0),o=findComment(s,``,e);if(e===o)return;const t=s.claim_info??={total_claimed:0,last_index:0},n=s.splice(e,o-e+1);detach(n.shift()),detach(n.pop());for(const a of n)a.claim_order=t.total_claimed,t.total_claimed+=1;realm[name].claim.forEach(a=>a(n)),n.forEach(detach)},m:async(s,e)=>{realm[name].mount.forEach(t=>t(s,e));const o=comment("");insert_hydration(s,o,e),await tick(),$$invalidate(1,realm[name].target=[o.parentNode,o.nextSibling],realm),detach(o)},d:s=>{realm[name].destroy.forEach(e=>e(s)),$$invalidate(1,realm[name]=initRealm(),realm)},c:()=>{}}),$$self.$$set=s=>{"name"in s&&$$invalidate(0,name=s.name),"$$scope"in s&&$$invalidate(2,$$scope=s.$$scope)},$$self.$$.update=()=>{$$self.$$.dirty&3&&(realm[name]||$$invalidate(1,realm[name]=initRealm(),realm))},[name,realm,$$scope,slots]}class Gateway extends SvelteComponent{constructor(e){super(),init(this,e,instance$5,create_fragment$5,safe_not_equal,{name:0})}}const get_after_slot_changes=s=>({}),get_after_slot_context=s=>({});function create_if_block$2(s){let e,o,t;return{c(){e=element("input"),this.h()},l(n){e=claim_element(n,"INPUT",{type:!0,class:!0,id:!0}),this.h()},h(){attr(e,"type","checkbox"),attr(e,"class","peer pointer-events-none absolute h-full w-full appearance-none rounded-2xl outline-2 outline-primary-600 focus-visible:outline"),attr(e,"id",s[2])},m(n,a){insert_hydration(n,e,a),e.checked=s[0],o||(t=listen(e,"change",s[5]),o=!0)},p(n,a){a&1&&(e.checked=n[0])},d(n){n&&detach(e),o=!1,t()}}}function create_fragment$4(s){let e,o,t,n,a,r,c,l;const i=s[4].default,_=create_slot(i,s,s[3],null);let m=!s[1]&&create_if_block$2(s);const p=s[4].after,u=create_slot(p,s,s[3],get_after_slot_context);return{c(){e=element("label"),_&&_.c(),o=space(),t=element("div"),m&&m.c(),n=space(),a=element("div"),c=space(),u&&u.c(),this.h()},l(d){e=claim_element(d,"LABEL",{class:!0,for:!0});var $=children(e);_&&_.l($),o=claim_space($),t=claim_element($,"DIV",{class:!0});var f=children(t);m&&m.l(f),n=claim_space(f),a=claim_element(f,"DIV",{class:!0}),children(a).forEach(detach),f.forEach(detach),c=claim_space($),u&&u.l($),$.forEach(detach),this.h()},h(){attr(a,"class",r="block w-[51px] cursor-pointer rounded-2xl bg-highlight p-0.5 shadow-inner after:block after:h-7 after:w-7 after:origin-left after:rounded-full after:bg-white after:shadow-sm after:transition-transform group-active:after:scale-x-110 peer-active:after:scale-x-110 "+(s[1]==="light-switch"?"outline-2 outline-offset-2 outline-primary-600 dark-focus:outline dark:bg-primary-600 dark:after:origin-right dark:after:translate-x-2/3":"peer-checked:bg-primary-600 peer-checked:after:origin-right peer-checked:after:translate-x-2/3")),attr(t,"class","relative"),attr(e,"class","group relative flex w-max cursor-pointer select-none items-center gap-2 p-[6px] text-content-200"),attr(e,"for",s[2])},m(d,$){insert_hydration(d,e,$),_&&_.m(e,null),append_hydration(e,o),append_hydration(e,t),m&&m.m(t,null),append_hydration(t,n),append_hydration(t,a),append_hydration(e,c),u&&u.m(e,null),l=!0},p(d,[$]){_&&_.p&&(!l||$&8)&&update_slot_base(_,i,d,d[3],l?get_slot_changes(i,d[3],$,null):get_all_dirty_from_scope(d[3]),null),d[1]?m&&(m.d(1),m=null):m?m.p(d,$):(m=create_if_block$2(d),m.c(),m.m(t,n)),(!l||$&2&&r!==(r="block w-[51px] cursor-pointer rounded-2xl bg-highlight p-0.5 shadow-inner after:block after:h-7 after:w-7 after:origin-left after:rounded-full after:bg-white after:shadow-sm after:transition-transform group-active:after:scale-x-110 peer-active:after:scale-x-110 "+(d[1]==="light-switch"?"outline-2 outline-offset-2 outline-primary-600 dark-focus:outline dark:bg-primary-600 dark:after:origin-right dark:after:translate-x-2/3":"peer-checked:bg-primary-600 peer-checked:after:origin-right peer-checked:after:translate-x-2/3")))&&attr(a,"class",r),u&&u.p&&(!l||$&8)&&update_slot_base(u,p,d,d[3],l?get_slot_changes(p,d[3],$,get_after_slot_changes):get_all_dirty_from_scope(d[3]),get_after_slot_context)},i(d){l||(transition_in(_,d),transition_in(u,d),l=!0)},o(d){transition_out(_,d),transition_out(u,d),l=!1},d(d){d&&detach(e),_&&_.d(d),m&&m.d(),u&&u.d(d)}}}function instance$4(s,e,o){let{$$slots:t={},$$scope:n}=e,{checked:a=!1}=e,{target:r=""}=e;const c=r||uuid();function l(){a=this.checked,o(0,a)}return s.$$set=i=>{"checked"in i&&o(0,a=i.checked),"target"in i&&o(1,r=i.target),"$$scope"in i&&o(3,n=i.$$scope)},[a,r,c,n,t,l]}class Checkbox extends SvelteComponent{constructor(e){super(),init(this,e,instance$4,create_fragment$4,safe_not_equal,{checked:0,target:1})}}function create_fragment$3(s){let e,o,t,n,a="madeus",r;return o=new Icon({props:{name:"amadeus",xl:!0}}),{c(){e=element("div"),create_component(o.$$.fragment),t=space(),n=element("span"),n.textContent=a,this.h()},l(c){e=claim_element(c,"DIV",{class:!0});var l=children(e);claim_component(o.$$.fragment,l),t=claim_space(l),n=claim_element(l,"SPAN",{class:!0,"data-svelte-h":!0}),get_svelte_dataset(n)!=="svelte-171rd2n"&&(n.textContent=a),l.forEach(detach),this.h()},h(){attr(n,"class","h-11 select-none text-2xl font-light"),toggle_class(n,"hidden",s[0]),toggle_class(n,"xl:block",s[0]==="auto"),attr(e,"class","flex items-center py-8 text-content-200")},m(c,l){insert_hydration(c,e,l),mount_component(o,e,null),append_hydration(e,t),append_hydration(e,n),r=!0},p(c,[l]){(!r||l&1)&&toggle_class(n,"hidden",c[0]),(!r||l&1)&&toggle_class(n,"xl:block",c[0]==="auto")},i(c){r||(transition_in(o.$$.fragment,c),r=!0)},o(c){transition_out(o.$$.fragment,c),r=!1},d(c){c&&detach(e),destroy_component(o)}}}function instance$3(s,e,o){let{sm:t=!1}=e;return s.$$set=n=>{"sm"in n&&o(0,t=n.sm)},[t]}class Logo extends SvelteComponent{constructor(e){super(),init(this,e,instance$3,create_fragment$3,safe_not_equal,{sm:0})}}function create_default_slot_1$2(s){let e,o;return e=new Icon({props:{name:"sun"}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p:noop,i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_after_slot(s){let e,o;return e=new Icon({props:{name:"moon",slot:"after"}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p:noop,i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot$2(s){let e;return{c(){e=element("input"),this.h()},l(o){e=claim_element(o,"INPUT",{class:!0,id:!0,type:!0}),this.h()},h(){attr(e,"class","absolute appearance-none"),attr(e,"id","light-switch"),attr(e,"type","checkbox")},m(o,t){insert_hydration(o,e,t)},p:noop,d(o){o&&detach(e)}}}function create_fragment$2(s){let e,o,t,n;return e=new Checkbox({props:{target:"light-switch",$$slots:{after:[create_after_slot],default:[create_default_slot_1$2]},$$scope:{ctx:s}}}),t=new Portal({props:{to:"start",unique:"light-switch",$$slots:{default:[create_default_slot$2]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),o=space(),create_component(t.$$.fragment)},l(a){claim_component(e.$$.fragment,a),o=claim_space(a),claim_component(t.$$.fragment,a)},m(a,r){mount_component(e,a,r),insert_hydration(a,o,r),mount_component(t,a,r),n=!0},p(a,[r]){const c={};r&128&&(c.$$scope={dirty:r,ctx:a}),e.$set(c);const l={};r&128&&(l.$$scope={dirty:r,ctx:a}),t.$set(l)},i(a){n||(transition_in(e.$$.fragment,a),transition_in(t.$$.fragment,a),n=!0)},o(a){transition_out(e.$$.fragment,a),transition_out(t.$$.fragment,a),n=!1},d(a){a&&detach(o),destroy_component(e,a),destroy_component(t,a)}}}const flipped=writable(!1);function instance$2(s,e,o){let t,n,a=noop;component_subscribe(s,flipped,m=>o(4,n=m)),s.$$.on_destroy.push(()=>a());const r=()=>"localStorage"in globalThis&&"dark"in localStorage,c=globalThis.matchMedia?.("(prefers-color-scheme: dark)");let{preference:l=c?.matches}=e,i=r()&&localStorage.dark==="true"!==l,{theme:_=t?"dark":"light"}=e;return c?.addEventListener("change",m=>{m.matches!==l&&(r()&&o(2,i=!i),o(0,l=m.matches))}),onMount(()=>{const m=p=>o(2,i=p.target?.checked);return tick().then(()=>{const p=document.getElementById("light-switch");p&&(p.checked=i,p.addEventListener("change",m))}),()=>document.getElementById("light-switch")?.removeEventListener("change",m)}),s.$$set=m=>{"preference"in m&&o(0,l=m.preference),"theme"in m&&o(1,_=m.theme)},s.$$.update=()=>{s.$$.dirty&5&&o(3,t=!!(+l^+i)),s.$$.dirty&12&&"localStorage"in globalThis&&(i||r())&&(localStorage.dark=t),s.$$.dirty&8&&o(1,_=t?"dark":"light"),s.$$.dirty&4&&set_store_value(flipped,n=i,n)},[l,_,i,t]}class LightSwitch extends SvelteComponent{constructor(e){super(),init(this,e,instance$2,create_fragment$2,safe_not_equal,{preference:0,theme:1})}}const get_bottom_section_slot_changes=s=>({}),get_bottom_section_slot_context=s=>({}),get_section_slot_changes=s=>({}),get_section_slot_context=s=>({}),get_bottom_slot_changes=s=>({}),get_bottom_slot_context=s=>({});function create_if_block_1(s){let e,o;return e=new Stack({props:{class:"gap-8 p-4",$$slots:{default:[create_default_slot_8]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p(t,n){const a={};n&8&&(a.$$scope={dirty:n,ctx:t}),e.$set(a)},i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot_8(s){let e,o,t,n;const a=s[2].default,r=create_slot(a,s,s[3],null);o=new Spacer({});const c=s[2].bottom,l=create_slot(c,s,s[3],get_bottom_slot_context);return{c(){r&&r.c(),e=space(),create_component(o.$$.fragment),t=space(),l&&l.c()},l(i){r&&r.l(i),e=claim_space(i),claim_component(o.$$.fragment,i),t=claim_space(i),l&&l.l(i)},m(i,_){r&&r.m(i,_),insert_hydration(i,e,_),mount_component(o,i,_),insert_hydration(i,t,_),l&&l.m(i,_),n=!0},p(i,_){r&&r.p&&(!n||_&8)&&update_slot_base(r,a,i,i[3],n?get_slot_changes(a,i[3],_,null):get_all_dirty_from_scope(i[3]),null),l&&l.p&&(!n||_&8)&&update_slot_base(l,c,i,i[3],n?get_slot_changes(c,i[3],_,get_bottom_slot_changes):get_all_dirty_from_scope(i[3]),get_bottom_slot_context)},i(i){n||(transition_in(r,i),transition_in(o.$$.fragment,i),transition_in(l,i),n=!0)},o(i){transition_out(r,i),transition_out(o.$$.fragment,i),transition_out(l,i),n=!1},d(i){i&&(detach(e),detach(t)),r&&r.d(i),destroy_component(o,i),l&&l.d(i)}}}function create_if_block$1(s){let e,o;return e=new Separator({}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot_7$1(s){let e;return{c(){e=text(s[0])},l(o){e=claim_text(o,s[0])},m(o,t){insert_hydration(o,e,t)},p(o,t){t&1&&set_data(e,o[0])},d(o){o&&detach(e)}}}function create_default_slot_6$1(s){let e;const o=s[2]["bottom-section"],t=create_slot(o,s,s[3],get_bottom_section_slot_context);return{c(){t&&t.c()},l(n){t&&t.l(n)},m(n,a){t&&t.m(n,a),e=!0},p(n,a){t&&t.p&&(!e||a&8)&&update_slot_base(t,o,n,n[3],e?get_slot_changes(o,n[3],a,get_bottom_section_slot_changes):get_all_dirty_from_scope(n[3]),get_bottom_section_slot_context)},i(n){e||(transition_in(t,n),e=!0)},o(n){transition_out(t,n),e=!1},d(n){t&&t.d(n)}}}function create_default_slot_5$1(s){let e,o,t,n,a,r,c;e=new Header({props:{sm:!0,$$slots:{default:[create_default_slot_7$1]},$$scope:{ctx:s}}});const l=s[2].section,i=create_slot(l,s,s[3],get_section_slot_context);return n=new Spacer({}),r=new Stack({props:{class:"place-items-center",$$slots:{default:[create_default_slot_6$1]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),o=space(),i&&i.c(),t=space(),create_component(n.$$.fragment),a=space(),create_component(r.$$.fragment)},l(_){claim_component(e.$$.fragment,_),o=claim_space(_),i&&i.l(_),t=claim_space(_),claim_component(n.$$.fragment,_),a=claim_space(_),claim_component(r.$$.fragment,_)},m(_,m){mount_component(e,_,m),insert_hydration(_,o,m),i&&i.m(_,m),insert_hydration(_,t,m),mount_component(n,_,m),insert_hydration(_,a,m),mount_component(r,_,m),c=!0},p(_,m){const p={};m&9&&(p.$$scope={dirty:m,ctx:_}),e.$set(p),i&&i.p&&(!c||m&8)&&update_slot_base(i,l,_,_[3],c?get_slot_changes(l,_[3],m,get_section_slot_changes):get_all_dirty_from_scope(_[3]),get_section_slot_context);const u={};m&8&&(u.$$scope={dirty:m,ctx:_}),r.$set(u)},i(_){c||(transition_in(e.$$.fragment,_),transition_in(i,_),transition_in(n.$$.fragment,_),transition_in(r.$$.fragment,_),c=!0)},o(_){transition_out(e.$$.fragment,_),transition_out(i,_),transition_out(n.$$.fragment,_),transition_out(r.$$.fragment,_),c=!1},d(_){_&&(detach(o),detach(t),detach(a)),destroy_component(e,_),i&&i.d(_),destroy_component(n,_),destroy_component(r,_)}}}function create_default_slot_4$1(s){let e,o,t,n,a,r=s[1]&&create_if_block_1(s),c=s[1]&&create_if_block$1();return n=new Stack({props:{class:"gap-1 p-4",$$slots:{default:[create_default_slot_5$1]},$$scope:{ctx:s}}}),{c(){r&&r.c(),e=space(),o=element("section"),c&&c.c(),t=space(),create_component(n.$$.fragment),this.h()},l(l){r&&r.l(l),e=claim_space(l),o=claim_element(l,"SECTION",{class:!0});var i=children(o);c&&c.l(i),t=claim_space(i),claim_component(n.$$.fragment,i),i.forEach(detach),this.h()},h(){attr(o,"class","min-w-[15rem] "+(s[1]?"hidden xl:flex":"flex"))},m(l,i){r&&r.m(l,i),insert_hydration(l,e,i),insert_hydration(l,o,i),c&&c.m(o,null),append_hydration(o,t),mount_component(n,o,null),a=!0},p(l,i){l[1]&&r.p(l,i);const _={};i&9&&(_.$$scope={dirty:i,ctx:l}),n.$set(_)},i(l){a||(transition_in(r),transition_in(c),transition_in(n.$$.fragment,l),a=!0)},o(l){transition_out(r),transition_out(c),transition_out(n.$$.fragment,l),a=!1},d(l){l&&(detach(e),detach(o)),r&&r.d(l),c&&c.d(),destroy_component(n)}}}function create_default_slot_3$1(s){let e,o,t,n,a,r,c;return o=new Logo({props:{sm:s[1]?"auto":!1}}),n=new Separator({}),r=new Stack({props:{x:!0,$$slots:{default:[create_default_slot_4$1]},$$scope:{ctx:s}}}),{c(){e=element("div"),create_component(o.$$.fragment),t=space(),create_component(n.$$.fragment),a=space(),create_component(r.$$.fragment),this.h()},l(l){e=claim_element(l,"DIV",{class:!0,"aria-hidden":!0});var i=children(e);claim_component(o.$$.fragment,i),t=claim_space(i),claim_component(n.$$.fragment,i),i.forEach(detach),a=claim_space(l),claim_component(r.$$.fragment,l),this.h()},h(){attr(e,"class","hidden w-full flex-col items-center tall:flex"),attr(e,"aria-hidden","true")},m(l,i){insert_hydration(l,e,i),mount_component(o,e,null),append_hydration(e,t),mount_component(n,e,null),insert_hydration(l,a,i),mount_component(r,l,i),c=!0},p(l,i){const _={};i&9&&(_.$$scope={dirty:i,ctx:l}),r.$set(_)},i(l){c||(transition_in(o.$$.fragment,l),transition_in(n.$$.fragment,l),transition_in(r.$$.fragment,l),c=!0)},o(l){transition_out(o.$$.fragment,l),transition_out(n.$$.fragment,l),transition_out(r.$$.fragment,l),c=!1},d(l){l&&(detach(e),detach(a)),destroy_component(o),destroy_component(n),destroy_component(r,l)}}}function create_default_slot_2$1(s){let e,o,t,n,a;return o=new Stack({props:{$$slots:{default:[create_default_slot_3$1]},$$scope:{ctx:s}}}),n=new Separator({props:{vertical:!0}}),{c(){e=element("nav"),create_component(o.$$.fragment),t=space(),create_component(n.$$.fragment),this.h()},l(r){e=claim_element(r,"NAV",{class:!0});var c=children(e);claim_component(o.$$.fragment,c),t=claim_space(c),claim_component(n.$$.fragment,c),c.forEach(detach),this.h()},h(){attr(e,"class","h-[100dvh] flex-shrink-0 overflow-y-auto overflow-x-hidden "+(s[1]?"hidden sm:flex":"flex"))},m(r,c){insert_hydration(r,e,c),mount_component(o,e,null),append_hydration(e,t),mount_component(n,e,null),a=!0},p(r,c){const l={};c&9&&(l.$$scope={dirty:c,ctx:r}),o.$set(l)},i(r){a||(transition_in(o.$$.fragment,r),transition_in(n.$$.fragment,r),a=!0)},o(r){transition_out(o.$$.fragment,r),transition_out(n.$$.fragment,r),a=!1},d(r){r&&detach(e),destroy_component(o),destroy_component(n)}}}function create_default_slot_1$1(s){let e;const o=s[2].default,t=create_slot(o,s,s[3],null);return{c(){t&&t.c()},l(n){t&&t.l(n)},m(n,a){t&&t.m(n,a),e=!0},p(n,a){t&&t.p&&(!e||a&8)&&update_slot_base(t,o,n,n[3],e?get_slot_changes(o,n[3],a,null):get_all_dirty_from_scope(n[3]),null)},i(n){e||(transition_in(t,n),e=!0)},o(n){transition_out(t,n),e=!1},d(n){t&&t.d(n)}}}function create_default_slot$1(s){let e,o,t,n,a;return o=new Separator({props:{vertical:!1}}),n=new Stack({props:{x:!0,class:"max-h-11",$$slots:{default:[create_default_slot_1$1]},$$scope:{ctx:s}}}),{c(){e=element("nav"),create_component(o.$$.fragment),t=space(),create_component(n.$$.fragment),this.h()},l(r){e=claim_element(r,"NAV",{class:!0});var c=children(e);claim_component(o.$$.fragment,c),t=claim_space(c),claim_component(n.$$.fragment,c),c.forEach(detach),this.h()},h(){attr(e,"class","h-12 w-full flex-col justify-between bg-surface-200 backdrop-blur-md "+(s[1]?"flex sm:hidden":"hidden"))},m(r,c){insert_hydration(r,e,c),mount_component(o,e,null),append_hydration(e,t),mount_component(n,e,null),a=!0},p(r,c){const l={};c&8&&(l.$$scope={dirty:c,ctx:r}),n.$set(l)},i(r){a||(transition_in(o.$$.fragment,r),transition_in(n.$$.fragment,r),a=!0)},o(r){transition_out(o.$$.fragment,r),transition_out(n.$$.fragment,r),a=!1},d(r){r&&detach(e),destroy_component(o),destroy_component(n)}}}function create_fragment$1(s){let e,o,t,n;return e=new Portal({props:{to:"left",$$slots:{default:[create_default_slot_2$1]},$$scope:{ctx:s}}}),t=new Portal({props:{to:"bottom",$$slots:{default:[create_default_slot$1]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),o=space(),create_component(t.$$.fragment)},l(a){claim_component(e.$$.fragment,a),o=claim_space(a),claim_component(t.$$.fragment,a)},m(a,r){mount_component(e,a,r),insert_hydration(a,o,r),mount_component(t,a,r),n=!0},p(a,[r]){const c={};r&9&&(c.$$scope={dirty:r,ctx:a}),e.$set(c);const l={};r&8&&(l.$$scope={dirty:r,ctx:a}),t.$set(l)},i(a){n||(transition_in(e.$$.fragment,a),transition_in(t.$$.fragment,a),n=!0)},o(a){transition_out(e.$$.fragment,a),transition_out(t.$$.fragment,a),n=!1},d(a){a&&detach(o),destroy_component(e,a),destroy_component(t,a)}}}function instance$1(s,e,o){let{$$slots:t={},$$scope:n}=e;const a=compute_slots(t);let{section:r}=e,c=a.default;return s.$$set=l=>{"section"in l&&o(0,r=l.section),"$$scope"in l&&o(3,n=l.$$scope)},[r,c,t,n]}class Nav extends SvelteComponent{constructor(e){super(),init(this,e,instance$1,create_fragment$1,safe_not_equal,{section:0})}}function get_each_context(s,e,o){const t=s.slice();return t[13]=e[o][0],t[14]=e[o][1],t[15]=e[o][2],t[16]=e[o][3],t}function get_each_context_2(s,e,o){const t=s.slice();return t[19]=e[o],t}function get_each_context_1(s,e,o){const t=s.slice();return t[19]=e[o],t}function create_default_slot_7(s){let e,o=s[19]+"",t,n,a;return e=new Icon({props:{md:!0,name:s[5][s[19]]}}),{c(){create_component(e.$$.fragment),t=text(o),n=space()},l(r){claim_component(e.$$.fragment,r),t=claim_text(r,o),n=claim_space(r)},m(r,c){mount_component(e,r,c),insert_hydration(r,t,c),insert_hydration(r,n,c),a=!0},p:noop,i(r){a||(transition_in(e.$$.fragment,r),a=!0)},o(r){transition_out(e.$$.fragment,r),a=!1},d(r){r&&(detach(t),detach(n)),destroy_component(e,r)}}}function create_each_block_2(s){let e,o;return e=new Button({props:{air:!0,compact:!0,stretch:!0,primary:s[19]===s[1],href:s[7](s[19]),$$slots:{default:[create_default_slot_7]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment)},l(t){claim_component(e.$$.fragment,t)},m(t,n){mount_component(e,t,n),o=!0},p(t,n){const a={};n&2&&(a.primary=t[19]===t[1]),n&2048&&(a.$$scope={dirty:n,ctx:t}),e.$set(a)},i(t){o||(transition_in(e.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),o=!1},d(t){destroy_component(e,t)}}}function create_default_slot_6(s){let e,o,t=ensure_array_like(Object.keys(s[6])),n=[];for(let r=0;rtransition_out(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;ri[1]+i[19];for(let i=0;i{l=null}),check_outros())},i(i){if(!a){for(let _=0;_bind(o,"value",p)),a=new LightSwitch({});const d=s[9].default,$=create_slot(d,s,s[11],null);return{c(){e=element("div"),create_component(o.$$.fragment),n=space(),create_component(a.$$.fragment),r=space(),c=element("div"),$&&$.c(),this.h()},l(f){e=claim_element(f,"DIV",{class:!0});var g=children(e);claim_component(o.$$.fragment,g),n=claim_space(g),claim_component(a.$$.fragment,g),g.forEach(detach),r=claim_space(f),c=claim_element(f,"DIV",{class:!0});var k=children(c);$&&$.l(k),k.forEach(detach),this.h()},h(){attr(e,"class","hidden gap-16 p-[21px] pb-0 sm:flex"),attr(c,"class",l="relative h-full scroll-smooth "+(s[0].route.id=="/library"?"overflow-hidden":"overflow-y-auto"))},m(f,g){insert_hydration(f,e,g),mount_component(o,e,null),append_hydration(e,n),mount_component(a,e,null),insert_hydration(f,r,g),insert_hydration(f,c,g),$&&$.m(c,null),i=!0,_||(m=action_destroyer(autoscroll.call(null,c)),_=!0)},p(f,g){const k={};g&2048&&(k.$$scope={dirty:g,ctx:f}),!t&&g&4&&(t=!0,k.value=f[2],add_flush_callback(()=>t=!1)),o.$set(k),$&&$.p&&(!i||g&2048)&&update_slot_base($,d,f,f[11],i?get_slot_changes(d,f[11],g,null):get_all_dirty_from_scope(f[11]),null),(!i||g&1&&l!==(l="relative h-full scroll-smooth "+(f[0].route.id=="/library"?"overflow-hidden":"overflow-y-auto")))&&attr(c,"class",l)},i(f){i||(transition_in(o.$$.fragment,f),transition_in(a.$$.fragment,f),transition_in($,f),i=!0)},o(f){transition_out(o.$$.fragment,f),transition_out(a.$$.fragment,f),transition_out($,f),i=!1},d(f){f&&(detach(e),detach(r),detach(c)),destroy_component(o),destroy_component(a),$&&$.d(f),_=!1,m()}}}function create_default_slot(s){let e,o,t,n;return e=new Nav({props:{section:s[1],$$slots:{bottom:[create_bottom_slot],section:[create_section_slot],default:[create_default_slot_6]},$$scope:{ctx:s}}}),o=new Player({}),t=new Stack({props:{class:"h-[100dvh] max-h-[100dvh] max-w-[100dvw]",$$slots:{default:[create_default_slot_1]},$$scope:{ctx:s}}}),{c(){create_component(e.$$.fragment),create_component(o.$$.fragment),create_component(t.$$.fragment)},l(a){claim_component(e.$$.fragment,a),claim_component(o.$$.fragment,a),claim_component(t.$$.fragment,a)},m(a,r){mount_component(e,a,r),mount_component(o,a,r),mount_component(t,a,r),n=!0},p(a,r){const c={};r&2&&(c.section=a[1]),r&2058&&(c.$$scope={dirty:r,ctx:a}),e.$set(c);const l={};r&2053&&(l.$$scope={dirty:r,ctx:a}),t.$set(l)},i(a){n||(transition_in(e.$$.fragment,a),transition_in(o.$$.fragment,a),transition_in(t.$$.fragment,a),n=!0)},o(a){transition_out(e.$$.fragment,a),transition_out(o.$$.fragment,a),transition_out(t.$$.fragment,a),n=!1},d(a){destroy_component(e,a),destroy_component(o,a),destroy_component(t,a)}}}function create_each_block(s){let e;return{c(){e=element("link"),this.h()},l(o){e=claim_element(o,"LINK",{rel:!0,media:!0,href:!0}),this.h()},h(){attr(e,"rel","apple-touch-startup-image"),attr(e,"media","(device-width: "+s[13]+"px) and (device-height: "+s[14]+"px) and (-webkit-device-pixel-ratio: "+s[15]+")"),attr(e,"href",base+"/images/splash-"+s[16]+".webp")},m(o,t){insert_hydration(o,e,t)},p:noop,d(o){o&&detach(e)}}}function create_fragment(s){let e,o,t,n,a,r,c;e=new Wrapper({props:{$$slots:{default:[create_default_slot]},$$scope:{ctx:s}}});let l=ensure_array_like(s[4]),i=[];for(let _=0;_o(2,n=f)),component_subscribe(s,extra,f=>o(3,a=f)),component_subscribe(s,page,f=>o(0,r=f));let{$$slots:c={},$$scope:l}=e;const i=[[320,568,2,"5"],[375,667,2,"8"],[375,812,3,"x"],[414,736,3,"plus"]],_={Home:"house",Feed:"activity",Library:"note",Explore:"compass",Playlists:"last",Artists:"people",Timeline:"clock",Tracks:"note",Albums:"disk",Listened:"history",Recommended:"stars",Following:"people"},m={Recommended:"/home/playlist#-2",Listened:"/home/playlist#-1"},p={Home:["Feed","Following","Listened","Recommended"],Library:["Playlists","Artists","Timeline"],Explore:["Tracks","Artists","Albums"]};function u(f){if(f in m)return m[f];if(f in p)return`/${f.toLowerCase()}`;if(t!=="Explore")return`${u(t)}#${f.toLowerCase()}`}function d(f){if(t==="Explore")return f.toLowerCase()}beforeNavigate(({from:f,to:g})=>{f?.url.pathname!==g?.url.pathname&&(set_store_value(extra,a=null,a),set_store_value(search,n="",n))}),onMount(()=>{preloadData("/home"),preloadData("/home/playlist"),preloadData("/library"),preloadData("/library/playlist"),preloadData("/library/artist"),preloadData("/explore")});function $(f){n=f,search.set(n)}return s.$$set=f=>{"$$scope"in f&&o(11,l=f.$$scope)},s.$$.update=()=>{s.$$.dirty&1&&o(1,t=capitalize(r.route.id?.split("/")?.[1]||"home"))},[r,t,n,a,i,_,p,u,d,c,$,l]}class Layout extends SvelteComponent{constructor(e){super(),init(this,e,instance,create_fragment,safe_not_equal,{})}}export{Layout as component,_layout as universal}; diff --git a/_app/immutable/nodes/1.hmCh84a7.js b/_app/immutable/nodes/1.THNaTtoM.js similarity index 91% rename from _app/immutable/nodes/1.hmCh84a7.js rename to _app/immutable/nodes/1.THNaTtoM.js index 62e8f71a..0f8ddf68 100644 --- a/_app/immutable/nodes/1.hmCh84a7.js +++ b/_app/immutable/nodes/1.THNaTtoM.js @@ -1 +1 @@ -import{s as b,f,l as u,a as x,g as h,h as d,m as v,d as l,c as S,i as c,u as g,n as E,G as $,v as q}from"../chunks/scheduler.yhBzS9E6.js";import{S as y,i as C}from"../chunks/index.f7836kWu.js";import{p as G}from"../chunks/stores.jWdOIcrH.js";function H(i){let a,s=i[0].status+"",r,o,n,p=i[0].error?.message+"",m;return{c(){a=f("h1"),r=u(s),o=x(),n=f("p"),m=u(p)},l(e){a=h(e,"H1",{});var t=d(a);r=v(t,s),t.forEach(l),o=S(e),n=h(e,"P",{});var _=d(n);m=v(_,p),_.forEach(l)},m(e,t){c(e,a,t),g(a,r),c(e,o,t),c(e,n,t),g(n,m)},p(e,[t]){t&1&&s!==(s=e[0].status+"")&&E(r,s),t&1&&p!==(p=e[0].error?.message+"")&&E(m,p)},i:$,o:$,d(e){e&&(l(a),l(o),l(n))}}}function P(i,a,s){let r;return q(i,G,o=>s(0,r=o)),[r]}class z extends y{constructor(a){super(),C(this,a,P,H,b,{})}}export{z as component}; +import{s as b,f,l as u,a as x,g as h,h as d,m as v,d as l,c as S,i as c,u as g,n as E,G as $,v as q}from"../chunks/scheduler.yhBzS9E6.js";import{S as y,i as C}from"../chunks/index.f7836kWu.js";import{p as G}from"../chunks/stores.iu7Qu9dF.js";function H(i){let a,s=i[0].status+"",r,o,n,p=i[0].error?.message+"",m;return{c(){a=f("h1"),r=u(s),o=x(),n=f("p"),m=u(p)},l(e){a=h(e,"H1",{});var t=d(a);r=v(t,s),t.forEach(l),o=S(e),n=h(e,"P",{});var _=d(n);m=v(_,p),_.forEach(l)},m(e,t){c(e,a,t),g(a,r),c(e,o,t),c(e,n,t),g(n,m)},p(e,[t]){t&1&&s!==(s=e[0].status+"")&&E(r,s),t&1&&p!==(p=e[0].error?.message+"")&&E(m,p)},i:$,o:$,d(e){e&&(l(a),l(o),l(n))}}}function P(i,a,s){let r;return q(i,G,o=>s(0,r=o)),[r]}class z extends y{constructor(a){super(),C(this,a,P,H,b,{})}}export{z as component}; diff --git a/_app/immutable/nodes/10.E6IsHE3D.js b/_app/immutable/nodes/10.rMwDKcDJ.js similarity index 89% rename from _app/immutable/nodes/10.E6IsHE3D.js rename to _app/immutable/nodes/10.rMwDKcDJ.js index 6d115297..5cb3d3d0 100644 --- a/_app/immutable/nodes/10.E6IsHE3D.js +++ b/_app/immutable/nodes/10.rMwDKcDJ.js @@ -1 +1 @@ -import{s as B,p as I,a as q,c as v,r as z,d as y,i as E,K as F,v as h,F as G,G as C}from"../chunks/scheduler.yhBzS9E6.js";import{S as K,i as P,f as j,b as p,d as m,m as $,a as d,t as _,e as g}from"../chunks/index.f7836kWu.js";import{B as D,I as S}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"../chunks/paths.k6rcf9P1.js";import{p as H}from"../chunks/stores.jWdOIcrH.js";import{a as w,l as k,p as J}from"../chunks/Track.LR7rfYB8.js";import{C as L}from"../chunks/Collection.NWTCPfm4.js";function M(a){let t,n;return t=new S({props:{name:"trash"}}),{c(){p(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,o){$(t,e,o),n=!0},p:C,i(e){n||(d(t.$$.fragment,e),n=!0)},o(e){_(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function N(a){let t,n;return t=new D({props:{air:!0,stretch:!0,$$slots:{default:[M]},$$scope:{ctx:a}}}),t.$on("click",a[3]),{c(){p(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,o){$(t,e,o),n=!0},p(e,o){const l={};o&256&&(l.$$scope={dirty:o,ctx:e}),t.$set(l)},i(e){n||(d(t.$$.fragment,e),n=!0)},o(e){_(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function O(a){let t,n;return t=new S({props:{name:"last",slot:"action"}}),{c(){p(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,o){$(t,e,o),n=!0},p:C,i(e){n||(d(t.$$.fragment,e),n=!0)},o(e){_(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function Q(a){let t,n,e,o,l;function f(r){a[6](r)}let c={of:a[0],style:"playlist",$$slots:{action:[O],default:[N]},$$scope:{ctx:a}};return a[1]!==void 0&&(c.selected=a[1]),t=new L({props:c}),I.push(()=>j(t,"selected",f)),t.$on("edit",a[2]),document.title=o=(a[0]?`${a[0].title} - `:"")+"Amadeus",{c(){p(t.$$.fragment),e=q()},l(r){m(t.$$.fragment,r),e=v(r),z("svelte-pttznx",document.head).forEach(y)},m(r,i){$(t,r,i),E(r,e,i),l=!0},p(r,[i]){const u={};i&1&&(u.of=r[0]),i&256&&(u.$$scope={dirty:i,ctx:r}),!n&&i&2&&(n=!0,u.selected=r[1],F(()=>n=!1)),t.$set(u),(!l||i&1)&&o!==(o=(r[0]?`${r[0].title} - `:"")+"Amadeus")&&(document.title=o)},i(r){l||(d(t.$$.fragment,r),l=!0)},o(r){_(t.$$.fragment,r),l=!1},d(r){r&&y(e),g(t,r)}}}function R(a,t,n){let e,o,l,f;h(a,w,s=>n(7,o=s)),h(a,H,s=>n(4,l=s)),h(a,J,s=>n(5,f=s));let c=new Set;function r({detail:{action:s,after:A,item:b}}){b.entry&&s==="rearrange"&&k.rearrange(b.entry,A?.entry)}function i(){k.purge([...c].map(s=>s.entry).filter(s=>!!s)),c.clear(),n(1,c)}function u(s){c=s,n(1,c)}return a.$$.update=()=>{a.$$.dirty&48&&n(0,e=f.find(s=>s.id===+l.url.hash.slice(1))),a.$$.dirty&1&&G(w,o=e?[e.title,"disk"]:null,o)},[e,c,r,i,l,f,u]}class x extends K{constructor(t){super(),P(this,t,R,Q,B,{})}}export{x as component}; +import{s as B,p as I,a as q,c as v,r as z,d as y,i as E,K as F,v as h,F as G,G as C}from"../chunks/scheduler.yhBzS9E6.js";import{S as K,i as P,f as j,b as p,d as m,m as $,a as d,t as _,e as g}from"../chunks/index.f7836kWu.js";import{B as D,I as S}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"../chunks/paths.G112lh3q.js";import{p as H}from"../chunks/stores.iu7Qu9dF.js";import{a as w,l as k,p as J}from"../chunks/Track.oiOqwbPY.js";import{C as L}from"../chunks/Collection.skwpo2VZ.js";function M(a){let t,n;return t=new S({props:{name:"trash"}}),{c(){p(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,o){$(t,e,o),n=!0},p:C,i(e){n||(d(t.$$.fragment,e),n=!0)},o(e){_(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function N(a){let t,n;return t=new D({props:{air:!0,stretch:!0,$$slots:{default:[M]},$$scope:{ctx:a}}}),t.$on("click",a[3]),{c(){p(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,o){$(t,e,o),n=!0},p(e,o){const l={};o&256&&(l.$$scope={dirty:o,ctx:e}),t.$set(l)},i(e){n||(d(t.$$.fragment,e),n=!0)},o(e){_(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function O(a){let t,n;return t=new S({props:{name:"last",slot:"action"}}),{c(){p(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,o){$(t,e,o),n=!0},p:C,i(e){n||(d(t.$$.fragment,e),n=!0)},o(e){_(t.$$.fragment,e),n=!1},d(e){g(t,e)}}}function Q(a){let t,n,e,o,l;function f(r){a[6](r)}let c={of:a[0],style:"playlist",$$slots:{action:[O],default:[N]},$$scope:{ctx:a}};return a[1]!==void 0&&(c.selected=a[1]),t=new L({props:c}),I.push(()=>j(t,"selected",f)),t.$on("edit",a[2]),document.title=o=(a[0]?`${a[0].title} - `:"")+"Amadeus",{c(){p(t.$$.fragment),e=q()},l(r){m(t.$$.fragment,r),e=v(r),z("svelte-pttznx",document.head).forEach(y)},m(r,i){$(t,r,i),E(r,e,i),l=!0},p(r,[i]){const u={};i&1&&(u.of=r[0]),i&256&&(u.$$scope={dirty:i,ctx:r}),!n&&i&2&&(n=!0,u.selected=r[1],F(()=>n=!1)),t.$set(u),(!l||i&1)&&o!==(o=(r[0]?`${r[0].title} - `:"")+"Amadeus")&&(document.title=o)},i(r){l||(d(t.$$.fragment,r),l=!0)},o(r){_(t.$$.fragment,r),l=!1},d(r){r&&y(e),g(t,r)}}}function R(a,t,n){let e,o,l,f;h(a,w,s=>n(7,o=s)),h(a,H,s=>n(4,l=s)),h(a,J,s=>n(5,f=s));let c=new Set;function r({detail:{action:s,after:A,item:b}}){b.entry&&s==="rearrange"&&k.rearrange(b.entry,A?.entry)}function i(){k.purge([...c].map(s=>s.entry).filter(s=>!!s)),c.clear(),n(1,c)}function u(s){c=s,n(1,c)}return a.$$.update=()=>{a.$$.dirty&48&&n(0,e=f.find(s=>s.id===+l.url.hash.slice(1))),a.$$.dirty&1&&G(w,o=e?[e.title,"disk"]:null,o)},[e,c,r,i,l,f,u]}class x extends K{constructor(t){super(),P(this,t,R,Q,B,{})}}export{x as component}; diff --git a/_app/immutable/nodes/11.RfDk6xuo.js b/_app/immutable/nodes/11.wOQFq_L3.js similarity index 94% rename from _app/immutable/nodes/11.RfDk6xuo.js rename to _app/immutable/nodes/11.wOQFq_L3.js index 6f2d4937..5c205397 100644 --- a/_app/immutable/nodes/11.RfDk6xuo.js +++ b/_app/immutable/nodes/11.wOQFq_L3.js @@ -1 +1 @@ -import{s as D,a as S,c as k,r as F,d as c,i as m,l as y,m as z,p as E,K as L}from"../chunks/scheduler.yhBzS9E6.js";import{S as G,i as J,b as _,d as g,m as d,a as h,t as v,e as w,f as P}from"../chunks/index.f7836kWu.js";import{H as M,S as N,B as O}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"../chunks/paths.k6rcf9P1.js";import{I as T}from"../chunks/Input.hoDY5QId.js";function Q(r){let e;return{c(){e=y("Connect")},l(s){e=z(s,"Connect")},m(s,a){m(s,e,a)},d(s){s&&c(e)}}}function R(r){let e;return{c(){e=y("Login")},l(s){e=z(s,"Login")},m(s,a){m(s,e,a)},d(s){s&&c(e)}}}function V(r){let e,s,a,u,p,n,o,f,$,i,b;function C(t){r[4](t)}let A={placeholder:"Hostname"};r[0]!==void 0&&(A.value=r[0]),e=new T({props:A}),E.push(()=>P(e,"value",C));function I(t){r[5](t)}let H={placeholder:"Username"};r[1]!==void 0&&(H.value=r[1]),u=new T({props:H}),E.push(()=>P(u,"value",I));function B(t){r[6](t)}let U={placeholder:"Password"};return r[2]!==void 0&&(U.value=r[2]),o=new T({props:U}),E.push(()=>P(o,"value",B)),i=new O({props:{primary:!0,stretch:!0,$$slots:{default:[R]},$$scope:{ctx:r}}}),i.$on("click",r[3]),{c(){_(e.$$.fragment),a=S(),_(u.$$.fragment),n=S(),_(o.$$.fragment),$=S(),_(i.$$.fragment)},l(t){g(e.$$.fragment,t),a=k(t),g(u.$$.fragment,t),n=k(t),g(o.$$.fragment,t),$=k(t),g(i.$$.fragment,t)},m(t,l){d(e,t,l),m(t,a,l),d(u,t,l),m(t,n,l),d(o,t,l),m(t,$,l),d(i,t,l),b=!0},p(t,l){const j={};!s&&l&1&&(s=!0,j.value=t[0],L(()=>s=!1)),e.$set(j);const q={};!p&&l&2&&(p=!0,q.value=t[1],L(()=>p=!1)),u.$set(q);const K={};!f&&l&4&&(f=!0,K.value=t[2],L(()=>f=!1)),o.$set(K);const W={};l&128&&(W.$$scope={dirty:l,ctx:t}),i.$set(W)},i(t){b||(h(e.$$.fragment,t),h(u.$$.fragment,t),h(o.$$.fragment,t),h(i.$$.fragment,t),b=!0)},o(t){v(e.$$.fragment,t),v(u.$$.fragment,t),v(o.$$.fragment,t),v(i.$$.fragment,t),b=!1},d(t){t&&(c(a),c(n),c($)),w(e,t),w(u,t),w(o,t),w(i,t)}}}function X(r){let e,s,a,u,p;return e=new M({props:{indent:!0,xl:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),a=new N({props:{class:"gap-2 p-4",$$slots:{default:[V]},$$scope:{ctx:r}}}),{c(){_(e.$$.fragment),s=S(),_(a.$$.fragment),u=S(),this.h()},l(n){g(e.$$.fragment,n),s=k(n),g(a.$$.fragment,n),u=k(n),F("svelte-w67gop",document.head).forEach(c),this.h()},h(){document.title="Settings - Amadeus"},m(n,o){d(e,n,o),m(n,s,o),d(a,n,o),m(n,u,o),p=!0},p(n,[o]){const f={};o&128&&(f.$$scope={dirty:o,ctx:n}),e.$set(f);const $={};o&135&&($.$$scope={dirty:o,ctx:n}),a.$set($)},i(n){p||(h(e.$$.fragment,n),h(a.$$.fragment,n),p=!0)},o(n){v(e.$$.fragment,n),v(a.$$.fragment,n),p=!1},d(n){n&&(c(s),c(u)),w(e,n),w(a,n)}}}function Y(r){return crypto.subtle.digest("SHA-1",new TextEncoder().encode(r)).then(e=>Array.from(new Uint8Array(e))).then(e=>e.map(s=>s.toString(16).padStart(2,"0")).join(""))}function Z(r,e,s){let a="",u="",p="";async function n(){const i=await Y(p),C=["ws:","wss:","http:","https:"].find(B=>a.startsWith(B))||globalThis.location?.protocol,A=["ws:","http:"].includes(C)?"ws:":"wss:",I=a.replace(/^\w+:\/\//,""),H=`${A}//${I}/trpc/${u}/${i}`;localStorage.setItem("remote",H),location.href="/home"}function o(i){a=i,s(0,a)}function f(i){u=i,s(1,u)}function $(i){p=i,s(2,p)}return[a,u,p,n,o,f,$]}class at extends G{constructor(e){super(),J(this,e,Z,X,D,{})}}export{at as component}; +import{s as D,a as S,c as k,r as F,d as c,i as m,l as y,m as z,p as E,K as L}from"../chunks/scheduler.yhBzS9E6.js";import{S as G,i as J,b as _,d as g,m as d,a as h,t as v,e as w,f as P}from"../chunks/index.f7836kWu.js";import{H as M,S as N,B as O}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"../chunks/paths.G112lh3q.js";import{I as T}from"../chunks/Input.UuPw_Vot.js";function Q(r){let e;return{c(){e=y("Connect")},l(s){e=z(s,"Connect")},m(s,a){m(s,e,a)},d(s){s&&c(e)}}}function R(r){let e;return{c(){e=y("Login")},l(s){e=z(s,"Login")},m(s,a){m(s,e,a)},d(s){s&&c(e)}}}function V(r){let e,s,a,u,p,n,o,f,$,i,b;function C(t){r[4](t)}let A={placeholder:"Hostname"};r[0]!==void 0&&(A.value=r[0]),e=new T({props:A}),E.push(()=>P(e,"value",C));function I(t){r[5](t)}let H={placeholder:"Username"};r[1]!==void 0&&(H.value=r[1]),u=new T({props:H}),E.push(()=>P(u,"value",I));function B(t){r[6](t)}let U={placeholder:"Password"};return r[2]!==void 0&&(U.value=r[2]),o=new T({props:U}),E.push(()=>P(o,"value",B)),i=new O({props:{primary:!0,stretch:!0,$$slots:{default:[R]},$$scope:{ctx:r}}}),i.$on("click",r[3]),{c(){_(e.$$.fragment),a=S(),_(u.$$.fragment),n=S(),_(o.$$.fragment),$=S(),_(i.$$.fragment)},l(t){g(e.$$.fragment,t),a=k(t),g(u.$$.fragment,t),n=k(t),g(o.$$.fragment,t),$=k(t),g(i.$$.fragment,t)},m(t,l){d(e,t,l),m(t,a,l),d(u,t,l),m(t,n,l),d(o,t,l),m(t,$,l),d(i,t,l),b=!0},p(t,l){const j={};!s&&l&1&&(s=!0,j.value=t[0],L(()=>s=!1)),e.$set(j);const q={};!p&&l&2&&(p=!0,q.value=t[1],L(()=>p=!1)),u.$set(q);const K={};!f&&l&4&&(f=!0,K.value=t[2],L(()=>f=!1)),o.$set(K);const W={};l&128&&(W.$$scope={dirty:l,ctx:t}),i.$set(W)},i(t){b||(h(e.$$.fragment,t),h(u.$$.fragment,t),h(o.$$.fragment,t),h(i.$$.fragment,t),b=!0)},o(t){v(e.$$.fragment,t),v(u.$$.fragment,t),v(o.$$.fragment,t),v(i.$$.fragment,t),b=!1},d(t){t&&(c(a),c(n),c($)),w(e,t),w(u,t),w(o,t),w(i,t)}}}function X(r){let e,s,a,u,p;return e=new M({props:{indent:!0,xl:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),a=new N({props:{class:"gap-2 p-4",$$slots:{default:[V]},$$scope:{ctx:r}}}),{c(){_(e.$$.fragment),s=S(),_(a.$$.fragment),u=S(),this.h()},l(n){g(e.$$.fragment,n),s=k(n),g(a.$$.fragment,n),u=k(n),F("svelte-w67gop",document.head).forEach(c),this.h()},h(){document.title="Settings - Amadeus"},m(n,o){d(e,n,o),m(n,s,o),d(a,n,o),m(n,u,o),p=!0},p(n,[o]){const f={};o&128&&(f.$$scope={dirty:o,ctx:n}),e.$set(f);const $={};o&135&&($.$$scope={dirty:o,ctx:n}),a.$set($)},i(n){p||(h(e.$$.fragment,n),h(a.$$.fragment,n),p=!0)},o(n){v(e.$$.fragment,n),v(a.$$.fragment,n),p=!1},d(n){n&&(c(s),c(u)),w(e,n),w(a,n)}}}function Y(r){return crypto.subtle.digest("SHA-1",new TextEncoder().encode(r)).then(e=>Array.from(new Uint8Array(e))).then(e=>e.map(s=>s.toString(16).padStart(2,"0")).join(""))}function Z(r,e,s){let a="",u="",p="";async function n(){const i=await Y(p),C=["ws:","wss:","http:","https:"].find(B=>a.startsWith(B))||globalThis.location?.protocol,A=["ws:","http:"].includes(C)?"ws:":"wss:",I=a.replace(/^\w+:\/\//,""),H=`${A}//${I}/trpc/${u}/${i}`;localStorage.setItem("remote",H),location.href="/home"}function o(i){a=i,s(0,a)}function f(i){u=i,s(1,u)}function $(i){p=i,s(2,p)}return[a,u,p,n,o,f,$]}class at extends G{constructor(e){super(),J(this,e,Z,X,D,{})}}export{at as component}; diff --git a/_app/immutable/nodes/3.8QmKai-d.js b/_app/immutable/nodes/3.JaftQo5l.js similarity index 97% rename from _app/immutable/nodes/3.8QmKai-d.js rename to _app/immutable/nodes/3.JaftQo5l.js index 399339a5..a44a86ef 100644 --- a/_app/immutable/nodes/3.8QmKai-d.js +++ b/_app/immutable/nodes/3.JaftQo5l.js @@ -1 +1 @@ -import{s as W,w as me,f as D,a as S,l as z,g as V,h as j,c as I,d,r as fe,m as T,j as L,k as G,i as w,u as A,x as pe,y as _e,z as ge,v as N,A as de,L as he,M as oe,e as X,I as be,G as F,n as ve,p as Z,K as x,F as ke}from"../chunks/scheduler.yhBzS9E6.js";import{S as K,i as M,a as _,t as g,b as h,d as b,m as v,e as k,g as O,c as P,f as ee}from"../chunks/index.f7836kWu.js";import{u as we,S as ue,H as B,B as C,I as R,d as ye}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import{h as Q,e as te,p as Ee,l as Se,P as Ie,b as ze,d as Y,t as Te,f as Ae,g as qe,s as J,W as De}from"../chunks/Track.LR7rfYB8.js";import{w as Ve}from"../chunks/paths.k6rcf9P1.js";import{n as je,p as He}from"../chunks/stores.jWdOIcrH.js";import{I as Le}from"../chunks/Input.hoDY5QId.js";import{S as Ne,T as ie,a as Ce}from"../chunks/Player.J8CE-V80.js";import{T as Oe}from"../chunks/util.VvTXxVpP.js";import{m as Pe}from"../chunks/stream.M_jKrRc6.js";import{O as $e}from"../chunks/Overview.T1RnAS_v.js";import{S as Be}from"../chunks/Spacer.tcMPZ3eG.js";function Ge(a){let e,r,t,l=`calc((100% - ${.5*(a[1]-1)+.25}rem) / ${a[1]})`,f="calc(100% - 0.25rem)",o,s=`repeat(${a[1]}, minmax(0, 1fr))`,n,$,c,u;const m=a[9].default,i=me(m,a,a[8],null);return{c(){e=D("div"),i&&i.c(),r=S(),t=D("div"),n=S(),$=D("style"),c=z(a[5]),this.h()},l(p){e=V(p,"DIV",{id:!0,class:!0});var E=j(e);i&&i.l(E),r=I(E),t=V(E,"DIV",{class:!0}),j(t).forEach(d),E.forEach(d),n=I(p);const q=fe("svelte-1hzlque",document.head);$=V(q,"STYLE",{});var H=j($);c=T(H,a[5]),H.forEach(d),q.forEach(d),this.h()},h(){L(t,"class","pointer-events-none absolute left-0.5 top-0.5 -z-10 rounded-md bg-primary-600 transition-transform"),G(t,"width",l),G(t,"height",f),L(e,"id",a[2]),L(e,"class",o="relative z-10 grid min-w-max touch-manipulation justify-around justify-items-center gap-2 rounded-lg p-0.5 outline-2 outline-offset-2 outline-primary-600 [&:has(input:focus-visible)]:outline "+(a[0]?"w-full":"w-max")+" "+(a[4]?"":"bg-highlight")),G(e,"grid-template-columns",s)},m(p,E){w(p,e,E),i&&i.m(e,null),A(e,r),A(e,t),w(p,n,E),A(document.head,$),A($,c),u=!0},p(p,[E]){i&&i.p&&(!u||E&256)&&pe(i,m,p,p[8],u?ge(m,p[8],E,null):_e(p[8]),null),E&2&&l!==(l=`calc((100% - ${.5*(p[1]-1)+.25}rem) / ${p[1]})`)&&G(t,"width",l),(!u||E&1&&o!==(o="relative z-10 grid min-w-max touch-manipulation justify-around justify-items-center gap-2 rounded-lg p-0.5 outline-2 outline-offset-2 outline-primary-600 [&:has(input:focus-visible)]:outline "+(p[0]?"w-full":"w-max")+" "+(p[4]?"":"bg-highlight")))&&L(e,"class",o),E&2&&s!==(s=`repeat(${p[1]}, minmax(0, 1fr))`)&&G(e,"grid-template-columns",s)},i(p){u||(_(i,p),u=!0)},o(p){g(i,p),u=!1},d(p){p&&(d(e),d(n)),i&&i.d(p),d($)}}}function We(a,e,r){let t,{$$slots:l={},$$scope:f}=e,{stretch:o=!1}=e,{size:s}=e,{value:n=0}=e;const $=we(),c=Ve(n);N(a,c,i=>r(7,t=i));const u=!!de("panel");he("group",{id:$,size:s,value:c,i:0});const m=Array.from({length:s}).map((i,p)=>`#${$} :has([name="${$}"]:checked):nth-last-of-type(${p+1})~div:last-child{transform:translateX(calc(${(s-p-1)*100}% + ${(s-p-1)*8}px));}`).join("");return a.$$set=i=>{"stretch"in i&&r(0,o=i.stretch),"size"in i&&r(1,s=i.size),"value"in i&&r(6,n=i.value),"$$scope"in i&&r(8,f=i.$$scope)},a.$$.update=()=>{a.$$.dirty&128&&r(6,n=t),a.$$.dirty&64&&c.set(n)},[o,s,$,c,u,m,n,t,f,l]}class Fe extends K{constructor(e){super(),M(this,e,We,Ge,W,{stretch:0,size:1,value:6})}}function re(a){let e,r,t,l,f;return r=new B({props:{sm:!0,$$slots:{default:[Ke]},$$scope:{ctx:a}}}),l=new $e({props:{style:a[0],of:a[1]}}),{c(){e=D("div"),h(r.$$.fragment),t=S(),h(l.$$.fragment)},l(o){e=V(o,"DIV",{});var s=j(e);b(r.$$.fragment,s),t=I(s),b(l.$$.fragment,s),s.forEach(d)},m(o,s){w(o,e,s),v(r,e,null),A(e,t),v(l,e,null),f=!0},p(o,s){const n={};s&16&&(n.$$scope={dirty:s,ctx:o}),r.$set(n);const $={};s&1&&($.style=o[0]),s&2&&($.of=o[1]),l.$set($)},i(o){f||(_(r.$$.fragment,o),_(l.$$.fragment,o),f=!0)},o(o){g(r.$$.fragment,o),g(l.$$.fragment,o),f=!1},d(o){o&&d(e),k(r),k(l)}}}function Ke(a){let e;return{c(){e=z("Library")},l(r){e=T(r,"Library")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function Me(a){let e;return{c(){e=z("Search")},l(r){e=T(r,"Search")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function Re(a){let e,r,t,l,f,o,s=a[1].length&&re(a);return t=new B({props:{sm:!0,$$slots:{default:[Me]},$$scope:{ctx:a}}}),f=new $e({props:{style:a[0],of:a[2],href:"/explore"}}),f.$on("end",a[3]),{c(){s&&s.c(),e=S(),r=D("div"),h(t.$$.fragment),l=S(),h(f.$$.fragment)},l(n){s&&s.l(n),e=I(n),r=V(n,"DIV",{});var $=j(r);b(t.$$.fragment,$),l=I($),b(f.$$.fragment,$),$.forEach(d)},m(n,$){s&&s.m(n,$),w(n,e,$),w(n,r,$),v(t,r,null),A(r,l),v(f,r,null),o=!0},p(n,$){n[1].length?s?(s.p(n,$),$&2&&_(s,1)):(s=re(n),s.c(),_(s,1),s.m(e.parentNode,e)):s&&(O(),g(s,1,1,()=>{s=null}),P());const c={};$&16&&(c.$$scope={dirty:$,ctx:n}),t.$set(c);const u={};$&1&&(u.style=n[0]),$&4&&(u.of=n[2]),f.$set(u)},i(n){o||(_(s),_(t.$$.fragment,n),_(f.$$.fragment,n),o=!0)},o(n){g(s),g(t.$$.fragment,n),g(f.$$.fragment,n),o=!1},d(n){n&&(d(e),d(r)),s&&s.d(n),k(t),k(f)}}}function Ue(a){let e,r;return e=new ue({props:{class:"gap-4 p-4",$$slots:{default:[Re]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,[l]){const f={};l&23&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function Xe(a,e,r){let{style:t}=e,{local:l}=e,{remote:f}=e;function o(s){oe.call(this,a,s)}return a.$$set=s=>{"style"in s&&r(0,t=s.style),"local"in s&&r(1,l=s.local),"remote"in s&&r(2,f=s.remote)},[t,l,f,o]}class ce extends K{constructor(e){super(),M(this,e,Xe,Ue,W,{style:0,local:1,remote:2})}}function ne(a,e,r){const t=a.slice();return t[3]=e[r],t}function se(a){let e,r,t,l,f,o;r=new ue({props:{x:!0,class:"place-items-baseline",$$slots:{default:[Qe]},$$scope:{ctx:a}}}),l=new Ne({});let s=te(a[1].slice(0,6)),n=[];for(let c=0;cg(n[c],1,1,()=>{n[c]=null});return{c(){e=D("div"),h(r.$$.fragment),t=S(),h(l.$$.fragment),f=S();for(let c=0;c*:first-child]:opacity-50")},m(c,u){w(c,e,u),v(r,e,null),A(e,t),v(l,e,null),A(e,f);for(let m=0;m{t=null}),P())},i(l){r||(_(t),r=!0)},o(l){g(t),r=!1},d(l){l&&d(e),t&&t.d(l)}}}function et(a,e,r){let t;N(a,Q,o=>r(1,t=o));let{type:l="tracks"}=e;const f=()=>Q.clear();return a.$$set=o=>{"type"in o&&r(0,l=o.type)},[l,t,f]}class tt extends K{constructor(e){super(),M(this,e,et,xe,W,{type:0})}}function ae(a){let e,r,t,l,f;return r=new B({props:{sm:!0,indent:!0,$$slots:{default:[rt]},$$scope:{ctx:a}}}),l=new ie({props:{fixed:!0,tracks:a[0],$$slots:{action:[nt]},$$scope:{ctx:a}}}),{c(){e=D("div"),h(r.$$.fragment),t=S(),h(l.$$.fragment),this.h()},l(o){e=V(o,"DIV",{class:!0});var s=j(e);b(r.$$.fragment,s),t=I(s),b(l.$$.fragment,s),s.forEach(d),this.h()},h(){L(e,"class","pt-4")},m(o,s){w(o,e,s),v(r,e,null),A(e,t),v(l,e,null),f=!0},p(o,s){const n={};s&512&&(n.$$scope={dirty:s,ctx:o}),r.$set(n);const $={};s&1&&($.tracks=o[0]),s&512&&($.$$scope={dirty:s,ctx:o}),l.$set($)},i(o){f||(_(r.$$.fragment,o),_(l.$$.fragment,o),f=!0)},o(o){g(r.$$.fragment,o),g(l.$$.fragment,o),f=!1},d(o){o&&d(e),k(r),k(l)}}}function rt(a){let e;return{c(){e=z("Library")},l(r){e=T(r,"Library")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function nt(a){let e,r;return e=new R({props:{name:"last",slot:"action"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function st(a){let e;return{c(){e=z("Search")},l(r){e=T(r,"Search")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function lt(a){let e,r;return e=new R({props:{name:"save"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function at(a){let e,r;return e=new C({props:{air:!0,stretch:!0,$$slots:{default:[lt]},$$scope:{ctx:a}}}),e.$on("click",a[4]),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&512&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function ft(a){let e,r;return e=new R({props:{name:"save",slot:"action"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function ot(a){let e,r,t,l,f,o,s,n=a[0].length&&ae(a);t=new B({props:{sm:!0,indent:!0,$$slots:{default:[st]},$$scope:{ctx:a}}});function $(u){a[5](u)}let c={fixed:!0,tracks:a[1],$$slots:{action:[ft],default:[at]},$$scope:{ctx:a}};return a[2]!==void 0&&(c.selected=a[2]),f=new ie({props:c}),Z.push(()=>ee(f,"selected",$)),f.$on("end",a[6]),f.$on("action",a[7]),{c(){n&&n.c(),e=S(),r=D("div"),h(t.$$.fragment),l=S(),h(f.$$.fragment),this.h()},l(u){n&&n.l(u),e=I(u),r=V(u,"DIV",{class:!0});var m=j(r);b(t.$$.fragment,m),l=I(m),b(f.$$.fragment,m),m.forEach(d),this.h()},h(){L(r,"class","pt-4")},m(u,m){n&&n.m(u,m),w(u,e,m),w(u,r,m),v(t,r,null),A(r,l),v(f,r,null),s=!0},p(u,[m]){u[0].length?n?(n.p(u,m),m&1&&_(n,1)):(n=ae(u),n.c(),_(n,1),n.m(e.parentNode,e)):n&&(O(),g(n,1,1,()=>{n=null}),P());const i={};m&512&&(i.$$scope={dirty:m,ctx:u}),t.$set(i);const p={};m&2&&(p.tracks=u[1]),m&516&&(p.$$scope={dirty:m,ctx:u}),!o&&m&4&&(o=!0,p.selected=u[2],x(()=>o=!1)),f.$set(p)},i(u){s||(_(n),_(t.$$.fragment,u),_(f.$$.fragment,u),s=!0)},o(u){g(n),g(t.$$.fragment,u),g(f.$$.fragment,u),s=!1},d(u){u&&(d(e),d(r)),n&&n.d(u),k(t),k(f)}}}function ut(a,e,r){let t;N(a,Ee,m=>r(8,t=m));let{local:l}=e,{remote:f}=e,o=new Set;function s(m){Se.push([...m],t[0].id),m==o&&(o.clear(),r(2,o))}const n=()=>s(o);function $(m){o=m,r(2,o)}function c(m){oe.call(this,a,m)}const u=({detail:m})=>s([m]);return a.$$set=m=>{"local"in m&&r(0,l=m.local),"remote"in m&&r(1,f=m.remote)},[l,f,o,s,n,$,c,u]}class it extends K{constructor(e){super(),M(this,e,ut,ot,W,{local:0,remote:1})}}function $t(a){let e;return{c(){e=z("Explore")},l(r){e=T(r,"Explore")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function ct(a){let e,r;return e=new B({props:{xl:!0,indent:!0,$$slots:{default:[$t]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32768&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function mt(a){let e,r;return e=new tt({props:{type:a[6][a[0]]}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&1&&(f.type=t[6][t[0]]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function pt(a){let e,r,t,l;const f=[dt,gt,_t],o=[];function s(n,$){return n[5].type==="tracks"?0:n[5].type==="artists"?1:n[5].type==="albums"?2:-1}return~(e=s(a))&&(r=o[e]=f[e](a)),{c(){r&&r.c(),t=X()},l(n){r&&r.l(n),t=X()},m(n,$){~e&&o[e].m(n,$),w(n,t,$),l=!0},p(n,$){let c=e;e=s(n),e===c?~e&&o[e].p(n,$):(r&&(O(),g(o[c],1,1,()=>{o[c]=null}),P()),~e?(r=o[e],r?r.p(n,$):(r=o[e]=f[e](n),r.c()),_(r,1),r.m(t.parentNode,t)):r=null)},i(n){l||(_(r),l=!0)},o(n){g(r),l=!1},d(n){n&&d(t),~e&&o[e].d(n)}}}function _t(a){let e,r;return e=new ce({props:{style:"album",remote:a[5].data,local:a[3]}}),e.$on("end",a[7].next),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32&&(f.remote=t[5].data),l&8&&(f.local=t[3]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function gt(a){let e,r;return e=new ce({props:{style:"artist",remote:a[5].data,local:a[4]}}),e.$on("end",a[7].next),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32&&(f.remote=t[5].data),l&16&&(f.local=t[4]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function dt(a){let e,r;return e=new it({props:{remote:a[5].data,local:a[2]}}),e.$on("end",a[7].next),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32&&(f.remote=t[5].data),l&4&&(f.local=t[2]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function ht(a){let e,r;return e=new R({props:{name:"search"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function bt(a){let e,r,t;function l(o){a[10](o)}let f={stretch:!0,resettable:!0,placeholder:"Search",$$slots:{default:[ht]},$$scope:{ctx:a}};return a[1]!==void 0&&(f.value=a[1]),e=new Le({props:f}),Z.push(()=>ee(e,"value",l)),{c(){h(e.$$.fragment)},l(o){b(e.$$.fragment,o)},m(o,s){v(e,o,s),t=!0},p(o,s){const n={};s&32768&&(n.$$scope={dirty:s,ctx:o}),!r&&s&2&&(r=!0,n.value=o[1],x(()=>r=!1)),e.$set(n)},i(o){t||(_(e.$$.fragment,o),t=!0)},o(o){g(e.$$.fragment,o),t=!1},d(o){k(e,o)}}}function vt(a){let e;return{c(){e=z("Tracks")},l(r){e=T(r,"Tracks")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function kt(a){let e;return{c(){e=z("Artists")},l(r){e=T(r,"Artists")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function wt(a){let e;return{c(){e=z("Albums")},l(r){e=T(r,"Albums")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function yt(a){let e,r,t,l,f,o;return e=new C({props:{id:"tracks",$$slots:{default:[vt]},$$scope:{ctx:a}}}),t=new C({props:{id:"artists",$$slots:{default:[kt]},$$scope:{ctx:a}}}),f=new C({props:{id:"albums",$$slots:{default:[wt]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment),r=S(),h(t.$$.fragment),l=S(),h(f.$$.fragment)},l(s){b(e.$$.fragment,s),r=I(s),b(t.$$.fragment,s),l=I(s),b(f.$$.fragment,s)},m(s,n){v(e,s,n),w(s,r,n),v(t,s,n),w(s,l,n),v(f,s,n),o=!0},p(s,n){const $={};n&32768&&($.$$scope={dirty:n,ctx:s}),e.$set($);const c={};n&32768&&(c.$$scope={dirty:n,ctx:s}),t.$set(c);const u={};n&32768&&(u.$$scope={dirty:n,ctx:s}),f.$set(u)},i(s){o||(_(e.$$.fragment,s),_(t.$$.fragment,s),_(f.$$.fragment,s),o=!0)},o(s){g(e.$$.fragment,s),g(t.$$.fragment,s),g(f.$$.fragment,s),o=!1},d(s){s&&(d(r),d(l)),k(e,s),k(t,s),k(f,s)}}}function Et(a){let e,r,t,l,f;e=new De({props:{not:!0,sm:!0,$$slots:{default:[bt]},$$scope:{ctx:a}}});function o(n){a[11](n)}let s={size:3,stretch:!0,$$slots:{default:[yt]},$$scope:{ctx:a}};return a[0]!==void 0&&(s.value=a[0]),t=new Fe({props:s}),Z.push(()=>ee(t,"value",o)),{c(){h(e.$$.fragment),r=S(),h(t.$$.fragment)},l(n){b(e.$$.fragment,n),r=I(n),b(t.$$.fragment,n)},m(n,$){v(e,n,$),w(n,r,$),v(t,n,$),f=!0},p(n,$){const c={};$&32770&&(c.$$scope={dirty:$,ctx:n}),e.$set(c);const u={};$&32768&&(u.$$scope={dirty:$,ctx:n}),!l&&$&1&&(l=!0,u.value=n[0],x(()=>l=!1)),t.$set(u)},i(n){f||(_(e.$$.fragment,n),_(t.$$.fragment,n),f=!0)},o(n){g(e.$$.fragment,n),g(t.$$.fragment,n),f=!1},d(n){n&&d(r),k(e,n),k(t,n)}}}function St(a){let e,r;return e=new Ce({props:{$$slots:{default:[Et]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32771&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function It(a){let e,r,t,l,f,o,s,n,$;e=new Oe({props:{title:"Explore",$$slots:{default:[ct]},$$scope:{ctx:a}}});const c=[pt,mt],u=[];function m(i,p){return i[1]?0:1}return t=m(a),l=u[t]=c[t](a),o=new Ie({props:{to:"bottom",$$slots:{default:[St]},$$scope:{ctx:a}}}),document.title=n=(a[1]||"Explore")+" - Amadeus",{c(){h(e.$$.fragment),r=S(),l.c(),f=S(),h(o.$$.fragment),s=S()},l(i){b(e.$$.fragment,i),r=I(i),l.l(i),f=I(i),b(o.$$.fragment,i),s=I(i),fe("svelte-17zny61",document.head).forEach(d)},m(i,p){v(e,i,p),w(i,r,p),u[t].m(i,p),w(i,f,p),v(o,i,p),w(i,s,p),$=!0},p(i,[p]){const E={};p&32768&&(E.$$scope={dirty:p,ctx:i}),e.$set(E);let q=t;t=m(i),t===q?u[t].p(i,p):(O(),g(u[q],1,1,()=>{u[q]=null}),P(),l=u[t],l?l.p(i,p):(l=u[t]=c[t](i),l.c()),_(l,1),l.m(f.parentNode,f));const H={};p&32771&&(H.$$scope={dirty:p,ctx:i}),o.$set(H),(!$||p&2)&&n!==(n=(i[1]||"Explore")+" - Amadeus")&&(document.title=n)},i(i){$||(_(e.$$.fragment,i),_(l),_(o.$$.fragment,i),$=!0)},o(i){g(e.$$.fragment,i),g(l),g(o.$$.fragment,i),$=!1},d(i){i&&(d(r),d(f),d(s)),k(e,i),u[t].d(i),k(o,i)}}}function zt(a,e,r){let t,l,f,o;N(a,J,y=>r(1,t=y)),N(a,je,y=>r(8,l=y)),N(a,He,y=>r(9,f=y));let s=0;const n=["tracks","artists","albums"],$=ye(y=>Q.log(y),2e3),c=~~(globalThis.innerHeight/56*2),u=Pe({tracks:Y.tracks,artists:Y.artists,albums:Y.albums},ze.next,n[s]);N(a,u,y=>r(5,o=y));let m=[],i=[],p=[];function E(y){const U=decodeURIComponent(y).split("/");U.length<2||(r(0,s=n.indexOf(U[0])),~s||r(0,s=0),t!==U[1]&&ke(J,t=U[1],t))}function q(y){t=y,J.set(t)}function H(y){s=y,r(0,s)}return a.$$.update=()=>{a.$$.dirty&512&&E(f.url.hash.slice(1)),a.$$.dirty&259&&(l||globalThis.history?.replaceState(null,"",`#${n[s]}/${t}`)),a.$$.dirty&1&&u.choose(n[s]),a.$$.dirty&2&&u.update(t?{query:t,page:c}:null),a.$$.dirty&2&&Te.search(t).then(y=>r(2,m=y)),a.$$.dirty&2&&Ae.search(t).then(y=>r(3,i=y)),a.$$.dirty&2&&qe.search(t).then(y=>r(4,p=y)),a.$$.dirty&2&&$(t)},[s,t,m,i,p,o,n,u,l,f,q,H]}class Bt extends K{constructor(e){super(),M(this,e,zt,It,W,{})}}export{Bt as component}; +import{s as W,w as me,f as D,a as S,l as z,g as V,h as j,c as I,d,r as fe,m as T,j as L,k as G,i as w,u as A,x as pe,y as _e,z as ge,v as N,A as de,L as he,M as oe,e as X,I as be,G as F,n as ve,p as Z,K as x,F as ke}from"../chunks/scheduler.yhBzS9E6.js";import{S as K,i as M,a as _,t as g,b as h,d as b,m as v,e as k,g as O,c as P,f as ee}from"../chunks/index.f7836kWu.js";import{u as we,S as ue,H as B,B as C,I as R,d as ye}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import{h as Q,e as te,p as Ee,l as Se,P as Ie,b as ze,d as Y,t as Te,f as Ae,g as qe,s as J,W as De}from"../chunks/Track.oiOqwbPY.js";import{w as Ve}from"../chunks/paths.G112lh3q.js";import{n as je,p as He}from"../chunks/stores.iu7Qu9dF.js";import{I as Le}from"../chunks/Input.UuPw_Vot.js";import{S as Ne,T as ie,a as Ce}from"../chunks/Player.4gabUvVV.js";import{T as Oe}from"../chunks/util.2xyf67Ew.js";import{m as Pe}from"../chunks/stream.ZDy3xr7S.js";import{O as $e}from"../chunks/Overview.bs2WCKrP.js";import{S as Be}from"../chunks/Spacer.tcMPZ3eG.js";function Ge(a){let e,r,t,l=`calc((100% - ${.5*(a[1]-1)+.25}rem) / ${a[1]})`,f="calc(100% - 0.25rem)",o,s=`repeat(${a[1]}, minmax(0, 1fr))`,n,$,c,u;const m=a[9].default,i=me(m,a,a[8],null);return{c(){e=D("div"),i&&i.c(),r=S(),t=D("div"),n=S(),$=D("style"),c=z(a[5]),this.h()},l(p){e=V(p,"DIV",{id:!0,class:!0});var E=j(e);i&&i.l(E),r=I(E),t=V(E,"DIV",{class:!0}),j(t).forEach(d),E.forEach(d),n=I(p);const q=fe("svelte-1hzlque",document.head);$=V(q,"STYLE",{});var H=j($);c=T(H,a[5]),H.forEach(d),q.forEach(d),this.h()},h(){L(t,"class","pointer-events-none absolute left-0.5 top-0.5 -z-10 rounded-md bg-primary-600 transition-transform"),G(t,"width",l),G(t,"height",f),L(e,"id",a[2]),L(e,"class",o="relative z-10 grid min-w-max touch-manipulation justify-around justify-items-center gap-2 rounded-lg p-0.5 outline-2 outline-offset-2 outline-primary-600 [&:has(input:focus-visible)]:outline "+(a[0]?"w-full":"w-max")+" "+(a[4]?"":"bg-highlight")),G(e,"grid-template-columns",s)},m(p,E){w(p,e,E),i&&i.m(e,null),A(e,r),A(e,t),w(p,n,E),A(document.head,$),A($,c),u=!0},p(p,[E]){i&&i.p&&(!u||E&256)&&pe(i,m,p,p[8],u?ge(m,p[8],E,null):_e(p[8]),null),E&2&&l!==(l=`calc((100% - ${.5*(p[1]-1)+.25}rem) / ${p[1]})`)&&G(t,"width",l),(!u||E&1&&o!==(o="relative z-10 grid min-w-max touch-manipulation justify-around justify-items-center gap-2 rounded-lg p-0.5 outline-2 outline-offset-2 outline-primary-600 [&:has(input:focus-visible)]:outline "+(p[0]?"w-full":"w-max")+" "+(p[4]?"":"bg-highlight")))&&L(e,"class",o),E&2&&s!==(s=`repeat(${p[1]}, minmax(0, 1fr))`)&&G(e,"grid-template-columns",s)},i(p){u||(_(i,p),u=!0)},o(p){g(i,p),u=!1},d(p){p&&(d(e),d(n)),i&&i.d(p),d($)}}}function We(a,e,r){let t,{$$slots:l={},$$scope:f}=e,{stretch:o=!1}=e,{size:s}=e,{value:n=0}=e;const $=we(),c=Ve(n);N(a,c,i=>r(7,t=i));const u=!!de("panel");he("group",{id:$,size:s,value:c,i:0});const m=Array.from({length:s}).map((i,p)=>`#${$} :has([name="${$}"]:checked):nth-last-of-type(${p+1})~div:last-child{transform:translateX(calc(${(s-p-1)*100}% + ${(s-p-1)*8}px));}`).join("");return a.$$set=i=>{"stretch"in i&&r(0,o=i.stretch),"size"in i&&r(1,s=i.size),"value"in i&&r(6,n=i.value),"$$scope"in i&&r(8,f=i.$$scope)},a.$$.update=()=>{a.$$.dirty&128&&r(6,n=t),a.$$.dirty&64&&c.set(n)},[o,s,$,c,u,m,n,t,f,l]}class Fe extends K{constructor(e){super(),M(this,e,We,Ge,W,{stretch:0,size:1,value:6})}}function re(a){let e,r,t,l,f;return r=new B({props:{sm:!0,$$slots:{default:[Ke]},$$scope:{ctx:a}}}),l=new $e({props:{style:a[0],of:a[1]}}),{c(){e=D("div"),h(r.$$.fragment),t=S(),h(l.$$.fragment)},l(o){e=V(o,"DIV",{});var s=j(e);b(r.$$.fragment,s),t=I(s),b(l.$$.fragment,s),s.forEach(d)},m(o,s){w(o,e,s),v(r,e,null),A(e,t),v(l,e,null),f=!0},p(o,s){const n={};s&16&&(n.$$scope={dirty:s,ctx:o}),r.$set(n);const $={};s&1&&($.style=o[0]),s&2&&($.of=o[1]),l.$set($)},i(o){f||(_(r.$$.fragment,o),_(l.$$.fragment,o),f=!0)},o(o){g(r.$$.fragment,o),g(l.$$.fragment,o),f=!1},d(o){o&&d(e),k(r),k(l)}}}function Ke(a){let e;return{c(){e=z("Library")},l(r){e=T(r,"Library")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function Me(a){let e;return{c(){e=z("Search")},l(r){e=T(r,"Search")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function Re(a){let e,r,t,l,f,o,s=a[1].length&&re(a);return t=new B({props:{sm:!0,$$slots:{default:[Me]},$$scope:{ctx:a}}}),f=new $e({props:{style:a[0],of:a[2],href:"/explore"}}),f.$on("end",a[3]),{c(){s&&s.c(),e=S(),r=D("div"),h(t.$$.fragment),l=S(),h(f.$$.fragment)},l(n){s&&s.l(n),e=I(n),r=V(n,"DIV",{});var $=j(r);b(t.$$.fragment,$),l=I($),b(f.$$.fragment,$),$.forEach(d)},m(n,$){s&&s.m(n,$),w(n,e,$),w(n,r,$),v(t,r,null),A(r,l),v(f,r,null),o=!0},p(n,$){n[1].length?s?(s.p(n,$),$&2&&_(s,1)):(s=re(n),s.c(),_(s,1),s.m(e.parentNode,e)):s&&(O(),g(s,1,1,()=>{s=null}),P());const c={};$&16&&(c.$$scope={dirty:$,ctx:n}),t.$set(c);const u={};$&1&&(u.style=n[0]),$&4&&(u.of=n[2]),f.$set(u)},i(n){o||(_(s),_(t.$$.fragment,n),_(f.$$.fragment,n),o=!0)},o(n){g(s),g(t.$$.fragment,n),g(f.$$.fragment,n),o=!1},d(n){n&&(d(e),d(r)),s&&s.d(n),k(t),k(f)}}}function Ue(a){let e,r;return e=new ue({props:{class:"gap-4 p-4",$$slots:{default:[Re]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,[l]){const f={};l&23&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function Xe(a,e,r){let{style:t}=e,{local:l}=e,{remote:f}=e;function o(s){oe.call(this,a,s)}return a.$$set=s=>{"style"in s&&r(0,t=s.style),"local"in s&&r(1,l=s.local),"remote"in s&&r(2,f=s.remote)},[t,l,f,o]}class ce extends K{constructor(e){super(),M(this,e,Xe,Ue,W,{style:0,local:1,remote:2})}}function ne(a,e,r){const t=a.slice();return t[3]=e[r],t}function se(a){let e,r,t,l,f,o;r=new ue({props:{x:!0,class:"place-items-baseline",$$slots:{default:[Qe]},$$scope:{ctx:a}}}),l=new Ne({});let s=te(a[1].slice(0,6)),n=[];for(let c=0;cg(n[c],1,1,()=>{n[c]=null});return{c(){e=D("div"),h(r.$$.fragment),t=S(),h(l.$$.fragment),f=S();for(let c=0;c*:first-child]:opacity-50")},m(c,u){w(c,e,u),v(r,e,null),A(e,t),v(l,e,null),A(e,f);for(let m=0;m{t=null}),P())},i(l){r||(_(t),r=!0)},o(l){g(t),r=!1},d(l){l&&d(e),t&&t.d(l)}}}function et(a,e,r){let t;N(a,Q,o=>r(1,t=o));let{type:l="tracks"}=e;const f=()=>Q.clear();return a.$$set=o=>{"type"in o&&r(0,l=o.type)},[l,t,f]}class tt extends K{constructor(e){super(),M(this,e,et,xe,W,{type:0})}}function ae(a){let e,r,t,l,f;return r=new B({props:{sm:!0,indent:!0,$$slots:{default:[rt]},$$scope:{ctx:a}}}),l=new ie({props:{fixed:!0,tracks:a[0],$$slots:{action:[nt]},$$scope:{ctx:a}}}),{c(){e=D("div"),h(r.$$.fragment),t=S(),h(l.$$.fragment),this.h()},l(o){e=V(o,"DIV",{class:!0});var s=j(e);b(r.$$.fragment,s),t=I(s),b(l.$$.fragment,s),s.forEach(d),this.h()},h(){L(e,"class","pt-4")},m(o,s){w(o,e,s),v(r,e,null),A(e,t),v(l,e,null),f=!0},p(o,s){const n={};s&512&&(n.$$scope={dirty:s,ctx:o}),r.$set(n);const $={};s&1&&($.tracks=o[0]),s&512&&($.$$scope={dirty:s,ctx:o}),l.$set($)},i(o){f||(_(r.$$.fragment,o),_(l.$$.fragment,o),f=!0)},o(o){g(r.$$.fragment,o),g(l.$$.fragment,o),f=!1},d(o){o&&d(e),k(r),k(l)}}}function rt(a){let e;return{c(){e=z("Library")},l(r){e=T(r,"Library")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function nt(a){let e,r;return e=new R({props:{name:"last",slot:"action"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function st(a){let e;return{c(){e=z("Search")},l(r){e=T(r,"Search")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function lt(a){let e,r;return e=new R({props:{name:"save"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function at(a){let e,r;return e=new C({props:{air:!0,stretch:!0,$$slots:{default:[lt]},$$scope:{ctx:a}}}),e.$on("click",a[4]),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&512&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function ft(a){let e,r;return e=new R({props:{name:"save",slot:"action"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function ot(a){let e,r,t,l,f,o,s,n=a[0].length&&ae(a);t=new B({props:{sm:!0,indent:!0,$$slots:{default:[st]},$$scope:{ctx:a}}});function $(u){a[5](u)}let c={fixed:!0,tracks:a[1],$$slots:{action:[ft],default:[at]},$$scope:{ctx:a}};return a[2]!==void 0&&(c.selected=a[2]),f=new ie({props:c}),Z.push(()=>ee(f,"selected",$)),f.$on("end",a[6]),f.$on("action",a[7]),{c(){n&&n.c(),e=S(),r=D("div"),h(t.$$.fragment),l=S(),h(f.$$.fragment),this.h()},l(u){n&&n.l(u),e=I(u),r=V(u,"DIV",{class:!0});var m=j(r);b(t.$$.fragment,m),l=I(m),b(f.$$.fragment,m),m.forEach(d),this.h()},h(){L(r,"class","pt-4")},m(u,m){n&&n.m(u,m),w(u,e,m),w(u,r,m),v(t,r,null),A(r,l),v(f,r,null),s=!0},p(u,[m]){u[0].length?n?(n.p(u,m),m&1&&_(n,1)):(n=ae(u),n.c(),_(n,1),n.m(e.parentNode,e)):n&&(O(),g(n,1,1,()=>{n=null}),P());const i={};m&512&&(i.$$scope={dirty:m,ctx:u}),t.$set(i);const p={};m&2&&(p.tracks=u[1]),m&516&&(p.$$scope={dirty:m,ctx:u}),!o&&m&4&&(o=!0,p.selected=u[2],x(()=>o=!1)),f.$set(p)},i(u){s||(_(n),_(t.$$.fragment,u),_(f.$$.fragment,u),s=!0)},o(u){g(n),g(t.$$.fragment,u),g(f.$$.fragment,u),s=!1},d(u){u&&(d(e),d(r)),n&&n.d(u),k(t),k(f)}}}function ut(a,e,r){let t;N(a,Ee,m=>r(8,t=m));let{local:l}=e,{remote:f}=e,o=new Set;function s(m){Se.push([...m],t[0].id),m==o&&(o.clear(),r(2,o))}const n=()=>s(o);function $(m){o=m,r(2,o)}function c(m){oe.call(this,a,m)}const u=({detail:m})=>s([m]);return a.$$set=m=>{"local"in m&&r(0,l=m.local),"remote"in m&&r(1,f=m.remote)},[l,f,o,s,n,$,c,u]}class it extends K{constructor(e){super(),M(this,e,ut,ot,W,{local:0,remote:1})}}function $t(a){let e;return{c(){e=z("Explore")},l(r){e=T(r,"Explore")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function ct(a){let e,r;return e=new B({props:{xl:!0,indent:!0,$$slots:{default:[$t]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32768&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function mt(a){let e,r;return e=new tt({props:{type:a[6][a[0]]}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&1&&(f.type=t[6][t[0]]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function pt(a){let e,r,t,l;const f=[dt,gt,_t],o=[];function s(n,$){return n[5].type==="tracks"?0:n[5].type==="artists"?1:n[5].type==="albums"?2:-1}return~(e=s(a))&&(r=o[e]=f[e](a)),{c(){r&&r.c(),t=X()},l(n){r&&r.l(n),t=X()},m(n,$){~e&&o[e].m(n,$),w(n,t,$),l=!0},p(n,$){let c=e;e=s(n),e===c?~e&&o[e].p(n,$):(r&&(O(),g(o[c],1,1,()=>{o[c]=null}),P()),~e?(r=o[e],r?r.p(n,$):(r=o[e]=f[e](n),r.c()),_(r,1),r.m(t.parentNode,t)):r=null)},i(n){l||(_(r),l=!0)},o(n){g(r),l=!1},d(n){n&&d(t),~e&&o[e].d(n)}}}function _t(a){let e,r;return e=new ce({props:{style:"album",remote:a[5].data,local:a[3]}}),e.$on("end",a[7].next),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32&&(f.remote=t[5].data),l&8&&(f.local=t[3]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function gt(a){let e,r;return e=new ce({props:{style:"artist",remote:a[5].data,local:a[4]}}),e.$on("end",a[7].next),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32&&(f.remote=t[5].data),l&16&&(f.local=t[4]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function dt(a){let e,r;return e=new it({props:{remote:a[5].data,local:a[2]}}),e.$on("end",a[7].next),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32&&(f.remote=t[5].data),l&4&&(f.local=t[2]),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function ht(a){let e,r;return e=new R({props:{name:"search"}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p:F,i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function bt(a){let e,r,t;function l(o){a[10](o)}let f={stretch:!0,resettable:!0,placeholder:"Search",$$slots:{default:[ht]},$$scope:{ctx:a}};return a[1]!==void 0&&(f.value=a[1]),e=new Le({props:f}),Z.push(()=>ee(e,"value",l)),{c(){h(e.$$.fragment)},l(o){b(e.$$.fragment,o)},m(o,s){v(e,o,s),t=!0},p(o,s){const n={};s&32768&&(n.$$scope={dirty:s,ctx:o}),!r&&s&2&&(r=!0,n.value=o[1],x(()=>r=!1)),e.$set(n)},i(o){t||(_(e.$$.fragment,o),t=!0)},o(o){g(e.$$.fragment,o),t=!1},d(o){k(e,o)}}}function vt(a){let e;return{c(){e=z("Tracks")},l(r){e=T(r,"Tracks")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function kt(a){let e;return{c(){e=z("Artists")},l(r){e=T(r,"Artists")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function wt(a){let e;return{c(){e=z("Albums")},l(r){e=T(r,"Albums")},m(r,t){w(r,e,t)},d(r){r&&d(e)}}}function yt(a){let e,r,t,l,f,o;return e=new C({props:{id:"tracks",$$slots:{default:[vt]},$$scope:{ctx:a}}}),t=new C({props:{id:"artists",$$slots:{default:[kt]},$$scope:{ctx:a}}}),f=new C({props:{id:"albums",$$slots:{default:[wt]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment),r=S(),h(t.$$.fragment),l=S(),h(f.$$.fragment)},l(s){b(e.$$.fragment,s),r=I(s),b(t.$$.fragment,s),l=I(s),b(f.$$.fragment,s)},m(s,n){v(e,s,n),w(s,r,n),v(t,s,n),w(s,l,n),v(f,s,n),o=!0},p(s,n){const $={};n&32768&&($.$$scope={dirty:n,ctx:s}),e.$set($);const c={};n&32768&&(c.$$scope={dirty:n,ctx:s}),t.$set(c);const u={};n&32768&&(u.$$scope={dirty:n,ctx:s}),f.$set(u)},i(s){o||(_(e.$$.fragment,s),_(t.$$.fragment,s),_(f.$$.fragment,s),o=!0)},o(s){g(e.$$.fragment,s),g(t.$$.fragment,s),g(f.$$.fragment,s),o=!1},d(s){s&&(d(r),d(l)),k(e,s),k(t,s),k(f,s)}}}function Et(a){let e,r,t,l,f;e=new De({props:{not:!0,sm:!0,$$slots:{default:[bt]},$$scope:{ctx:a}}});function o(n){a[11](n)}let s={size:3,stretch:!0,$$slots:{default:[yt]},$$scope:{ctx:a}};return a[0]!==void 0&&(s.value=a[0]),t=new Fe({props:s}),Z.push(()=>ee(t,"value",o)),{c(){h(e.$$.fragment),r=S(),h(t.$$.fragment)},l(n){b(e.$$.fragment,n),r=I(n),b(t.$$.fragment,n)},m(n,$){v(e,n,$),w(n,r,$),v(t,n,$),f=!0},p(n,$){const c={};$&32770&&(c.$$scope={dirty:$,ctx:n}),e.$set(c);const u={};$&32768&&(u.$$scope={dirty:$,ctx:n}),!l&&$&1&&(l=!0,u.value=n[0],x(()=>l=!1)),t.$set(u)},i(n){f||(_(e.$$.fragment,n),_(t.$$.fragment,n),f=!0)},o(n){g(e.$$.fragment,n),g(t.$$.fragment,n),f=!1},d(n){n&&d(r),k(e,n),k(t,n)}}}function St(a){let e,r;return e=new Ce({props:{$$slots:{default:[Et]},$$scope:{ctx:a}}}),{c(){h(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,l){v(e,t,l),r=!0},p(t,l){const f={};l&32771&&(f.$$scope={dirty:l,ctx:t}),e.$set(f)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){g(e.$$.fragment,t),r=!1},d(t){k(e,t)}}}function It(a){let e,r,t,l,f,o,s,n,$;e=new Oe({props:{title:"Explore",$$slots:{default:[ct]},$$scope:{ctx:a}}});const c=[pt,mt],u=[];function m(i,p){return i[1]?0:1}return t=m(a),l=u[t]=c[t](a),o=new Ie({props:{to:"bottom",$$slots:{default:[St]},$$scope:{ctx:a}}}),document.title=n=(a[1]||"Explore")+" - Amadeus",{c(){h(e.$$.fragment),r=S(),l.c(),f=S(),h(o.$$.fragment),s=S()},l(i){b(e.$$.fragment,i),r=I(i),l.l(i),f=I(i),b(o.$$.fragment,i),s=I(i),fe("svelte-17zny61",document.head).forEach(d)},m(i,p){v(e,i,p),w(i,r,p),u[t].m(i,p),w(i,f,p),v(o,i,p),w(i,s,p),$=!0},p(i,[p]){const E={};p&32768&&(E.$$scope={dirty:p,ctx:i}),e.$set(E);let q=t;t=m(i),t===q?u[t].p(i,p):(O(),g(u[q],1,1,()=>{u[q]=null}),P(),l=u[t],l?l.p(i,p):(l=u[t]=c[t](i),l.c()),_(l,1),l.m(f.parentNode,f));const H={};p&32771&&(H.$$scope={dirty:p,ctx:i}),o.$set(H),(!$||p&2)&&n!==(n=(i[1]||"Explore")+" - Amadeus")&&(document.title=n)},i(i){$||(_(e.$$.fragment,i),_(l),_(o.$$.fragment,i),$=!0)},o(i){g(e.$$.fragment,i),g(l),g(o.$$.fragment,i),$=!1},d(i){i&&(d(r),d(f),d(s)),k(e,i),u[t].d(i),k(o,i)}}}function zt(a,e,r){let t,l,f,o;N(a,J,y=>r(1,t=y)),N(a,je,y=>r(8,l=y)),N(a,He,y=>r(9,f=y));let s=0;const n=["tracks","artists","albums"],$=ye(y=>Q.log(y),2e3),c=~~(globalThis.innerHeight/56*2),u=Pe({tracks:Y.tracks,artists:Y.artists,albums:Y.albums},ze.next,n[s]);N(a,u,y=>r(5,o=y));let m=[],i=[],p=[];function E(y){const U=decodeURIComponent(y).split("/");U.length<2||(r(0,s=n.indexOf(U[0])),~s||r(0,s=0),t!==U[1]&&ke(J,t=U[1],t))}function q(y){t=y,J.set(t)}function H(y){s=y,r(0,s)}return a.$$.update=()=>{a.$$.dirty&512&&E(f.url.hash.slice(1)),a.$$.dirty&259&&(l||globalThis.history?.replaceState(null,"",`#${n[s]}/${t}`)),a.$$.dirty&1&&u.choose(n[s]),a.$$.dirty&2&&u.update(t?{query:t,page:c}:null),a.$$.dirty&2&&Te.search(t).then(y=>r(2,m=y)),a.$$.dirty&2&&Ae.search(t).then(y=>r(3,i=y)),a.$$.dirty&2&&qe.search(t).then(y=>r(4,p=y)),a.$$.dirty&2&&$(t)},[s,t,m,i,p,o,n,u,l,f,q,H]}class Bt extends K{constructor(e){super(),M(this,e,zt,It,W,{})}}export{Bt as component}; diff --git a/_app/immutable/nodes/4.VR3ziamF.js b/_app/immutable/nodes/4.zI7EMXNC.js similarity index 79% rename from _app/immutable/nodes/4.VR3ziamF.js rename to _app/immutable/nodes/4.zI7EMXNC.js index 5d5a7900..75e2df14 100644 --- a/_app/immutable/nodes/4.VR3ziamF.js +++ b/_app/immutable/nodes/4.zI7EMXNC.js @@ -1 +1 @@ -import{s as C,a as j,c as w,r as y,d as c,i as A,v as u,F as I,G as d,N as S}from"../chunks/scheduler.yhBzS9E6.js";import{S as q,i as E,b as f,d as $,m as _,a as g,t as b,e as h}from"../chunks/index.f7836kWu.js";import{C as F}from"../chunks/Collection.NWTCPfm4.js";import{b as G,j as H,a as p}from"../chunks/Track.LR7rfYB8.js";import{I as N}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"../chunks/paths.k6rcf9P1.js";import{p as P}from"../chunks/stores.jWdOIcrH.js";import{s as T}from"../chunks/stream.M_jKrRc6.js";function x(o){let a,s;return a=new N({props:{name:"last",slot:"action"}}),{c(){f(a.$$.fragment)},l(t){$(a.$$.fragment,t)},m(t,n){_(a,t,n),s=!0},p:d,i(t){s||(g(a.$$.fragment,t),s=!0)},o(t){b(a.$$.fragment,t),s=!1},d(t){h(a,t)}}}function z(o){let a,s,t,n;return a=new F({props:{style:"album",tracks:o[1],of:o[1]?.detail,$$slots:{action:[x]},$$scope:{ctx:o}}}),a.$on("end",o[3]),document.title=t=(o[1]?.detail?`${o[1].detail.title} - `:"")+"Amadeus",{c(){f(a.$$.fragment),s=j()},l(e){$(a.$$.fragment,e),s=w(e),y("svelte-1gxvj9u",document.head).forEach(c)},m(e,r){_(a,e,r),A(e,s,r),n=!0},p(e,[r]){const i={};r&2&&(i.tracks=e[1]),r&2&&(i.of=e[1]?.detail),r&64&&(i.$$scope={dirty:r,ctx:e}),a.$set(i),(!n||r&2)&&t!==(t=(e[1]?.detail?`${e[1].detail.title} - `:"")+"Amadeus")&&(document.title=t)},i(e){n||(g(a.$$.fragment,e),n=!0)},o(e){b(a.$$.fragment,e),n=!1},d(e){e&&c(s),h(a,e)}}}function B(o,a,s){let t,n,e=d,r=()=>(e(),e=S(t,m=>s(1,n=m)),t),i,l;u(o,p,m=>s(4,i=m)),u(o,P,m=>s(2,l=m)),o.$$.on_destroy.push(()=>e());const k=~~(globalThis.innerHeight/56*2),v=()=>t.next();return o.$$.update=()=>{o.$$.dirty&5&&t.update({id:+l.url.hash.slice(1),page:k}),o.$$.dirty&2&&I(p,i=n?.detail?[n.detail.title,"disk"]:null,i)},r(s(0,t=T(H.album,G.next))),[t,n,l,v]}class U extends q{constructor(a){super(),E(this,a,B,z,C,{})}}export{U as component}; +import{s as C,a as j,c as w,r as y,d as c,i as A,v as u,F as I,G as d,N as S}from"../chunks/scheduler.yhBzS9E6.js";import{S as q,i as E,b as f,d as $,m as _,a as g,t as b,e as h}from"../chunks/index.f7836kWu.js";import{C as F}from"../chunks/Collection.skwpo2VZ.js";import{b as G,j as H,a as p}from"../chunks/Track.oiOqwbPY.js";import{I as N}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"../chunks/paths.G112lh3q.js";import{p as P}from"../chunks/stores.iu7Qu9dF.js";import{s as T}from"../chunks/stream.ZDy3xr7S.js";function x(o){let a,s;return a=new N({props:{name:"last",slot:"action"}}),{c(){f(a.$$.fragment)},l(t){$(a.$$.fragment,t)},m(t,n){_(a,t,n),s=!0},p:d,i(t){s||(g(a.$$.fragment,t),s=!0)},o(t){b(a.$$.fragment,t),s=!1},d(t){h(a,t)}}}function z(o){let a,s,t,n;return a=new F({props:{style:"album",tracks:o[1],of:o[1]?.detail,$$slots:{action:[x]},$$scope:{ctx:o}}}),a.$on("end",o[3]),document.title=t=(o[1]?.detail?`${o[1].detail.title} - `:"")+"Amadeus",{c(){f(a.$$.fragment),s=j()},l(e){$(a.$$.fragment,e),s=w(e),y("svelte-1gxvj9u",document.head).forEach(c)},m(e,r){_(a,e,r),A(e,s,r),n=!0},p(e,[r]){const i={};r&2&&(i.tracks=e[1]),r&2&&(i.of=e[1]?.detail),r&64&&(i.$$scope={dirty:r,ctx:e}),a.$set(i),(!n||r&2)&&t!==(t=(e[1]?.detail?`${e[1].detail.title} - `:"")+"Amadeus")&&(document.title=t)},i(e){n||(g(a.$$.fragment,e),n=!0)},o(e){b(a.$$.fragment,e),n=!1},d(e){e&&c(s),h(a,e)}}}function B(o,a,s){let t,n,e=d,r=()=>(e(),e=S(t,m=>s(1,n=m)),t),i,l;u(o,p,m=>s(4,i=m)),u(o,P,m=>s(2,l=m)),o.$$.on_destroy.push(()=>e());const k=~~(globalThis.innerHeight/56*2),v=()=>t.next();return o.$$.update=()=>{o.$$.dirty&5&&t.update({id:+l.url.hash.slice(1),page:k}),o.$$.dirty&2&&I(p,i=n?.detail?[n.detail.title,"disk"]:null,i)},r(s(0,t=T(H.album,G.next))),[t,n,l,v]}class U extends q{constructor(a){super(),E(this,a,B,z,C,{})}}export{U as component}; diff --git a/_app/immutable/nodes/5.IMsjhbl6.js b/_app/immutable/nodes/5.6E1Dv1RD.js similarity index 79% rename from _app/immutable/nodes/5.IMsjhbl6.js rename to _app/immutable/nodes/5.6E1Dv1RD.js index ec81f8fa..0399df9c 100644 --- a/_app/immutable/nodes/5.IMsjhbl6.js +++ b/_app/immutable/nodes/5.6E1Dv1RD.js @@ -1 +1 @@ -import{s as j,a as k,c as w,r as y,d as c,i as A,v as p,F as I,G as f,N as S}from"../chunks/scheduler.yhBzS9E6.js";import{S as q,i as E,b as d,d as $,m as _,a as g,t as h,e as b}from"../chunks/index.f7836kWu.js";import{C as F}from"../chunks/Collection.NWTCPfm4.js";import{b as G,j as H,a as u}from"../chunks/Track.LR7rfYB8.js";import{I as N}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"../chunks/paths.k6rcf9P1.js";import{p as P}from"../chunks/stores.jWdOIcrH.js";import{s as T}from"../chunks/stream.M_jKrRc6.js";function x(o){let a,s;return a=new N({props:{name:"last",slot:"action"}}),{c(){d(a.$$.fragment)},l(t){$(a.$$.fragment,t)},m(t,n){_(a,t,n),s=!0},p:f,i(t){s||(g(a.$$.fragment,t),s=!0)},o(t){h(a.$$.fragment,t),s=!1},d(t){b(a,t)}}}function z(o){let a,s,t,n;return a=new F({props:{style:"artist",tracks:o[1],of:o[1]?.detail,$$slots:{action:[x]},$$scope:{ctx:o}}}),a.$on("end",o[3]),document.title=t=(o[1]?.detail?`${o[1].detail.title} - `:"")+"Amadeus",{c(){d(a.$$.fragment),s=k()},l(e){$(a.$$.fragment,e),s=w(e),y("svelte-1gxvj9u",document.head).forEach(c)},m(e,r){_(a,e,r),A(e,s,r),n=!0},p(e,[r]){const i={};r&2&&(i.tracks=e[1]),r&2&&(i.of=e[1]?.detail),r&64&&(i.$$scope={dirty:r,ctx:e}),a.$set(i),(!n||r&2)&&t!==(t=(e[1]?.detail?`${e[1].detail.title} - `:"")+"Amadeus")&&(document.title=t)},i(e){n||(g(a.$$.fragment,e),n=!0)},o(e){h(a.$$.fragment,e),n=!1},d(e){e&&c(s),b(a,e)}}}function B(o,a,s){let t,n,e=f,r=()=>(e(),e=S(t,m=>s(1,n=m)),t),i,l;p(o,u,m=>s(4,i=m)),p(o,P,m=>s(2,l=m)),o.$$.on_destroy.push(()=>e());const v=~~(globalThis.innerHeight/56*2),C=()=>t.next();return o.$$.update=()=>{o.$$.dirty&5&&t.update({id:+l.url.hash.slice(1),page:v}),o.$$.dirty&2&&I(u,i=n?.detail?[n.detail.title,"person"]:null,i)},r(s(0,t=T(H.artist,G.next))),[t,n,l,C]}class U extends q{constructor(a){super(),E(this,a,B,z,j,{})}}export{U as component}; +import{s as j,a as k,c as w,r as y,d as c,i as A,v as p,F as I,G as f,N as S}from"../chunks/scheduler.yhBzS9E6.js";import{S as q,i as E,b as d,d as $,m as _,a as g,t as h,e as b}from"../chunks/index.f7836kWu.js";import{C as F}from"../chunks/Collection.skwpo2VZ.js";import{b as G,j as H,a as u}from"../chunks/Track.oiOqwbPY.js";import{I as N}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"../chunks/paths.G112lh3q.js";import{p as P}from"../chunks/stores.iu7Qu9dF.js";import{s as T}from"../chunks/stream.ZDy3xr7S.js";function x(o){let a,s;return a=new N({props:{name:"last",slot:"action"}}),{c(){d(a.$$.fragment)},l(t){$(a.$$.fragment,t)},m(t,n){_(a,t,n),s=!0},p:f,i(t){s||(g(a.$$.fragment,t),s=!0)},o(t){h(a.$$.fragment,t),s=!1},d(t){b(a,t)}}}function z(o){let a,s,t,n;return a=new F({props:{style:"artist",tracks:o[1],of:o[1]?.detail,$$slots:{action:[x]},$$scope:{ctx:o}}}),a.$on("end",o[3]),document.title=t=(o[1]?.detail?`${o[1].detail.title} - `:"")+"Amadeus",{c(){d(a.$$.fragment),s=k()},l(e){$(a.$$.fragment,e),s=w(e),y("svelte-1gxvj9u",document.head).forEach(c)},m(e,r){_(a,e,r),A(e,s,r),n=!0},p(e,[r]){const i={};r&2&&(i.tracks=e[1]),r&2&&(i.of=e[1]?.detail),r&64&&(i.$$scope={dirty:r,ctx:e}),a.$set(i),(!n||r&2)&&t!==(t=(e[1]?.detail?`${e[1].detail.title} - `:"")+"Amadeus")&&(document.title=t)},i(e){n||(g(a.$$.fragment,e),n=!0)},o(e){h(a.$$.fragment,e),n=!1},d(e){e&&c(s),b(a,e)}}}function B(o,a,s){let t,n,e=f,r=()=>(e(),e=S(t,m=>s(1,n=m)),t),i,l;p(o,u,m=>s(4,i=m)),p(o,P,m=>s(2,l=m)),o.$$.on_destroy.push(()=>e());const v=~~(globalThis.innerHeight/56*2),C=()=>t.next();return o.$$.update=()=>{o.$$.dirty&5&&t.update({id:+l.url.hash.slice(1),page:v}),o.$$.dirty&2&&I(u,i=n?.detail?[n.detail.title,"person"]:null,i)},r(s(0,t=T(H.artist,G.next))),[t,n,l,C]}class U extends q{constructor(a){super(),E(this,a,B,z,j,{})}}export{U as component}; diff --git a/_app/immutable/nodes/6.M-At1isD.js b/_app/immutable/nodes/6.w3KI7Lna.js similarity index 95% rename from _app/immutable/nodes/6.M-At1isD.js rename to _app/immutable/nodes/6.w3KI7Lna.js index ec7c0383..12b1213a 100644 --- a/_app/immutable/nodes/6.M-At1isD.js +++ b/_app/immutable/nodes/6.w3KI7Lna.js @@ -1 +1 @@ -import{s as N,a as w,c as v,r as z,d,i as k,v as H,o as F,l as S,m as D,f as q,g as L,h as P,j as V,I as J,u as K,G as W}from"../chunks/scheduler.yhBzS9E6.js";import{S as Q,i as R,b as m,d as p,m as _,a as u,t as i,e as g,g as Y,c as A}from"../chunks/index.f7836kWu.js";import{k as I,W as U,e as B,s as X,m as Z,T as y}from"../chunks/Track.LR7rfYB8.js";import{S as O,H as T,B as C,I as G}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"../chunks/paths.k6rcf9P1.js";import{T as x}from"../chunks/util.VvTXxVpP.js";import{O as ee}from"../chunks/Overview.T1RnAS_v.js";function E(o,e,r){const t=o.slice();return t[8]=e[r].device,t[9]=e[r].track,t[10]=e[r].progress,t}function te(o){let e;return{c(){e=S("Home")},l(r){e=D(r,"Home")},m(r,t){k(r,e,t)},d(r){r&&d(e)}}}function re(o){let e,r;return e=new G({props:{name:"settings"}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p:W,i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function ne(o){let e,r;return e=new C({props:{round:!0,href:"/settings",$$slots:{default:[re]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8192&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function se(o){let e,r;return e=new U({props:{not:!0,sm:!0,slot:"after",$$slots:{default:[ne]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8192&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function ae(o){let e,r;return e=new T({props:{xl:!0,indent:!0,id:"feed",$$slots:{after:[se],default:[te]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8192&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function M(o){let e,r;return e=new O({props:{class:"gap-1",$$slots:{default:[$e]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8193&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function oe(o){let e;return{c(){e=S("Other Devices")},l(r){e=D(r,"Other Devices")},m(r,t){k(r,e,t)},d(r){r&&d(e)}}}function le(o){let e,r;return e=new G({props:{name:"close"}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p:W,i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function fe(o){let e,r;function t(...s){return o[5](o[8],...s)}return e=new C({props:{air:!0,$$slots:{default:[le]},$$scope:{ctx:o}}}),e.$on("click",t),{c(){m(e.$$.fragment)},l(s){p(e.$$.fragment,s)},m(s,a){_(e,s,a),r=!0},p(s,a){o=s;const n={};a&8192&&(n.$$scope={dirty:a,ctx:o}),e.$set(n)},i(s){r||(u(e.$$.fragment,s),r=!0)},o(s){i(e.$$.fragment,s),r=!1},d(s){g(e,s)}}}function j(o){let e,r,t,s;function a(){return o[6](o[8])}return r=new y({props:{sm:!0,track:o[9],progress:o[10],$$slots:{default:[fe]},$$scope:{ctx:o}}}),r.$on("click",a),{c(){e=q("div"),m(r.$$.fragment),t=w(),this.h()},l(n){e=L(n,"DIV",{class:!0});var f=P(e);p(r.$$.fragment,f),t=v(f),f.forEach(d),this.h()},h(){V(e,"class","dark:ring-none rounded-lg shadow-sm ring-1 ring-highlight [&>*]:bg-surface-100")},m(n,f){k(n,e,f),_(r,e,null),K(e,t),s=!0},p(n,f){o=n;const l={};f&1&&(l.track=o[9]),f&1&&(l.progress=o[10]),f&8193&&(l.$$scope={dirty:f,ctx:o}),r.$set(l)},i(n){s||(u(r.$$.fragment,n),s=!0)},o(n){i(r.$$.fragment,n),s=!1},d(n){n&&d(e),g(r)}}}function $e(o){let e,r,t,s;e=new T({props:{sm:!0,$$slots:{default:[oe]},$$scope:{ctx:o}}});let a=B(o[0]),n=[];for(let l=0;li(n[l],1,1,()=>{n[l]=null});return{c(){m(e.$$.fragment),r=w(),t=q("div");for(let l=0;l{s=null}),A());const f={};n&8198&&(f.$$scope={dirty:n,ctx:a}),r.$set(f)},i(a){t||(u(s),u(r.$$.fragment,a),t=!0)},o(a){i(s),i(r.$$.fragment,a),t=!1},d(a){a&&d(e),s&&s.d(a),g(r,a)}}}function me(o){let e,r,t,s,a;return e=new x({props:{title:"Home",$$slots:{default:[ae]},$$scope:{ctx:o}}}),t=new O({props:{class:"gap-4 p-4",$$slots:{default:[ie]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment),r=w(),m(t.$$.fragment),s=w(),this.h()},l(n){p(e.$$.fragment,n),r=v(n),p(t.$$.fragment,n),s=v(n),z("svelte-1c748qj",document.head).forEach(d),this.h()},h(){document.title="Amadeus"},m(n,f){_(e,n,f),k(n,r,f),_(t,n,f),k(n,s,f),a=!0},p(n,[f]){const l={};f&8192&&(l.$$scope={dirty:f,ctx:n}),e.$set(l);const c={};f&8199&&(c.$$scope={dirty:f,ctx:n}),t.$set(c)},i(n){a||(u(e.$$.fragment,n),u(t.$$.fragment,n),a=!0)},o(n){i(e.$$.fragment,n),i(t.$$.fragment,n),a=!1},d(n){n&&(d(r),d(s)),g(e,n),g(t,n)}}}function pe(o,e,r){let t,s,a,n;H(o,I,$=>r(4,s=$)),H(o,X,$=>r(1,a=$)),H(o,Z,$=>r(2,n=$));const f=new Set([-3,-4]);F(()=>{location.hash||location.replace("#feed")});const l=($,b)=>(I.clear($),b.stopPropagation()),c=$=>I.replicate($),h=$=>!f.has($.id);return o.$$.update=()=>{o.$$.dirty&16&&r(0,t=s.filter($=>!$.local))},[t,a,n,f,s,l,c,h]}class be extends Q{constructor(e){super(),R(this,e,pe,me,N,{})}}export{be as component}; +import{s as N,a as w,c as v,r as z,d,i as k,v as H,o as F,l as S,m as D,f as q,g as L,h as P,j as V,I as J,u as K,G as W}from"../chunks/scheduler.yhBzS9E6.js";import{S as Q,i as R,b as m,d as p,m as _,a as u,t as i,e as g,g as Y,c as A}from"../chunks/index.f7836kWu.js";import{k as I,W as U,e as B,s as X,m as Z,T as y}from"../chunks/Track.oiOqwbPY.js";import{S as O,H as T,B as C,I as G}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"../chunks/paths.G112lh3q.js";import{T as x}from"../chunks/util.2xyf67Ew.js";import{O as ee}from"../chunks/Overview.bs2WCKrP.js";function E(o,e,r){const t=o.slice();return t[8]=e[r].device,t[9]=e[r].track,t[10]=e[r].progress,t}function te(o){let e;return{c(){e=S("Home")},l(r){e=D(r,"Home")},m(r,t){k(r,e,t)},d(r){r&&d(e)}}}function re(o){let e,r;return e=new G({props:{name:"settings"}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p:W,i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function ne(o){let e,r;return e=new C({props:{round:!0,href:"/settings",$$slots:{default:[re]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8192&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function se(o){let e,r;return e=new U({props:{not:!0,sm:!0,slot:"after",$$slots:{default:[ne]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8192&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function ae(o){let e,r;return e=new T({props:{xl:!0,indent:!0,id:"feed",$$slots:{after:[se],default:[te]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8192&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function M(o){let e,r;return e=new O({props:{class:"gap-1",$$slots:{default:[$e]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p(t,s){const a={};s&8193&&(a.$$scope={dirty:s,ctx:t}),e.$set(a)},i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function oe(o){let e;return{c(){e=S("Other Devices")},l(r){e=D(r,"Other Devices")},m(r,t){k(r,e,t)},d(r){r&&d(e)}}}function le(o){let e,r;return e=new G({props:{name:"close"}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,s){_(e,t,s),r=!0},p:W,i(t){r||(u(e.$$.fragment,t),r=!0)},o(t){i(e.$$.fragment,t),r=!1},d(t){g(e,t)}}}function fe(o){let e,r;function t(...s){return o[5](o[8],...s)}return e=new C({props:{air:!0,$$slots:{default:[le]},$$scope:{ctx:o}}}),e.$on("click",t),{c(){m(e.$$.fragment)},l(s){p(e.$$.fragment,s)},m(s,a){_(e,s,a),r=!0},p(s,a){o=s;const n={};a&8192&&(n.$$scope={dirty:a,ctx:o}),e.$set(n)},i(s){r||(u(e.$$.fragment,s),r=!0)},o(s){i(e.$$.fragment,s),r=!1},d(s){g(e,s)}}}function j(o){let e,r,t,s;function a(){return o[6](o[8])}return r=new y({props:{sm:!0,track:o[9],progress:o[10],$$slots:{default:[fe]},$$scope:{ctx:o}}}),r.$on("click",a),{c(){e=q("div"),m(r.$$.fragment),t=w(),this.h()},l(n){e=L(n,"DIV",{class:!0});var f=P(e);p(r.$$.fragment,f),t=v(f),f.forEach(d),this.h()},h(){V(e,"class","dark:ring-none rounded-lg shadow-sm ring-1 ring-highlight [&>*]:bg-surface-100")},m(n,f){k(n,e,f),_(r,e,null),K(e,t),s=!0},p(n,f){o=n;const l={};f&1&&(l.track=o[9]),f&1&&(l.progress=o[10]),f&8193&&(l.$$scope={dirty:f,ctx:o}),r.$set(l)},i(n){s||(u(r.$$.fragment,n),s=!0)},o(n){i(r.$$.fragment,n),s=!1},d(n){n&&d(e),g(r)}}}function $e(o){let e,r,t,s;e=new T({props:{sm:!0,$$slots:{default:[oe]},$$scope:{ctx:o}}});let a=B(o[0]),n=[];for(let l=0;li(n[l],1,1,()=>{n[l]=null});return{c(){m(e.$$.fragment),r=w(),t=q("div");for(let l=0;l{s=null}),A());const f={};n&8198&&(f.$$scope={dirty:n,ctx:a}),r.$set(f)},i(a){t||(u(s),u(r.$$.fragment,a),t=!0)},o(a){i(s),i(r.$$.fragment,a),t=!1},d(a){a&&d(e),s&&s.d(a),g(r,a)}}}function me(o){let e,r,t,s,a;return e=new x({props:{title:"Home",$$slots:{default:[ae]},$$scope:{ctx:o}}}),t=new O({props:{class:"gap-4 p-4",$$slots:{default:[ie]},$$scope:{ctx:o}}}),{c(){m(e.$$.fragment),r=w(),m(t.$$.fragment),s=w(),this.h()},l(n){p(e.$$.fragment,n),r=v(n),p(t.$$.fragment,n),s=v(n),z("svelte-1c748qj",document.head).forEach(d),this.h()},h(){document.title="Amadeus"},m(n,f){_(e,n,f),k(n,r,f),_(t,n,f),k(n,s,f),a=!0},p(n,[f]){const l={};f&8192&&(l.$$scope={dirty:f,ctx:n}),e.$set(l);const c={};f&8199&&(c.$$scope={dirty:f,ctx:n}),t.$set(c)},i(n){a||(u(e.$$.fragment,n),u(t.$$.fragment,n),a=!0)},o(n){i(e.$$.fragment,n),i(t.$$.fragment,n),a=!1},d(n){n&&(d(r),d(s)),g(e,n),g(t,n)}}}function pe(o,e,r){let t,s,a,n;H(o,I,$=>r(4,s=$)),H(o,X,$=>r(1,a=$)),H(o,Z,$=>r(2,n=$));const f=new Set([-3,-4]);F(()=>{location.hash||location.replace("#feed")});const l=($,b)=>(I.clear($),b.stopPropagation()),c=$=>I.replicate($),h=$=>!f.has($.id);return o.$$.update=()=>{o.$$.dirty&16&&r(0,t=s.filter($=>!$.local))},[t,a,n,f,s,l,c,h]}class be extends Q{constructor(e){super(),R(this,e,pe,me,N,{})}}export{be as component}; diff --git a/_app/immutable/nodes/7.YHXThGsn.js b/_app/immutable/nodes/7.FeXnvpF2.js similarity index 89% rename from _app/immutable/nodes/7.YHXThGsn.js rename to _app/immutable/nodes/7.FeXnvpF2.js index 91a40e88..5a462247 100644 --- a/_app/immutable/nodes/7.YHXThGsn.js +++ b/_app/immutable/nodes/7.FeXnvpF2.js @@ -1 +1 @@ -import{s as k,p as C,a as S,c as y,r as A,d as g,i as B,K as I,v as h,G as b}from"../chunks/scheduler.yhBzS9E6.js";import{S as q,i as v,f as z,b as u,d as m,m as p,a as $,t as d,e as _}from"../chunks/index.f7836kWu.js";import{C as E}from"../chunks/Collection.NWTCPfm4.js";import{B as G,I as w}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"../chunks/paths.k6rcf9P1.js";import{p as K}from"../chunks/stores.jWdOIcrH.js";import{l as P,m as j}from"../chunks/Track.LR7rfYB8.js";function D(a){let t,n;return t=new w({props:{name:"trash"}}),{c(){u(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,s){p(t,e,s),n=!0},p:b,i(e){n||($(t.$$.fragment,e),n=!0)},o(e){d(t.$$.fragment,e),n=!1},d(e){_(t,e)}}}function F(a){let t,n;return t=new G({props:{air:!0,stretch:!0,$$slots:{default:[D]},$$scope:{ctx:a}}}),t.$on("click",a[2]),{c(){u(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,s){p(t,e,s),n=!0},p(e,s){const l={};s&64&&(l.$$scope={dirty:s,ctx:e}),t.$set(l)},i(e){n||($(t.$$.fragment,e),n=!0)},o(e){d(t.$$.fragment,e),n=!1},d(e){_(t,e)}}}function H(a){let t,n;return t=new w({props:{name:"last",slot:"action"}}),{c(){u(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,s){p(t,e,s),n=!0},p:b,i(e){n||($(t.$$.fragment,e),n=!0)},o(e){d(t.$$.fragment,e),n=!1},d(e){_(t,e)}}}function J(a){let t,n,e,s,l;function c(o){a[5](o)}let i={of:a[1],style:"playlist",fixed:!0,$$slots:{action:[H],default:[F]},$$scope:{ctx:a}};return a[0]!==void 0&&(i.selected=a[0]),t=new E({props:i}),C.push(()=>z(t,"selected",c)),document.title=s=(a[1]?`${a[1].title} - `:"")+"Amadeus",{c(){u(t.$$.fragment),e=S()},l(o){m(t.$$.fragment,o),e=y(o),A("svelte-pttznx",document.head).forEach(g)},m(o,r){p(t,o,r),B(o,e,r),l=!0},p(o,[r]){const f={};r&2&&(f.of=o[1]),r&64&&(f.$$scope={dirty:r,ctx:o}),!n&&r&1&&(n=!0,f.selected=o[0],I(()=>n=!1)),t.$set(f),(!l||r&2)&&s!==(s=(o[1]?`${o[1].title} - `:"")+"Amadeus")&&(document.title=s)},i(o){l||($(t.$$.fragment,o),l=!0)},o(o){d(t.$$.fragment,o),l=!1},d(o){o&&g(e),_(t,o)}}}function L(a,t,n){let e,s,l;h(a,K,r=>n(3,s=r)),h(a,j,r=>n(4,l=r));let c=new Set;function i(){P.purge([...c].map(r=>r.entry).filter(r=>!!r)),c.clear(),n(0,c)}function o(r){c=r,n(0,c)}return a.$$.update=()=>{a.$$.dirty&24&&n(1,e=l.find(r=>r.id===+s.url.hash.slice(1)))},[c,e,i,s,l,o]}class V extends q{constructor(t){super(),v(this,t,L,J,k,{})}}export{V as component}; +import{s as k,p as C,a as S,c as y,r as A,d as g,i as B,K as I,v as h,G as b}from"../chunks/scheduler.yhBzS9E6.js";import{S as q,i as v,f as z,b as u,d as m,m as p,a as $,t as d,e as _}from"../chunks/index.f7836kWu.js";import{C as E}from"../chunks/Collection.skwpo2VZ.js";import{B as G,I as w}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"../chunks/paths.G112lh3q.js";import{p as K}from"../chunks/stores.iu7Qu9dF.js";import{l as P,m as j}from"../chunks/Track.oiOqwbPY.js";function D(a){let t,n;return t=new w({props:{name:"trash"}}),{c(){u(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,s){p(t,e,s),n=!0},p:b,i(e){n||($(t.$$.fragment,e),n=!0)},o(e){d(t.$$.fragment,e),n=!1},d(e){_(t,e)}}}function F(a){let t,n;return t=new G({props:{air:!0,stretch:!0,$$slots:{default:[D]},$$scope:{ctx:a}}}),t.$on("click",a[2]),{c(){u(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,s){p(t,e,s),n=!0},p(e,s){const l={};s&64&&(l.$$scope={dirty:s,ctx:e}),t.$set(l)},i(e){n||($(t.$$.fragment,e),n=!0)},o(e){d(t.$$.fragment,e),n=!1},d(e){_(t,e)}}}function H(a){let t,n;return t=new w({props:{name:"last",slot:"action"}}),{c(){u(t.$$.fragment)},l(e){m(t.$$.fragment,e)},m(e,s){p(t,e,s),n=!0},p:b,i(e){n||($(t.$$.fragment,e),n=!0)},o(e){d(t.$$.fragment,e),n=!1},d(e){_(t,e)}}}function J(a){let t,n,e,s,l;function c(o){a[5](o)}let i={of:a[1],style:"playlist",fixed:!0,$$slots:{action:[H],default:[F]},$$scope:{ctx:a}};return a[0]!==void 0&&(i.selected=a[0]),t=new E({props:i}),C.push(()=>z(t,"selected",c)),document.title=s=(a[1]?`${a[1].title} - `:"")+"Amadeus",{c(){u(t.$$.fragment),e=S()},l(o){m(t.$$.fragment,o),e=y(o),A("svelte-pttznx",document.head).forEach(g)},m(o,r){p(t,o,r),B(o,e,r),l=!0},p(o,[r]){const f={};r&2&&(f.of=o[1]),r&64&&(f.$$scope={dirty:r,ctx:o}),!n&&r&1&&(n=!0,f.selected=o[0],I(()=>n=!1)),t.$set(f),(!l||r&2)&&s!==(s=(o[1]?`${o[1].title} - `:"")+"Amadeus")&&(document.title=s)},i(o){l||($(t.$$.fragment,o),l=!0)},o(o){d(t.$$.fragment,o),l=!1},d(o){o&&g(e),_(t,o)}}}function L(a,t,n){let e,s,l;h(a,K,r=>n(3,s=r)),h(a,j,r=>n(4,l=r));let c=new Set;function i(){P.purge([...c].map(r=>r.entry).filter(r=>!!r)),c.clear(),n(0,c)}function o(r){c=r,n(0,c)}return a.$$.update=()=>{a.$$.dirty&24&&n(1,e=l.find(r=>r.id===+s.url.hash.slice(1)))},[c,e,i,s,l,o]}class V extends q{constructor(t){super(),v(this,t,L,J,k,{})}}export{V as component}; diff --git a/_app/immutable/nodes/8.Ow38-iKz.js b/_app/immutable/nodes/8.UPr0t3xw.js similarity index 96% rename from _app/immutable/nodes/8.Ow38-iKz.js rename to _app/immutable/nodes/8.UPr0t3xw.js index 0c0e2267..7210e76a 100644 --- a/_app/immutable/nodes/8.Ow38-iKz.js +++ b/_app/immutable/nodes/8.UPr0t3xw.js @@ -1,4 +1,4 @@ -import{P as re,Q as le,R as O,S as oe,s as W,p as R,w as F,f as z,a as M,g as A,h as D,c as N,d,j as k,E as w,i as y,u as I,J as K,C as ce,K as ue,x as X,y as Z,z as x,T as ie,A as fe,o as _e,G as g,e as Q,r as ee,k as S,U as me,V as pe,I as he,L as $e,l as te,m as se,v as P,D as de}from"../chunks/scheduler.yhBzS9E6.js";import{g as ge,t as v,c as ve,a as b,S as q,i as G,f as be,b as C,d as L,m as E,e as T}from"../chunks/index.f7836kWu.js";import{e as U,p as j,s as ke,g as we,t as Ce}from"../chunks/Track.LR7rfYB8.js";import{S as ne}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import{i as Le,T as Ee}from"../chunks/Player.J8CE-V80.js";import{a as Te}from"../chunks/autoscroll.ckBVSgbF.js";import"../chunks/paths.k6rcf9P1.js";import{T as ye}from"../chunks/util.VvTXxVpP.js";import{O as ae}from"../chunks/Overview.T1RnAS_v.js";function Se(s,e){const n=e.token={};function t(a,r,u,o){if(e.token!==n)return;e.resolved=o;let f=e.ctx;u!==void 0&&(f=f.slice(),f[u]=o);const c=a&&(e.current=a)(f);let p=!1;e.block&&(e.blocks?e.blocks.forEach((i,m)=>{m!==r&&i&&(ge(),v(i,1,1,()=>{e.blocks[m]===i&&(e.blocks[m]=null)}),ve())}):e.block.d(1),c.c(),b(c,1),c.m(e.mount(),e.anchor),p=!0),e.block=c,e.blocks&&(e.blocks[r]=c),p&&oe()}if(re(s)){const a=le();if(s.then(r=>{O(a),t(e.then,1,e.value,r),O(null)},r=>{if(O(a),t(e.catch,2,e.error,r),O(null),!e.hasCatch)throw r}),e.current!==e.pending)return t(e.pending,0),!0}else{if(e.current!==e.then)return t(e.then,1,e.value,s),!0;e.resolved=s}}function Ie(s,e,n){const t=e.slice(),{resolved:a}=s;s.current===s.then&&(t[s.value]=a),s.current===s.catch&&(t[s.error]=a),s.block.p(t,n)}function ze(s){let e;return{c(){e=z("div"),this.h()},l(n){e=A(n,"DIV",{class:!0}),D(e).forEach(d),this.h()},h(){k(e,"class","py-11")},m(n,t){y(n,e,t)},p:g,d(n){n&&d(e)}}}function Ae(s){let e,n,t,a,r,u,o,f;function c(l){s[6](l)}let p={title:s[0],$$slots:{default:[ze]},$$scope:{ctx:s}};s[3]!==void 0&&(p.stuck=s[3]),n=new ye({props:p}),R.push(()=>be(n,"stuck",c));const i=s[5].default,m=F(i,s,s[8],null);return{c(){e=z("section"),C(n.$$.fragment),a=M(),m&&m.c(),this.h()},l(l){e=A(l,"SECTION",{id:!0,class:!0});var _=D(e);L(n.$$.fragment,_),a=N(_),m&&m.l(_),_.forEach(d),this.h()},h(){k(e,"id",r=s[0].toLowerCase()),k(e,"class","relative z-10 h-full w-full snap-start snap-always overflow-x-hidden overflow-y-scroll"),w(e,"[&~nav_div_a]:pointer-events-none",s[2]&&s[3]),w(e,"[&~nav_div_a]:-translate-y-full",s[2]&&s[3]),w(e,"[&~nav_div]:opacity-0",s[2]&&s[3]),w(e,"target",s[2])},m(l,_){y(l,e,_),E(n,e,null),I(e,a),m&&m.m(e,null),s[7](e),u=!0,o||(f=[K(Le.call(null,e,[0,.5,.999])),ce(e,"intersect",s[4]),K(Te.call(null,e))],o=!0)},p(l,[_]){const h={};_&1&&(h.title=l[0]),_&256&&(h.$$scope={dirty:_,ctx:l}),!t&&_&8&&(t=!0,h.stuck=l[3],ue(()=>t=!1)),n.$set(h),m&&m.p&&(!u||_&256)&&X(m,i,l,l[8],u?x(i,l[8],_,null):Z(l[8]),null),(!u||_&1&&r!==(r=l[0].toLowerCase()))&&k(e,"id",r),(!u||_&12)&&w(e,"[&~nav_div_a]:pointer-events-none",l[2]&&l[3]),(!u||_&12)&&w(e,"[&~nav_div_a]:-translate-y-full",l[2]&&l[3]),(!u||_&12)&&w(e,"[&~nav_div]:opacity-0",l[2]&&l[3]),(!u||_&4)&&w(e,"target",l[2])},i(l){u||(b(n.$$.fragment,l),b(m,l),u=!0)},o(l){v(n.$$.fragment,l),v(m,l),u=!1},d(l){l&&d(e),T(n),m&&m.d(l),s[7](null),o=!1,ie(f)}}}function Ve(s,e,n){let{$$slots:t={},$$scope:a}=e,{name:r}=e;const u=fe("tabs");u.push(r);let o,f=!1,c=!1;function p({detail:l}){if(u.length<=1)return n(2,f=!0);n(2,f=l.intersectionRatio>.5),l.intersectionRatio>=.999&&location.replace(`#${r.toLowerCase()}`)}_e(()=>{location.hash===`#${r.toLowerCase()}`&&o.scrollIntoView()});function i(l){c=l,n(3,c)}function m(l){R[l?"unshift":"push"](()=>{o=l,n(1,o)})}return s.$$set=l=>{"name"in l&&n(0,r=l.name),"$$scope"in l&&n(8,a=l.$$scope)},[r,o,f,c,p,t,i,m,a]}class H extends q{constructor(e){super(),G(this,e,Ve,Ae,W,{name:0})}}function Y(s,e,n){const t=s.slice();return t[14]=e[n],t[15]=e,t[16]=n,t}function B(s){let e,n,t=s[14]+"",a,r,u=s[16];const o=()=>s[10](e,u),f=()=>s[10](null,u);return{c(){e=z("div"),n=z("a"),a=te(t),r=M(),this.h()},l(c){e=A(c,"DIV",{class:!0,"aria-label":!0});var p=D(e);n=A(p,"A",{href:!0,class:!0});var i=D(n);a=se(i,t),i.forEach(d),r=N(p),p.forEach(d),this.h()},h(){k(n,"href","#"+s[14].toLowerCase()),k(n,"class","block transform-gpu touch-manipulation select-none transition-composite duration-300 will-change-transform focus-visible:underline focus-visible:outline-none hover:text-content-100 svelte-1ucfubu"),k(e,"class","h-11 origin-top-left overflow-hidden pl-4 text-center text-2xl font-normal text-content-200 underline-offset-4 transition-opacity duration-300 ease-in svelte-1ucfubu"),k(e,"aria-label",s[14]),S(e,"transform",s[4][s[16]])},m(c,p){y(c,e,p),I(e,n),I(n,a),I(e,r),o()},p(c,p){s=c,u!==s[16]&&(f(),u=s[16],o()),p&16&&S(e,"transform",s[4][s[16]])},d(c){c&&d(e),f()}}}function Me(s){return{c:g,l:g,m:g,p:g,d:g}}function De(s){let e,n=s[13]+"",t;return{c(){e=z("style"),t=te(n),this.h()},l(a){e=A(a,"STYLE",{class:!0});var r=D(e);t=se(r,n),r.forEach(d),this.h()},h(){k(e,"class","svelte-1ucfubu")},m(a,r){y(a,e,r),I(e,t)},p:g,d(a){a&&d(e)}}}function Ne(s){return{c:g,l:g,m:g,p:g,d:g}}function Oe(s){let e,n,t,a,r,u,o;const f=s[9].default,c=F(f,s,s[8],null);let p=U(s[5]),i=[];for(let l=0;ls[12].call(e)),w(e,"scroll-smooth",s[2])},m(l,_){y(l,e,_),c&&c.m(e,null),I(e,n),I(e,t);for(let h=0;hu.parentNode,m.anchor=u,o=!0},p(l,[_]){if(s=l,c&&c.p&&(!o||_&256)&&X(c,f,s,s[8],o?x(f,s[8],_,null):Z(s[8]),null),_&49){p=U(s[5]);let h;for(h=0;h`:where(#${$.toLowerCase()}).target~nav>div{color:hsl(var(--color-content-200));pointer-events:auto;font-weight:normal;}:where(#${$.toLowerCase()}:target~nav)>div[aria-label='${$}'],#${$.toLowerCase()}.target~nav>div[aria-label='${$}']{color:hsl(var(--color-content));pointer-events:none;font-weight:bold;}`).join("")}function l($,V){R[$?"unshift":"push"](()=>{f[V]=$,n(0,f)})}function _($){R[$?"unshift":"push"](()=>{p=$,n(3,p)})}function h(){i=this.clientWidth,n(1,i)}return s.$$set=$=>{"$$scope"in $&&n(8,o=$.$$scope)},s.$$.update=()=>{s.$$.dirty&1&&n(7,t=f.map($=>$.offsetLeft)),s.$$.dirty&131&&n(2,a=t.slice(-1)[0]+f.slice(-1)[0]?.clientWidth>=i),s.$$.dirty&134&&n(4,r=t.map(($,V)=>{if(!a)return"";const J=i*V/$||1;return` +import{P as re,Q as le,R as O,S as oe,s as W,p as R,w as F,f as z,a as M,g as A,h as D,c as N,d,j as k,E as w,i as y,u as I,J as K,C as ce,K as ue,x as X,y as Z,z as x,T as ie,A as fe,o as _e,G as g,e as Q,r as ee,k as S,U as me,V as pe,I as he,L as $e,l as te,m as se,v as P,D as de}from"../chunks/scheduler.yhBzS9E6.js";import{g as ge,t as v,c as ve,a as b,S as q,i as G,f as be,b as C,d as L,m as E,e as T}from"../chunks/index.f7836kWu.js";import{e as U,p as j,s as ke,g as we,t as Ce}from"../chunks/Track.oiOqwbPY.js";import{S as ne}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import{i as Le,T as Ee}from"../chunks/Player.4gabUvVV.js";import{a as Te}from"../chunks/autoscroll.sHJkSdr1.js";import"../chunks/paths.G112lh3q.js";import{T as ye}from"../chunks/util.2xyf67Ew.js";import{O as ae}from"../chunks/Overview.bs2WCKrP.js";function Se(s,e){const n=e.token={};function t(a,r,u,o){if(e.token!==n)return;e.resolved=o;let f=e.ctx;u!==void 0&&(f=f.slice(),f[u]=o);const c=a&&(e.current=a)(f);let p=!1;e.block&&(e.blocks?e.blocks.forEach((i,m)=>{m!==r&&i&&(ge(),v(i,1,1,()=>{e.blocks[m]===i&&(e.blocks[m]=null)}),ve())}):e.block.d(1),c.c(),b(c,1),c.m(e.mount(),e.anchor),p=!0),e.block=c,e.blocks&&(e.blocks[r]=c),p&&oe()}if(re(s)){const a=le();if(s.then(r=>{O(a),t(e.then,1,e.value,r),O(null)},r=>{if(O(a),t(e.catch,2,e.error,r),O(null),!e.hasCatch)throw r}),e.current!==e.pending)return t(e.pending,0),!0}else{if(e.current!==e.then)return t(e.then,1,e.value,s),!0;e.resolved=s}}function Ie(s,e,n){const t=e.slice(),{resolved:a}=s;s.current===s.then&&(t[s.value]=a),s.current===s.catch&&(t[s.error]=a),s.block.p(t,n)}function ze(s){let e;return{c(){e=z("div"),this.h()},l(n){e=A(n,"DIV",{class:!0}),D(e).forEach(d),this.h()},h(){k(e,"class","py-11")},m(n,t){y(n,e,t)},p:g,d(n){n&&d(e)}}}function Ae(s){let e,n,t,a,r,u,o,f;function c(l){s[6](l)}let p={title:s[0],$$slots:{default:[ze]},$$scope:{ctx:s}};s[3]!==void 0&&(p.stuck=s[3]),n=new ye({props:p}),R.push(()=>be(n,"stuck",c));const i=s[5].default,m=F(i,s,s[8],null);return{c(){e=z("section"),C(n.$$.fragment),a=M(),m&&m.c(),this.h()},l(l){e=A(l,"SECTION",{id:!0,class:!0});var _=D(e);L(n.$$.fragment,_),a=N(_),m&&m.l(_),_.forEach(d),this.h()},h(){k(e,"id",r=s[0].toLowerCase()),k(e,"class","relative z-10 h-full w-full snap-start snap-always overflow-x-hidden overflow-y-scroll"),w(e,"[&~nav_div_a]:pointer-events-none",s[2]&&s[3]),w(e,"[&~nav_div_a]:-translate-y-full",s[2]&&s[3]),w(e,"[&~nav_div]:opacity-0",s[2]&&s[3]),w(e,"target",s[2])},m(l,_){y(l,e,_),E(n,e,null),I(e,a),m&&m.m(e,null),s[7](e),u=!0,o||(f=[K(Le.call(null,e,[0,.5,.999])),ce(e,"intersect",s[4]),K(Te.call(null,e))],o=!0)},p(l,[_]){const h={};_&1&&(h.title=l[0]),_&256&&(h.$$scope={dirty:_,ctx:l}),!t&&_&8&&(t=!0,h.stuck=l[3],ue(()=>t=!1)),n.$set(h),m&&m.p&&(!u||_&256)&&X(m,i,l,l[8],u?x(i,l[8],_,null):Z(l[8]),null),(!u||_&1&&r!==(r=l[0].toLowerCase()))&&k(e,"id",r),(!u||_&12)&&w(e,"[&~nav_div_a]:pointer-events-none",l[2]&&l[3]),(!u||_&12)&&w(e,"[&~nav_div_a]:-translate-y-full",l[2]&&l[3]),(!u||_&12)&&w(e,"[&~nav_div]:opacity-0",l[2]&&l[3]),(!u||_&4)&&w(e,"target",l[2])},i(l){u||(b(n.$$.fragment,l),b(m,l),u=!0)},o(l){v(n.$$.fragment,l),v(m,l),u=!1},d(l){l&&d(e),T(n),m&&m.d(l),s[7](null),o=!1,ie(f)}}}function Ve(s,e,n){let{$$slots:t={},$$scope:a}=e,{name:r}=e;const u=fe("tabs");u.push(r);let o,f=!1,c=!1;function p({detail:l}){if(u.length<=1)return n(2,f=!0);n(2,f=l.intersectionRatio>.5),l.intersectionRatio>=.999&&location.replace(`#${r.toLowerCase()}`)}_e(()=>{location.hash===`#${r.toLowerCase()}`&&o.scrollIntoView()});function i(l){c=l,n(3,c)}function m(l){R[l?"unshift":"push"](()=>{o=l,n(1,o)})}return s.$$set=l=>{"name"in l&&n(0,r=l.name),"$$scope"in l&&n(8,a=l.$$scope)},[r,o,f,c,p,t,i,m,a]}class H extends q{constructor(e){super(),G(this,e,Ve,Ae,W,{name:0})}}function Y(s,e,n){const t=s.slice();return t[14]=e[n],t[15]=e,t[16]=n,t}function B(s){let e,n,t=s[14]+"",a,r,u=s[16];const o=()=>s[10](e,u),f=()=>s[10](null,u);return{c(){e=z("div"),n=z("a"),a=te(t),r=M(),this.h()},l(c){e=A(c,"DIV",{class:!0,"aria-label":!0});var p=D(e);n=A(p,"A",{href:!0,class:!0});var i=D(n);a=se(i,t),i.forEach(d),r=N(p),p.forEach(d),this.h()},h(){k(n,"href","#"+s[14].toLowerCase()),k(n,"class","block transform-gpu touch-manipulation select-none transition-composite duration-300 will-change-transform focus-visible:underline focus-visible:outline-none hover:text-content-100 svelte-1ucfubu"),k(e,"class","h-11 origin-top-left overflow-hidden pl-4 text-center text-2xl font-normal text-content-200 underline-offset-4 transition-opacity duration-300 ease-in svelte-1ucfubu"),k(e,"aria-label",s[14]),S(e,"transform",s[4][s[16]])},m(c,p){y(c,e,p),I(e,n),I(n,a),I(e,r),o()},p(c,p){s=c,u!==s[16]&&(f(),u=s[16],o()),p&16&&S(e,"transform",s[4][s[16]])},d(c){c&&d(e),f()}}}function Me(s){return{c:g,l:g,m:g,p:g,d:g}}function De(s){let e,n=s[13]+"",t;return{c(){e=z("style"),t=te(n),this.h()},l(a){e=A(a,"STYLE",{class:!0});var r=D(e);t=se(r,n),r.forEach(d),this.h()},h(){k(e,"class","svelte-1ucfubu")},m(a,r){y(a,e,r),I(e,t)},p:g,d(a){a&&d(e)}}}function Ne(s){return{c:g,l:g,m:g,p:g,d:g}}function Oe(s){let e,n,t,a,r,u,o;const f=s[9].default,c=F(f,s,s[8],null);let p=U(s[5]),i=[];for(let l=0;ls[12].call(e)),w(e,"scroll-smooth",s[2])},m(l,_){y(l,e,_),c&&c.m(e,null),I(e,n),I(e,t);for(let h=0;hu.parentNode,m.anchor=u,o=!0},p(l,[_]){if(s=l,c&&c.p&&(!o||_&256)&&X(c,f,s,s[8],o?x(f,s[8],_,null):Z(s[8]),null),_&49){p=U(s[5]);let h;for(h=0;h`:where(#${$.toLowerCase()}).target~nav>div{color:hsl(var(--color-content-200));pointer-events:auto;font-weight:normal;}:where(#${$.toLowerCase()}:target~nav)>div[aria-label='${$}'],#${$.toLowerCase()}.target~nav>div[aria-label='${$}']{color:hsl(var(--color-content));pointer-events:none;font-weight:bold;}`).join("")}function l($,V){R[$?"unshift":"push"](()=>{f[V]=$,n(0,f)})}function _($){R[$?"unshift":"push"](()=>{p=$,n(3,p)})}function h(){i=this.clientWidth,n(1,i)}return s.$$set=$=>{"$$scope"in $&&n(8,o=$.$$scope)},s.$$.update=()=>{s.$$.dirty&1&&n(7,t=f.map($=>$.offsetLeft)),s.$$.dirty&131&&n(2,a=t.slice(-1)[0]+f.slice(-1)[0]?.clientWidth>=i),s.$$.dirty&134&&n(4,r=t.map(($,V)=>{if(!a)return"";const J=i*V/$||1;return` translate3d(${-$}px,-2.75rem,${-J+1}px) scale(${J}) translate3d(${$}px,2.75rem,0) diff --git a/_app/immutable/nodes/9.oqKgscox.js b/_app/immutable/nodes/9.py_ynymV.js similarity index 79% rename from _app/immutable/nodes/9.oqKgscox.js rename to _app/immutable/nodes/9.py_ynymV.js index 314ff8f9..b22fc8c3 100644 --- a/_app/immutable/nodes/9.oqKgscox.js +++ b/_app/immutable/nodes/9.py_ynymV.js @@ -1 +1 @@ -import{s as g,a as h,c as b,r as C,d as m,i as v,v as c,F as w,G as y}from"../chunks/scheduler.yhBzS9E6.js";import{S as A,i as I,b as p,d as u,m as f,a as _,t as $,e as d}from"../chunks/index.f7836kWu.js";import{C as S}from"../chunks/Collection.NWTCPfm4.js";import{a as l,g as q}from"../chunks/Track.LR7rfYB8.js";import{I as z}from"../chunks/Spinner.svelte_svelte_type_style_lang.azhq3UA4.js";import"../chunks/paths.k6rcf9P1.js";import{p as E}from"../chunks/stores.jWdOIcrH.js";function F(a){let e,n;return e=new z({props:{name:"last",slot:"action"}}),{c(){p(e.$$.fragment)},l(o){u(e.$$.fragment,o)},m(o,r){f(e,o,r),n=!0},p:y,i(o){n||(_(e.$$.fragment,o),n=!0)},o(o){$(e.$$.fragment,o),n=!1},d(o){d(e,o)}}}function G(a){let e,n,o,r;return e=new S({props:{of:a[0],style:"artist",$$slots:{action:[F]},$$scope:{ctx:a}}}),document.title=o=(a[0]?`${a[0].title} - `:"")+"Amadeus",{c(){p(e.$$.fragment),n=h()},l(t){u(e.$$.fragment,t),n=b(t),C("svelte-pttznx",document.head).forEach(m)},m(t,s){f(e,t,s),v(t,n,s),r=!0},p(t,[s]){const i={};s&1&&(i.of=t[0]),s&16&&(i.$$scope={dirty:s,ctx:t}),e.$set(i),(!r||s&1)&&o!==(o=(t[0]?`${t[0].title} - `:"")+"Amadeus")&&(document.title=o)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){$(e.$$.fragment,t),r=!1},d(t){t&&m(n),d(e,t)}}}function P(a,e,n){let o,r,t,s;return c(a,l,i=>n(3,r=i)),c(a,E,i=>n(1,t=i)),c(a,q,i=>n(2,s=i)),a.$$.update=()=>{a.$$.dirty&6&&n(0,o=s.find(i=>i.id===+t.url.hash.slice(1))),a.$$.dirty&1&&w(l,r=o?[o.title,"person"]:null,r)},[o,t,s]}class K extends A{constructor(e){super(),I(this,e,P,G,g,{})}}export{K as component}; +import{s as g,a as h,c as b,r as C,d as m,i as v,v as c,F as w,G as y}from"../chunks/scheduler.yhBzS9E6.js";import{S as A,i as I,b as p,d as u,m as f,a as _,t as $,e as d}from"../chunks/index.f7836kWu.js";import{C as S}from"../chunks/Collection.skwpo2VZ.js";import{a as l,g as q}from"../chunks/Track.oiOqwbPY.js";import{I as z}from"../chunks/Spinner.svelte_svelte_type_style_lang.NQN6mtec.js";import"../chunks/paths.G112lh3q.js";import{p as E}from"../chunks/stores.iu7Qu9dF.js";function F(a){let e,n;return e=new z({props:{name:"last",slot:"action"}}),{c(){p(e.$$.fragment)},l(o){u(e.$$.fragment,o)},m(o,r){f(e,o,r),n=!0},p:y,i(o){n||(_(e.$$.fragment,o),n=!0)},o(o){$(e.$$.fragment,o),n=!1},d(o){d(e,o)}}}function G(a){let e,n,o,r;return e=new S({props:{of:a[0],style:"artist",$$slots:{action:[F]},$$scope:{ctx:a}}}),document.title=o=(a[0]?`${a[0].title} - `:"")+"Amadeus",{c(){p(e.$$.fragment),n=h()},l(t){u(e.$$.fragment,t),n=b(t),C("svelte-pttznx",document.head).forEach(m)},m(t,s){f(e,t,s),v(t,n,s),r=!0},p(t,[s]){const i={};s&1&&(i.of=t[0]),s&16&&(i.$$scope={dirty:s,ctx:t}),e.$set(i),(!r||s&1)&&o!==(o=(t[0]?`${t[0].title} - `:"")+"Amadeus")&&(document.title=o)},i(t){r||(_(e.$$.fragment,t),r=!0)},o(t){$(e.$$.fragment,t),r=!1},d(t){t&&m(n),d(e,t)}}}function P(a,e,n){let o,r,t,s;return c(a,l,i=>n(3,r=i)),c(a,E,i=>n(1,t=i)),c(a,q,i=>n(2,s=i)),a.$$.update=()=>{a.$$.dirty&6&&n(0,o=s.find(i=>i.id===+t.url.hash.slice(1))),a.$$.dirty&1&&w(l,r=o?[o.title,"person"]:null,r)},[o,t,s]}class K extends A{constructor(e){super(),I(this,e,P,G,g,{})}}export{K as component}; diff --git a/_app/version.json b/_app/version.json index 77b74e90..539f2f85 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1704479236485"} \ No newline at end of file +{"version":"1704646009287"} \ No newline at end of file diff --git a/explore.html b/explore.html index 4eb5ed03..3d69eedd 100644 --- a/explore.html +++ b/explore.html @@ -5,27 +5,27 @@ - + - + - - + + - + - - - - - - - + + + + + + + - - - - Explore - Amadeus + + + + Explore - Amadeus
+