From cd03dce392caddff253b8f4a7b7a27292c876ee5 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 30 Aug 2023 17:26:53 +0100 Subject: [PATCH] fix: correct overflow of code blocks in markdown --- src/resources/webview/assets/index.css | 2 +- src/resources/webview/assets/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/webview/assets/index.css b/src/resources/webview/assets/index.css index 1a536b40..1a59209f 100644 --- a/src/resources/webview/assets/index.css +++ b/src/resources/webview/assets/index.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}body{padding:0}details>summary{cursor:pointer}details>summary:hover{opacity:.8}*,:before,:after{--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: rgb(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: rgb(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: }.visible{visibility:visible}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.left-\[0px\]{left:0}.left-\[16px\]{left:16px}.left-\[32px\]{left:32px}.right-3{right:.75rem}.top-3{top:.75rem}.top-\[0px\]{top:0}.top-\[16px\]{top:16px}.top-\[32px\]{top:32px}.col-span-1{grid-column:span 1 / span 1}.col-span-4{grid-column:span 4 / span 4}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-4{margin-left:1rem}.mr-4{margin-right:1rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-2{height:.5rem}.h-4{height:1rem}.h-7{height:1.75rem}.h-\[1\.5rem\]{height:1.5rem}.h-\[2px\]{height:2px}.h-\[34px\]{height:34px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-full{max-height:100%}.w-2{width:.5rem}.w-4{width:1rem}.w-7{width:1.75rem}.w-\[2px\]{width:2px}.w-\[34px\]{width:34px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-full{max-width:100%}.grow{flex-grow:1}.grow-0{flex-grow:0}@keyframes oscillateY{0%{transform:translateY(0)}40%{transform:translateY(-.25rem);opacity:.4}60%{transform:translateY(0)}to{transform:translateY(0)}}.animate-typing-dots{animation:oscillateY .8s ease-in-out infinite}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-8{gap:2rem}.divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(2px * var(--tw-divide-x-reverse));border-left-width:calc(2px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-y-4>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(4px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(4px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:var(--border)}.overflow-clip{overflow:clip}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-tr-lg{border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-border{border-color:var(--border)}.border-b-border{border-bottom-color:var(--border)}.border-t-border{border-top-color:var(--border)}.bg-background{background-color:var(--background)}.bg-chat{background-color:var(--chat)}.bg-editor{background-color:var(--editor)}.bg-error{background-color:var(--error)}.bg-foreground{background-color:var(--foreground)}.bg-highlight{background-color:var(--highlight)}.bg-primary{background-color:var(--primary)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pl-5{padding-left:1.25rem}.pr-10{padding-right:2.5rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.italic{font-style:italic}.text-foreground{color:var(--foreground)}.text-highlight{color:var(--highlight)}.underline{text-decoration-line:underline}.transition{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-duration:.15s}.rounded-lg-bl-none{border-top-left-radius:.5rem;border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-lg-br-none{border-top-left-radius:.5rem;border-top-right-radius:.5rem;border-bottom-left-radius:.5rem}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:bg-chat:hover{background-color:var(--chat)}.hover\:opacity-80:hover{opacity:.8}.hover\:enabled\:opacity-80:enabled:hover{opacity:.8}.disabled\:text-disabled:disabled{color:var(--disabled)}.group:hover .group-hover\:visible{visibility:visible} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}body{padding:0}details>summary{cursor:pointer}details>summary:hover{opacity:.8}*,:before,:after{--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: rgb(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: rgb(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: }.visible{visibility:visible}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.left-\[0px\]{left:0}.left-\[16px\]{left:16px}.left-\[32px\]{left:32px}.right-3{right:.75rem}.top-3{top:.75rem}.top-\[0px\]{top:0}.top-\[16px\]{top:16px}.top-\[32px\]{top:32px}.col-span-1{grid-column:span 1 / span 1}.col-span-4{grid-column:span 4 / span 4}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-4{margin-left:1rem}.mr-4{margin-right:1rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-2{height:.5rem}.h-4{height:1rem}.h-7{height:1.75rem}.h-\[1\.5rem\]{height:1.5rem}.h-\[2px\]{height:2px}.h-\[34px\]{height:34px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-full{max-height:100%}.w-2{width:.5rem}.w-4{width:1rem}.w-7{width:1.75rem}.w-\[2px\]{width:2px}.w-\[34px\]{width:34px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.max-w-full{max-width:100%}.grow{flex-grow:1}.grow-0{flex-grow:0}@keyframes oscillateY{0%{transform:translateY(0)}40%{transform:translateY(-.25rem);opacity:.4}60%{transform:translateY(0)}to{transform:translateY(0)}}.animate-typing-dots{animation:oscillateY .8s ease-in-out infinite}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-8{gap:2rem}.divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(2px * var(--tw-divide-x-reverse));border-left-width:calc(2px * calc(1 - var(--tw-divide-x-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-y-4>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(4px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(4px * var(--tw-divide-y-reverse))}.divide-border>:not([hidden])~:not([hidden]){border-color:var(--border)}.overflow-clip{overflow:clip}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-tl-lg{border-top-left-radius:.5rem}.rounded-tr-lg{border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-border{border-color:var(--border)}.border-b-border{border-bottom-color:var(--border)}.border-t-border{border-top-color:var(--border)}.bg-background{background-color:var(--background)}.bg-chat{background-color:var(--chat)}.bg-editor{background-color:var(--editor)}.bg-error{background-color:var(--error)}.bg-foreground{background-color:var(--foreground)}.bg-highlight{background-color:var(--highlight)}.bg-primary{background-color:var(--primary)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pl-5{padding-left:1.25rem}.pr-10{padding-right:2.5rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.italic{font-style:italic}.text-foreground{color:var(--foreground)}.text-highlight{color:var(--highlight)}.underline{text-decoration-line:underline}.transition{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-duration:.15s}.rounded-lg-bl-none{border-top-left-radius:.5rem;border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-lg-br-none{border-top-left-radius:.5rem;border-top-right-radius:.5rem;border-bottom-left-radius:.5rem}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:bg-chat:hover{background-color:var(--chat)}.hover\:opacity-80:hover{opacity:.8}.hover\:enabled\:opacity-80:enabled:hover{opacity:.8}.disabled\:text-disabled:disabled{color:var(--disabled)}.group:hover .group-hover\:visible{visibility:visible} diff --git a/src/resources/webview/assets/index.js b/src/resources/webview/assets/index.js index a1490add..bf47757a 100644 --- a/src/resources/webview/assets/index.js +++ b/src/resources/webview/assets/index.js @@ -849,4 +849,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho ]`,h={scope:"string",variants:[u,l,c,f]},p={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],g=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:b,literal:(ee=>{const X=[];return ee.forEach(q=>{X.push(q),q.toLowerCase()===q?X.push(q.toUpperCase()):X.push(q.toLowerCase())}),X})(E),built_in:g},A=ee=>ee.map(X=>X.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,t.concat(d,"+"),t.concat("(?!",A(g).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},v=t.concat(r,"\\b(?!\\()"),N={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),v],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),v],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[I,s,N,e.C_BLOCK_COMMENT_MODE,h,p,k]},O={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",A(b).join("\\b|"),"|",A(g).join("\\b|"),"\\b)"),r,t.concat(d,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(O);const U=[I,N,e.C_BLOCK_COMMENT_MODE,h,p,k],j={begin:t.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:y,contains:[j,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,O,N,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},k,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",s,N,e.C_BLOCK_COMMENT_MODE,h,p]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},h,p]}}function bL(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function vL(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function AL(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},c={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",h=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,p=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${h}))[eE][+-]?(${d})[jJ]?(?=${p})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${d})[jJ](?=${p})`}]},b={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,E,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,E,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,E,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},f,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,g,f]}]}}function SL(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function NL(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function CL(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},v=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);c.contains=v,E.contains=v;const N="[>?]>",I="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",D="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",O=[{begin:/^\s*=>/,starts:{end:"$",contains:v}},{className:"meta.prompt",begin:"^("+N+"|"+I+"|"+D+")(?=[ ])",starts:{end:"$",keywords:o,contains:v}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(O).concat(u).concat(v)}}function xL(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],s=["true","false","Some","None","Ok","Err"],o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],a=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:a,keyword:i,literal:s,built_in:o},illegal:""},n]}}const kL=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),wL=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],OL=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],IL=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],RL=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ML=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function LL(e){const t=kL(e),n=RL,r=IL,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+wL.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ML.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:OL.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function PL(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function DL(e){const t=e.regex,n=e.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=c,p=[...u,...l].filter(y=>!c.includes(y)),E={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},b={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={begin:t.concat(/\b/,t.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function T(y,{exceptions:A,when:k}={}){const v=k;return A=A||[],y.map(N=>N.match(/\|\d+$/)||A.includes(N)?N:v(N)?`${N}|0`:N)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:T(p,{when:y=>y.length<3}),literal:s,type:a,built_in:f},contains:[{begin:t.either(...d),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:p.concat(d),literal:s,type:a}},{className:"type",begin:t.either(...o)},g,E,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,b]}}function C8(e){return e?typeof e=="string"?e:e.source:null}function h1(e){return we("(?=",e,")")}function we(...e){return e.map(n=>C8(n)).join("")}function FL(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Rt(...e){return"("+(FL(e).capture?"":"?:")+e.map(r=>C8(r)).join("|")+")"}const wp=e=>we(/\b/,e,/\w$/.test(e)?/\b/:/\B/),BL=["Protocol","Type"].map(wp),iE=["init","self"].map(wp),UL=["Any","Self"],ed=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],sE=["false","nil","true"],HL=["assignment","associativity","higherThan","left","lowerThan","none","right"],zL=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],oE=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],x8=Rt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),k8=Rt(x8,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),td=we(x8,k8,"*"),w8=Rt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),xu=Rt(w8,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),lr=we(w8,xu,"*"),nd=we(/[A-Z]/,xu,"*"),$L=["autoclosure",we(/convention\(/,Rt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",we(/objc\(/,lr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],GL=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function KL(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Rt(...BL,...iE)],className:{2:"keyword"}},s={match:we(/\./,Rt(...ed)),relevance:0},o=ed.filter(he=>typeof he=="string").concat(["_|0"]),a=ed.filter(he=>typeof he!="string").concat(UL).map(wp),l={variants:[{className:"keyword",match:Rt(...a,...iE)}]},u={$pattern:Rt(/\b\w+/,/#\w+/),keyword:o.concat(zL),literal:sE},c=[i,s,l],f={match:we(/\./,Rt(...oE)),relevance:0},d={className:"built_in",match:we(/\b/,Rt(...oE),/(?=\()/)},h=[f,d],p={match:/->/,relevance:0},E={className:"operator",relevance:0,variants:[{match:td},{match:`\\.(\\.|${k8})+`}]},b=[p,E],g="([0-9]_*)+",T="([0-9a-fA-F]_*)+",y={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${T})(\\.(${T}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(he="")=>({className:"subst",variants:[{match:we(/\\/,he,/[0\\tnr"']/)},{match:we(/\\/,he,/u\{[0-9a-fA-F]{1,8}\}/)}]}),k=(he="")=>({className:"subst",match:we(/\\/,he,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(he="")=>({className:"subst",label:"interpol",begin:we(/\\/,he,/\(/),end:/\)/}),N=(he="")=>({begin:we(he,/"""/),end:we(/"""/,he),contains:[A(he),k(he),v(he)]}),I=(he="")=>({begin:we(he,/"/),end:we(/"/,he),contains:[A(he),v(he)]}),D={className:"string",variants:[N(),N("#"),N("##"),N("###"),I(),I("#"),I("##"),I("###")]},O={match:we(/`/,lr,/`/)},U={className:"variable",match:/\$\d+/},j={className:"variable",match:`\\$${xu}+`},ee=[O,U,j],X={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:GL,contains:[...b,y,D]}]}},q={className:"keyword",match:we(/@/,Rt(...$L))},de={className:"meta",match:we(/@/,lr)},P=[X,q,de],R={match:h1(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:we(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,xu,"+")},{className:"type",match:nd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:we(/\s+&\s+/,h1(nd)),relevance:0}]},B={begin://,keywords:u,contains:[...r,...c,...P,p,R]};R.contains.push(B);const _={match:we(lr,/\s*:/),keywords:"_|0",relevance:0},$={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",_,...r,...c,...h,...b,y,D,...ee,...P,R]},re={begin://,contains:[...r,R]},C={begin:Rt(h1(we(lr,/\s*:/)),h1(we(lr,/\s+/,lr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:lr}]},be={begin:/\(/,end:/\)/,keywords:u,contains:[C,...r,...c,...b,y,D,...P,R,$],endsParent:!0,illegal:/["']/},ve={match:[/func/,/\s+/,Rt(O.match,lr,td)],className:{1:"keyword",3:"title.function"},contains:[re,be,t],illegal:[/\[/,/%/]},le={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,be,t],illegal:/\[|%/},et={match:[/operator/,/\s+/,td],className:{1:"keyword",3:"title"}},vt={begin:[/precedencegroup/,/\s+/,nd],className:{1:"keyword",3:"title"},contains:[R],keywords:[...HL,...sE],end:/}/};for(const he of D.variants){const ht=he.contains.find(Jn=>Jn.label==="interpol");ht.keywords=u;const mt=[...c,...h,...b,y,D,...ee];ht.contains=[...mt,{begin:/\(/,end:/\)/,contains:["self",...mt]}]}return{name:"Swift",keywords:u,contains:[...r,ve,le,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:u,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},et,vt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...h,...b,y,D,...ee,...P,R,$]}}const ku="[A-Za-z$_][0-9A-Za-z$_]*",O8=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],I8=["true","false","null","undefined","NaN","Infinity"],R8=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],M8=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],L8=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],P8=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],D8=[].concat(L8,R8,M8);function VL(e){const t=e.regex,n=(R,{after:B})=>{const _="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,B)=>{const _=R[0].length+R.index,$=R.input[_];if($==="<"||$===","){B.ignoreMatch();return}$===">"&&(n(R,{after:_})||B.ignoreMatch());let re;const C=R.input.substring(_);if(re=C.match(/^\s*=/)){B.ignoreMatch();return}if((re=C.match(/^\s+extends\s+/))&&re.index===0){B.ignoreMatch();return}}},a={$pattern:ku,keyword:O8,literal:I8,built_in:D8,"variable.language":P8},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},T={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,E,b,{match:/\$\d+/},f];d.contains=y.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(y)});const A=[].concat(T,d.contains),k=A.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(A)}]),v={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k},N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},I={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...R8,...M8]}},D={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(R){return t.concat("(?!",R.join("|"),")")}const ee={match:t.concat(/\b/,j([...L8,"super","import"]),r,t.lookahead(/\(/)),className:"title.function",relevance:0},X={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},de="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(de)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:I},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),D,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,E,b,T,{match:/\$\d+/},f,I,{className:"attr",begin:r+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,e.REGEXP_MODE,{className:"function",begin:de,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},X,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},ee,U,N,q,{match:/\$[(.]/}]}}function jL(e){const t=VL(e),n=ku,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:ku,keyword:O8.concat(a),literal:I8,built_in:D8.concat(r),"variable.language":P8},u={className:"meta",begin:"@"+n},c=(d,h,p)=>{const E=d.contains.findIndex(b=>b.label===h);if(E===-1)throw new Error("can not find mode to replace");d.contains.splice(E,1,p)};Object.assign(t.keywords,l),t.exports.PARAMS_CONTAINS.push(u),t.contains=t.contains.concat([u,i,s]),c(t,"shebang",e.SHEBANG()),c(t,"use_strict",o);const f=t.contains.find(d=>d.label==="func.def");return f.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function WL(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,i),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,i),/ +/,t.either(o,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,c,f,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}function YL(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,e.QUOTE_STRING_MODE,l,u,a]}}function qL(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,l,a]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function QL(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},o=e.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",u="(\\.[0-9]*)?",c="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",f={className:"number",begin:"\\b"+a+l+u+c+"\\b"},d={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},h={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},p={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},h,p,s],b=[...E];return b.pop(),b.push(o),d.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}function F8(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&F8(n)}),e}class aE{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function B8(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function qr(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const XL="",lE=e=>!!e.scope,ZL=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class JL{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=B8(t)}openNode(t){if(!lE(t))return;const n=ZL(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){lE(t)&&(this.buffer+=XL)}value(){return this.buffer}span(t){this.buffer+=``}}const uE=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Op{constructor(){this.rootNode=uE(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=uE({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Op._collapse(n)}))}}class eP extends Op{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new JL(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Wa(e){return e?typeof e=="string"?e:e.source:null}function U8(e){return is("(?=",e,")")}function tP(e){return is("(?:",e,")*")}function nP(e){return is("(?:",e,")?")}function is(...e){return e.map(n=>Wa(n)).join("")}function rP(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ip(...e){return"("+(rP(e).capture?"":"?:")+e.map(r=>Wa(r)).join("|")+")"}function H8(e){return new RegExp(e.toString()+"|").exec("").length-1}function iP(e,t){const n=e&&e.exec(t);return n&&n.index===0}const sP=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Rp(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let s=Wa(r),o="";for(;s.length>0;){const a=sP.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&n++)}return o}).map(r=>`(${r})`).join(t)}const oP=/\b\B/,z8="[a-zA-Z]\\w*",Mp="[a-zA-Z_]\\w*",$8="\\b\\d+(\\.\\d+)?",G8="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",K8="\\b(0b[01]+)",aP="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",lP=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=is(t,/.*\b/,e.binary,/\b.*/)),qr({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Ya={begin:"\\\\[\\s\\S]",relevance:0},uP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ya]},cP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ya]},fP={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Mc=function(e,t,n={}){const r=qr({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Ip("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:is(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},dP=Mc("//","$"),hP=Mc("/\\*","\\*/"),mP=Mc("#","$"),pP={scope:"number",begin:$8,relevance:0},gP={scope:"number",begin:G8,relevance:0},EP={scope:"number",begin:K8,relevance:0},TP={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Ya,{begin:/\[/,end:/\]/,relevance:0,contains:[Ya]}]}]},yP={scope:"title",begin:z8,relevance:0},_P={scope:"title",begin:Mp,relevance:0},bP={begin:"\\.\\s*"+Mp,relevance:0},vP=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var m1=Object.freeze({__proto__:null,MATCH_NOTHING_RE:oP,IDENT_RE:z8,UNDERSCORE_IDENT_RE:Mp,NUMBER_RE:$8,C_NUMBER_RE:G8,BINARY_NUMBER_RE:K8,RE_STARTERS_RE:aP,SHEBANG:lP,BACKSLASH_ESCAPE:Ya,APOS_STRING_MODE:uP,QUOTE_STRING_MODE:cP,PHRASAL_WORDS_MODE:fP,COMMENT:Mc,C_LINE_COMMENT_MODE:dP,C_BLOCK_COMMENT_MODE:hP,HASH_COMMENT_MODE:mP,NUMBER_MODE:pP,C_NUMBER_MODE:gP,BINARY_NUMBER_MODE:EP,REGEXP_MODE:TP,TITLE_MODE:yP,UNDERSCORE_TITLE_MODE:_P,METHOD_GUARD:bP,END_SAME_AS_BEGIN:vP});function AP(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function SP(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function NP(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=AP,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function CP(e,t){Array.isArray(e.illegal)&&(e.illegal=Ip(...e.illegal))}function xP(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function kP(e,t){e.relevance===void 0&&(e.relevance=1)}const wP=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=is(n.beforeMatch,U8(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},OP=["of","and","for","in","not","or","if","then","parent","list","value"],IP="keyword";function V8(e,t,n=IP){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(s){Object.assign(r,V8(e[s],t,s))}),r;function i(s,o){t&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");r[l[0]]=[s,RP(l[0],l[1])]})}}function RP(e,t){return t?Number(t):MP(e)?0:1}function MP(e){return OP.includes(e.toLowerCase())}const cE={},zi=e=>{console.error(e)},fE=(e,...t)=>{console.log(`WARN: ${e}`,...t)},gs=(e,t)=>{cE[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),cE[`${e}/${t}`]=!0)},wu=new Error;function j8(e,t,{key:n}){let r=0;const i=e[n],s={},o={};for(let a=1;a<=t.length;a++)o[a+r]=i[a],s[a+r]=!0,r+=H8(t[a-1]);e[n]=o,e[n]._emit=s,e[n]._multi=!0}function LP(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw zi("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),wu;if(typeof e.beginScope!="object"||e.beginScope===null)throw zi("beginScope must be object"),wu;j8(e,e.begin,{key:"beginScope"}),e.begin=Rp(e.begin,{joinWith:""})}}function PP(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw zi("skip, excludeEnd, returnEnd not compatible with endScope: {}"),wu;if(typeof e.endScope!="object"||e.endScope===null)throw zi("endScope must be object"),wu;j8(e,e.end,{key:"endScope"}),e.end=Rp(e.end,{joinWith:""})}}function DP(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function FP(e){DP(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),LP(e),PP(e)}function BP(e){function t(o,a){return new RegExp(Wa(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=H8(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=t(Rp(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const u=l.findIndex((f,d)=>d>0&&f!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new n;return this.rules.slice(a).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){const a=new r;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){const l=o;if(o.isCompiled)return l;[SP,xP,FP,wP].forEach(c=>c(o,a)),e.compilerExtensions.forEach(c=>c(o,a)),o.__beforeBegin=null,[NP,CP,kP].forEach(c=>c(o,a)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=V8(o.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=t(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=t(l.end)),l.terminatorEnd=Wa(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(c){return UP(c==="self"?o:c)})),o.contains.forEach(function(c){s(c,l)}),o.starts&&s(o.starts,a),l.matcher=i(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=qr(e.classNameAliases||{}),s(e)}function W8(e){return e?e.endsWithParent||W8(e.starts):!1}function UP(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return qr(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:W8(e)?qr(e,{starts:e.starts?qr(e.starts):null}):Object.isFrozen(e)?qr(e):e}var HP="11.8.0";class zP extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const rd=B8,dE=qr,hE=Symbol("nomatch"),$P=7,Y8=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:eP};function l(P){return a.noHighlightRe.test(P)}function u(P){let R=P.className+" ";R+=P.parentNode?P.parentNode.className:"";const B=a.languageDetectRe.exec(R);if(B){const _=D(B[1]);return _||(fE(s.replace("{}",B[1])),fE("Falling back to no-highlight mode for this block.",P)),_?B[1]:"no-highlight"}return R.split(/\s+/).find(_=>l(_)||D(_))}function c(P,R,B){let _="",$="";typeof R=="object"?(_=P,B=R.ignoreIllegals,$=R.language):(gs("10.7.0","highlight(lang, code, ...args) has been deprecated."),gs("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),$=P,_=R),B===void 0&&(B=!0);const re={code:_,language:$};q("before:highlight",re);const C=re.result?re.result:f(re.language,re.code,B);return C.code=re.code,q("after:highlight",C),C}function f(P,R,B,_){const $=Object.create(null);function re(w,M){return w.keywords[M]}function C(){if(!ae.keywords){Qe.addText(xe);return}let w=0;ae.keywordPatternRe.lastIndex=0;let M=ae.keywordPatternRe.exec(xe),K="";for(;M;){K+=xe.substring(w,M.index);const ne=Ht.case_insensitive?M[0].toLowerCase():M[0],ue=re(ae,ne);if(ue){const[We,Dn]=ue;if(Qe.addText(K),K="",$[ne]=($[ne]||0)+1,$[ne]<=$P&&(fs+=Dn),We.startsWith("_"))K+=M[0];else{const En=Ht.classNameAliases[We]||We;le(M[0],En)}}else K+=M[0];w=ae.keywordPatternRe.lastIndex,M=ae.keywordPatternRe.exec(xe)}K+=xe.substring(w),Qe.addText(K)}function be(){if(xe==="")return;let w=null;if(typeof ae.subLanguage=="string"){if(!t[ae.subLanguage]){Qe.addText(xe);return}w=f(ae.subLanguage,xe,!0,bo[ae.subLanguage]),bo[ae.subLanguage]=w._top}else w=h(xe,ae.subLanguage.length?ae.subLanguage:null);ae.relevance>0&&(fs+=w.relevance),Qe.__addSublanguage(w._emitter,w.language)}function ve(){ae.subLanguage!=null?be():C(),xe=""}function le(w,M){w!==""&&(Qe.startScope(M),Qe.addText(w),Qe.endScope())}function et(w,M){let K=1;const ne=M.length-1;for(;K<=ne;){if(!w._emit[K]){K++;continue}const ue=Ht.classNameAliases[w[K]]||w[K],We=M[K];ue?le(We,ue):(xe=We,C(),xe=""),K++}}function vt(w,M){return w.scope&&typeof w.scope=="string"&&Qe.openNode(Ht.classNameAliases[w.scope]||w.scope),w.beginScope&&(w.beginScope._wrap?(le(xe,Ht.classNameAliases[w.beginScope._wrap]||w.beginScope._wrap),xe=""):w.beginScope._multi&&(et(w.beginScope,M),xe="")),ae=Object.create(w,{parent:{value:ae}}),ae}function he(w,M,K){let ne=iP(w.endRe,K);if(ne){if(w["on:end"]){const ue=new aE(w);w["on:end"](M,ue),ue.isMatchIgnored&&(ne=!1)}if(ne){for(;w.endsParent&&w.parent;)w=w.parent;return w}}if(w.endsWithParent)return he(w.parent,M,K)}function ht(w){return ae.matcher.regexIndex===0?(xe+=w[0],1):(Ao=!0,0)}function mt(w){const M=w[0],K=w.rule,ne=new aE(K),ue=[K.__beforeBegin,K["on:begin"]];for(const We of ue)if(We&&(We(w,ne),ne.isMatchIgnored))return ht(M);return K.skip?xe+=M:(K.excludeBegin&&(xe+=M),ve(),!K.returnBegin&&!K.excludeBegin&&(xe=M)),vt(K,w),K.returnBegin?0:M.length}function Jn(w){const M=w[0],K=R.substring(w.index),ne=he(ae,w,K);if(!ne)return hE;const ue=ae;ae.endScope&&ae.endScope._wrap?(ve(),le(M,ae.endScope._wrap)):ae.endScope&&ae.endScope._multi?(ve(),et(ae.endScope,w)):ue.skip?xe+=M:(ue.returnEnd||ue.excludeEnd||(xe+=M),ve(),ue.excludeEnd&&(xe=M));do ae.scope&&Qe.closeNode(),!ae.skip&&!ae.subLanguage&&(fs+=ae.relevance),ae=ae.parent;while(ae!==ne.parent);return ne.starts&&vt(ne.starts,w),ue.returnEnd?0:M.length}function ls(){const w=[];for(let M=ae;M!==Ht;M=M.parent)M.scope&&w.unshift(M.scope);w.forEach(M=>Qe.openNode(M))}let us={};function El(w,M){const K=M&&M[0];if(xe+=w,K==null)return ve(),0;if(us.type==="begin"&&M.type==="end"&&us.index===M.index&&K===""){if(xe+=R.slice(M.index,M.index+1),!i){const ne=new Error(`0 width match regex (${P})`);throw ne.languageName=P,ne.badRule=us.rule,ne}return 1}if(us=M,M.type==="begin")return mt(M);if(M.type==="illegal"&&!B){const ne=new Error('Illegal lexeme "'+K+'" for mode "'+(ae.scope||"")+'"');throw ne.mode=ae,ne}else if(M.type==="end"){const ne=Jn(M);if(ne!==hE)return ne}if(M.type==="illegal"&&K==="")return 1;if(vo>1e5&&vo>M.index*3)throw new Error("potential infinite loop, way more iterations than matches");return xe+=K,K.length}const Ht=D(P);if(!Ht)throw zi(s.replace("{}",P)),new Error('Unknown language: "'+P+'"');const Tl=BP(Ht);let cs="",ae=_||Tl;const bo={},Qe=new a.__emitter(a);ls();let xe="",fs=0,er=0,vo=0,Ao=!1;try{if(Ht.__emitTokens)Ht.__emitTokens(R,Qe);else{for(ae.matcher.considerAll();;){vo++,Ao?Ao=!1:ae.matcher.considerAll(),ae.matcher.lastIndex=er;const w=ae.matcher.exec(R);if(!w)break;const M=R.substring(er,w.index),K=El(M,w);er=w.index+K}El(R.substring(er))}return Qe.finalize(),cs=Qe.toHTML(),{language:P,value:cs,relevance:fs,illegal:!1,_emitter:Qe,_top:ae}}catch(w){if(w.message&&w.message.includes("Illegal"))return{language:P,value:rd(R),illegal:!0,relevance:0,_illegalBy:{message:w.message,index:er,context:R.slice(er-100,er+100),mode:w.mode,resultSoFar:cs},_emitter:Qe};if(i)return{language:P,value:rd(R),illegal:!1,relevance:0,errorRaised:w,_emitter:Qe,_top:ae};throw w}}function d(P){const R={value:rd(P),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return R._emitter.addText(P),R}function h(P,R){R=R||a.languages||Object.keys(t);const B=d(P),_=R.filter(D).filter(U).map(ve=>f(ve,P,!1));_.unshift(B);const $=_.sort((ve,le)=>{if(ve.relevance!==le.relevance)return le.relevance-ve.relevance;if(ve.language&&le.language){if(D(ve.language).supersetOf===le.language)return 1;if(D(le.language).supersetOf===ve.language)return-1}return 0}),[re,C]=$,be=re;return be.secondBest=C,be}function p(P,R,B){const _=R&&n[R]||B;P.classList.add("hljs"),P.classList.add(`language-${_}`)}function E(P){let R=null;const B=u(P);if(l(B))return;if(q("before:highlightElement",{el:P,language:B}),P.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(P)),a.throwUnescapedHTML))throw new zP("One of your code blocks includes unescaped HTML.",P.innerHTML);R=P;const _=R.textContent,$=B?c(_,{language:B,ignoreIllegals:!0}):h(_);P.innerHTML=$.value,p(P,B,$.language),P.result={language:$.language,re:$.relevance,relevance:$.relevance},$.secondBest&&(P.secondBest={language:$.secondBest.language,relevance:$.secondBest.relevance}),q("after:highlightElement",{el:P,result:$,text:_})}function b(P){a=dE(a,P)}const g=()=>{A(),gs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function T(){A(),gs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let y=!1;function A(){if(document.readyState==="loading"){y=!0;return}document.querySelectorAll(a.cssSelector).forEach(E)}function k(){y&&A()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",k,!1);function v(P,R){let B=null;try{B=R(e)}catch(_){if(zi("Language definition for '{}' could not be registered.".replace("{}",P)),i)zi(_);else throw _;B=o}B.name||(B.name=P),t[P]=B,B.rawDefinition=R.bind(null,e),B.aliases&&O(B.aliases,{languageName:P})}function N(P){delete t[P];for(const R of Object.keys(n))n[R]===P&&delete n[R]}function I(){return Object.keys(t)}function D(P){return P=(P||"").toLowerCase(),t[P]||t[n[P]]}function O(P,{languageName:R}){typeof P=="string"&&(P=[P]),P.forEach(B=>{n[B.toLowerCase()]=R})}function U(P){const R=D(P);return R&&!R.disableAutodetect}function j(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=R=>{P["before:highlightBlock"](Object.assign({block:R.el},R))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=R=>{P["after:highlightBlock"](Object.assign({block:R.el},R))})}function ee(P){j(P),r.push(P)}function X(P){const R=r.indexOf(P);R!==-1&&r.splice(R,1)}function q(P,R){const B=P;r.forEach(function(_){_[B]&&_[B](R)})}function de(P){return gs("10.7.0","highlightBlock will be removed entirely in v12.0"),gs("10.7.0","Please use highlightElement now."),E(P)}Object.assign(e,{highlight:c,highlightAuto:h,highlightAll:A,highlightElement:E,highlightBlock:de,configure:b,initHighlighting:g,initHighlightingOnLoad:T,registerLanguage:v,unregisterLanguage:N,listLanguages:I,getLanguage:D,registerAliases:O,autoDetection:U,inherit:dE,addPlugin:ee,removePlugin:X}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=HP,e.regex={concat:is,lookahead:U8,either:Ip,optional:nP,anyNumberOfTimes:tP};for(const P in m1)typeof m1[P]=="object"&&F8(m1[P]);return Object.assign(e,m1),e},lo=Y8({});lo.newInstance=()=>Y8({});var GP=lo;lo.HighlightJS=lo;lo.default=lo;const xn=Xn(GP);var q8={exports:{}};(function(e){(function(){var t;t=e.exports=i,t.format=i,t.vsprintf=r,typeof console<"u"&&typeof console.log=="function"&&(t.printf=n);function n(){console.log(i.apply(null,arguments))}function r(s,o){return i.apply(null,[s].concat(o))}function i(s){for(var o=1,a=[].slice.call(arguments),l=0,u=s.length,c="",f,d=!1,h,p,E=!1,b,g=function(){return a[o++]},T=function(){for(var y="";/\d/.test(s[l]);)y+=s[l++],f=s[l];return y.length>0?parseInt(y):null};li.data.relevance&&(i=o)}return i}function qP(e,t){xn.registerLanguage(e,t)}const QP=function(e,t){if(typeof e=="string")xn.registerAliases(t,{languageName:e});else{let n;for(n in e)jP.call(e,n)&&xn.registerAliases(e[n],{languageName:n})}};function XP(e){return!!xn.getLanguage(e)}function ZP(){return xn.listLanguages()}class JP{constructor(t){this.options=t,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=t.split(".").map((s,o)=>o?s+"_".repeat(o):this.options.classPrefix+s),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const ce={highlight:Q8,highlightAuto:YP,registerLanguage:qP,registered:XP,listLanguages:ZP,registerAlias:QP};ce.registerLanguage("arduino",BM);ce.registerLanguage("bash",UM);ce.registerLanguage("c",HM);ce.registerLanguage("cpp",zM);ce.registerLanguage("csharp",$M);ce.registerLanguage("css",qM);ce.registerLanguage("diff",QM);ce.registerLanguage("go",XM);ce.registerLanguage("graphql",ZM);ce.registerLanguage("ini",JM);ce.registerLanguage("java",eL);ce.registerLanguage("javascript",sL);ce.registerLanguage("json",oL);ce.registerLanguage("kotlin",lL);ce.registerLanguage("less",mL);ce.registerLanguage("lua",pL);ce.registerLanguage("makefile",gL);ce.registerLanguage("markdown",EL);ce.registerLanguage("objectivec",TL);ce.registerLanguage("perl",yL);ce.registerLanguage("php",_L);ce.registerLanguage("php-template",bL);ce.registerLanguage("plaintext",vL);ce.registerLanguage("python",AL);ce.registerLanguage("python-repl",SL);ce.registerLanguage("r",NL);ce.registerLanguage("ruby",CL);ce.registerLanguage("rust",xL);ce.registerLanguage("scss",LL);ce.registerLanguage("shell",PL);ce.registerLanguage("sql",DL);ce.registerLanguage("swift",KL);ce.registerLanguage("typescript",jL);ce.registerLanguage("vbnet",WL);ce.registerLanguage("wasm",YL);ce.registerLanguage("xml",qL);ce.registerLanguage("yaml",QL);const ss=function(e){if(e==null)return Lp;if(typeof e=="string")return tD(e);if(typeof e=="object")return eD(e);if(typeof e=="function")return X8(e);throw new Error("Expected function, string, or array as test")};function eD(e){const t=[];let n=-1;for(;++nl&&(l=u):u&&(l!==void 0&&l>-1&&a.push(` `.repeat(l)||" "),l=-1,a.push(u))}return a.join("")}function J8(e,t,n){return e.type==="element"?iD(e,t,n):e.type==="text"?n.whitespace==="normal"?eb(e,n):sD(e):[]}function iD(e,t,n){const r=tb(e,n),i=e.children||[];let s=-1,o=[];if(rD(e))return o;let a,l;for(Uh(e)||TE(e)&&mE(t,e,TE)?l=` -`:nD(e)?(a=2,l=2):Z8(e)&&(a=1,l=1);++s-1?r.slice(0,u):r}return(u,c)=>{ul(u,"element",(f,d,h)=>{const p=h;if(!p||!("tagName"in p)||p.tagName!=="pre"||f.tagName!=="code"||!f.properties)return;const E=fD(f);if(E===!1||!E&&!a||E&&i&&i.includes(E))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);let b;try{b=E?ce.highlight(E,yE(p),{prefix:r}):ce.highlightAuto(yE(p),{prefix:r,subset:o})}catch(g){const T=g;(!s||!/Unknown language/.test(T.message))&&c.fail(T,f,"rehype-highlight:missing-language");return}!E&&b.data.language&&f.properties.className.push("language-"+b.data.language),Array.isArray(b.children)&&b.children.length>0&&(f.children=b.children)})}}function fD(e){const t=e.properties&&e.properties.className;let n=-1;if(Array.isArray(t))for(;++n{window.sourceryLS.postMessage(e)},hD=({copyValue:e})=>{const[t,n]=Y.useState(!1);return navigator.clipboard?L.jsx("button",{className:"flex h-7 w-7 flex-row items-center justify-center p-1 hover:bg-chat",onClick:async()=>{await navigator.clipboard.writeText(e).then(()=>{n(!0)})},onBlur:()=>{n(!1)},children:t?L.jsx(dn.Check,{}):L.jsx(dn.Copy,{})}):null},mD=({copyValue:e})=>L.jsx("button",{className:"flex h-7 w-7 flex-row items-center justify-center p-1 hover:bg-chat",onClick:()=>H1({type:"insertAtCursor",content:e}),children:L.jsx(dn.Insert,{})}),nb=({markdown:e})=>{var t;return L.jsx(v2,{remarkPlugins:[Vw],rehypePlugins:[NM,cD,[DM,{attributes:{...Cu.attributes,span:[...((t=Cu.attributes)==null?void 0:t.span)||[],dD]}}]],transformLinkUri:n=>n.startsWith("https")||n.startsWith("file")||n==="VALID_FILE"||n==="VALID_DIRECTORY"?n:"",components:{h1({children:n}){return L.jsx("h1",{className:"mb-2 mt-6 text-lg font-bold first:mt-0 last:mb-0",children:n})},h2({children:n}){return L.jsx("h2",{className:"mt-2 font-bold first:mt-0",children:n})},h3({children:n}){return L.jsx("h3",{className:"mt-2 font-bold first:mt-0",children:n})},h4({children:n}){return L.jsx("h4",{className:"mt-2 font-bold first:mt-0",children:n})},h5({children:n}){return L.jsx("h5",{className:"mt-2 font-bold first:mt-0",children:n})},h6({children:n}){return L.jsx("h6",{className:"mt-2 font-bold first:mt-0",children:n})},ul({children:n}){return L.jsx("ul",{className:"list-disc pl-5",children:n})},p({children:n}){return L.jsx("p",{className:"mt-2 first:mt-0",children:n})},code({inline:n,className:r,children:i,...s}){const o=String(i).replace(/\n$/,"");return n?L.jsx("code",{...s,className:r,children:o}):L.jsxs("div",{className:"group relative",children:[L.jsx("pre",{className:Kt(r,"my-4 rounded border border-border bg-editor px-4 py-3"),children:L.jsx("code",{children:i})}),L.jsxs("div",{className:"invisible absolute right-3 top-3 flex flex-row items-center divide-x-2 divide-border rounded border-2 border-border group-hover:visible",children:[L.jsx(hD,{copyValue:o}),L.jsx(mD,{copyValue:o})]})]})},a({href:n,children:r}){if(!n)return L.jsx("span",{children:"[Missing link]"});if(n.startsWith("https"))return L.jsx("a",{className:"underline hover:cursor-pointer",onClick:()=>H1({type:"openLinkRequest",link:n,linkType:"url"}),children:r});if(n==="VALID_FILE"){const i=String(r).replace(/\n$/,"");return L.jsx("a",{className:"underline hover:cursor-pointer",onClick:s=>{s.preventDefault(),H1({type:"openLinkRequest",link:i,linkType:"file"})},children:r})}if(n==="VALID_DIRECTORY"){const i=String(r).replace(/\n$/,"");return L.jsx("a",{className:"underline hover:cursor-pointer",onClick:s=>{s.preventDefault(),H1({type:"openLinkRequest",link:i,linkType:"directory"})},children:r})}return L.jsx("span",{children:"[Invalid link]"})}},children:e})},rb=()=>L.jsxs("div",{className:"flex h-[1.5rem] flex-row items-center gap-1",children:[L.jsx("span",{className:"inline-block h-2 w-2 animate-typing-dots rounded-full bg-foreground",style:{animationDelay:"0s"}}),L.jsx("span",{className:"inline-block h-2 w-2 animate-typing-dots rounded-full bg-foreground",style:{animationDelay:"0.2s"}}),L.jsx("span",{className:"inline-block h-2 w-2 animate-typing-dots rounded-full bg-foreground",style:{animationDelay:"0.4s"}})]}),Lc=e=>{window.sourceryLS.postMessage(e)},_E=({outcome:e,textContent:t})=>L.jsx("div",{className:"flex flex-row justify-start",children:L.jsx("div",{className:Kt("rounded-lg-bl-none mr-4 w-fit max-w-full rounded-tl-lg rounded-tr-lg px-4 py-2",e==="error"?"bg-error":"bg-chat"),children:t?L.jsx(nb,{markdown:t}):L.jsx(rb,{})})}),pD=({textContent:e})=>L.jsx("div",{className:"flex flex-row justify-end",children:L.jsx("p",{className:"rounded-lg-br-none ml-4 w-fit bg-chat px-4 py-2",children:e})}),gD=()=>{const[e,t]=Y.useState(),n=Y.useRef(null),r=s=>{s.preventDefault(),e&&(Lc({type:"chat/messageRequest",data:{kind:"user_message",message:e}}),t(""))},i=Y.useCallback(s=>{var o;s.key=="Enter"&&!s.shiftKey&&(s.preventDefault(),(o=n.current)==null||o.requestSubmit())},[]);return L.jsx("div",{className:"relative w-full",children:L.jsxs("form",{onSubmit:r,ref:n,children:[L.jsx("textarea",{name:"chatPrompt",id:"chatPrompt",placeholder:"Type your message here!",className:"w-full rounded bg-editor p-2 pr-10",value:e,onChange:({target:{value:s}})=>t(s),onKeyDown:i,autoFocus:!0}),L.jsx("button",{className:"absolute right-3 top-3",type:"submit",children:L.jsx(dn.Send,{className:"h-4 w-4 text-highlight"})})]})})},ED=({expanded:e,onClick:t})=>L.jsxs("header",{className:"flex grow-0 flex-row items-center justify-between border-b border-b-border px-2 py-1",children:[L.jsxs("div",{className:"flex cursor-pointer flex-row items-center gap-2 hover:opacity-80",onClick:t,children:[e?L.jsx(dn.ChevronDown,{}):L.jsx(dn.ChevronRight,{}),L.jsx("span",{className:"font-bold",children:"Chat"})]}),L.jsx("button",{className:Kt("rounded px-1 hover:bg-chat",e?"visible":"invisible"),onClick:n=>{n.stopPropagation(),Lc({type:"chat/clearRequest"})},children:"New Conversation"})]}),TD=({expanded:e,cancelButtonDisabled:t})=>L.jsxs("footer",{className:Kt("flex grow-0 flex-col gap-2 border-t border-t-border p-2",e?"block":"hidden"),children:[L.jsx("div",{className:"flex flex-row justify-center",children:L.jsxs("button",{disabled:t,className:"flex w-fit flex-row items-center gap-2 p-2 hover:enabled:opacity-80 disabled:text-disabled",onClick:()=>Lc({type:"chat/cancelRequest"}),children:[L.jsx(dn.Cancel,{}),L.jsx("span",{children:"Cancel"})]})}),L.jsx(gD,{})]}),yD=()=>{const[{messages:e,currentMessage:t},n]=Y.useState({messages:[],currentMessage:null}),[r,i]=Y.useState(!0),[s,o]=Y.useState(!0),a=Y.useRef(null),l=L_(a),u=Y.useCallback(({result:f})=>{switch(f.role){case"user":{n(Kn(d=>{d.messages.push(f),d.currentMessage={role:"assistant",outcome:"success",textContent:""}})),a.current&&M_(a.current);break}case"assistant":o(!1),n(Kn(d=>{d.currentMessage&&f.outcome!=="error"?d.currentMessage.textContent+=f.textContent:d.currentMessage&&d.currentMessage.textContent&&f.outcome==="error"?(d.messages.push(d.currentMessage,f),d.currentMessage=null):f.outcome==="error"?(d.messages.push(f),d.currentMessage=null):d.currentMessage=f}))}},[]),c=Y.useCallback(({data:f})=>{switch(f.command){case"chat/addResult":u(f);break;case"chat/clear":n(Kn(()=>({messages:[],currentMessage:null})));break;case"chat/focus":i(()=>!0);break;case"chat/assistantFinished":n(Kn(d=>{d.currentMessage&&d.currentMessage.textContent&&d.messages.push(d.currentMessage),d.currentMessage=null})),o(Kn(()=>!0));break}},[u]);return Y.useLayoutEffect(()=>{l()},[t==null?void 0:t.textContent,e.length]),Y.useEffect(()=>(window.addEventListener("message",c),()=>window.removeEventListener("message",c)),[c]),Y.useEffect(()=>{Lc({type:"chat/initialiseRequest"})},[]),L.jsxs("div",{className:Kt("flex flex-col overflow-clip",r?"grow":"grow-0"),children:[L.jsx(ED,{onClick:()=>i(f=>!f),expanded:r}),L.jsxs("section",{className:Kt("flex grow flex-col gap-2 overflow-y-auto p-2",r?"block":"hidden"),ref:a,children:[e.map(({role:f,outcome:d,textContent:h},p)=>{switch(f){case"assistant":return L.jsx(_E,{outcome:d,textContent:h},p);case"user":return L.jsx(pD,{outcome:d,textContent:h},p)}}),t&&L.jsx(_E,{outcome:t.outcome,textContent:t.textContent})]}),L.jsx(TD,{cancelButtonDisabled:s,expanded:r})]})},bE=e=>{window.sourceryLS.postMessage(e)},_D=({expanded:e,onClick:t})=>L.jsx("header",{className:"flex grow-0 flex-row items-center justify-between border-b border-b-border px-2 py-1",children:L.jsxs("div",{className:"flex cursor-pointer flex-row items-center gap-2 hover:opacity-80",onClick:t,children:[e?L.jsx(dn.ChevronDown,{}):L.jsx(dn.ChevronRight,{}),L.jsx("span",{className:"font-bold",children:"Recipes"})]})}),bD=()=>{const[e,t]=Y.useState(!0),[n,r]=Y.useState([]),i=Y.useCallback(({data:{command:s,result:o}})=>{switch(s){case"recipes/addRecipes":r(o)}},[]);return Y.useEffect(()=>(window.addEventListener("message",i),()=>window.removeEventListener("message",i)),[]),Y.useEffect(()=>{bE({type:"recipes/initialiseRequest"})},[]),L.jsxs("div",{className:"flex h-fit flex-col",children:[L.jsx(_D,{onClick:()=>t(s=>!s),expanded:e}),L.jsx("section",{className:Kt("h-fit grow overflow-y-auto p-2",e?"block":"hidden"),children:L.jsx("ul",{className:"flex flex-col gap-2",children:n.map((s,o)=>L.jsx("li",{children:L.jsx("button",{className:"w-full rounded bg-primary p-1 text-center hover:opacity-80",onClick:()=>bE({type:"recipes/recipeRequest",data:{kind:"recipe_request",...s}}),children:s.name})},o))})})]})},vE=({outcome:e,textContent:t})=>L.jsx("div",{className:"flex flex-row justify-start",children:L.jsx("div",{className:Kt("rounded-lg-bl-none mr-4 w-fit max-w-full rounded-tl-lg rounded-tr-lg px-4 py-2",e==="error"?"bg-error":"bg-chat"),children:t?L.jsx(nb,{markdown:t}):L.jsx(rb,{})})}),Ou=e=>{window.sourceryLS.postMessage(e)},vD=({onClick:e,expanded:t})=>L.jsxs("header",{className:"itemscenter flex grow-0 flex-row justify-between border-b border-b-border px-2 py-1",children:[L.jsxs("div",{className:"flex cursor-pointer flex-row items-center gap-2 hover:opacity-80",onClick:e,children:[t?L.jsx(dn.ChevronDown,{}):L.jsx(dn.ChevronRight,{}),L.jsx("span",{className:"font-bold",children:"Code Review"})]}),L.jsx("button",{className:Kt("rounded px-1 hover:bg-chat",t?"visible":"invisible"),onClick:()=>Ou({type:"review/clearRequest"}),children:"New Review"})]}),AD=({branches:e})=>{const t=Y.useCallback(n=>{n.preventDefault();const r=Object.fromEntries(new FormData(n.currentTarget).entries());Ou({type:"review/reviewRequest",data:{kind:"review_request",...r}})},[]);return L.jsxs("form",{className:"flex flex-col gap-2 p-2",onSubmit:t,children:[L.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[L.jsx("label",{htmlFor:"current",className:"col-span-1 flex flex-row items-center",children:"Current Branch"}),L.jsx("input",{type:"text",name:"current",className:"col-span-4 rounded border border-border bg-editor px-2 py-1 font-mono",defaultValue:e==null?void 0:e.current}),L.jsx("label",{htmlFor:"main",className:"col-span-1 flex flex-row items-center",children:"Main Branch"}),L.jsx("input",{type:"text",name:"main",className:"col-span-4 rounded border border-border bg-editor px-2 py-1 font-mono",defaultValue:e==null?void 0:e.main})]}),L.jsx("button",{type:"submit",className:"w-full rounded border border-border bg-primary p-1 hover:opacity-80",children:"Review My Code"})]})},SD=()=>{const[e,t]=Y.useState(!1),[n,r]=Y.useState(),[{messages:i,currentMessage:s},o]=Y.useState({messages:[],currentMessage:null}),[a,l]=Y.useState(!0),u=Y.useRef(null),c=L_(u),f=Y.useCallback(({result:h})=>{l(()=>!1),o(Kn(p=>{p.currentMessage&&h.outcome!=="error"?p.currentMessage.textContent+=h.textContent:p.currentMessage&&p.currentMessage.textContent&&h.outcome==="error"?(p.messages.push(p.currentMessage,h),p.currentMessage=null):h.outcome==="error"?(p.messages.push(h),p.currentMessage=null):p.currentMessage=h}))},[]),d=Y.useCallback(({data:h})=>{switch(h.command){case"review/addResult":f(h);break;case"review/clear":o(Kn(()=>({messages:[],currentMessage:null})));break;case"review/focus":t(()=>!0);break;case"review/assistantFinished":o(Kn(p=>{p.currentMessage&&p.currentMessage.textContent&&p.messages.push(p.currentMessage),p.currentMessage=null})),l(Kn(()=>!0));break;case"review/addBranches":r(()=>h.result);break}},[f]);return Y.useLayoutEffect(()=>{c()},[s==null?void 0:s.textContent,i.length]),Y.useEffect(()=>(window.addEventListener("message",d),()=>window.removeEventListener("message",d)),[d]),Y.useEffect(()=>{Ou({type:"review/initialiseRequest"})},[]),L.jsxs("div",{className:Kt("flex flex-col overflow-clip",e?"grow":"grow-0"),children:[L.jsx(vD,{onClick:()=>t(h=>!h),expanded:e}),L.jsx("section",{className:Kt("flex flex-col divide-y divide-border",e?"block":"hidden"),children:L.jsx(AD,{branches:n})}),L.jsxs("section",{className:Kt("flex grow flex-col gap-2 overflow-y-auto p-2",e?"block":"hidden"),ref:u,children:[i.map(({outcome:h,textContent:p},E)=>L.jsx(vE,{outcome:h,textContent:p},E)),s&&L.jsx(vE,{outcome:s.outcome,textContent:s.textContent})]}),L.jsx("footer",{className:Kt("flex flex-row justify-center border-t border-border",e?"block":"hidden"),children:L.jsxs("button",{className:"flex w-fit flex-row items-center gap-2 p-1 hover:enabled:opacity-80 disabled:text-disabled",disabled:a,onClick:()=>Ou({type:"review/cancelRequest"}),children:[L.jsx(dn.Cancel,{}),L.jsx("span",{children:"Cancel"})]})})]})},ND=e=>{window.sourceryLS.postMessage(e)},CD=()=>{const e=Y.useCallback(t=>{t.preventDefault(),ND({type:"optIn/enableRequest"})},[]);return L.jsxs("section",{className:"flex flex-col p-8",children:[L.jsx("h1",{className:"mb-4 text-lg font-bold",children:"Sourcery Coding Assistant Opt-In"}),L.jsx("p",{className:"mb-2",children:"By enabling the Sourcery coding assistant you agree that Sourcery can send your code to third-party large language model services for analysis (OpenAI, Anthropic)."}),L.jsx("p",{className:"mb-2",children:"Sourcery does not store any of your code on its servers."}),L.jsx("form",{onSubmit:e,className:"mb-3 mt-4",children:L.jsx("button",{type:"submit",className:"rounded bg-primary px-2 py-1 font-bold hover:opacity-80",children:"Opt In"})}),L.jsxs("p",{className:"mb-2 text-sm italic",children:["Enabling the coding assistant creates an entry in your"," ",L.jsxs("a",{href:"https://docs.sourcery.ai/Reference/Configuration/Sources/#user-configuration-file-system-locations",className:"underline",target:"_blank",children:["personal ",L.jsx("code",{children:".sourcery.yaml"})]})," ","file.",L.jsx("br",{}),"You can opt-out at any time by removing or commenting out this entry."]})]})},ib=Y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Pc=Y.createContext({}),Pp=Y.createContext(null),Dc=typeof document<"u",xD=Dc?Y.useLayoutEffect:Y.useEffect,sb=Y.createContext({strict:!1});function kD(e,t,n,r){const{visualElement:i}=Y.useContext(Pc),s=Y.useContext(sb),o=Y.useContext(Pp),a=Y.useContext(ib).reducedMotion,l=Y.useRef();r=r||s.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;Y.useInsertionEffect(()=>{u&&u.update(n,o)});const c=Y.useRef(!!window.HandoffAppearAnimations);return xD(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),Y.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function Hs(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wD(e,t,n){return Y.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Hs(n)&&(n.current=r))},[t])}function qa(e){return typeof e=="string"||Array.isArray(e)}function Fc(e){return typeof e=="object"&&typeof e.start=="function"}const Dp=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fp=["initial",...Dp];function Bc(e){return Fc(e.animate)||Fp.some(t=>qa(e[t]))}function ob(e){return!!(Bc(e)||e.variants)}function OD(e,t){if(Bc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||qa(n)?n:void 0,animate:qa(r)?r:void 0}}return e.inherit!==!1?t:{}}function ID(e){const{initial:t,animate:n}=OD(e,Y.useContext(Pc));return Y.useMemo(()=>({initial:t,animate:n}),[AE(t),AE(n)])}function AE(e){return Array.isArray(e)?e.join(" "):e}const SE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Qa={};for(const e in SE)Qa[e]={isEnabled:t=>SE[e].some(n=>!!t[n])};function RD(e){for(const t in e)Qa[t]={...Qa[t],...e[t]}}const ab=Y.createContext({}),lb=Y.createContext({}),MD=Symbol.for("motionComponentSymbol");function LD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&RD(e);function s(a,l){let u;const c={...Y.useContext(ib),...a,layoutId:PD(a)},{isStatic:f}=c,d=ID(a),h=r(a,f);if(!f&&Dc){d.visualElement=kD(i,h,c,t);const p=Y.useContext(lb),E=Y.useContext(sb).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,E,e,p))}return Y.createElement(Pc.Provider,{value:d},u&&d.visualElement?Y.createElement(u,{visualElement:d.visualElement,...c}):null,n(i,a,wD(h,d.visualElement,l),h,f,d.visualElement))}const o=Y.forwardRef(s);return o[MD]=i,o}function PD({layoutId:e}){const t=Y.useContext(ab).id;return t&&e!==void 0?t+"-"+e:e}function DD(e){function t(r,i={}){return LD(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const FD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bp(e){return typeof e!="string"||e.includes("-")?!1:!!(FD.indexOf(e)>-1||/[A-Z]/.test(e))}const Iu={};function BD(e){Object.assign(Iu,e)}const hl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],os=new Set(hl);function ub(e,{layout:t,layoutId:n}){return os.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Iu[e]||e==="opacity")}const Bt=e=>!!(e&&e.getVelocity),UD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HD=hl.length;function zD(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let s="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),fb=cb("--"),Hh=cb("var(--"),$D=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,GD=(e,t)=>t&&typeof e=="number"?t.transform(e):e,fi=(e,t,n)=>Math.min(Math.max(n,e),t),as={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ga={...as,transform:e=>fi(0,1,e)},p1={...as,default:1},Ea=e=>Math.round(e*1e5)/1e5,Uc=/(-)?([\d]*\.?[\d])+/g,db=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,KD=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ml(e){return typeof e=="string"}const pl=e=>({test:t=>ml(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ur=pl("deg"),Qn=pl("%"),oe=pl("px"),VD=pl("vh"),jD=pl("vw"),NE={...Qn,parse:e=>Qn.parse(e)/100,transform:e=>Qn.transform(e*100)},CE={...as,transform:Math.round},hb={borderWidth:oe,borderTopWidth:oe,borderRightWidth:oe,borderBottomWidth:oe,borderLeftWidth:oe,borderRadius:oe,radius:oe,borderTopLeftRadius:oe,borderTopRightRadius:oe,borderBottomRightRadius:oe,borderBottomLeftRadius:oe,width:oe,maxWidth:oe,height:oe,maxHeight:oe,size:oe,top:oe,right:oe,bottom:oe,left:oe,padding:oe,paddingTop:oe,paddingRight:oe,paddingBottom:oe,paddingLeft:oe,margin:oe,marginTop:oe,marginRight:oe,marginBottom:oe,marginLeft:oe,rotate:Ur,rotateX:Ur,rotateY:Ur,rotateZ:Ur,scale:p1,scaleX:p1,scaleY:p1,scaleZ:p1,skew:Ur,skewX:Ur,skewY:Ur,distance:oe,translateX:oe,translateY:oe,translateZ:oe,x:oe,y:oe,z:oe,perspective:oe,transformPerspective:oe,opacity:ga,originX:NE,originY:NE,originZ:oe,zIndex:CE,fillOpacity:ga,strokeOpacity:ga,numOctaves:CE};function Up(e,t,n,r){const{style:i,vars:s,transform:o,transformOrigin:a}=e;let l=!1,u=!1,c=!0;for(const f in t){const d=t[f];if(fb(f)){s[f]=d;continue}const h=hb[f],p=GD(d,h);if(os.has(f)){if(l=!0,o[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,a[f]=p):i[f]=p}if(t.transform||(l||r?i.transform=zD(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=a;i.transformOrigin=`${f} ${d} ${h}`}}const Hp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mb(e,t,n){for(const r in t)!Bt(t[r])&&!ub(r,n)&&(e[r]=t[r])}function WD({transformTemplate:e},t,n){return Y.useMemo(()=>{const r=Hp();return Up(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function YD(e,t,n){const r=e.style||{},i={};return mb(i,r,e),Object.assign(i,WD(e,t,n)),e.transformValues?e.transformValues(i):i}function qD(e,t,n){const r={},i=YD(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const QD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Ru(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||QD.has(e)}let pb=e=>!Ru(e);function XD(e){e&&(pb=t=>t.startsWith("on")?!Ru(t):e(t))}try{XD(require("@emotion/is-prop-valid").default)}catch{}function ZD(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(pb(i)||n===!0&&Ru(i)||!t&&!Ru(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function xE(e,t,n){return typeof e=="string"?e:oe.transform(t+n*e)}function JD(e,t,n){const r=xE(t,e.x,e.width),i=xE(n,e.y,e.height);return`${r} ${i}`}const eF={offset:"stroke-dashoffset",array:"stroke-dasharray"},tF={offset:"strokeDashoffset",array:"strokeDasharray"};function nF(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?eF:tF;e[s.offset]=oe.transform(-r);const o=oe.transform(t),a=oe.transform(n);e[s.array]=`${o} ${a}`}function zp(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(Up(e,u,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:E}=e;h.transform&&(E&&(p.transform=h.transform),delete h.transform),E&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=JD(E,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&nF(h,o,a,l,!1)}const gb=()=>({...Hp(),attrs:{}}),$p=e=>typeof e=="string"&&e.toLowerCase()==="svg";function rF(e,t,n,r){const i=Y.useMemo(()=>{const s=gb();return zp(s,t,{enableHardwareAcceleration:!1},$p(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};mb(s,e.style,e),i.style={...s,...i.style}}return i}function iF(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Bp(n)?rF:qD)(r,s,o,n),c={...ZD(r,typeof n=="string",e),...l,ref:i},{children:f}=r,d=Y.useMemo(()=>Bt(f)?f.get():f,[f]);return Y.createElement(n,{...c,children:d})}}const Gp=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Eb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Tb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yb(e,t,n,r){Eb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Tb.has(i)?i:Gp(i),t.attrs[i])}function Kp(e,t){const{style:n}=e,r={};for(const i in n)(Bt(n[i])||t.style&&Bt(t.style[i])||ub(i,e))&&(r[i]=n[i]);return r}function _b(e,t){const n=Kp(e,t);for(const r in e)if(Bt(e[r])||Bt(t[r])){const i=hl.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function Vp(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function sF(e){const t=Y.useRef(null);return t.current===null&&(t.current=e()),t.current}const Mu=e=>Array.isArray(e),oF=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),aF=e=>Mu(e)?e[e.length-1]||0:e;function z1(e){const t=Bt(e)?e.get():e;return oF(t)?t.toValue():t}function lF({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,s){const o={latestValues:uF(r,i,s,e),renderState:t()};return n&&(o.mount=a=>n(r,a,o)),o}const bb=e=>(t,n)=>{const r=Y.useContext(Pc),i=Y.useContext(Pp),s=()=>lF(e,t,r,i);return n?s():sF(s)};function uF(e,t,n,r){const i={},s=r(e,{});for(const d in s)i[d]=z1(s[d]);let{initial:o,animate:a}=e;const l=Bc(e),u=ob(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;return f&&typeof f!="boolean"&&!Fc(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=Vp(e,h);if(!p)return;const{transitionEnd:E,transition:b,...g}=p;for(const T in g){let y=g[T];if(Array.isArray(y)){const A=c?y.length-1:0;y=y[A]}y!==null&&(i[T]=y)}for(const T in E)i[T]=E[T]}),i}const je=e=>e;function cF(e){let t=[],n=[],r=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const f=c&&i,d=f?t:n;return u&&o.add(l),d.indexOf(l)===-1&&(d.push(l),f&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(f[d]=cF(()=>n=!0),f),{}),o=f=>s[f].process(i),a=()=>{const f=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(f-i.timestamp,fF),1),i.timestamp=f,i.isProcessing=!0,g1.forEach(o),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:g1.reduce((f,d)=>{const h=s[d];return f[d]=(p,E=!1,b=!1)=>(n||l(),h.schedule(p,E,b)),f},{}),cancel:f=>g1.forEach(d=>s[d].cancel(f)),state:i,steps:s}}const{schedule:Fe,cancel:Nr,state:Et,steps:id}=dF(typeof requestAnimationFrame<"u"?requestAnimationFrame:je,!0),hF={useVisualState:bb({scrapeMotionValuesFromProps:_b,createRenderState:gb,onMount:(e,t,{renderState:n,latestValues:r})=>{Fe.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Fe.render(()=>{zp(n,r,{enableHardwareAcceleration:!1},$p(t.tagName),e.transformTemplate),yb(t,n)})}})},mF={useVisualState:bb({scrapeMotionValuesFromProps:Kp,createRenderState:Hp})};function pF(e,{forwardMotionProps:t=!1},n,r){return{...Bp(e)?hF:mF,preloadedFeatures:n,useRender:iF(t),createVisualElement:r,Component:e}}function hr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const vb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Hc(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const gF=e=>t=>vb(t)&&e(t,Hc(t));function pr(e,t,n,r){return hr(e,t,gF(n),r)}const EF=(e,t)=>n=>t(e(n)),ii=(...e)=>e.reduce(EF);function Ab(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const kE=Ab("dragHorizontal"),wE=Ab("dragVertical");function Sb(e){let t=!1;if(e==="y")t=wE();else if(e==="x")t=kE();else{const n=kE(),r=wE();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function Nb(){const e=Sb(!0);return e?(e(),!1):!0}class Ti{constructor(t){this.isMounted=!1,this.node=t}update(){}}function OE(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(s,o)=>{if(s.type==="touch"||Nb())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&Fe.update(()=>a[r](s,o))};return pr(e.current,n,i,{passive:!e.getProps()[r]})}class TF extends Ti{mount(){this.unmount=ii(OE(this.node,!0),OE(this.node,!1))}unmount(){}}class yF extends Ti{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ii(hr(this.node.current,"focus",()=>this.onFocus()),hr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Cb=(e,t)=>t?e===t?!0:Cb(e,t.parentElement):!1;function sd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Hc(n))}class _F extends Ti{constructor(){super(...arguments),this.removeStartListeners=je,this.removeEndListeners=je,this.removeAccessibleListeners=je,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),s=pr(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Fe.update(()=>{Cb(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),o=pr(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=ii(s,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||sd("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Fe.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=hr(this.node.current,"keyup",o),sd("down",(a,l)=>{this.startPress(a,l)})},n=hr(this.node.current,"keydown",t),r=()=>{this.isPressing&&sd("cancel",(s,o)=>this.cancelPress(s,o))},i=hr(this.node.current,"blur",r);this.removeAccessibleListeners=ii(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Fe.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Nb()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Fe.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=pr(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=hr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ii(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const zh=new WeakMap,od=new WeakMap,bF=e=>{const t=zh.get(e.target);t&&t(e)},vF=e=>{e.forEach(bF)};function AF({root:e,...t}){const n=e||document;od.has(n)||od.set(n,{});const r=od.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(vF,{root:e,...t})),r[i]}function SF(e,t,n){const r=AF(t);return zh.set(e,n),r.observe(e),()=>{zh.delete(e),r.unobserve(e)}}const NF={some:0,all:1};class CF extends Ti{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:NF[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return SF(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xF(t,n))&&this.startObserver()}unmount(){}}function xF({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kF={inView:{Feature:CF},tap:{Feature:_F},focus:{Feature:yF},hover:{Feature:TF}};function xb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function OF(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function zc(e,t,n){const r=e.getProps();return Vp(r,t,n!==void 0?n:r.custom,wF(e),OF(e))}const IF="framerAppearId",RF="data-"+Gp(IF);let MF=je,jp=je;const si=e=>e*1e3,gr=e=>e/1e3,LF={current:!1},kb=e=>Array.isArray(e)&&typeof e[0]=="number";function wb(e){return!!(!e||typeof e=="string"&&Ob[e]||kb(e)||Array.isArray(e)&&e.every(wb))}const Qo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ob={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qo([0,.65,.55,1]),circOut:Qo([.55,0,1,.45]),backIn:Qo([.31,.01,.66,-.59]),backOut:Qo([.33,1.53,.69,.99])};function Ib(e){if(e)return kb(e)?Qo(e):Array.isArray(e)?e.map(Ib):Ob[e]}function PF(e,t,n,{delay:r=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Ib(a);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function DF(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const Rb=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,FF=1e-7,BF=12;function UF(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Rb(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>FF&&++aUF(s,0,1,e,n);return s=>s===0||s===1?s:Rb(i(s),t,r)}const HF=gl(.42,0,1,1),zF=gl(0,0,.58,1),Mb=gl(.42,0,.58,1),$F=e=>Array.isArray(e)&&typeof e[0]!="number",Lb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Pb=e=>t=>1-e(1-t),Db=e=>1-Math.sin(Math.acos(e)),Wp=Pb(Db),GF=Lb(Wp),Fb=gl(.33,1.53,.69,.99),Yp=Pb(Fb),KF=Lb(Yp),VF=e=>(e*=2)<1?.5*Yp(e):.5*(2-Math.pow(2,-10*(e-1))),jF={linear:je,easeIn:HF,easeInOut:Mb,easeOut:zF,circIn:Db,circInOut:GF,circOut:Wp,backIn:Yp,backInOut:KF,backOut:Fb,anticipate:VF},IE=e=>{if(Array.isArray(e)){jp(e.length===4);const[t,n,r,i]=e;return gl(t,n,r,i)}else if(typeof e=="string")return jF[e];return e},qp=(e,t)=>n=>!!(ml(n)&&KD.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Bb=(e,t,n)=>r=>{if(!ml(r))return r;const[i,s,o,a]=r.match(Uc);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},WF=e=>fi(0,255,e),ad={...as,transform:e=>Math.round(WF(e))},Bi={test:qp("rgb","red"),parse:Bb("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ad.transform(e)+", "+ad.transform(t)+", "+ad.transform(n)+", "+Ea(ga.transform(r))+")"};function YF(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const $h={test:qp("#"),parse:YF,transform:Bi.transform},zs={test:qp("hsl","hue"),parse:Bb("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Qn.transform(Ea(t))+", "+Qn.transform(Ea(n))+", "+Ea(ga.transform(r))+")"},At={test:e=>Bi.test(e)||$h.test(e)||zs.test(e),parse:e=>Bi.test(e)?Bi.parse(e):zs.test(e)?zs.parse(e):$h.parse(e),transform:e=>ml(e)?e:e.hasOwnProperty("red")?Bi.transform(e):zs.transform(e)},He=(e,t,n)=>-n*e+n*t+e;function ld(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qF({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=ld(l,a,e+1/3),s=ld(l,a,e),o=ld(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}const ud=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},QF=[$h,Bi,zs],XF=e=>QF.find(t=>t.test(e));function RE(e){const t=XF(e);let n=t.parse(e);return t===zs&&(n=qF(n)),n}const Ub=(e,t)=>{const n=RE(e),r=RE(t),i={...n};return s=>(i.red=ud(n.red,r.red,s),i.green=ud(n.green,r.green,s),i.blue=ud(n.blue,r.blue,s),i.alpha=He(n.alpha,r.alpha,s),Bi.transform(i))};function ZF(e){var t,n;return isNaN(e)&&ml(e)&&(((t=e.match(Uc))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(db))===null||n===void 0?void 0:n.length)||0)>0}const Hb={regex:$D,countKey:"Vars",token:"${v}",parse:je},zb={regex:db,countKey:"Colors",token:"${c}",parse:At.parse},$b={regex:Uc,countKey:"Numbers",token:"${n}",parse:as.parse};function cd(e,{regex:t,countKey:n,token:r,parse:i}){const s=e.tokenised.match(t);s&&(e["num"+n]=s.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...s.map(i)))}function Lu(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&cd(n,Hb),cd(n,zb),cd(n,$b),n}function Gb(e){return Lu(e).values}function Kb(e){const{values:t,numColors:n,numVars:r,tokenised:i}=Lu(e),s=t.length;return o=>{let a=i;for(let l=0;ltypeof e=="number"?0:e;function eB(e){const t=Gb(e);return Kb(e)(t.map(JF))}const di={test:ZF,parse:Gb,createTransformer:Kb,getAnimatableNone:eB},Vb=(e,t)=>n=>`${n>0?t:e}`;function jb(e,t){return typeof e=="number"?n=>He(e,t,n):At.test(e)?Ub(e,t):e.startsWith("var(")?Vb(e,t):Yb(e,t)}const Wb=(e,t)=>{const n=[...e],r=n.length,i=e.map((s,o)=>jb(s,t[o]));return s=>{for(let o=0;o{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=jb(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}},Yb=(e,t)=>{const n=di.createTransformer(t),r=Lu(e),i=Lu(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?ii(Wb(r.values,i.values),n):Vb(e,t)},Xa=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},ME=(e,t)=>n=>He(e,t,n);function nB(e){return typeof e=="number"?ME:typeof e=="string"?At.test(e)?Ub:Yb:Array.isArray(e)?Wb:typeof e=="object"?tB:ME}function rB(e,t,n){const r=[],i=n||nB(e[0]),s=e.length-1;for(let o=0;ot[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=rB(t,r,i),a=o.length,l=u=>{let c=0;if(a>1)for(;cl(fi(e[0],e[s-1],u)):l}function iB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Xa(0,t,r);e.push(He(n,1,i))}}function sB(e){const t=[0];return iB(t,e.length-1),t}function oB(e,t){return e.map(n=>n*t)}function aB(e,t){return e.map(()=>t||Mb).splice(0,e.length-1)}function Pu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=$F(r)?r.map(IE):IE(r),s={done:!1,value:t[0]},o=oB(n&&n.length===t.length?n:sB(t),e),a=qb(o,t,{ease:Array.isArray(i)?i:aB(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}function Qb(e,t){return t?e*(1e3/t):0}const lB=5;function Xb(e,t,n){const r=Math.max(t-lB,0);return Qb(n-e(r),t-r)}const fd=.001,uB=.01,LE=10,cB=.05,fB=1;function dB({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,s;MF(e<=si(LE));let o=1-t;o=fi(cB,fB,o),e=fi(uB,LE,gr(e)),o<1?(i=u=>{const c=u*o,f=c*e,d=c-n,h=Gh(u,o),p=Math.exp(-f);return fd-d/h*p},s=u=>{const f=u*o*e,d=f*n+n,h=Math.pow(o,2)*Math.pow(u,2)*e,p=Math.exp(-f),E=Gh(Math.pow(u,2),o);return(-i(u)+fd>0?-1:1)*((d-h)*p)/E}):(i=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-fd+c*f},s=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const a=5/e,l=mB(i,s,a);if(e=si(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const hB=12;function mB(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function EB(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!PE(e,gB)&&PE(e,pB)){const n=dB(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function Zb({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],s=e[e.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:c,duration:f,isResolvedFromDuration:d}=EB(r),h=c?-gr(c):0,p=l/(2*Math.sqrt(a*u)),E=s-i,b=gr(Math.sqrt(a/u)),g=Math.abs(E)<5;n||(n=g?.01:2),t||(t=g?.005:.5);let T;if(p<1){const y=Gh(b,p);T=A=>{const k=Math.exp(-p*b*A);return s-k*((h+p*b*E)/y*Math.sin(y*A)+E*Math.cos(y*A))}}else if(p===1)T=y=>s-Math.exp(-b*y)*(E+(h+b*E)*y);else{const y=b*Math.sqrt(p*p-1);T=A=>{const k=Math.exp(-p*b*A),v=Math.min(y*A,300);return s-k*((h+p*b*E)*Math.sinh(v)+y*E*Math.cosh(v))/y}}return{calculatedDuration:d&&f||null,next:y=>{const A=T(y);if(d)o.done=y>=f;else{let k=h;y!==0&&(p<1?k=Xb(T,y,A):k=0);const v=Math.abs(k)<=n,N=Math.abs(s-A)<=t;o.done=v&&N}return o.value=o.done?s:A,o}}}function DE({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],d={done:!1,value:f},h=I=>a!==void 0&&Il,p=I=>a===void 0?l:l===void 0||Math.abs(a-I)-E*Math.exp(-I/r),y=I=>g+T(I),A=I=>{const D=T(I),O=y(I);d.done=Math.abs(D)<=u,d.value=d.done?g:O};let k,v;const N=I=>{h(d.value)&&(k=I,v=Zb({keyframes:[d.value,p(d.value)],velocity:Xb(y,I,d.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return N(0),{calculatedDuration:null,next:I=>{let D=!1;return!v&&k===void 0&&(D=!0,A(I),N(I)),k!==void 0&&I>k?v.next(I-k):(!D&&A(I),d)}}}const TB=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Fe.update(t,!0),stop:()=>Nr(t),now:()=>Et.isProcessing?Et.timestamp:performance.now()}},FE=2e4;function BE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=FE?1/0:t}const yB={decay:DE,inertia:DE,tween:Pu,keyframes:Pu,spring:Zb};function Du({autoplay:e=!0,delay:t=0,driver:n=TB,keyframes:r,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:f,...d}){let h=1,p=!1,E,b;const g=()=>{b=new Promise($=>{E=$})};g();let T;const y=yB[i]||Pu;let A;y!==Pu&&typeof r[0]!="number"&&(A=qb([0,100],r,{clamp:!1}),r=[0,100]);const k=y({...d,keyframes:r});let v;a==="mirror"&&(v=y({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let N="idle",I=null,D=null,O=null;k.calculatedDuration===null&&s&&(k.calculatedDuration=BE(k));const{calculatedDuration:U}=k;let j=1/0,ee=1/0;U!==null&&(j=U+o,ee=j*(s+1)-o);let X=0;const q=$=>{if(D===null)return;h>0&&(D=Math.min(D,$)),h<0&&(D=Math.min($-ee/h,D)),I!==null?X=I:X=Math.round($-D)*h;const re=X-t*(h>=0?1:-1),C=h>=0?re<0:re>ee;X=Math.max(re,0),N==="finished"&&I===null&&(X=ee);let be=X,ve=k;if(s){const he=X/j;let ht=Math.floor(he),mt=he%1;!mt&&he>=1&&(mt=1),mt===1&&ht--,ht=Math.min(ht,s+1);const Jn=!!(ht%2);Jn&&(a==="reverse"?(mt=1-mt,o&&(mt-=o/j)):a==="mirror"&&(ve=v));let ls=fi(0,1,mt);X>ee&&(ls=a==="reverse"&&Jn?1:0),be=ls*j}const le=C?{done:!1,value:r[0]}:ve.next(be);A&&(le.value=A(le.value));let{done:et}=le;!C&&U!==null&&(et=h>=0?X>=ee:X<=0);const vt=I===null&&(N==="finished"||N==="running"&&et);return f&&f(le.value),vt&&R(),le},de=()=>{T&&T.stop(),T=void 0},P=()=>{N="idle",de(),E(),g(),D=O=null},R=()=>{N="finished",c&&c(),de(),E()},B=()=>{if(p)return;T||(T=n(q));const $=T.now();l&&l(),I!==null?D=$-I:(!D||N==="finished")&&(D=$),N==="finished"&&g(),O=D,I=null,N="running",T.start()};e&&B();const _={then($,re){return b.then($,re)},get time(){return gr(X)},set time($){$=si($),X=$,I!==null||!T||h===0?I=$:D=T.now()-$/h},get duration(){const $=k.calculatedDuration===null?BE(k):k.calculatedDuration;return gr($)},get speed(){return h},set speed($){$===h||!T||(h=$,_.time=gr(X))},get state(){return N},play:B,pause:()=>{N="paused",I=X},stop:()=>{p=!0,N!=="idle"&&(N="idle",u&&u(),P())},cancel:()=>{O!==null&&q(O),P()},complete:()=>{N="finished"},sample:$=>(D=0,q($))};return _}function _B(e){let t;return()=>(t===void 0&&(t=e()),t)}const bB=_B(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),vB=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),E1=10,AB=2e4,SB=(e,t)=>t.type==="spring"||e==="backgroundColor"||!wb(t.ease);function NB(e,t,{onUpdate:n,onComplete:r,...i}){if(!(bB()&&vB.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let o=!1,a,l;const u=()=>{l=new Promise(T=>{a=T})};u();let{keyframes:c,duration:f=300,ease:d,times:h}=i;if(SB(t,i)){const T=Du({...i,repeat:0,delay:0});let y={done:!1,value:c[0]};const A=[];let k=0;for(;!y.done&&kp.cancel(),b=()=>{Fe.update(E),a(),u()};return p.onfinish=()=>{e.set(DF(c,i)),r&&r(),b()},{then(T,y){return l.then(T,y)},attachTimeline(T){return p.timeline=T,p.onfinish=null,je},get time(){return gr(p.currentTime||0)},set time(T){p.currentTime=si(T)},get speed(){return p.playbackRate},set speed(T){p.playbackRate=T},get duration(){return gr(f)},play:()=>{o||(p.play(),Nr(E))},pause:()=>p.pause(),stop:()=>{if(o=!0,p.playState==="idle")return;const{currentTime:T}=p;if(T){const y=Du({...i,autoplay:!1});e.setWithVelocity(y.sample(T-E1).value,y.sample(T).value,E1)}b()},complete:()=>p.finish(),cancel:b}}function CB({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:je,pause:je,stop:je,then:s=>(s(),Promise.resolve()),cancel:je,complete:je});return t?Du({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const xB={type:"spring",stiffness:500,damping:25,restSpeed:10},kB=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wB={type:"keyframes",duration:.8},OB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IB=(e,{keyframes:t})=>t.length>2?wB:os.has(e)?e.startsWith("scale")?kB(t[1]):xB:OB,Kh=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(di.test(t)||t==="0")&&!t.startsWith("url(")),RB=new Set(["brightness","contrast","saturate","opacity"]);function MB(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Uc)||[];if(!r)return e;const i=n.replace(r,"");let s=RB.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const LB=/([a-z-]*)\(.*?\)/g,Vh={...di,getAnimatableNone:e=>{const t=e.match(LB);return t?t.map(MB).join(" "):e}},PB={...hb,color:At,backgroundColor:At,outlineColor:At,fill:At,stroke:At,borderColor:At,borderTopColor:At,borderRightColor:At,borderBottomColor:At,borderLeftColor:At,filter:Vh,WebkitFilter:Vh},Qp=e=>PB[e];function Jb(e,t){let n=Qp(e);return n!==Vh&&(n=di),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ev=e=>/^0[^.\s]+$/.test(e);function DB(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||ev(e)}function FB(e,t,n,r){const i=Kh(t,n);let s;Array.isArray(n)?s=[...n]:s=[null,n];const o=r.from!==void 0?r.from:e.get();let a;const l=[];for(let u=0;ui=>{const s=tv(r,e)||{},o=s.delay||r.delay||0;let{elapsed:a=0}=r;a=a-si(o);const l=FB(t,e,n,s),u=l[0],c=l[l.length-1],f=Kh(e,u),d=Kh(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(BB(s)||(h={...h,...IB(e,h)}),h.duration&&(h.duration=si(h.duration)),h.repeatDelay&&(h.repeatDelay=si(h.repeatDelay)),!f||!d||LF.current||s.type===!1)return CB(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=NB(t,e,h);if(p)return p}return Du(h)};function Fu(e){return!!(Bt(e)&&e.add)}const nv=e=>/^\-?\d*\.?\d+$/.test(e);function Zp(e,t){e.indexOf(t)===-1&&e.push(t)}function Jp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class e0{constructor(){this.subscriptions=[]}add(t){return Zp(this.subscriptions,t),()=>Jp(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s!isNaN(parseFloat(e));class HB{constructor(t,n={}){this.version="10.16.1",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:s,timestamp:o}=Et;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,Fe.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Fe.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=UB(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new e0);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Qb(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function uo(e,t){return new HB(e,t)}const rv=e=>t=>t.test(e),zB={test:e=>e==="auto",parse:e=>e},iv=[as,oe,Qn,Ur,jD,VD,zB],$o=e=>iv.find(rv(e)),$B=[...iv,At,di],GB=e=>$B.find(rv(e));function KB(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,uo(n))}function VB(e,t){const n=zc(e,t);let{transitionEnd:r={},transition:i={},...s}=n?e.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const o in s){const a=aF(s[o]);KB(e,o,a)}}function jB(e,t,n){var r,i;const s=Object.keys(t).filter(a=>!e.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(f))),u.push(E)}return o&&Promise.all(u).then(()=>{o&&VB(e,o)}),u}function jh(e,t,n={}){const r=zc(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(sv(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:f}=i;return QB(e,t,u+l,c,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function QB(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(XB).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(jh(u,t,{...s,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function XB(e,t){return e.sortNodePosition(t)}function ZB(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>jh(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=jh(e,t,n);else{const i=typeof t=="function"?zc(e,t,n.custom):t;r=Promise.all(sv(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const JB=[...Dp].reverse(),eU=Dp.length;function tU(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ZB(e,n,r)))}function nU(e){let t=tU(e);const n=iU();let r=!0;const i=(l,u)=>{const c=zc(e,u);if(c){const{transition:f,transitionEnd:d,...h}=c;l={...l,...h,...d}}return l};function s(l){t=l(e)}function o(l,u){const c=e.getProps(),f=e.getVariantContext(!0)||{},d=[],h=new Set;let p={},E=1/0;for(let g=0;gE&&k;const O=Array.isArray(A)?A:[A];let U=O.reduce(i,{});v===!1&&(U={});const{prevResolvedValues:j={}}=y,ee={...j,...U},X=q=>{D=!0,h.delete(q),y.needsAnimating[q]=!0};for(const q in ee){const de=U[q],P=j[q];p.hasOwnProperty(q)||(de!==P?Mu(de)&&Mu(P)?!xb(de,P)||I?X(q):y.protectedKeys[q]=!0:de!==void 0?X(q):h.add(q):de!==void 0&&h.has(q)?X(q):y.protectedKeys[q]=!0)}y.prevProp=A,y.prevResolvedValues=U,y.isActive&&(p={...p,...U}),r&&e.blockInitialAnimation&&(D=!1),D&&!N&&d.push(...O.map(q=>({animation:q,options:{type:T,...l}})))}if(h.size){const g={};h.forEach(T=>{const y=e.getBaseTarget(T);y!==void 0&&(g[T]=y)}),d.push({animation:g})}let b=!!d.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(d):Promise.resolve()}function a(l,u,c){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(c,l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n}}function rU(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xb(t,e):!1}function Si(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iU(){return{animate:Si(!0),whileInView:Si(),whileHover:Si(),whileTap:Si(),whileDrag:Si(),whileFocus:Si(),exit:Si()}}class sU extends Ti{constructor(t){super(t),t.animationState||(t.animationState=nU(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Fc(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let oU=0;class aU extends Ti{constructor(){super(...arguments),this.id=oU++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const lU={animation:{Feature:sU},exit:{Feature:aU}},UE=(e,t)=>Math.abs(e-t);function uU(e,t){const n=UE(e.x,t.x),r=UE(e.y,t.y);return Math.sqrt(n**2+r**2)}class ov{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=hd(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=uU(u.offset,{x:0,y:0})>=3;if(!c&&!f)return;const{point:d}=u,{timestamp:h}=Et;this.history.push({...d,timestamp:h});const{onStart:p,onMove:E}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=dd(c,this.transformPagePoint),Fe.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=hd(u.type==="pointercancel"?this.lastMoveEventInfo:dd(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,h),d&&d(u,h)},!vb(t))return;this.handlers=n,this.transformPagePoint=r;const i=Hc(t),s=dd(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=Et;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=n;l&&l(t,hd(s,this.history)),this.removeListeners=ii(pr(window,"pointermove",this.handlePointerMove),pr(window,"pointerup",this.handlePointerUp),pr(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Nr(this.updatePoint)}}function dd(e,t){return t?{point:t(e.point)}:e}function HE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hd({point:e},t){return{point:e,delta:HE(e,av(t)),offset:HE(e,cU(t)),velocity:fU(t,.1)}}function cU(e){return e[0]}function av(e){return e[e.length-1]}function fU(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=av(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>si(t)));)n--;if(!r)return{x:0,y:0};const s=gr(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Qt(e){return e.max-e.min}function Wh(e,t=0,n=.01){return Math.abs(e-t)<=n}function zE(e,t,n,r=.5){e.origin=r,e.originPoint=He(t.min,t.max,e.origin),e.scale=Qt(n)/Qt(t),(Wh(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=He(n.min,n.max,e.origin)-e.originPoint,(Wh(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Ta(e,t,n,r){zE(e.x,t.x,n.x,r?r.originX:void 0),zE(e.y,t.y,n.y,r?r.originY:void 0)}function $E(e,t,n){e.min=n.min+t.min,e.max=e.min+Qt(t)}function dU(e,t,n){$E(e.x,t.x,n.x),$E(e.y,t.y,n.y)}function GE(e,t,n){e.min=t.min-n.min,e.max=e.min+Qt(t)}function ya(e,t,n){GE(e.x,t.x,n.x),GE(e.y,t.y,n.y)}function hU(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?He(n,e,r.max):Math.min(e,n)),e}function KE(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function mU(e,{top:t,left:n,bottom:r,right:i}){return{x:KE(e.x,n,i),y:KE(e.y,t,r)}}function VE(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Xa(t.min,t.max-r,e.min):r>i&&(n=Xa(e.min,e.max-i,t.min)),fi(0,1,n)}function EU(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yh=.35;function TU(e=Yh){return e===!1?e=0:e===!0&&(e=Yh),{x:jE(e,"left","right"),y:jE(e,"top","bottom")}}function jE(e,t,n){return{min:WE(e,t),max:WE(e,n)}}function WE(e,t){return typeof e=="number"?e:e[t]||0}const YE=()=>({translate:0,scale:1,origin:0,originPoint:0}),$s=()=>({x:YE(),y:YE()}),qE=()=>({min:0,max:0}),Xe=()=>({x:qE(),y:qE()});function zn(e){return[e("x"),e("y")]}function lv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function yU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function _U(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function md(e){return e===void 0||e===1}function qh({scale:e,scaleX:t,scaleY:n}){return!md(e)||!md(t)||!md(n)}function wi(e){return qh(e)||uv(e)||e.z||e.rotate||e.rotateX||e.rotateY}function uv(e){return QE(e.x)||QE(e.y)}function QE(e){return e&&e!=="0%"}function Bu(e,t,n){const r=e-n,i=t*r;return n+i}function XE(e,t,n,r,i){return i!==void 0&&(e=Bu(e,i,r)),Bu(e,n,r)+t}function Qh(e,t=0,n=1,r,i){e.min=XE(e.min,t,n,r,i),e.max=XE(e.max,t,n,r,i)}function cv(e,{x:t,y:n}){Qh(e.x,t.translate,t.scale,t.originPoint),Qh(e.y,n.translate,n.scale,n.originPoint)}function bU(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function Gr(e,t){e.min=e.min+t,e.max=e.max+t}function JE(e,t,[n,r,i]){const s=t[i]!==void 0?t[i]:.5,o=He(e.min,e.max,s);Qh(e,t[n],t[r],o,t.scale)}const vU=["x","scaleX","originX"],AU=["y","scaleY","originY"];function Gs(e,t){JE(e.x,t,vU),JE(e.y,t,AU)}function fv(e,t){return lv(_U(e.getBoundingClientRect(),t))}function SU(e,t,n){const r=fv(e,n),{scroll:i}=t;return i&&(Gr(r.x,i.offset.x),Gr(r.y,i.offset.y)),r}const NU=new WeakMap;class CU{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(Hc(l,"page").point)},s=(l,u)=>{const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();if(c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Sb(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zn(p=>{let E=this.getAxisMotionValue(p).get()||0;if(Qn.test(E)){const{projection:b}=this.visualElement;if(b&&b.layout){const g=b.layout.layoutBox[p];g&&(E=Qt(g)*(parseFloat(E)/100))}}this.originPoint[p]=E}),d&&Fe.update(()=>d(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},o=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(f&&this.currentDirection===null){this.currentDirection=xU(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},a=(l,u)=>this.stop(l,u);this.panSession=new ov(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Fe.update(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!T1(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=hU(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Hs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=mU(r.layoutBox,t):this.constraints=!1,this.elastic=TU(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&zn(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=EU(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Hs(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=SU(r,i.root,this.visualElement.getTransformPagePoint());let o=pU(i.layout.layoutBox,s);if(n){const a=n(yU(o));this.hasMutatedConstraints=!!a,a&&(o=lv(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=zn(c=>{if(!T1(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(Xp(t,r,0,n))}stopAnimation(){zn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){zn(n=>{const{drag:r}=this.getProps();if(!T1(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-He(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Hs(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};zn(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();i[o]=gU({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),zn(o=>{if(!T1(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(He(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;NU.set(this.visualElement,this);const t=this.visualElement.current,n=pr(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Hs(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const o=hr(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(zn(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Yh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function T1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function xU(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class kU extends Ti{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new CU(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}unmount(){this.removeGroupControls(),this.removeListeners()}}const eT=e=>(t,n)=>{e&&Fe.update(()=>e(t,n))};class wU extends Ti{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new ov(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:eT(t),onStart:eT(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Fe.update(()=>i(s,o))}}}mount(){this.removePointerDownListener=pr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function OU(){const e=Y.useContext(Pp);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=Y.useId();return Y.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}const $1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function tT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(oe.test(e))e=parseFloat(e);else return e;const n=tT(e,t.target.x),r=tT(e,t.target.y);return`${n}% ${r}%`}},IU={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=di.parse(e);if(i.length>5)return r;const s=di.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=He(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class RU extends kn.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;BD(MU),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),$1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Fe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function dv(e){const[t,n]=OU(),r=Y.useContext(ab);return kn.createElement(RU,{...e,layoutGroup:r,switchLayoutGroup:Y.useContext(lb),isPresent:t,safeToRemove:n})}const MU={borderRadius:{...Go,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Go,borderTopRightRadius:Go,borderBottomLeftRadius:Go,borderBottomRightRadius:Go,boxShadow:IU},hv=["TopLeft","TopRight","BottomLeft","BottomRight"],LU=hv.length,nT=e=>typeof e=="string"?parseFloat(e):e,rT=e=>typeof e=="number"||oe.test(e);function PU(e,t,n,r,i,s){i?(e.opacity=He(0,n.opacity!==void 0?n.opacity:1,DU(r)),e.opacityExit=He(t.opacity!==void 0?t.opacity:1,0,FU(r))):s&&(e.opacity=He(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;ort?1:n(Xa(e,t,r))}function sT(e,t){e.min=t.min,e.max=t.max}function tn(e,t){sT(e.x,t.x),sT(e.y,t.y)}function oT(e,t,n,r,i){return e-=t,e=Bu(e,1/n,r),i!==void 0&&(e=Bu(e,1/i,r)),e}function BU(e,t=0,n=1,r=.5,i,s=e,o=e){if(Qn.test(t)&&(t=parseFloat(t),t=He(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=He(s.min,s.max,r);e===s&&(a-=t),e.min=oT(e.min,t,n,a,i),e.max=oT(e.max,t,n,a,i)}function aT(e,t,[n,r,i],s,o){BU(e,t[n],t[r],t[i],t.scale,s,o)}const UU=["x","scaleX","originX"],HU=["y","scaleY","originY"];function lT(e,t,n,r){aT(e.x,t,UU,n?n.x:void 0,r?r.x:void 0),aT(e.y,t,HU,n?n.y:void 0,r?r.y:void 0)}function uT(e){return e.translate===0&&e.scale===1}function pv(e){return uT(e.x)&&uT(e.y)}function zU(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function gv(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function cT(e){return Qt(e.x)/Qt(e.y)}class $U{constructor(){this.members=[]}add(t){Zp(this.members,t),t.scheduleRender()}remove(t){if(Jp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function fT(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y;if((i||s)&&(r=`translate3d(${i}px, ${s}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(r+=`scale(${o}, ${a})`),r||"none"}const GU=(e,t)=>e.depth-t.depth;class KU{constructor(){this.children=[],this.isDirty=!1}add(t){Zp(this.children,t),this.isDirty=!0}remove(t){Jp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(GU),this.isDirty=!1,this.children.forEach(t)}}function VU(e,t){const n=performance.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Nr(r),e(s-t))};return Fe.read(r,!0),()=>Nr(r)}function jU(e){window.MotionDebug&&window.MotionDebug.record(e)}function WU(e){return e instanceof SVGElement&&e.tagName!=="svg"}function YU(e,t,n){const r=Bt(e)?e:uo(e);return r.start(Xp("",r,t,n)),r.animation}const dT=["","X","Y","Z"],hT=1e3;let qU=0;const Oi={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Ev({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=qU++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Oi.totalNodes=Oi.resolvedTargetDeltas=Oi.recalculatedProjection=0,this.nodes.forEach(ZU),this.nodes.forEach(rH),this.nodes.forEach(iH),this.nodes.forEach(JU),jU(Oi)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=VU(d,250),$1.hasAnimatedSinceResize&&($1.hasAnimatedSinceResize=!1,this.nodes.forEach(pT))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||c.getDefaultTransition()||uH,{onLayoutAnimationStart:b,onLayoutAnimationComplete:g}=c.getProps(),T=!this.targetLayout||!gv(this.targetLayout,p)||h,y=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||d&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,y);const A={...tv(E,"layout"),onPlay:b,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||pT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Nr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(sH),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(eH),this.sharedNodes.forEach(oH)}scheduleUpdateProjection(){Fe.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Fe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const k=A/1e3;gT(f.x,o.x,k),gT(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ya(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),aH(this.relativeTarget,this.relativeTargetOrigin,d,k),y&&zU(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Xe()),tn(y,this.relativeTarget)),E&&(this.animationValues=c,PU(c,u,this.latestValues,k,T,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Nr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Fe.update(()=>{$1.hasAnimatedSinceResize=!0,this.currentAnimation=YU(0,hT,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hT),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Tv(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Xe();const f=Qt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=Qt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}tn(a,l),Gs(a,c),Ta(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new $U),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let c=0;c{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(mT),this.root.sharedNodes.clear()}}}function QU(e){e.updateLayout()}function XU(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?zn(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Qt(d);d.min=r[f].min,d.max=d.min+h}):Tv(s,n.layoutBox,r)&&zn(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Qt(r[f]);d.max=d.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const a=$s();Ta(a,r,n.layoutBox);const l=$s();o?Ta(l,e.applyTransform(i,!0),n.measuredBox):Ta(l,r,n.layoutBox);const u=!pv(a);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=Xe();ya(p,n.layoutBox,d.layoutBox);const E=Xe();ya(E,r,h.layoutBox),gv(p,E)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=E,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ZU(e){Oi.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function JU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eH(e){e.clearSnapshot()}function mT(e){e.clearMeasurements()}function tH(e){e.isLayoutDirty=!1}function nH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function pT(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rH(e){e.resolveTargetDelta()}function iH(e){e.calcProjection()}function sH(e){e.resetRotation()}function oH(e){e.removeLeadSnapshot()}function gT(e,t,n){e.translate=He(t.translate,0,n),e.scale=He(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ET(e,t,n,r){e.min=He(t.min,n.min,r),e.max=He(t.max,n.max,r)}function aH(e,t,n,r){ET(e.x,t.x,n.x,r),ET(e.y,t.y,n.y,r)}function lH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uH={duration:.45,ease:[.4,0,.1,1]},TT=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),yT=TT("applewebkit/")&&!TT("chrome/")?Math.round:je;function _T(e){e.min=yT(e.min),e.max=yT(e.max)}function cH(e){_T(e.x),_T(e.y)}function Tv(e,t,n){return e==="position"||e==="preserve-aspect"&&!Wh(cT(t),cT(n),.2)}const fH=Ev({attachResizeListener:(e,t)=>hr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pd={current:void 0},yv=Ev({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pd.current){const e=new fH({});e.mount(window),e.setOptions({layoutScroll:!0}),pd.current=e}return pd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dH={pan:{Feature:wU},drag:{Feature:kU,ProjectionNode:yv,MeasureLayout:dv}},hH=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function mH(e){const t=hH.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function Xh(e,t,n=1){const[r,i]=mH(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return nv(o)?parseFloat(o):o}else return Hh(i)?Xh(i,t,n+1):i}function pH(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const s=i.get();if(!Hh(s))return;const o=Xh(s,r);o&&i.set(o)});for(const i in t){const s=t[i];if(!Hh(s))continue;const o=Xh(s,r);o&&(t[i]=o,n||(n={}),n[i]===void 0&&(n[i]=s))}return{target:t,transitionEnd:n}}const gH=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),_v=e=>gH.has(e),EH=e=>Object.keys(e).some(_v),bT=e=>e===as||e===oe,vT=(e,t)=>parseFloat(e.split(", ")[t]),AT=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return vT(i[1],t);{const s=r.match(/^matrix\((.+)\)$/);return s?vT(s[1],e):0}},TH=new Set(["x","y","z"]),yH=hl.filter(e=>!TH.has(e));function _H(e){const t=[];return yH.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:AT(4,13),y:AT(5,14)};co.translateX=co.x;co.translateY=co.y;const bH=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{a[u]=co[u](r,s)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(a[u]),e[u]=co[u](l,s)}),e},vH=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(_v);let s=[],o=!1;const a=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],f=$o(c);const d=t[l];let h;if(Mu(d)){const p=d.length,E=d[0]===null?1:0;c=d[E],f=$o(c);for(let b=E;b=0?window.pageYOffset:null,u=bH(t,e,a);return s.length&&s.forEach(([c,f])=>{e.getValue(c).set(f)}),e.render(),Dc&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function AH(e,t,n,r){return EH(t)?vH(e,t,n,r):{target:t,transitionEnd:r}}const SH=(e,t,n,r)=>{const i=pH(e,t,r);return t=i.target,r=i.transitionEnd,AH(e,t,n,r)},Zh={current:null},bv={current:!1};function NH(){if(bv.current=!0,!!Dc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Zh.current=e.matches;e.addListener(t),t()}else Zh.current=!1}function CH(e,t,n){const{willChange:r}=t;for(const i in t){const s=t[i],o=n[i];if(Bt(s))e.addValue(i,s),Fu(r)&&r.add(i);else if(Bt(o))e.addValue(i,uo(s,{owner:e})),Fu(r)&&r.remove(i);else if(o!==s)if(e.hasValue(i)){const a=e.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=e.getStaticValue(i);e.addValue(i,uo(a!==void 0?a:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const ST=new WeakMap,vv=Object.keys(Qa),xH=vv.length,NT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],kH=Fp.length;class wH{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Fe.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=Bc(n),this.isVariantNode=ob(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const f in c){const d=c[f];a[f]!==void 0&&Bt(d)&&(d.set(a[f],!1),Fu(u)&&u.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,ST.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),bv.current||NH(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Zh.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ST.delete(this.current),this.projection&&this.projection.unmount(),Nr(this.notifyUpdate),Nr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=os.has(t),i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Fe.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,layoutScroll:d,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=uo(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=Vp(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Bt(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new e0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Av extends wH{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},s){let o=YB(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),o&&(o=i(o))),s){jB(this,r,o);const a=SH(this,r,o,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function OH(e){return window.getComputedStyle(e)}class IH extends Av{readValueFromInstance(t,n){if(os.has(n)){const r=Qp(n);return r&&r.default||0}else{const r=OH(t),i=(fb(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return fv(t,n)}build(t,n,r,i){Up(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return Kp(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Bt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){Eb(t,n,r,i)}}class RH extends Av{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(os.has(n)){const r=Qp(n);return r&&r.default||0}return n=Tb.has(n)?n:Gp(n),t.getAttribute(n)}measureInstanceViewportBox(){return Xe()}scrapeMotionValuesFromProps(t,n){return _b(t,n)}build(t,n,r,i){zp(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){yb(t,n,r,i)}mount(t){this.isSVGTag=$p(t.tagName),super.mount(t)}}const MH=(e,t)=>Bp(e)?new RH(t,{enableHardwareAcceleration:!1}):new IH(t,{enableHardwareAcceleration:!0}),LH={layout:{ProjectionNode:yv,MeasureLayout:dv}},PH={...lU,...kF,...dH,...LH},DH=DD((e,t)=>pF(e,t,PH,MH)),FH=[{position:{left:0,top:0},delay:.1},{position:{left:16,top:0},delay:.05},{position:{left:32,top:0},delay:0},{position:{left:0,top:16},delay:.15},{position:{left:16,top:16},delay:.2},{position:{left:32,top:16},delay:.25},{position:{left:0,top:32},delay:.4},{position:{left:16,top:32},delay:.35},{position:{left:32,top:32},delay:.3}],BH=({color:e})=>L.jsx("div",{className:"relative h-[34px] w-[34px]",children:FH.map(({position:t,delay:n},r)=>L.jsx(DH.div,{className:`absolute ${e?"bg-"+e:"bg-highlight"} left-[${t.left}px] top-[${t.top}px] h-[2px] w-[2px]`,animate:{opacity:[0,1,1,0,0]},transition:{delay:n,duration:1,repeat:1/0,times:[0,.1,.6,.7,1],repeatDelay:1}},r))}),UH=()=>L.jsxs("section",{className:"flex flex-col p-8",children:[L.jsx("h1",{className:"mb-4 text-lg font-bold",children:"Sourcery Coding Assistant"}),L.jsx("p",{className:"mb-2",children:"We're rolling out the Sourcery Coding Assistant to early access users."}),L.jsxs("p",{children:["Find out more and sign up for early access"," ",L.jsx("a",{href:"https://sourcery.ai/coding-assistant/",className:"underline",target:"_blank",children:"here"}),"."]})]});window.sourceryLS=window.sourceryLS||{};const HH=e=>{window.sourceryLS.postMessage(e)};function zH(){const[{status:e,context:t},n]=Y.useState({status:"pending",context:{isFeatureFlagEnabled:!1,isConfigEnabled:!1}}),r=Y.useCallback(({data:i})=>{switch(i.command){case"context/update":n(Kn(s=>{s.status="ok",Object.entries(i.updates).forEach(([o,a])=>{s.context[o]=a})}))}},[]);return Y.useEffect(()=>(window.addEventListener("message",r),()=>window.removeEventListener("message",r)),[r]),Y.useEffect(()=>{HH({type:"context/contextRequest"})},[]),L.jsx("main",{className:"flex h-full max-h-full flex-col divide-y-4 divide-border overflow-clip bg-background text-foreground",children:e==="pending"?L.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-8",children:[L.jsx(BH,{}),L.jsx("p",{className:"italic",children:"Loading..."})]}):t.isFeatureFlagEnabled?t.isConfigEnabled?L.jsxs(L.Fragment,{children:[L.jsx(yD,{}),L.jsx(bD,{}),L.jsx(SD,{})]}):L.jsx(CD,{}):L.jsx(UH,{})})}gd.createRoot(document.getElementById("root")).render(L.jsx(kn.StrictMode,{children:L.jsx(zH,{})})); +`:nD(e)?(a=2,l=2):Z8(e)&&(a=1,l=1);++s-1?r.slice(0,u):r}return(u,c)=>{ul(u,"element",(f,d,h)=>{const p=h;if(!p||!("tagName"in p)||p.tagName!=="pre"||f.tagName!=="code"||!f.properties)return;const E=fD(f);if(E===!1||!E&&!a||E&&i&&i.includes(E))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);let b;try{b=E?ce.highlight(E,yE(p),{prefix:r}):ce.highlightAuto(yE(p),{prefix:r,subset:o})}catch(g){const T=g;(!s||!/Unknown language/.test(T.message))&&c.fail(T,f,"rehype-highlight:missing-language");return}!E&&b.data.language&&f.properties.className.push("language-"+b.data.language),Array.isArray(b.children)&&b.children.length>0&&(f.children=b.children)})}}function fD(e){const t=e.properties&&e.properties.className;let n=-1;if(Array.isArray(t))for(;++n{window.sourceryLS.postMessage(e)},hD=({copyValue:e})=>{const[t,n]=Y.useState(!1);return navigator.clipboard?L.jsx("button",{className:"flex h-7 w-7 flex-row items-center justify-center bg-editor p-1 hover:bg-chat",onClick:async()=>{await navigator.clipboard.writeText(e).then(()=>{n(!0)})},onBlur:()=>{n(!1)},children:t?L.jsx(dn.Check,{}):L.jsx(dn.Copy,{})}):null},mD=({copyValue:e})=>L.jsx("button",{className:"flex h-7 w-7 flex-row items-center justify-center bg-editor p-1 hover:bg-chat",onClick:()=>H1({type:"insertAtCursor",content:e}),children:L.jsx(dn.Insert,{})}),nb=({markdown:e})=>{var t;return L.jsx(v2,{remarkPlugins:[Vw],rehypePlugins:[NM,cD,[DM,{attributes:{...Cu.attributes,span:[...((t=Cu.attributes)==null?void 0:t.span)||[],dD]}}]],transformLinkUri:n=>n.startsWith("https")||n.startsWith("file")||n==="VALID_FILE"||n==="VALID_DIRECTORY"?n:"",components:{h1({children:n}){return L.jsx("h1",{className:"mb-2 mt-6 text-lg font-bold first:mt-0 last:mb-0",children:n})},h2({children:n}){return L.jsx("h2",{className:"mt-2 font-bold first:mt-0",children:n})},h3({children:n}){return L.jsx("h3",{className:"mt-2 font-bold first:mt-0",children:n})},h4({children:n}){return L.jsx("h4",{className:"mt-2 font-bold first:mt-0",children:n})},h5({children:n}){return L.jsx("h5",{className:"mt-2 font-bold first:mt-0",children:n})},h6({children:n}){return L.jsx("h6",{className:"mt-2 font-bold first:mt-0",children:n})},ul({children:n}){return L.jsx("ul",{className:"list-disc pl-5",children:n})},ol({children:n}){return L.jsx("ol",{className:"list-disc pl-5",children:n})},p({children:n}){return L.jsx("p",{className:"mt-2 first:mt-0",children:n})},code({inline:n,className:r,children:i,...s}){const o=String(i).replace(/\n$/,"");return n?L.jsx("code",{...s,className:r,children:o}):L.jsxs("div",{className:"group relative",children:[L.jsx("pre",{className:Kt(r,"my-4 overflow-x-auto rounded border border-border bg-editor px-4 py-3"),children:L.jsx("code",{children:i})}),L.jsxs("div",{className:"invisible absolute right-3 top-3 flex flex-row items-center divide-x-2 divide-border rounded border-2 border-border group-hover:visible",children:[L.jsx(hD,{copyValue:o}),L.jsx(mD,{copyValue:o})]})]})},a({href:n,children:r}){if(!n)return L.jsx("span",{children:"[Missing link]"});if(n.startsWith("https"))return L.jsx("a",{className:"underline hover:cursor-pointer",onClick:()=>H1({type:"openLinkRequest",link:n,linkType:"url"}),children:r});if(n==="VALID_FILE"){const i=String(r).replace(/\n$/,"");return L.jsx("a",{className:"underline hover:cursor-pointer",onClick:s=>{s.preventDefault(),H1({type:"openLinkRequest",link:i,linkType:"file"})},children:r})}if(n==="VALID_DIRECTORY"){const i=String(r).replace(/\n$/,"");return L.jsx("a",{className:"underline hover:cursor-pointer",onClick:s=>{s.preventDefault(),H1({type:"openLinkRequest",link:i,linkType:"directory"})},children:r})}return L.jsx("span",{children:"[Invalid link]"})}},children:e})},rb=()=>L.jsxs("div",{className:"flex h-[1.5rem] flex-row items-center gap-1",children:[L.jsx("span",{className:"inline-block h-2 w-2 animate-typing-dots rounded-full bg-foreground",style:{animationDelay:"0s"}}),L.jsx("span",{className:"inline-block h-2 w-2 animate-typing-dots rounded-full bg-foreground",style:{animationDelay:"0.2s"}}),L.jsx("span",{className:"inline-block h-2 w-2 animate-typing-dots rounded-full bg-foreground",style:{animationDelay:"0.4s"}})]}),Lc=e=>{window.sourceryLS.postMessage(e)},_E=({outcome:e,textContent:t})=>L.jsx("div",{className:"flex flex-row justify-start",children:L.jsx("div",{className:Kt("rounded-lg-bl-none mr-4 w-fit max-w-full rounded-tl-lg rounded-tr-lg px-4 py-2",e==="error"?"bg-error":"bg-chat"),children:t?L.jsx(nb,{markdown:t}):L.jsx(rb,{})})}),pD=({textContent:e})=>L.jsx("div",{className:"flex flex-row justify-end",children:L.jsx("p",{className:"rounded-lg-br-none ml-4 w-fit bg-chat px-4 py-2",children:e})}),gD=()=>{const[e,t]=Y.useState(),n=Y.useRef(null),r=s=>{s.preventDefault(),e&&(Lc({type:"chat/messageRequest",data:{kind:"user_message",message:e}}),t(""))},i=Y.useCallback(s=>{var o;s.key=="Enter"&&!s.shiftKey&&(s.preventDefault(),(o=n.current)==null||o.requestSubmit())},[]);return L.jsx("div",{className:"relative w-full",children:L.jsxs("form",{onSubmit:r,ref:n,children:[L.jsx("textarea",{name:"chatPrompt",id:"chatPrompt",placeholder:"Type your message here!",className:"w-full rounded bg-editor p-2 pr-10",value:e,onChange:({target:{value:s}})=>t(s),onKeyDown:i,autoFocus:!0}),L.jsx("button",{className:"absolute right-3 top-3",type:"submit",children:L.jsx(dn.Send,{className:"h-4 w-4 text-highlight"})})]})})},ED=({expanded:e,onClick:t})=>L.jsxs("header",{className:"flex grow-0 flex-row items-center justify-between border-b border-b-border px-2 py-1",children:[L.jsxs("div",{className:"flex cursor-pointer flex-row items-center gap-2 hover:opacity-80",onClick:t,children:[e?L.jsx(dn.ChevronDown,{}):L.jsx(dn.ChevronRight,{}),L.jsx("span",{className:"font-bold",children:"Chat"})]}),L.jsx("button",{className:Kt("rounded px-1 hover:bg-chat",e?"visible":"invisible"),onClick:n=>{n.stopPropagation(),Lc({type:"chat/clearRequest"})},children:"New Conversation"})]}),TD=({expanded:e,cancelButtonDisabled:t})=>L.jsxs("footer",{className:Kt("flex grow-0 flex-col gap-2 border-t border-t-border p-2",e?"block":"hidden"),children:[L.jsx("div",{className:"flex flex-row justify-center",children:L.jsxs("button",{disabled:t,className:"flex w-fit flex-row items-center gap-2 p-2 hover:enabled:opacity-80 disabled:text-disabled",onClick:()=>Lc({type:"chat/cancelRequest"}),children:[L.jsx(dn.Cancel,{}),L.jsx("span",{children:"Cancel"})]})}),L.jsx(gD,{})]}),yD=()=>{const[{messages:e,currentMessage:t},n]=Y.useState({messages:[],currentMessage:null}),[r,i]=Y.useState(!0),[s,o]=Y.useState(!0),a=Y.useRef(null),l=L_(a),u=Y.useCallback(({result:f})=>{switch(f.role){case"user":{n(Kn(d=>{d.messages.push(f),d.currentMessage={role:"assistant",outcome:"success",textContent:""}})),a.current&&M_(a.current);break}case"assistant":o(!1),n(Kn(d=>{d.currentMessage&&f.outcome!=="error"?d.currentMessage.textContent+=f.textContent:d.currentMessage&&d.currentMessage.textContent&&f.outcome==="error"?(d.messages.push(d.currentMessage,f),d.currentMessage=null):f.outcome==="error"?(d.messages.push(f),d.currentMessage=null):d.currentMessage=f}))}},[]),c=Y.useCallback(({data:f})=>{switch(f.command){case"chat/addResult":u(f);break;case"chat/clear":n(Kn(()=>({messages:[],currentMessage:null})));break;case"chat/focus":i(()=>!0);break;case"chat/assistantFinished":n(Kn(d=>{d.currentMessage&&d.currentMessage.textContent&&d.messages.push(d.currentMessage),d.currentMessage=null})),o(Kn(()=>!0));break}},[u]);return Y.useLayoutEffect(()=>{l()},[t==null?void 0:t.textContent,e.length]),Y.useEffect(()=>(window.addEventListener("message",c),()=>window.removeEventListener("message",c)),[c]),Y.useEffect(()=>{Lc({type:"chat/initialiseRequest"})},[]),L.jsxs("div",{className:Kt("flex flex-col overflow-clip",r?"grow":"grow-0"),children:[L.jsx(ED,{onClick:()=>i(f=>!f),expanded:r}),L.jsxs("section",{className:Kt("flex grow flex-col gap-2 overflow-y-auto p-2",r?"block":"hidden"),ref:a,children:[e.map(({role:f,outcome:d,textContent:h},p)=>{switch(f){case"assistant":return L.jsx(_E,{outcome:d,textContent:h},p);case"user":return L.jsx(pD,{outcome:d,textContent:h},p)}}),t&&L.jsx(_E,{outcome:t.outcome,textContent:t.textContent})]}),L.jsx(TD,{cancelButtonDisabled:s,expanded:r})]})},bE=e=>{window.sourceryLS.postMessage(e)},_D=({expanded:e,onClick:t})=>L.jsx("header",{className:"flex grow-0 flex-row items-center justify-between border-b border-b-border px-2 py-1",children:L.jsxs("div",{className:"flex cursor-pointer flex-row items-center gap-2 hover:opacity-80",onClick:t,children:[e?L.jsx(dn.ChevronDown,{}):L.jsx(dn.ChevronRight,{}),L.jsx("span",{className:"font-bold",children:"Recipes"})]})}),bD=()=>{const[e,t]=Y.useState(!0),[n,r]=Y.useState([]),i=Y.useCallback(({data:{command:s,result:o}})=>{switch(s){case"recipes/addRecipes":r(o)}},[]);return Y.useEffect(()=>(window.addEventListener("message",i),()=>window.removeEventListener("message",i)),[]),Y.useEffect(()=>{bE({type:"recipes/initialiseRequest"})},[]),L.jsxs("div",{className:"flex h-fit flex-col",children:[L.jsx(_D,{onClick:()=>t(s=>!s),expanded:e}),L.jsx("section",{className:Kt("h-fit grow overflow-y-auto p-2",e?"block":"hidden"),children:L.jsx("ul",{className:"flex flex-col gap-2",children:n.map((s,o)=>L.jsx("li",{children:L.jsx("button",{className:"w-full rounded bg-primary p-1 text-center hover:opacity-80",onClick:()=>bE({type:"recipes/recipeRequest",data:{kind:"recipe_request",...s}}),children:s.name})},o))})})]})},vE=({outcome:e,textContent:t})=>L.jsx("div",{className:"flex flex-row justify-start",children:L.jsx("div",{className:Kt("rounded-lg-bl-none mr-4 w-fit max-w-full rounded-tl-lg rounded-tr-lg px-4 py-2",e==="error"?"bg-error":"bg-chat"),children:t?L.jsx(nb,{markdown:t}):L.jsx(rb,{})})}),Ou=e=>{window.sourceryLS.postMessage(e)},vD=({onClick:e,expanded:t})=>L.jsxs("header",{className:"itemscenter flex grow-0 flex-row justify-between border-b border-b-border px-2 py-1",children:[L.jsxs("div",{className:"flex cursor-pointer flex-row items-center gap-2 hover:opacity-80",onClick:e,children:[t?L.jsx(dn.ChevronDown,{}):L.jsx(dn.ChevronRight,{}),L.jsx("span",{className:"font-bold",children:"Code Review"})]}),L.jsx("button",{className:Kt("rounded px-1 hover:bg-chat",t?"visible":"invisible"),onClick:()=>Ou({type:"review/clearRequest"}),children:"New Review"})]}),AD=({branches:e})=>{const t=Y.useCallback(n=>{n.preventDefault();const r=Object.fromEntries(new FormData(n.currentTarget).entries());Ou({type:"review/reviewRequest",data:{kind:"review_request",...r}})},[]);return L.jsxs("form",{className:"flex flex-col gap-2 p-2",onSubmit:t,children:[L.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[L.jsx("label",{htmlFor:"current",className:"col-span-1 flex flex-row items-center",children:"Current Branch"}),L.jsx("input",{type:"text",name:"current",className:"col-span-4 rounded border border-border bg-editor px-2 py-1 font-mono",defaultValue:e==null?void 0:e.current}),L.jsx("label",{htmlFor:"main",className:"col-span-1 flex flex-row items-center",children:"Main Branch"}),L.jsx("input",{type:"text",name:"main",className:"col-span-4 rounded border border-border bg-editor px-2 py-1 font-mono",defaultValue:e==null?void 0:e.main})]}),L.jsx("button",{type:"submit",className:"w-full rounded border border-border bg-primary p-1 hover:opacity-80",children:"Review My Code"})]})},SD=()=>{const[e,t]=Y.useState(!1),[n,r]=Y.useState(),[{messages:i,currentMessage:s},o]=Y.useState({messages:[],currentMessage:null}),[a,l]=Y.useState(!0),u=Y.useRef(null),c=L_(u),f=Y.useCallback(({result:h})=>{l(()=>!1),o(Kn(p=>{p.currentMessage&&h.outcome!=="error"?p.currentMessage.textContent+=h.textContent:p.currentMessage&&p.currentMessage.textContent&&h.outcome==="error"?(p.messages.push(p.currentMessage,h),p.currentMessage=null):h.outcome==="error"?(p.messages.push(h),p.currentMessage=null):p.currentMessage=h}))},[]),d=Y.useCallback(({data:h})=>{switch(h.command){case"review/addResult":f(h);break;case"review/clear":o(Kn(()=>({messages:[],currentMessage:null})));break;case"review/focus":t(()=>!0);break;case"review/assistantFinished":o(Kn(p=>{p.currentMessage&&p.currentMessage.textContent&&p.messages.push(p.currentMessage),p.currentMessage=null})),l(Kn(()=>!0));break;case"review/addBranches":r(()=>h.result);break}},[f]);return Y.useLayoutEffect(()=>{c()},[s==null?void 0:s.textContent,i.length]),Y.useEffect(()=>(window.addEventListener("message",d),()=>window.removeEventListener("message",d)),[d]),Y.useEffect(()=>{Ou({type:"review/initialiseRequest"})},[]),L.jsxs("div",{className:Kt("flex flex-col overflow-clip",e?"grow":"grow-0"),children:[L.jsx(vD,{onClick:()=>t(h=>!h),expanded:e}),L.jsx("section",{className:Kt("flex flex-col divide-y divide-border",e?"block":"hidden"),children:L.jsx(AD,{branches:n})}),L.jsxs("section",{className:Kt("flex grow flex-col gap-2 overflow-y-auto p-2",e?"block":"hidden"),ref:u,children:[i.map(({outcome:h,textContent:p},E)=>L.jsx(vE,{outcome:h,textContent:p},E)),s&&L.jsx(vE,{outcome:s.outcome,textContent:s.textContent})]}),L.jsx("footer",{className:Kt("flex flex-row justify-center border-t border-border",e?"block":"hidden"),children:L.jsxs("button",{className:"flex w-fit flex-row items-center gap-2 p-1 hover:enabled:opacity-80 disabled:text-disabled",disabled:a,onClick:()=>Ou({type:"review/cancelRequest"}),children:[L.jsx(dn.Cancel,{}),L.jsx("span",{children:"Cancel"})]})})]})},ND=e=>{window.sourceryLS.postMessage(e)},CD=()=>{const e=Y.useCallback(t=>{t.preventDefault(),ND({type:"optIn/enableRequest"})},[]);return L.jsxs("section",{className:"flex flex-col p-8",children:[L.jsx("h1",{className:"mb-4 text-lg font-bold",children:"Sourcery Coding Assistant Opt-In"}),L.jsx("p",{className:"mb-2",children:"By enabling the Sourcery coding assistant you agree that Sourcery can send your code to third-party large language model services for analysis (OpenAI, Anthropic)."}),L.jsx("p",{className:"mb-2",children:"Sourcery does not store any of your code on its servers."}),L.jsx("form",{onSubmit:e,className:"mb-3 mt-4",children:L.jsx("button",{type:"submit",className:"rounded bg-primary px-2 py-1 font-bold hover:opacity-80",children:"Opt In"})}),L.jsxs("p",{className:"mb-2 text-sm italic",children:["Enabling the coding assistant creates an entry in your"," ",L.jsxs("a",{href:"https://docs.sourcery.ai/Reference/Configuration/Sources/#user-configuration-file-system-locations",className:"underline",target:"_blank",children:["personal ",L.jsx("code",{children:".sourcery.yaml"})]})," ","file.",L.jsx("br",{}),"You can opt-out at any time by removing or commenting out this entry."]})]})},ib=Y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Pc=Y.createContext({}),Pp=Y.createContext(null),Dc=typeof document<"u",xD=Dc?Y.useLayoutEffect:Y.useEffect,sb=Y.createContext({strict:!1});function kD(e,t,n,r){const{visualElement:i}=Y.useContext(Pc),s=Y.useContext(sb),o=Y.useContext(Pp),a=Y.useContext(ib).reducedMotion,l=Y.useRef();r=r||s.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;Y.useInsertionEffect(()=>{u&&u.update(n,o)});const c=Y.useRef(!!window.HandoffAppearAnimations);return xD(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),Y.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function Hs(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wD(e,t,n){return Y.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Hs(n)&&(n.current=r))},[t])}function qa(e){return typeof e=="string"||Array.isArray(e)}function Fc(e){return typeof e=="object"&&typeof e.start=="function"}const Dp=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fp=["initial",...Dp];function Bc(e){return Fc(e.animate)||Fp.some(t=>qa(e[t]))}function ob(e){return!!(Bc(e)||e.variants)}function OD(e,t){if(Bc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||qa(n)?n:void 0,animate:qa(r)?r:void 0}}return e.inherit!==!1?t:{}}function ID(e){const{initial:t,animate:n}=OD(e,Y.useContext(Pc));return Y.useMemo(()=>({initial:t,animate:n}),[AE(t),AE(n)])}function AE(e){return Array.isArray(e)?e.join(" "):e}const SE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Qa={};for(const e in SE)Qa[e]={isEnabled:t=>SE[e].some(n=>!!t[n])};function RD(e){for(const t in e)Qa[t]={...Qa[t],...e[t]}}const ab=Y.createContext({}),lb=Y.createContext({}),MD=Symbol.for("motionComponentSymbol");function LD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&RD(e);function s(a,l){let u;const c={...Y.useContext(ib),...a,layoutId:PD(a)},{isStatic:f}=c,d=ID(a),h=r(a,f);if(!f&&Dc){d.visualElement=kD(i,h,c,t);const p=Y.useContext(lb),E=Y.useContext(sb).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,E,e,p))}return Y.createElement(Pc.Provider,{value:d},u&&d.visualElement?Y.createElement(u,{visualElement:d.visualElement,...c}):null,n(i,a,wD(h,d.visualElement,l),h,f,d.visualElement))}const o=Y.forwardRef(s);return o[MD]=i,o}function PD({layoutId:e}){const t=Y.useContext(ab).id;return t&&e!==void 0?t+"-"+e:e}function DD(e){function t(r,i={}){return LD(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const FD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bp(e){return typeof e!="string"||e.includes("-")?!1:!!(FD.indexOf(e)>-1||/[A-Z]/.test(e))}const Iu={};function BD(e){Object.assign(Iu,e)}const hl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],os=new Set(hl);function ub(e,{layout:t,layoutId:n}){return os.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Iu[e]||e==="opacity")}const Bt=e=>!!(e&&e.getVelocity),UD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HD=hl.length;function zD(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let s="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),fb=cb("--"),Hh=cb("var(--"),$D=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,GD=(e,t)=>t&&typeof e=="number"?t.transform(e):e,fi=(e,t,n)=>Math.min(Math.max(n,e),t),as={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ga={...as,transform:e=>fi(0,1,e)},p1={...as,default:1},Ea=e=>Math.round(e*1e5)/1e5,Uc=/(-)?([\d]*\.?[\d])+/g,db=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,KD=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ml(e){return typeof e=="string"}const pl=e=>({test:t=>ml(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ur=pl("deg"),Qn=pl("%"),oe=pl("px"),VD=pl("vh"),jD=pl("vw"),NE={...Qn,parse:e=>Qn.parse(e)/100,transform:e=>Qn.transform(e*100)},CE={...as,transform:Math.round},hb={borderWidth:oe,borderTopWidth:oe,borderRightWidth:oe,borderBottomWidth:oe,borderLeftWidth:oe,borderRadius:oe,radius:oe,borderTopLeftRadius:oe,borderTopRightRadius:oe,borderBottomRightRadius:oe,borderBottomLeftRadius:oe,width:oe,maxWidth:oe,height:oe,maxHeight:oe,size:oe,top:oe,right:oe,bottom:oe,left:oe,padding:oe,paddingTop:oe,paddingRight:oe,paddingBottom:oe,paddingLeft:oe,margin:oe,marginTop:oe,marginRight:oe,marginBottom:oe,marginLeft:oe,rotate:Ur,rotateX:Ur,rotateY:Ur,rotateZ:Ur,scale:p1,scaleX:p1,scaleY:p1,scaleZ:p1,skew:Ur,skewX:Ur,skewY:Ur,distance:oe,translateX:oe,translateY:oe,translateZ:oe,x:oe,y:oe,z:oe,perspective:oe,transformPerspective:oe,opacity:ga,originX:NE,originY:NE,originZ:oe,zIndex:CE,fillOpacity:ga,strokeOpacity:ga,numOctaves:CE};function Up(e,t,n,r){const{style:i,vars:s,transform:o,transformOrigin:a}=e;let l=!1,u=!1,c=!0;for(const f in t){const d=t[f];if(fb(f)){s[f]=d;continue}const h=hb[f],p=GD(d,h);if(os.has(f)){if(l=!0,o[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,a[f]=p):i[f]=p}if(t.transform||(l||r?i.transform=zD(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=a;i.transformOrigin=`${f} ${d} ${h}`}}const Hp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mb(e,t,n){for(const r in t)!Bt(t[r])&&!ub(r,n)&&(e[r]=t[r])}function WD({transformTemplate:e},t,n){return Y.useMemo(()=>{const r=Hp();return Up(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function YD(e,t,n){const r=e.style||{},i={};return mb(i,r,e),Object.assign(i,WD(e,t,n)),e.transformValues?e.transformValues(i):i}function qD(e,t,n){const r={},i=YD(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const QD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Ru(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||QD.has(e)}let pb=e=>!Ru(e);function XD(e){e&&(pb=t=>t.startsWith("on")?!Ru(t):e(t))}try{XD(require("@emotion/is-prop-valid").default)}catch{}function ZD(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(pb(i)||n===!0&&Ru(i)||!t&&!Ru(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function xE(e,t,n){return typeof e=="string"?e:oe.transform(t+n*e)}function JD(e,t,n){const r=xE(t,e.x,e.width),i=xE(n,e.y,e.height);return`${r} ${i}`}const eF={offset:"stroke-dashoffset",array:"stroke-dasharray"},tF={offset:"strokeDashoffset",array:"strokeDasharray"};function nF(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?eF:tF;e[s.offset]=oe.transform(-r);const o=oe.transform(t),a=oe.transform(n);e[s.array]=`${o} ${a}`}function zp(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f,d){if(Up(e,u,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:E}=e;h.transform&&(E&&(p.transform=h.transform),delete h.transform),E&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=JD(E,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&nF(h,o,a,l,!1)}const gb=()=>({...Hp(),attrs:{}}),$p=e=>typeof e=="string"&&e.toLowerCase()==="svg";function rF(e,t,n,r){const i=Y.useMemo(()=>{const s=gb();return zp(s,t,{enableHardwareAcceleration:!1},$p(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};mb(s,e.style,e),i.style={...s,...i.style}}return i}function iF(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Bp(n)?rF:qD)(r,s,o,n),c={...ZD(r,typeof n=="string",e),...l,ref:i},{children:f}=r,d=Y.useMemo(()=>Bt(f)?f.get():f,[f]);return Y.createElement(n,{...c,children:d})}}const Gp=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Eb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Tb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yb(e,t,n,r){Eb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Tb.has(i)?i:Gp(i),t.attrs[i])}function Kp(e,t){const{style:n}=e,r={};for(const i in n)(Bt(n[i])||t.style&&Bt(t.style[i])||ub(i,e))&&(r[i]=n[i]);return r}function _b(e,t){const n=Kp(e,t);for(const r in e)if(Bt(e[r])||Bt(t[r])){const i=hl.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function Vp(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function sF(e){const t=Y.useRef(null);return t.current===null&&(t.current=e()),t.current}const Mu=e=>Array.isArray(e),oF=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),aF=e=>Mu(e)?e[e.length-1]||0:e;function z1(e){const t=Bt(e)?e.get():e;return oF(t)?t.toValue():t}function lF({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,s){const o={latestValues:uF(r,i,s,e),renderState:t()};return n&&(o.mount=a=>n(r,a,o)),o}const bb=e=>(t,n)=>{const r=Y.useContext(Pc),i=Y.useContext(Pp),s=()=>lF(e,t,r,i);return n?s():sF(s)};function uF(e,t,n,r){const i={},s=r(e,{});for(const d in s)i[d]=z1(s[d]);let{initial:o,animate:a}=e;const l=Bc(e),u=ob(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;return f&&typeof f!="boolean"&&!Fc(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=Vp(e,h);if(!p)return;const{transitionEnd:E,transition:b,...g}=p;for(const T in g){let y=g[T];if(Array.isArray(y)){const A=c?y.length-1:0;y=y[A]}y!==null&&(i[T]=y)}for(const T in E)i[T]=E[T]}),i}const je=e=>e;function cF(e){let t=[],n=[],r=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const f=c&&i,d=f?t:n;return u&&o.add(l),d.indexOf(l)===-1&&(d.push(l),f&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(f[d]=cF(()=>n=!0),f),{}),o=f=>s[f].process(i),a=()=>{const f=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(f-i.timestamp,fF),1),i.timestamp=f,i.isProcessing=!0,g1.forEach(o),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:g1.reduce((f,d)=>{const h=s[d];return f[d]=(p,E=!1,b=!1)=>(n||l(),h.schedule(p,E,b)),f},{}),cancel:f=>g1.forEach(d=>s[d].cancel(f)),state:i,steps:s}}const{schedule:Fe,cancel:Nr,state:Et,steps:id}=dF(typeof requestAnimationFrame<"u"?requestAnimationFrame:je,!0),hF={useVisualState:bb({scrapeMotionValuesFromProps:_b,createRenderState:gb,onMount:(e,t,{renderState:n,latestValues:r})=>{Fe.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Fe.render(()=>{zp(n,r,{enableHardwareAcceleration:!1},$p(t.tagName),e.transformTemplate),yb(t,n)})}})},mF={useVisualState:bb({scrapeMotionValuesFromProps:Kp,createRenderState:Hp})};function pF(e,{forwardMotionProps:t=!1},n,r){return{...Bp(e)?hF:mF,preloadedFeatures:n,useRender:iF(t),createVisualElement:r,Component:e}}function hr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const vb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Hc(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const gF=e=>t=>vb(t)&&e(t,Hc(t));function pr(e,t,n,r){return hr(e,t,gF(n),r)}const EF=(e,t)=>n=>t(e(n)),ii=(...e)=>e.reduce(EF);function Ab(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const kE=Ab("dragHorizontal"),wE=Ab("dragVertical");function Sb(e){let t=!1;if(e==="y")t=wE();else if(e==="x")t=kE();else{const n=kE(),r=wE();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function Nb(){const e=Sb(!0);return e?(e(),!1):!0}class Ti{constructor(t){this.isMounted=!1,this.node=t}update(){}}function OE(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(s,o)=>{if(s.type==="touch"||Nb())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&Fe.update(()=>a[r](s,o))};return pr(e.current,n,i,{passive:!e.getProps()[r]})}class TF extends Ti{mount(){this.unmount=ii(OE(this.node,!0),OE(this.node,!1))}unmount(){}}class yF extends Ti{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ii(hr(this.node.current,"focus",()=>this.onFocus()),hr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Cb=(e,t)=>t?e===t?!0:Cb(e,t.parentElement):!1;function sd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Hc(n))}class _F extends Ti{constructor(){super(...arguments),this.removeStartListeners=je,this.removeEndListeners=je,this.removeAccessibleListeners=je,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),s=pr(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Fe.update(()=>{Cb(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),o=pr(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=ii(s,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||sd("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Fe.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=hr(this.node.current,"keyup",o),sd("down",(a,l)=>{this.startPress(a,l)})},n=hr(this.node.current,"keydown",t),r=()=>{this.isPressing&&sd("cancel",(s,o)=>this.cancelPress(s,o))},i=hr(this.node.current,"blur",r);this.removeAccessibleListeners=ii(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Fe.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Nb()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Fe.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=pr(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=hr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ii(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const zh=new WeakMap,od=new WeakMap,bF=e=>{const t=zh.get(e.target);t&&t(e)},vF=e=>{e.forEach(bF)};function AF({root:e,...t}){const n=e||document;od.has(n)||od.set(n,{});const r=od.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(vF,{root:e,...t})),r[i]}function SF(e,t,n){const r=AF(t);return zh.set(e,n),r.observe(e),()=>{zh.delete(e),r.unobserve(e)}}const NF={some:0,all:1};class CF extends Ti{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:NF[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return SF(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xF(t,n))&&this.startObserver()}unmount(){}}function xF({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kF={inView:{Feature:CF},tap:{Feature:_F},focus:{Feature:yF},hover:{Feature:TF}};function xb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function OF(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function zc(e,t,n){const r=e.getProps();return Vp(r,t,n!==void 0?n:r.custom,wF(e),OF(e))}const IF="framerAppearId",RF="data-"+Gp(IF);let MF=je,jp=je;const si=e=>e*1e3,gr=e=>e/1e3,LF={current:!1},kb=e=>Array.isArray(e)&&typeof e[0]=="number";function wb(e){return!!(!e||typeof e=="string"&&Ob[e]||kb(e)||Array.isArray(e)&&e.every(wb))}const Qo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ob={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qo([0,.65,.55,1]),circOut:Qo([.55,0,1,.45]),backIn:Qo([.31,.01,.66,-.59]),backOut:Qo([.33,1.53,.69,.99])};function Ib(e){if(e)return kb(e)?Qo(e):Array.isArray(e)?e.map(Ib):Ob[e]}function PF(e,t,n,{delay:r=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Ib(a);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function DF(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const Rb=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,FF=1e-7,BF=12;function UF(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Rb(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>FF&&++aUF(s,0,1,e,n);return s=>s===0||s===1?s:Rb(i(s),t,r)}const HF=gl(.42,0,1,1),zF=gl(0,0,.58,1),Mb=gl(.42,0,.58,1),$F=e=>Array.isArray(e)&&typeof e[0]!="number",Lb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Pb=e=>t=>1-e(1-t),Db=e=>1-Math.sin(Math.acos(e)),Wp=Pb(Db),GF=Lb(Wp),Fb=gl(.33,1.53,.69,.99),Yp=Pb(Fb),KF=Lb(Yp),VF=e=>(e*=2)<1?.5*Yp(e):.5*(2-Math.pow(2,-10*(e-1))),jF={linear:je,easeIn:HF,easeInOut:Mb,easeOut:zF,circIn:Db,circInOut:GF,circOut:Wp,backIn:Yp,backInOut:KF,backOut:Fb,anticipate:VF},IE=e=>{if(Array.isArray(e)){jp(e.length===4);const[t,n,r,i]=e;return gl(t,n,r,i)}else if(typeof e=="string")return jF[e];return e},qp=(e,t)=>n=>!!(ml(n)&&KD.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Bb=(e,t,n)=>r=>{if(!ml(r))return r;const[i,s,o,a]=r.match(Uc);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},WF=e=>fi(0,255,e),ad={...as,transform:e=>Math.round(WF(e))},Bi={test:qp("rgb","red"),parse:Bb("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ad.transform(e)+", "+ad.transform(t)+", "+ad.transform(n)+", "+Ea(ga.transform(r))+")"};function YF(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const $h={test:qp("#"),parse:YF,transform:Bi.transform},zs={test:qp("hsl","hue"),parse:Bb("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Qn.transform(Ea(t))+", "+Qn.transform(Ea(n))+", "+Ea(ga.transform(r))+")"},At={test:e=>Bi.test(e)||$h.test(e)||zs.test(e),parse:e=>Bi.test(e)?Bi.parse(e):zs.test(e)?zs.parse(e):$h.parse(e),transform:e=>ml(e)?e:e.hasOwnProperty("red")?Bi.transform(e):zs.transform(e)},He=(e,t,n)=>-n*e+n*t+e;function ld(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qF({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=ld(l,a,e+1/3),s=ld(l,a,e),o=ld(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}const ud=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},QF=[$h,Bi,zs],XF=e=>QF.find(t=>t.test(e));function RE(e){const t=XF(e);let n=t.parse(e);return t===zs&&(n=qF(n)),n}const Ub=(e,t)=>{const n=RE(e),r=RE(t),i={...n};return s=>(i.red=ud(n.red,r.red,s),i.green=ud(n.green,r.green,s),i.blue=ud(n.blue,r.blue,s),i.alpha=He(n.alpha,r.alpha,s),Bi.transform(i))};function ZF(e){var t,n;return isNaN(e)&&ml(e)&&(((t=e.match(Uc))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(db))===null||n===void 0?void 0:n.length)||0)>0}const Hb={regex:$D,countKey:"Vars",token:"${v}",parse:je},zb={regex:db,countKey:"Colors",token:"${c}",parse:At.parse},$b={regex:Uc,countKey:"Numbers",token:"${n}",parse:as.parse};function cd(e,{regex:t,countKey:n,token:r,parse:i}){const s=e.tokenised.match(t);s&&(e["num"+n]=s.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...s.map(i)))}function Lu(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&cd(n,Hb),cd(n,zb),cd(n,$b),n}function Gb(e){return Lu(e).values}function Kb(e){const{values:t,numColors:n,numVars:r,tokenised:i}=Lu(e),s=t.length;return o=>{let a=i;for(let l=0;ltypeof e=="number"?0:e;function eB(e){const t=Gb(e);return Kb(e)(t.map(JF))}const di={test:ZF,parse:Gb,createTransformer:Kb,getAnimatableNone:eB},Vb=(e,t)=>n=>`${n>0?t:e}`;function jb(e,t){return typeof e=="number"?n=>He(e,t,n):At.test(e)?Ub(e,t):e.startsWith("var(")?Vb(e,t):Yb(e,t)}const Wb=(e,t)=>{const n=[...e],r=n.length,i=e.map((s,o)=>jb(s,t[o]));return s=>{for(let o=0;o{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=jb(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}},Yb=(e,t)=>{const n=di.createTransformer(t),r=Lu(e),i=Lu(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?ii(Wb(r.values,i.values),n):Vb(e,t)},Xa=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},ME=(e,t)=>n=>He(e,t,n);function nB(e){return typeof e=="number"?ME:typeof e=="string"?At.test(e)?Ub:Yb:Array.isArray(e)?Wb:typeof e=="object"?tB:ME}function rB(e,t,n){const r=[],i=n||nB(e[0]),s=e.length-1;for(let o=0;ot[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=rB(t,r,i),a=o.length,l=u=>{let c=0;if(a>1)for(;cl(fi(e[0],e[s-1],u)):l}function iB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Xa(0,t,r);e.push(He(n,1,i))}}function sB(e){const t=[0];return iB(t,e.length-1),t}function oB(e,t){return e.map(n=>n*t)}function aB(e,t){return e.map(()=>t||Mb).splice(0,e.length-1)}function Pu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=$F(r)?r.map(IE):IE(r),s={done:!1,value:t[0]},o=oB(n&&n.length===t.length?n:sB(t),e),a=qb(o,t,{ease:Array.isArray(i)?i:aB(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}function Qb(e,t){return t?e*(1e3/t):0}const lB=5;function Xb(e,t,n){const r=Math.max(t-lB,0);return Qb(n-e(r),t-r)}const fd=.001,uB=.01,LE=10,cB=.05,fB=1;function dB({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,s;MF(e<=si(LE));let o=1-t;o=fi(cB,fB,o),e=fi(uB,LE,gr(e)),o<1?(i=u=>{const c=u*o,f=c*e,d=c-n,h=Gh(u,o),p=Math.exp(-f);return fd-d/h*p},s=u=>{const f=u*o*e,d=f*n+n,h=Math.pow(o,2)*Math.pow(u,2)*e,p=Math.exp(-f),E=Gh(Math.pow(u,2),o);return(-i(u)+fd>0?-1:1)*((d-h)*p)/E}):(i=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-fd+c*f},s=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const a=5/e,l=mB(i,s,a);if(e=si(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const hB=12;function mB(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function EB(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!PE(e,gB)&&PE(e,pB)){const n=dB(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function Zb({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],s=e[e.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:c,duration:f,isResolvedFromDuration:d}=EB(r),h=c?-gr(c):0,p=l/(2*Math.sqrt(a*u)),E=s-i,b=gr(Math.sqrt(a/u)),g=Math.abs(E)<5;n||(n=g?.01:2),t||(t=g?.005:.5);let T;if(p<1){const y=Gh(b,p);T=A=>{const k=Math.exp(-p*b*A);return s-k*((h+p*b*E)/y*Math.sin(y*A)+E*Math.cos(y*A))}}else if(p===1)T=y=>s-Math.exp(-b*y)*(E+(h+b*E)*y);else{const y=b*Math.sqrt(p*p-1);T=A=>{const k=Math.exp(-p*b*A),v=Math.min(y*A,300);return s-k*((h+p*b*E)*Math.sinh(v)+y*E*Math.cosh(v))/y}}return{calculatedDuration:d&&f||null,next:y=>{const A=T(y);if(d)o.done=y>=f;else{let k=h;y!==0&&(p<1?k=Xb(T,y,A):k=0);const v=Math.abs(k)<=n,N=Math.abs(s-A)<=t;o.done=v&&N}return o.value=o.done?s:A,o}}}function DE({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],d={done:!1,value:f},h=I=>a!==void 0&&Il,p=I=>a===void 0?l:l===void 0||Math.abs(a-I)-E*Math.exp(-I/r),y=I=>g+T(I),A=I=>{const D=T(I),O=y(I);d.done=Math.abs(D)<=u,d.value=d.done?g:O};let k,v;const N=I=>{h(d.value)&&(k=I,v=Zb({keyframes:[d.value,p(d.value)],velocity:Xb(y,I,d.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return N(0),{calculatedDuration:null,next:I=>{let D=!1;return!v&&k===void 0&&(D=!0,A(I),N(I)),k!==void 0&&I>k?v.next(I-k):(!D&&A(I),d)}}}const TB=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Fe.update(t,!0),stop:()=>Nr(t),now:()=>Et.isProcessing?Et.timestamp:performance.now()}},FE=2e4;function BE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=FE?1/0:t}const yB={decay:DE,inertia:DE,tween:Pu,keyframes:Pu,spring:Zb};function Du({autoplay:e=!0,delay:t=0,driver:n=TB,keyframes:r,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:f,...d}){let h=1,p=!1,E,b;const g=()=>{b=new Promise($=>{E=$})};g();let T;const y=yB[i]||Pu;let A;y!==Pu&&typeof r[0]!="number"&&(A=qb([0,100],r,{clamp:!1}),r=[0,100]);const k=y({...d,keyframes:r});let v;a==="mirror"&&(v=y({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let N="idle",I=null,D=null,O=null;k.calculatedDuration===null&&s&&(k.calculatedDuration=BE(k));const{calculatedDuration:U}=k;let j=1/0,ee=1/0;U!==null&&(j=U+o,ee=j*(s+1)-o);let X=0;const q=$=>{if(D===null)return;h>0&&(D=Math.min(D,$)),h<0&&(D=Math.min($-ee/h,D)),I!==null?X=I:X=Math.round($-D)*h;const re=X-t*(h>=0?1:-1),C=h>=0?re<0:re>ee;X=Math.max(re,0),N==="finished"&&I===null&&(X=ee);let be=X,ve=k;if(s){const he=X/j;let ht=Math.floor(he),mt=he%1;!mt&&he>=1&&(mt=1),mt===1&&ht--,ht=Math.min(ht,s+1);const Jn=!!(ht%2);Jn&&(a==="reverse"?(mt=1-mt,o&&(mt-=o/j)):a==="mirror"&&(ve=v));let ls=fi(0,1,mt);X>ee&&(ls=a==="reverse"&&Jn?1:0),be=ls*j}const le=C?{done:!1,value:r[0]}:ve.next(be);A&&(le.value=A(le.value));let{done:et}=le;!C&&U!==null&&(et=h>=0?X>=ee:X<=0);const vt=I===null&&(N==="finished"||N==="running"&&et);return f&&f(le.value),vt&&R(),le},de=()=>{T&&T.stop(),T=void 0},P=()=>{N="idle",de(),E(),g(),D=O=null},R=()=>{N="finished",c&&c(),de(),E()},B=()=>{if(p)return;T||(T=n(q));const $=T.now();l&&l(),I!==null?D=$-I:(!D||N==="finished")&&(D=$),N==="finished"&&g(),O=D,I=null,N="running",T.start()};e&&B();const _={then($,re){return b.then($,re)},get time(){return gr(X)},set time($){$=si($),X=$,I!==null||!T||h===0?I=$:D=T.now()-$/h},get duration(){const $=k.calculatedDuration===null?BE(k):k.calculatedDuration;return gr($)},get speed(){return h},set speed($){$===h||!T||(h=$,_.time=gr(X))},get state(){return N},play:B,pause:()=>{N="paused",I=X},stop:()=>{p=!0,N!=="idle"&&(N="idle",u&&u(),P())},cancel:()=>{O!==null&&q(O),P()},complete:()=>{N="finished"},sample:$=>(D=0,q($))};return _}function _B(e){let t;return()=>(t===void 0&&(t=e()),t)}const bB=_B(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),vB=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),E1=10,AB=2e4,SB=(e,t)=>t.type==="spring"||e==="backgroundColor"||!wb(t.ease);function NB(e,t,{onUpdate:n,onComplete:r,...i}){if(!(bB()&&vB.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let o=!1,a,l;const u=()=>{l=new Promise(T=>{a=T})};u();let{keyframes:c,duration:f=300,ease:d,times:h}=i;if(SB(t,i)){const T=Du({...i,repeat:0,delay:0});let y={done:!1,value:c[0]};const A=[];let k=0;for(;!y.done&&kp.cancel(),b=()=>{Fe.update(E),a(),u()};return p.onfinish=()=>{e.set(DF(c,i)),r&&r(),b()},{then(T,y){return l.then(T,y)},attachTimeline(T){return p.timeline=T,p.onfinish=null,je},get time(){return gr(p.currentTime||0)},set time(T){p.currentTime=si(T)},get speed(){return p.playbackRate},set speed(T){p.playbackRate=T},get duration(){return gr(f)},play:()=>{o||(p.play(),Nr(E))},pause:()=>p.pause(),stop:()=>{if(o=!0,p.playState==="idle")return;const{currentTime:T}=p;if(T){const y=Du({...i,autoplay:!1});e.setWithVelocity(y.sample(T-E1).value,y.sample(T).value,E1)}b()},complete:()=>p.finish(),cancel:b}}function CB({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:je,pause:je,stop:je,then:s=>(s(),Promise.resolve()),cancel:je,complete:je});return t?Du({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const xB={type:"spring",stiffness:500,damping:25,restSpeed:10},kB=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wB={type:"keyframes",duration:.8},OB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},IB=(e,{keyframes:t})=>t.length>2?wB:os.has(e)?e.startsWith("scale")?kB(t[1]):xB:OB,Kh=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(di.test(t)||t==="0")&&!t.startsWith("url(")),RB=new Set(["brightness","contrast","saturate","opacity"]);function MB(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Uc)||[];if(!r)return e;const i=n.replace(r,"");let s=RB.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const LB=/([a-z-]*)\(.*?\)/g,Vh={...di,getAnimatableNone:e=>{const t=e.match(LB);return t?t.map(MB).join(" "):e}},PB={...hb,color:At,backgroundColor:At,outlineColor:At,fill:At,stroke:At,borderColor:At,borderTopColor:At,borderRightColor:At,borderBottomColor:At,borderLeftColor:At,filter:Vh,WebkitFilter:Vh},Qp=e=>PB[e];function Jb(e,t){let n=Qp(e);return n!==Vh&&(n=di),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ev=e=>/^0[^.\s]+$/.test(e);function DB(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||ev(e)}function FB(e,t,n,r){const i=Kh(t,n);let s;Array.isArray(n)?s=[...n]:s=[null,n];const o=r.from!==void 0?r.from:e.get();let a;const l=[];for(let u=0;ui=>{const s=tv(r,e)||{},o=s.delay||r.delay||0;let{elapsed:a=0}=r;a=a-si(o);const l=FB(t,e,n,s),u=l[0],c=l[l.length-1],f=Kh(e,u),d=Kh(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(BB(s)||(h={...h,...IB(e,h)}),h.duration&&(h.duration=si(h.duration)),h.repeatDelay&&(h.repeatDelay=si(h.repeatDelay)),!f||!d||LF.current||s.type===!1)return CB(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=NB(t,e,h);if(p)return p}return Du(h)};function Fu(e){return!!(Bt(e)&&e.add)}const nv=e=>/^\-?\d*\.?\d+$/.test(e);function Zp(e,t){e.indexOf(t)===-1&&e.push(t)}function Jp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class e0{constructor(){this.subscriptions=[]}add(t){return Zp(this.subscriptions,t),()=>Jp(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s!isNaN(parseFloat(e));class HB{constructor(t,n={}){this.version="10.16.1",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:s,timestamp:o}=Et;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,Fe.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Fe.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=UB(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new e0);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Qb(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function uo(e,t){return new HB(e,t)}const rv=e=>t=>t.test(e),zB={test:e=>e==="auto",parse:e=>e},iv=[as,oe,Qn,Ur,jD,VD,zB],$o=e=>iv.find(rv(e)),$B=[...iv,At,di],GB=e=>$B.find(rv(e));function KB(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,uo(n))}function VB(e,t){const n=zc(e,t);let{transitionEnd:r={},transition:i={},...s}=n?e.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const o in s){const a=aF(s[o]);KB(e,o,a)}}function jB(e,t,n){var r,i;const s=Object.keys(t).filter(a=>!e.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(f))),u.push(E)}return o&&Promise.all(u).then(()=>{o&&VB(e,o)}),u}function jh(e,t,n={}){const r=zc(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(sv(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:f}=i;return QB(e,t,u+l,c,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function QB(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(XB).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(jh(u,t,{...s,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function XB(e,t){return e.sortNodePosition(t)}function ZB(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>jh(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=jh(e,t,n);else{const i=typeof t=="function"?zc(e,t,n.custom):t;r=Promise.all(sv(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const JB=[...Dp].reverse(),eU=Dp.length;function tU(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ZB(e,n,r)))}function nU(e){let t=tU(e);const n=iU();let r=!0;const i=(l,u)=>{const c=zc(e,u);if(c){const{transition:f,transitionEnd:d,...h}=c;l={...l,...h,...d}}return l};function s(l){t=l(e)}function o(l,u){const c=e.getProps(),f=e.getVariantContext(!0)||{},d=[],h=new Set;let p={},E=1/0;for(let g=0;gE&&k;const O=Array.isArray(A)?A:[A];let U=O.reduce(i,{});v===!1&&(U={});const{prevResolvedValues:j={}}=y,ee={...j,...U},X=q=>{D=!0,h.delete(q),y.needsAnimating[q]=!0};for(const q in ee){const de=U[q],P=j[q];p.hasOwnProperty(q)||(de!==P?Mu(de)&&Mu(P)?!xb(de,P)||I?X(q):y.protectedKeys[q]=!0:de!==void 0?X(q):h.add(q):de!==void 0&&h.has(q)?X(q):y.protectedKeys[q]=!0)}y.prevProp=A,y.prevResolvedValues=U,y.isActive&&(p={...p,...U}),r&&e.blockInitialAnimation&&(D=!1),D&&!N&&d.push(...O.map(q=>({animation:q,options:{type:T,...l}})))}if(h.size){const g={};h.forEach(T=>{const y=e.getBaseTarget(T);y!==void 0&&(g[T]=y)}),d.push({animation:g})}let b=!!d.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(d):Promise.resolve()}function a(l,u,c){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(c,l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n}}function rU(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xb(t,e):!1}function Si(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iU(){return{animate:Si(!0),whileInView:Si(),whileHover:Si(),whileTap:Si(),whileDrag:Si(),whileFocus:Si(),exit:Si()}}class sU extends Ti{constructor(t){super(t),t.animationState||(t.animationState=nU(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Fc(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let oU=0;class aU extends Ti{constructor(){super(...arguments),this.id=oU++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const lU={animation:{Feature:sU},exit:{Feature:aU}},UE=(e,t)=>Math.abs(e-t);function uU(e,t){const n=UE(e.x,t.x),r=UE(e.y,t.y);return Math.sqrt(n**2+r**2)}class ov{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=hd(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=uU(u.offset,{x:0,y:0})>=3;if(!c&&!f)return;const{point:d}=u,{timestamp:h}=Et;this.history.push({...d,timestamp:h});const{onStart:p,onMove:E}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=dd(c,this.transformPagePoint),Fe.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=hd(u.type==="pointercancel"?this.lastMoveEventInfo:dd(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,h),d&&d(u,h)},!vb(t))return;this.handlers=n,this.transformPagePoint=r;const i=Hc(t),s=dd(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=Et;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=n;l&&l(t,hd(s,this.history)),this.removeListeners=ii(pr(window,"pointermove",this.handlePointerMove),pr(window,"pointerup",this.handlePointerUp),pr(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Nr(this.updatePoint)}}function dd(e,t){return t?{point:t(e.point)}:e}function HE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hd({point:e},t){return{point:e,delta:HE(e,av(t)),offset:HE(e,cU(t)),velocity:fU(t,.1)}}function cU(e){return e[0]}function av(e){return e[e.length-1]}function fU(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=av(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>si(t)));)n--;if(!r)return{x:0,y:0};const s=gr(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Qt(e){return e.max-e.min}function Wh(e,t=0,n=.01){return Math.abs(e-t)<=n}function zE(e,t,n,r=.5){e.origin=r,e.originPoint=He(t.min,t.max,e.origin),e.scale=Qt(n)/Qt(t),(Wh(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=He(n.min,n.max,e.origin)-e.originPoint,(Wh(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Ta(e,t,n,r){zE(e.x,t.x,n.x,r?r.originX:void 0),zE(e.y,t.y,n.y,r?r.originY:void 0)}function $E(e,t,n){e.min=n.min+t.min,e.max=e.min+Qt(t)}function dU(e,t,n){$E(e.x,t.x,n.x),$E(e.y,t.y,n.y)}function GE(e,t,n){e.min=t.min-n.min,e.max=e.min+Qt(t)}function ya(e,t,n){GE(e.x,t.x,n.x),GE(e.y,t.y,n.y)}function hU(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?He(n,e,r.max):Math.min(e,n)),e}function KE(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function mU(e,{top:t,left:n,bottom:r,right:i}){return{x:KE(e.x,n,i),y:KE(e.y,t,r)}}function VE(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Xa(t.min,t.max-r,e.min):r>i&&(n=Xa(e.min,e.max-i,t.min)),fi(0,1,n)}function EU(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yh=.35;function TU(e=Yh){return e===!1?e=0:e===!0&&(e=Yh),{x:jE(e,"left","right"),y:jE(e,"top","bottom")}}function jE(e,t,n){return{min:WE(e,t),max:WE(e,n)}}function WE(e,t){return typeof e=="number"?e:e[t]||0}const YE=()=>({translate:0,scale:1,origin:0,originPoint:0}),$s=()=>({x:YE(),y:YE()}),qE=()=>({min:0,max:0}),Xe=()=>({x:qE(),y:qE()});function zn(e){return[e("x"),e("y")]}function lv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function yU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function _U(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function md(e){return e===void 0||e===1}function qh({scale:e,scaleX:t,scaleY:n}){return!md(e)||!md(t)||!md(n)}function wi(e){return qh(e)||uv(e)||e.z||e.rotate||e.rotateX||e.rotateY}function uv(e){return QE(e.x)||QE(e.y)}function QE(e){return e&&e!=="0%"}function Bu(e,t,n){const r=e-n,i=t*r;return n+i}function XE(e,t,n,r,i){return i!==void 0&&(e=Bu(e,i,r)),Bu(e,n,r)+t}function Qh(e,t=0,n=1,r,i){e.min=XE(e.min,t,n,r,i),e.max=XE(e.max,t,n,r,i)}function cv(e,{x:t,y:n}){Qh(e.x,t.translate,t.scale,t.originPoint),Qh(e.y,n.translate,n.scale,n.originPoint)}function bU(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function Gr(e,t){e.min=e.min+t,e.max=e.max+t}function JE(e,t,[n,r,i]){const s=t[i]!==void 0?t[i]:.5,o=He(e.min,e.max,s);Qh(e,t[n],t[r],o,t.scale)}const vU=["x","scaleX","originX"],AU=["y","scaleY","originY"];function Gs(e,t){JE(e.x,t,vU),JE(e.y,t,AU)}function fv(e,t){return lv(_U(e.getBoundingClientRect(),t))}function SU(e,t,n){const r=fv(e,n),{scroll:i}=t;return i&&(Gr(r.x,i.offset.x),Gr(r.y,i.offset.y)),r}const NU=new WeakMap;class CU{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(Hc(l,"page").point)},s=(l,u)=>{const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();if(c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Sb(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zn(p=>{let E=this.getAxisMotionValue(p).get()||0;if(Qn.test(E)){const{projection:b}=this.visualElement;if(b&&b.layout){const g=b.layout.layoutBox[p];g&&(E=Qt(g)*(parseFloat(E)/100))}}this.originPoint[p]=E}),d&&Fe.update(()=>d(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},o=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(f&&this.currentDirection===null){this.currentDirection=xU(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},a=(l,u)=>this.stop(l,u);this.panSession=new ov(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Fe.update(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!T1(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=hU(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Hs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=mU(r.layoutBox,t):this.constraints=!1,this.elastic=TU(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&zn(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=EU(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Hs(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=SU(r,i.root,this.visualElement.getTransformPagePoint());let o=pU(i.layout.layoutBox,s);if(n){const a=n(yU(o));this.hasMutatedConstraints=!!a,a&&(o=lv(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=zn(c=>{if(!T1(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(Xp(t,r,0,n))}stopAnimation(){zn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){zn(n=>{const{drag:r}=this.getProps();if(!T1(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-He(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Hs(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};zn(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();i[o]=gU({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),zn(o=>{if(!T1(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(He(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;NU.set(this.visualElement,this);const t=this.visualElement.current,n=pr(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Hs(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const o=hr(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(zn(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Yh,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function T1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function xU(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class kU extends Ti{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new CU(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}unmount(){this.removeGroupControls(),this.removeListeners()}}const eT=e=>(t,n)=>{e&&Fe.update(()=>e(t,n))};class wU extends Ti{constructor(){super(...arguments),this.removePointerDownListener=je}onPointerDown(t){this.session=new ov(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:eT(t),onStart:eT(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Fe.update(()=>i(s,o))}}}mount(){this.removePointerDownListener=pr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function OU(){const e=Y.useContext(Pp);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=Y.useId();return Y.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}const $1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function tT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Go={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(oe.test(e))e=parseFloat(e);else return e;const n=tT(e,t.target.x),r=tT(e,t.target.y);return`${n}% ${r}%`}},IU={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=di.parse(e);if(i.length>5)return r;const s=di.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=He(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class RU extends kn.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;BD(MU),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),$1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Fe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function dv(e){const[t,n]=OU(),r=Y.useContext(ab);return kn.createElement(RU,{...e,layoutGroup:r,switchLayoutGroup:Y.useContext(lb),isPresent:t,safeToRemove:n})}const MU={borderRadius:{...Go,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Go,borderTopRightRadius:Go,borderBottomLeftRadius:Go,borderBottomRightRadius:Go,boxShadow:IU},hv=["TopLeft","TopRight","BottomLeft","BottomRight"],LU=hv.length,nT=e=>typeof e=="string"?parseFloat(e):e,rT=e=>typeof e=="number"||oe.test(e);function PU(e,t,n,r,i,s){i?(e.opacity=He(0,n.opacity!==void 0?n.opacity:1,DU(r)),e.opacityExit=He(t.opacity!==void 0?t.opacity:1,0,FU(r))):s&&(e.opacity=He(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;ort?1:n(Xa(e,t,r))}function sT(e,t){e.min=t.min,e.max=t.max}function tn(e,t){sT(e.x,t.x),sT(e.y,t.y)}function oT(e,t,n,r,i){return e-=t,e=Bu(e,1/n,r),i!==void 0&&(e=Bu(e,1/i,r)),e}function BU(e,t=0,n=1,r=.5,i,s=e,o=e){if(Qn.test(t)&&(t=parseFloat(t),t=He(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=He(s.min,s.max,r);e===s&&(a-=t),e.min=oT(e.min,t,n,a,i),e.max=oT(e.max,t,n,a,i)}function aT(e,t,[n,r,i],s,o){BU(e,t[n],t[r],t[i],t.scale,s,o)}const UU=["x","scaleX","originX"],HU=["y","scaleY","originY"];function lT(e,t,n,r){aT(e.x,t,UU,n?n.x:void 0,r?r.x:void 0),aT(e.y,t,HU,n?n.y:void 0,r?r.y:void 0)}function uT(e){return e.translate===0&&e.scale===1}function pv(e){return uT(e.x)&&uT(e.y)}function zU(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function gv(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function cT(e){return Qt(e.x)/Qt(e.y)}class $U{constructor(){this.members=[]}add(t){Zp(this.members,t),t.scheduleRender()}remove(t){if(Jp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function fT(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y;if((i||s)&&(r=`translate3d(${i}px, ${s}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(r+=`scale(${o}, ${a})`),r||"none"}const GU=(e,t)=>e.depth-t.depth;class KU{constructor(){this.children=[],this.isDirty=!1}add(t){Zp(this.children,t),this.isDirty=!0}remove(t){Jp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(GU),this.isDirty=!1,this.children.forEach(t)}}function VU(e,t){const n=performance.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Nr(r),e(s-t))};return Fe.read(r,!0),()=>Nr(r)}function jU(e){window.MotionDebug&&window.MotionDebug.record(e)}function WU(e){return e instanceof SVGElement&&e.tagName!=="svg"}function YU(e,t,n){const r=Bt(e)?e:uo(e);return r.start(Xp("",r,t,n)),r.animation}const dT=["","X","Y","Z"],hT=1e3;let qU=0;const Oi={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Ev({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=qU++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Oi.totalNodes=Oi.resolvedTargetDeltas=Oi.recalculatedProjection=0,this.nodes.forEach(ZU),this.nodes.forEach(rH),this.nodes.forEach(iH),this.nodes.forEach(JU),jU(Oi)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=VU(d,250),$1.hasAnimatedSinceResize&&($1.hasAnimatedSinceResize=!1,this.nodes.forEach(pT))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||c.getDefaultTransition()||uH,{onLayoutAnimationStart:b,onLayoutAnimationComplete:g}=c.getProps(),T=!this.targetLayout||!gv(this.targetLayout,p)||h,y=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||d&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,y);const A={...tv(E,"layout"),onPlay:b,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else d||pT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Nr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(sH),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(eH),this.sharedNodes.forEach(oH)}scheduleUpdateProjection(){Fe.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Fe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const k=A/1e3;gT(f.x,o.x,k),gT(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ya(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),aH(this.relativeTarget,this.relativeTargetOrigin,d,k),y&&zU(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Xe()),tn(y,this.relativeTarget)),E&&(this.animationValues=c,PU(c,u,this.latestValues,k,T,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Nr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Fe.update(()=>{$1.hasAnimatedSinceResize=!0,this.currentAnimation=YU(0,hT,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hT),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Tv(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Xe();const f=Qt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=Qt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}tn(a,l),Gs(a,c),Ta(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new $U),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let c=0;c{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(mT),this.root.sharedNodes.clear()}}}function QU(e){e.updateLayout()}function XU(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?zn(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Qt(d);d.min=r[f].min,d.max=d.min+h}):Tv(s,n.layoutBox,r)&&zn(f=>{const d=o?n.measuredBox[f]:n.layoutBox[f],h=Qt(r[f]);d.max=d.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const a=$s();Ta(a,r,n.layoutBox);const l=$s();o?Ta(l,e.applyTransform(i,!0),n.measuredBox):Ta(l,r,n.layoutBox);const u=!pv(a);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=Xe();ya(p,n.layoutBox,d.layoutBox);const E=Xe();ya(E,r,h.layoutBox),gv(p,E)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=E,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function ZU(e){Oi.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function JU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eH(e){e.clearSnapshot()}function mT(e){e.clearMeasurements()}function tH(e){e.isLayoutDirty=!1}function nH(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function pT(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rH(e){e.resolveTargetDelta()}function iH(e){e.calcProjection()}function sH(e){e.resetRotation()}function oH(e){e.removeLeadSnapshot()}function gT(e,t,n){e.translate=He(t.translate,0,n),e.scale=He(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ET(e,t,n,r){e.min=He(t.min,n.min,r),e.max=He(t.max,n.max,r)}function aH(e,t,n,r){ET(e.x,t.x,n.x,r),ET(e.y,t.y,n.y,r)}function lH(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uH={duration:.45,ease:[.4,0,.1,1]},TT=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),yT=TT("applewebkit/")&&!TT("chrome/")?Math.round:je;function _T(e){e.min=yT(e.min),e.max=yT(e.max)}function cH(e){_T(e.x),_T(e.y)}function Tv(e,t,n){return e==="position"||e==="preserve-aspect"&&!Wh(cT(t),cT(n),.2)}const fH=Ev({attachResizeListener:(e,t)=>hr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pd={current:void 0},yv=Ev({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pd.current){const e=new fH({});e.mount(window),e.setOptions({layoutScroll:!0}),pd.current=e}return pd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dH={pan:{Feature:wU},drag:{Feature:kU,ProjectionNode:yv,MeasureLayout:dv}},hH=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function mH(e){const t=hH.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function Xh(e,t,n=1){const[r,i]=mH(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return nv(o)?parseFloat(o):o}else return Hh(i)?Xh(i,t,n+1):i}function pH(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const s=i.get();if(!Hh(s))return;const o=Xh(s,r);o&&i.set(o)});for(const i in t){const s=t[i];if(!Hh(s))continue;const o=Xh(s,r);o&&(t[i]=o,n||(n={}),n[i]===void 0&&(n[i]=s))}return{target:t,transitionEnd:n}}const gH=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),_v=e=>gH.has(e),EH=e=>Object.keys(e).some(_v),bT=e=>e===as||e===oe,vT=(e,t)=>parseFloat(e.split(", ")[t]),AT=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return vT(i[1],t);{const s=r.match(/^matrix\((.+)\)$/);return s?vT(s[1],e):0}},TH=new Set(["x","y","z"]),yH=hl.filter(e=>!TH.has(e));function _H(e){const t=[];return yH.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const co={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:AT(4,13),y:AT(5,14)};co.translateX=co.x;co.translateY=co.y;const bH=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{a[u]=co[u](r,s)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(a[u]),e[u]=co[u](l,s)}),e},vH=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(_v);let s=[],o=!1;const a=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],f=$o(c);const d=t[l];let h;if(Mu(d)){const p=d.length,E=d[0]===null?1:0;c=d[E],f=$o(c);for(let b=E;b=0?window.pageYOffset:null,u=bH(t,e,a);return s.length&&s.forEach(([c,f])=>{e.getValue(c).set(f)}),e.render(),Dc&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function AH(e,t,n,r){return EH(t)?vH(e,t,n,r):{target:t,transitionEnd:r}}const SH=(e,t,n,r)=>{const i=pH(e,t,r);return t=i.target,r=i.transitionEnd,AH(e,t,n,r)},Zh={current:null},bv={current:!1};function NH(){if(bv.current=!0,!!Dc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Zh.current=e.matches;e.addListener(t),t()}else Zh.current=!1}function CH(e,t,n){const{willChange:r}=t;for(const i in t){const s=t[i],o=n[i];if(Bt(s))e.addValue(i,s),Fu(r)&&r.add(i);else if(Bt(o))e.addValue(i,uo(s,{owner:e})),Fu(r)&&r.remove(i);else if(o!==s)if(e.hasValue(i)){const a=e.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=e.getStaticValue(i);e.addValue(i,uo(a!==void 0?a:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const ST=new WeakMap,vv=Object.keys(Qa),xH=vv.length,NT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],kH=Fp.length;class wH{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Fe.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=Bc(n),this.isVariantNode=ob(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const f in c){const d=c[f];a[f]!==void 0&&Bt(d)&&(d.set(a[f],!1),Fu(u)&&u.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,ST.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),bv.current||NH(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Zh.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ST.delete(this.current),this.projection&&this.projection.unmount(),Nr(this.notifyUpdate),Nr(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=os.has(t),i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Fe.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,layoutScroll:d,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=uo(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=Vp(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Bt(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new e0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Av extends wH{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},s){let o=YB(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),o&&(o=i(o))),s){jB(this,r,o);const a=SH(this,r,o,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function OH(e){return window.getComputedStyle(e)}class IH extends Av{readValueFromInstance(t,n){if(os.has(n)){const r=Qp(n);return r&&r.default||0}else{const r=OH(t),i=(fb(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return fv(t,n)}build(t,n,r,i){Up(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return Kp(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Bt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){Eb(t,n,r,i)}}class RH extends Av{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(os.has(n)){const r=Qp(n);return r&&r.default||0}return n=Tb.has(n)?n:Gp(n),t.getAttribute(n)}measureInstanceViewportBox(){return Xe()}scrapeMotionValuesFromProps(t,n){return _b(t,n)}build(t,n,r,i){zp(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){yb(t,n,r,i)}mount(t){this.isSVGTag=$p(t.tagName),super.mount(t)}}const MH=(e,t)=>Bp(e)?new RH(t,{enableHardwareAcceleration:!1}):new IH(t,{enableHardwareAcceleration:!0}),LH={layout:{ProjectionNode:yv,MeasureLayout:dv}},PH={...lU,...kF,...dH,...LH},DH=DD((e,t)=>pF(e,t,PH,MH)),FH=[{position:{left:0,top:0},delay:.1},{position:{left:16,top:0},delay:.05},{position:{left:32,top:0},delay:0},{position:{left:0,top:16},delay:.15},{position:{left:16,top:16},delay:.2},{position:{left:32,top:16},delay:.25},{position:{left:0,top:32},delay:.4},{position:{left:16,top:32},delay:.35},{position:{left:32,top:32},delay:.3}],BH=({color:e})=>L.jsx("div",{className:"relative h-[34px] w-[34px]",children:FH.map(({position:t,delay:n},r)=>L.jsx(DH.div,{className:`absolute ${e?"bg-"+e:"bg-highlight"} left-[${t.left}px] top-[${t.top}px] h-[2px] w-[2px]`,animate:{opacity:[0,1,1,0,0]},transition:{delay:n,duration:1,repeat:1/0,times:[0,.1,.6,.7,1],repeatDelay:1}},r))}),UH=()=>L.jsxs("section",{className:"flex flex-col p-8",children:[L.jsx("h1",{className:"mb-4 text-lg font-bold",children:"Sourcery Coding Assistant"}),L.jsx("p",{className:"mb-2",children:"We're rolling out the Sourcery Coding Assistant to early access users."}),L.jsxs("p",{children:["Find out more and sign up for early access"," ",L.jsx("a",{href:"https://sourcery.ai/coding-assistant/",className:"underline",target:"_blank",children:"here"}),"."]})]});window.sourceryLS=window.sourceryLS||{};const HH=e=>{window.sourceryLS.postMessage(e)};function zH(){const[{status:e,context:t},n]=Y.useState({status:"pending",context:{isFeatureFlagEnabled:!1,isConfigEnabled:!1}}),r=Y.useCallback(({data:i})=>{switch(i.command){case"context/update":n(Kn(s=>{s.status="ok",Object.entries(i.updates).forEach(([o,a])=>{s.context[o]=a})}))}},[]);return Y.useEffect(()=>(window.addEventListener("message",r),()=>window.removeEventListener("message",r)),[r]),Y.useEffect(()=>{HH({type:"context/contextRequest"})},[]),L.jsx("main",{className:"flex h-full max-h-full flex-col divide-y-4 divide-border overflow-clip bg-background text-foreground",children:e==="pending"?L.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-8",children:[L.jsx(BH,{}),L.jsx("p",{className:"italic",children:"Loading..."})]}):t.isFeatureFlagEnabled?t.isConfigEnabled?L.jsxs(L.Fragment,{children:[L.jsx(yD,{}),L.jsx(bD,{}),L.jsx(SD,{})]}):L.jsx(CD,{}):L.jsx(UH,{})})}gd.createRoot(document.getElementById("root")).render(L.jsx(kn.StrictMode,{children:L.jsx(zH,{})}));